Charles Petzold uses a return after each WM processing in a ["winprok" :) ]

The point of this i think is to not have code "cascade" needlessly through the rest of the "switch" or ".elseif" respectively and return immediately.

example:
?  ?  
case WM_DESTROY :
?  ?  PostQuitMessage (0) ;
?  ?  return 0 ;


Shouldn't i use ret in asm as well after each message processing, or isn't it the same thing?

example:

.elseif uMsg==WM_DESTROY
invoke PostQuitMessage, NULL
?  ?  ?  ?  ?  ?  ? ret
Posted on 2006-08-20 04:47:15 by w0lfshad3
Sure thing, just remember putting a returnvalue in EAX first.
Posted on 2006-08-20 06:53:44 by f0dder
oops i just been corrected by Tedd, the .if .elseif .else conditional structure falls through without checking the remaining conditions thus returning after every message processing is redundant(except DefWindowProc).
Posted on 2006-08-24 08:59:16 by w0lfshad3