Hi,
After using RegisterWindowMessage, what is the best way to check for that window message in WndProc.

.ELSEIF uMsg==uMyMsg ;DOES NOT WORK

mov eax,uMyMsg ;at the beginning of WndProc
.
.
.
.
.ELSEIF uMsg==eax ;WORKS!!!

Is there a way of doing this WITHOUT the additional mov?

Thanks
Posted on 2003-02-03 05:50:39 by bgong68
I assume uMyMsg is a memory location?

If so, there is no way to do the compare without moving it into some register.

As a general rule, it is more often done this way:

mov eax,uMsg

.IF eax==WM_COMMAND
.
.
.
.ELSEIF eax==uMyMsg
.
.
.
.ENDIF
Posted on 2003-02-03 06:16:06 by AmkG
I do not think so.

For
.if macro expands to cmp instruction and jumps.
Since you cannot cmp memory,memory


.ELSEIF uMsg==uMyMsg ;DOES NOT WORK

mov eax,uMyMsg ;at the beginning of WndProc
.
.
.
.


does not work
Posted on 2003-02-03 06:18:29 by roticv
Thanks for the help. ^_^
Posted on 2003-02-03 20:48:58 by bgong68