I use PostMessage to drive an application by sending it keyboard
events. Messages that are sent with no modifiers are processed well.
As an example, the '.' key message sent here:
My messages:
Recognized: "Release brakes"
Message: 0x100 wParam: 0xbe lParam: 0x340001
Message: 0x102 wParam: 0x2e lParam: 0x340001
Message: 0x101 wParam: 0xbe lParam: 0xc0340001
What Spy++ generates when the '.' key is pressed:
00130122 P WM_KEYDOWN wParam:000000BE lParam:00340001
00130122 P WM_CHAR wParam:0000002E lParam:00340001
00130122 P WM_KEYUP wParam:000000BE lParam:C0340001
(Both are the same).
But then, if I try doing the same thing for the SHIFT-1 key sequence,
I generate the following messages from my application:
Message: 0x100 wParam: 0x10 lParam: 0x2a0001
Message: 0x100 wParam: 0x31 lParam: 0x20001
Message: 0x102 wParam: 0x21 lParam: 0x20001
Message: 0x101 wParam: 0x31 lParam: 0xc0020001
Message: 0x101 wParam: 0x10 lParam: 0xc02a0001
And Spy++ generated the following:
00130122 P WM_KEYDOWN wParam:00000010 lParam:002A0001
00130122 P WM_KEYDOWN wParam:00000031 lParam:00020001
00130122 P WM_CHAR wParam:00000021 lParam:00020001
00130122 P WM_KEYUP wParam:00000031 lParam:C0020001
00130122 P WM_KEYUP wParam:00000010 lParam:C02A0001
(Both are the same again).
For an obscure reason, the application that I try to control through
those messages (Microsoft Flight Simulator 2004) does not react to the
SHIFT message, but does behave as expected for messages like the '.'
pressed. Are there other messages than keyboard messages that I should
care about for modifiers? What could be so special about the SHIFT
modifier that would make it not work? Any help is greatly appreciated.