4. Display and Update window
To make the window appear, you need to call ShowWindow to display the window.
BOOL ShowWindow ( hwnd hwnd, int ncmdshow);
The first parameter is the window handle that is returned when the window is created. The second window specifies the status of the window display. Common states are:sw_hide hides the window and activates other windows,sw_show activates and displays the window in its original position, andsw_showmaximized activates and maximizes the window ;sw_showminimized activates the window and minimizes it;sw_shownormal activates and displays the vault.
Update window
After calling the ShowWindow function, call UpdateWindow to refresh the window. The prototype is as follows:
BOOL UpdateWindow ( hwnd hwnd // handle to Window);
Its parameter HWND refers to the handle of the window after the window was created successfully. The UpdateWindow function refreshes the window by sending a WM_PAINT message, and UpdateWindow sends theWM_PAINT message directly to the window procedure function for processing without putting it into the message queue example .
Window creation ends.
Chapter One internal running mechanism of Windows Program (4) WinMain function (cont.)