Sending messages to another application
-
Hi! I was implementing the On-screen keyboard application that comes with Windows. I have two queries regarding this: 1. I have made my app 'always on top', but the problem is setting focus to the application just below this one. I am aware that SetFocus is useless in this case. I want to find a way to this using GetNextWindow 2. Let's assume notepad is going to be receiving keystrokes via this on-screen keyboard app. Can anyone send me code to this. I have tried something like: DWORD dwProcessID; ::GetWindowThreadProcessId(hForeground,&dwProcessID); ::PostThreadMessage(dwProcessID, WM_KEYDOWN, 65, 1); ::PostThreadMessage(dwProcessID,WM_CHAR, 65,1); ::PostThreadMessage(dwProcessID, WM_KEYUP, 65,1); But this doesnt help. Any help will be greatly appreciated. Thanks for your time Richard
-
Hi! I was implementing the On-screen keyboard application that comes with Windows. I have two queries regarding this: 1. I have made my app 'always on top', but the problem is setting focus to the application just below this one. I am aware that SetFocus is useless in this case. I want to find a way to this using GetNextWindow 2. Let's assume notepad is going to be receiving keystrokes via this on-screen keyboard app. Can anyone send me code to this. I have tried something like: DWORD dwProcessID; ::GetWindowThreadProcessId(hForeground,&dwProcessID); ::PostThreadMessage(dwProcessID, WM_KEYDOWN, 65, 1); ::PostThreadMessage(dwProcessID,WM_CHAR, 65,1); ::PostThreadMessage(dwProcessID, WM_KEYUP, 65,1); But this doesnt help. Any help will be greatly appreciated. Thanks for your time Richard
-
Hi! I was implementing the On-screen keyboard application that comes with Windows. I have two queries regarding this: 1. I have made my app 'always on top', but the problem is setting focus to the application just below this one. I am aware that SetFocus is useless in this case. I want to find a way to this using GetNextWindow 2. Let's assume notepad is going to be receiving keystrokes via this on-screen keyboard app. Can anyone send me code to this. I have tried something like: DWORD dwProcessID; ::GetWindowThreadProcessId(hForeground,&dwProcessID); ::PostThreadMessage(dwProcessID, WM_KEYDOWN, 65, 1); ::PostThreadMessage(dwProcessID,WM_CHAR, 65,1); ::PostThreadMessage(dwProcessID, WM_KEYUP, 65,1); But this doesnt help. Any help will be greatly appreciated. Thanks for your time Richard
Good link also http://www.codeproject.com/dialog/keystroke.asp Papa while (TRUE) Papa.WillLove ( Bebe ) ;
-
Good link also http://www.codeproject.com/dialog/keystroke.asp Papa while (TRUE) Papa.WillLove ( Bebe ) ;
Thanks so much for your quick reply, Papa (is that ur name ?):-D
-
Thanks so much for your quick reply, Papa (is that ur name ?):-D