WM_COMMAND or my problem?
There''s something funny with the wparam of WM_COMMAND. I created a popup-window and a normal push-button. And when I clicked the button, under WM_COMMAND, the HIWORD(wparam) is 0, not BN_CLICKED. Why?
Acoording to MSDN:
wParam
The high-order word specifies the notification code if the message is from a control. If the message is from an accelerator, this value is 1. If the message is from a menu, this value is zero.
The low-order word specifies the identifier of the menu item, control, or accelerator.
Since my button is not from a menu, why is it zero?
Anyone knows why???
"after many years of singularity, i'm still searching on the event horizon"
I am not sure if this would work, but try casting the wParam to a LOWORD.
-Taphreek
-Taphreek
-Taphreek
the hiword of wparam should be always zero uppon WM_COMMAND
you can use:
LOWORD(wParam) == IDC_MYBUTTON
that''s it
Arkon
[QSoft Systems]
you can use:
LOWORD(wParam) == IDC_MYBUTTON
that''s it
Arkon
[QSoft Systems]
That should make my code go further! Thanks for the help!! ![](smile.gif)
But I still don''t understand why was HIWORD(wparam) always zero?
Or is the MSDN screwed up?![](wink.gif)
![](smile.gif)
But I still don''t understand why was HIWORD(wparam) always zero?
Or is the MSDN screwed up?
![](wink.gif)
"after many years of singularity, i'm still searching on the event horizon"
AH... I just found out WHY!
BN_CLICKED is defined as zero! And since the notification code is on the upper word, i.e. HIWORD(wParam), it is zero when I press the push-button.![](wink.gif)
But one thing, Arkon, is my push-button consider a menu? Because my push-button is not a menu, I still get a zero on the upper word of wParam.
BN_CLICKED is defined as zero! And since the notification code is on the upper word, i.e. HIWORD(wParam), it is zero when I press the push-button.
![](wink.gif)
But one thing, Arkon, is my push-button consider a menu? Because my push-button is not a menu, I still get a zero on the upper word of wParam.
"after many years of singularity, i'm still searching on the event horizon"
It is not a real menu, but it is an identifier that WM_COMMAND uses to identify what button is pushed. You can use any value from 0 - 65535 (in theory of course). They decided to use a (HMENU) cast to drive everyone insane. =)
The nightmare travels across the cosmos with his burning mane. The trail of ash that is produced.
?Have a nice day!?
quote:
Original post by GoofProg
It is not a real menu, but it is an identifier that WM_COMMAND uses to identify what button is pushed. You can use any value from 0 - 65535 (in theory of course). They decided to use a (HMENU) cast to drive everyone insane. =)
That''s the lo-order word of wParam - the identifier of control, menu item or accelerator.
What about the hi-word? Is the high word useless?
"after many years of singularity, i'm still searching on the event horizon"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement