The Windows Operating System and applications are event-driven. Describe how a Windows application is decoding event...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The Windows Operating System and applications are event-driven. Describe how a Windows application is decoding event messages in its main message procedure WndProc. How does the application decode a WM_COMMAND message to call the DialogBox? Refer to the source code example below. Discuss how such an approach is 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: wm Id = LOWORD (wParam); wmEvent = HIWORD (wParam); // Parse the menu selections: switch (wmId) } { case IDM_ABOUT: break; case IDM_EXIT: DialogBox (hInst, MAKEINTRESOURCE (IDD_ABOUTBOX), hwnd, About); DestroyWindow(hWnd); default: break; return DefWindowProc(hWnd, message, wParam, 1Param); } break; case WM_PAINT: hdc = BeginPaint (hWnd, &ps); // TODO: Add any drawing code here... EndPaint (hWnd, &ps); break; case WM_DESTROY: default: } return 0; PostQuitMessage(0); break; return DefWindowProc(hWnd, message, wParam, 1Param); The Windows Operating System and applications are event-driven. Describe how a Windows application is decoding event messages in its main message procedure WndProc. How does the application decode a WM_COMMAND message to call the DialogBox? Refer to the source code example below. Discuss how such an approach is 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: wm Id = LOWORD (wParam); wmEvent = HIWORD (wParam); // Parse the menu selections: switch (wmId) } { case IDM_ABOUT: break; case IDM_EXIT: DialogBox (hInst, MAKEINTRESOURCE (IDD_ABOUTBOX), hwnd, About); DestroyWindow(hWnd); default: break; return DefWindowProc(hWnd, message, wParam, 1Param); } break; case WM_PAINT: hdc = BeginPaint (hWnd, &ps); // TODO: Add any drawing code here... EndPaint (hWnd, &ps); break; case WM_DESTROY: default: } return 0; PostQuitMessage(0); break; return DefWindowProc(hWnd, message, wParam, 1Param);
Expert Answer:
Related Book For
Accounting Information Systems
ISBN: 978-0133428537
13th edition
Authors: Marshall B. Romney, Paul J. Steinbart
Posted Date:
Students also viewed these programming questions
-
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 main message procedure WndProc....
-
Consider Scheins four key organizational culture factors as described in Highlight 12.6. What examples can you identify within the IKEA organization that contributes to the companys strong corporate...
-
On January 1, 2021, Access IT Company exchanged $980,000 for 40 percent of the outstanding voting stock of Net Connect. Especially attractive to Access IT was a research project underway at Net...
-
At the end of its first year of operation, Jaeger Industries AG has 1,000,000 of ordinary shares and net income of 228,000. Prepare (a) The closing entry for net income (b) The equity section at...
-
If a CPU issues one memory request every instruction and the computer runs at 200 MIPS, about how many CPUs will it take to saturate a 400-MHz bus? Assume that a memory reference requires one bus...
-
a. Define and illustrate kiting. b. How can kiting be prevented and detected?
-
The controller of Trenshaw Company wants to improve the companys control system by preparing a month-by-month cash budget. The following information is for the month ending July 31, 2014. June 30,...
-
W = 235 lb/ft L = 10.5 ft L W The proposed beam for the loading diagram above is a steel 5-in nominal extra strong pipe. What is the maximum bending stress?
-
The following trial balance of Oakley NV does not balance. Each of the listed accounts should have a normal balance per the general ledger. An examination of the ledger and journal reveals the...
-
On January 1, 2021, Sampson Co. purchased 100,000, representing 10% of Fraser's outstanding shares. P10 par ordinary shares of Fraser Co. at P18 per share. Transaction costs amounted to P50,000, and...
-
A positively charged hollow sphere of radius \(+100 \mathrm{~mm}\) has a uniform surface charge density of \(10 \mathrm{nC} / \mathrm{m}^{2}\). Determine the electric field (a) 20 mm (b) 90 mm, and...
-
(LO2) Describe the claim of right doctrine.
-
(L02) Drew is self-employed as a mobile pet groomer and received a check from his customer on December 28, Year11. He did not deposit the income until January 2, Year12. In which year is the income...
-
(LO2) Mark is a successful attorney specializing in mergers and acquisitions. He hires his 16-year-old son, Eric, to perform general office work and pays Eric \(\( \$ \) 100,000\). Will this income...
-
(LO1) Suzanne prepares tax returns and Bill is a professional tennis instructor. If Suzanne prepares Bill's tax return in exchange for Bill providing her daughter tennis lessons, does either Suzanne...
-
Calculate the Larmor radius (gyro-radius) r for the following cases, if v| is negligible. [20 points]. (a) A 10-KeV electron in the earth's magnetic field of 5 x 10-5T (b) A 3.5-MeV 4He ash particle...
-
How does health insurance risk differ from other types of insurance risk (e.g., automobile or homeowners insurance)? What is the difference between cost sharing and cost shifting? Is retiree health...
-
Lancaster Company makes electrical parts for contractors and home improvement retail stores. After their annual audit, Lancasters auditors commented on the following items regarding internal controls...
-
Hands-on practice in database design is important. Use a relational DBMS to implement the integrated REA data model presented in this chapter, or one of the integrated data models from the homework...
-
Excel Project a. Expand the cash budget you created in Problem 12.4 to include a row for expected cash outflows equal to 77% of the current months sales. b. Also add a row to calculate the amount of...
-
Consider the multiple linear regression model fit to the baseball data in Problem 3.41. Problem 3.41 Consider the 2016 major league baseball data in Table B.22. While team ERA was useful in...
-
Consider the simple linear regression model fit to the rental price data from Problem 2.36. Data From Problem 2.36 Table B.24 contains data on median family home rental price and other data for 51 US...
-
Consider the multiple linear regression model fit to the rental price data in Problem 3.42. Problem 3.42 Table B.24 contains data on median family home rental price and other data for 51 US cities....
Study smarter with the SolutionInn App