What would be the syntax for SendMessage when the message has Hiword and Loword in its wParam ??
SendMessage, 0x111, ????, %hwndcontrol%, A
Thanks for any suggestions !
SendMessage, WM_COMMAND, hiword loword of wParam ?
Started by
Mr_and_Mrs_D
, Sep 10 2008 08:48 PM
5 replies to this topic
LoWord := 1 HiWord := 2 wParam := MakeLong( LoWord, HiWord ) SendMessage, 0x111, %wParam%,0, %hwndcontrol%, A MakeLong( LoWord, HiWord ) { return (HiWord << 16) | (LoWord & 0xffff) }
#2
-
Posted 10 September 2008 - 08:57 PM
I was about to thank you for your super quick answer and Lo ! You came up with another answer, omg.
Thanks
Thanks
#3
-
Posted 10 September 2008 - 09:18 PM
XP SP3 Pro x32 / 7 x64 Pro - AHK 1.0.48.05
LoWord := 1 HiWord := 2 wParam := MakeLong( LoWord, HiWord ) SendMessage, 0x111, %wParam%,0, %hwndcontrol%, A MakeLong( LoWord, HiWord ) { return (HiWord << 16) | (LoWord & 0xffff) }
How would you do the conversion backwards? The OnMessage for 0x200 (WM_MouseMove) gives the X and Y coords, but as HiWord and LoWord; when I saw this I decided to just use MouseGetPos instead but if I could use it from the system that would be even better.
Seems like I should be able to figure out how to reverse it from the code you posted, but I'm absolutely terrible with bit-wise operations x_x
Edit: Nevermind, managed to figure it out (I think). I have this, and it works for a couple examples, so hopefully it's been done how it should:
MakeShort( Long , ByRef LoWord, ByRef HiWord) { LoWord := Long & 0xffff HiWord := Long >> 16 }
#4
-
Posted 10 September 2008 - 11:47 PM
managed to figure it out (I think). I have this, and it works for a couple examples, so hopefully it's been done how it should:
That is the correct method and I have been using it for a long time.
HIWORDs and LOWORDs posted by Chris
#5
-
Posted 11 September 2008 - 04:43 AM
Yay! I guess I probably should have done a forum search for Hi-/LoWords before just going to MouseGetPos... Ah well. Thanks for the help.
#6
-
Posted 11 September 2008 - 04:49 AM