Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern(Windows) private static LRESULT msgRouter(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- if(msg == WM_NCCREATE)
- {
- /*
- * TRICK: Id == hWnd
- * ---
- * Inizializzazione Componente
- */
- CREATESTRUCT* pCreateStruct = cast(CREATESTRUCT*)lParam;
- LONG param = cast(LONG)pCreateStruct.lpCreateParams;
- SetWindowLongW(hWnd, GWL_USERDATA, param);
- SetWindowLongW(hWnd, GWL_ID, cast(LONG)hWnd);
- Control theThis = winCast!(Control)(param);
- theThis._handle = hWnd;
- theThis.onHandleCreated(EventArgs.empty);
- }
- Control theThis = winCast!(Control)((GetWindowLongW(hWnd, GWL_USERDATA)));
- if(msg == WM_CREATE)
- {
- // Aggiornamento Font, rimuove FIXED SYS
- theThis.originalWndProc(WM_SETFONT, cast(WPARAM)SystemFonts.activeFont.handle, MAKELPARAM(1, 0));
- }
- if(theThis)
- {
- return theThis.wndProc(msg, wParam, lParam);
- }
- return Control.defWindowProc(hWnd, msg, wParam, lParam);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement