I'm trying to make a program that will simulate a LEFT
keypress to a window.
I'm using this:
PostMessage(hwnd, WM_KEYDOWN, new IntPtr(0x25), new IntPtr(0));
and this:
PostMessage(hwnd, WM_KEYUP, new IntPtr(0x25), new IntPtr(0));
But the results of these two lines of code aren't identical to the result of normally pressing LEFT
on the window...
Normally pressing LEFT
(WORKS):
P WM_KEYDOWN nVirtKey:VK_LEFT cRepeat:1 ScanCode:4B fExtended:1 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYUP nVirtKey:VK_LEFT cRepeat:1 ScanCode:4B fExtended:1 fAltDown:0 fRepeat:1 fUp:1
PostMessage
ing a LEFT
keypress (DOESN'T WORK):
P WM_KEYDOWN nVirtKey:VK_LEFT cRepeat:0 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
P WM_KEYUP nVirtKey:VK_LEFT cRepeat:0 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
Why is that? Is it because of the cRepeat
, ScanCode
, fExtended
, fRepeat
and fUp
that aren't the same? if so how do I set them correctly?