Question: 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

 Question A2: Windows Event Handling (10 marks) The Windows Operating System

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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!