Sending LOWORD/HIWORD WPARAMS

How do I send an LPARAM or WPARAM with a HIWORD and a LOWORD value in PostMessage()?

Do I have to send it as a union, or is it done in some other way?
Last edited on
There are pre-defined macros just for that newbieg. For example, here is MAKELPARAM from MSDN ...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
MAKELPARAM
The MAKELPARAM macro creates an unsigned 32-bit value for use as an lParam parameter in a message. The macro concatenates two given 16-bit values. 

LPARAM MAKELPARAM(
  WORD wLow,  // low-order word
  WORD wHigh  // high-order word
);
 
Parameters
wLow 
Specifies the low-order word of the new long value. 
wHigh 
Specifies the high-order word of the new long value. 
Return Values
The return value is an unsigned 32-bit value. 


Its fun! I do it all the time. Just today I sent a WM_VSCROLL message and posted a WM_LBUTTONDOWN message. You can send button presses, lots of things.

Thanks, That's exactly what I needed for my program.
Topic archived. No new replies allowed.