1. Engineering
  2. Computer Science
  3. question a2 windows event handling 10 marks the windows operating...

Question: question a2 windows event handling 10 marks the windows operating...

Question details

Question A2: Windows Event Handling (10 marks) The Windows Operating System and applications are event-driven. Describe how a Windows application is decoding a WM COMMAND event message to call a Dialog Box from its mairn message procedure WndProc. You also need to describe the role of the parameters. Refer to the source code example below. Discuss how event-driven systems are beneficial for interactive applications. LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM 1Param) int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc switch (message) case WM COMMAND: wmId LOWORD (wParam); wmEvent HIWORD (wParam) // Parse the menu selections 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, 1Param); break case WM PAINT: hdc BeginPaint (hwnd, &ps) ITODO: Add any drawing code here... EndPaint (hwnd, &ps); break; case WMDESTROY PostQuitMessage() break; default: return DefWindowProc(hwnd, message, WParam, 1Param); return ;

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution