In《Programint Windows》chapter 5 code:DEVCAPS1.C,there are
"return msg.wParam;" but not "return 0;" which we are familiar with; Is "return 0" different from "return msg,wParam"?
search MSDN:
GetMessage():
Return Value
If the function retrieves a message other than WM_QUIT, the return value is nonzero.
If the function retrieves the WM_QUIT message, the return value is zero.
so when out of while ,the function GetMessage gets the msg WM_QUIT;
search WM_QUIT:
this msg has two Parameters
wParam
Specifies the exit code given in the PostQuitMessage function.
lParam
This parameter is not used.
here we know here wParam is assigned by the parameter which PostQuitMessage passed;
then I return <<Programing Windows >>:
case WM_DESTROY: PostQuitMessage (0) ; return 0 ;
you see here PostQuitMessage 's parameter is 0
In a word here at this code return 0 and return msg.wParam is the same. Do you agree?