I got a WM_COMMAND in a button event by Spy++, It looks like:
<000116> 001B0A02 S WM_NOTIFY idCtrl:133978 pnmh:0019F9A0
<000117> 001B0A02 R WM_NOTIFY
<000118> 001B0A02 S WM_COMMAND wNotifyCode:0000 wID:2 hwndCtl:00020B5A
<000119> 001B0A02 R WM_COMMAND
<000120> 001B0A02 S WM_NOTIFY idCtrl:133978 pnmh:0019F9BC
<000121> 001B0A02 R WM_NOTIFY
Then I tried to redo WM_COMMAND
by SendMessage
:
Nothing happened. I used the AHK script to be sure, same result.
When I used SendMessage()
, Spy++ got this:
<000423> 001B0A02 S WM_COMMAND wNotifyCode:0000 wID:2 hwndCtl:00000014
<000424> 001B0A02 R WM_COMMAND
I also let the lParam = 0
, then it worked but not as I expected, another Menu item opened.
<000001> 001B0A02 S WM_COMMAND wNotifyCode:0 (sent from a menu) wID:2
So how can I do this?