Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
- {
- switch (message)
- {
- case WM_NOTIFY:
- {
- HWND hCtrlWnd = GetDlgItem(hWnd, wParam);
- base_window *c = (base_window *)GetWindowLong((HWND)hCtrlWnd, GWLP_USERDATA);
- if (c != NULL) {
- return c->WindowProc(hWnd, message, wParam, lParam);
- }
- //Handle other messages
- }
- break;
- case WM_COMMAND:
- {
- //If this window class, has a custom wndprc
- base_window *c = (base_window *)GetWindowLong((HWND)lParam, GWLP_USERDATA);
- if (c != NULL) {
- return c->WindowProc(hWnd, message, wParam, lParam);
- }
- //Handle other messages
- int wmId = LOWORD(wParam);
- switch (wmId)
- {
- case IDM_ABOUT:
- DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
- break;
- case IDM_EXIT:
- DestroyWindow(hWnd);
- break;
- default:
- return DefWindowProc(hWnd, message, wParam, lParam);
- }
- }
- break;
- case WM_SIZE:
- objManager.resizeWindows(hWnd, message, wParam, lParam);
- break;
- case WM_DESTROY:
- PostQuitMessage(0);
- break;
- default:
- return DefWindowProc(hWnd, message, wParam, lParam);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement