From: Magnus Olsson on 17 Apr 2008 02:14 When I press CTRL+x, CTRL+ALT+x or CTRL+ALT+SHIFT+x (where x is a number) I want to send a sequence of chars to another application that is not I focus. To send the sequence I user following code: PostMessage(wnd, WM_KEYDOWN, key, 0x1); PostMessage(wnd, WM_KEYUP, key, 0xC0010001); It works perfect when I dont user Ctrl, Alt or Shift, but when I use them, I get problem. If I e.g. try to send the letter F when I have Ctrl pressed, the target applications handle it as CTRL+F, but I want it to ignore the ctrl (I dont have access to the target applications source code). I have try to use SetKeyboardState (together with AttachThreadInput) to set the keyboard state before I send, and it works sometimes, but not always. I have alsow try to use SnedInput to send KEYEVENTF_KEYUP for Ctrl, Alt and Shift, but it doesnt help. Any sugestion how to solv it?
|
Pages: 1 Prev: How to get Motherboard serial number? Next: Combo box cannot be displayed completely |