
18 2. Windows Programming Fundamentals
who can’t wait, here is an explanation: WinMain typically contains a message loop that runs
until a WM_QUIT message is received. Upon receiving a WM_QUIT message, WinMain should
return the value contained in the quit message’s wParam parameter. If WinMain terminates
before entering the message loop, it should return 0.
Next is the calling convention WINAPI. A calling convention denes how the function
is called. e order in which parameters are passed, how the stack is cleaned up, etc., is all
specied by the calling convention.
e input parameters are:
• hInstance. is is essentially a pointer to the app ...