I'm trying to replicate a CTRL + UP ARROW message but it's like ignoring the CTRL key, the result is like only sending UP ARROW, without sending CTRL
This is how the Spy++ results looks:
CTRL KEYDOWN:
UP ARROW KEYDOWN:
UP ARROW KEYUP:
CTRL KEYUP:
This is the code I'm using:
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, uint lParam);
SendMessage(whandle, 0x100, 0x00000011, 0x011D0001);
SendMessage(whandle, 0x100, 0x00000026, 0x01480001);
SendMessage(whandle, 0x101, 0x00000026, 0xC1480001);
SendMessage(whandle, 0x101, 0x00000011, 0xC11D0001);
I've changed this SendMessage signature to accept KEYUP lParams:
private static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, uint lParam);
Maybe the signature is wrong? I don't really know what I'm missing
I can't use SendKeys or any method that requires setting the window in front, it must work in background, neither SetKeyBoardState that could affect to other programs running
EDIT:
Tested with PostMessage and I get the same results, CTRL key is ignored
PostMessage(whandle, 0x100, 0x00000011, 0x011D0001);
PostMessage(whandle, 0x100, 0x00000026, 0x01480001);
PostMessage(whandle, 0x101, 0x00000026, 0xC1480001);
PostMessage(whandle, 0x101, 0x00000011, 0xC11D0001);