Link to home
Start Free TrialLog in
Avatar of Knut Hunstad
Knut HunstadFlag for Norway

asked on

LOWORD/HIWORD vs GET_X_LPARAM/GET_Y_LPARAM and MAKELONG vs MAKELPARAM

Hi!

While searching for something else, I ran across the statement that in Windows functions interpreting coordinates, one should use GET_X_LPARAM/GET_Y_LPARAM instead of LOWORD/HIWORD on the lParam parameter. Also it seems one should use MAKELPARAM instead of MAKELONG.

I do understand the difference, but feel a little uncertain about the benefits and pitfalls by simply replacing:

- LOWORD -> GET_X_LPARAM
- HIWORD -> GET_Y_LPARAM
- MAKELONG -> MAKELPARAM

in all of my company's code.

First about the need to do this: is it correct that the only problem with not changing this is that things might (or certainly will?) not work if your multiple monitor setup is different from having the main monitor to the left and others as extensions to the right of it?

Or does it even then work as long as you avoid some very specific functions?

Then to the pitfalls: if we simply do the replacements above in all our code, is there any reason to believe something that works correct now doesn't work the same afterwards?

I am guessing not, but I would like to be very sure before I suggest such a change in all our code.

Thank you for any insight into this!
ASKER CERTIFIED SOLUTION
Avatar of Ted Bouskill
Ted Bouskill
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Knut Hunstad

ASKER

Actually, I have now tested with some weird 2 monitor setups and confirmed that HIWORD/LOWORD don't work correctly! I'll go for a global replace in all our code.

Thanks for the input reassuring me that this is risk free and necessary!