Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the "low word" and "high word" locations of a WParam change in 64bit code?

I'm trying to handle the WM_XBUTTONUP message which is from the extra mouse buttons on some mice. The SDK documentation states that the low word of wParam holds the virtual key information and that the high word holds which button was pressed. I understand how this works in 32bit code, however in 64bit code the wParam is a 64bit unsigned integer. I've seen code that uses Lo(msg.wparam) and Hi(msg.wparam). Does this code still work in 64bits or does something have to change? In other words, does the definition of "high word" change from 32bit to 64bit?

like image 457
MarkF Avatar asked Mar 19 '23 07:03

MarkF


1 Answers

You should have shown the code. Lo and Hi return the low byte and the high byte of a 16-bit value, respectively, so they wouldn't work with 32-bit code, either. Perhaps you meant LoWord and HiWord.

In 64-bit code, you can typecast a 64-bit integer value to Int64Rec:

case Int64Rec(Msg.WParam).Lo of ...

like image 134
Ondrej Kelle Avatar answered Apr 28 '23 12:04

Ondrej Kelle