0

I am having trouble with creating lparam for postmessage. I know that application gets such key:

WM_KEYDOWN nVirtKey: VK_CONTROL cRepeat:1 ScanCode: 1D fExtended:0 fAltDown:0 fRepeat:0 fUp:0

WM_KEYDOWN nVirtKey: VK_LEFT cRepeat:1 ScanCode: 4B fExtended:1 fAltDown:0 fRepeat:0 fUp:0

WM_UP nVirtKey: VK_LEFT cRepeat:1 ScanCode: 4B fExtended:1 fAltDown:0 fRepeat:1 fUp:1

WM_UP nVirtKey: VK_CONTROL cRepeat:1 ScanCode: 1D fExtended:0 fAltDown:0 fRepeat:1 fUp:1

could you tell me how I am supposed to create that lparam? I have read msdn, and I have made such lparam: 0x00011D00 and 0x00011D03 but they send such crap:

WM_KEYDOWN nVirtKey: VK_CONTROL cRepeat:7424 ScanCode: 01 fExtended:0 fAltDown:0 fRepeat:0 fUp:0

WM_KEYDOWN nVirtKey: VK_LEFT cRepeat:1 ScanCode: 00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0

WM_UP nVirtKey: VK_LEFT cRepeat:1 ScanCode: 00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0

WM_UP nVirtKey: VK_CONTROL cRepeat:7427 ScanCode: 01 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
JleruOHeP
  • 10,106
  • 3
  • 45
  • 71
Immons
  • 257
  • 1
  • 11
  • why do you want to postmessage WM_KEYDOWN and WM_UP ? – codeteq Aug 30 '12 at 11:30
  • The lower 16 bits are the repeat count. So 0x1D00 = 7424. You can't get this code to work, you must use SendInput() to control the state of modifier keys like Ctrl. – Hans Passant Aug 30 '12 at 13:01
  • I've found Lparam using Spy++, but still that doesn't work, even though it is used same way as I would just click Ctrl+left arrow. How can I send multiplte key to background APP in C#? Somebody? – Immons Aug 30 '12 at 17:04

0 Answers0