473,324 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Generating Keyboard events in another application

does anyone know how to generate keyboard events in another
application?

like
[DllImport ("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int
wParam, int lParam);

can be used for mouse events...

how would you do keyboard events?

assuming that the other appliation is not a dotNet application

Nov 17 '05 #1
2 3133
You would use SendMessage also:

The follow will send a 'M' to the targetWindow

SendMessage(targetWindowHandle, WM_KEYDOWN, VK_M, 0)

Michael Cierkowski

<we********@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
does anyone know how to generate keyboard events in another
application?

like
[DllImport ("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int
wParam, int lParam);

can be used for mouse events...

how would you do keyboard events?

assuming that the other appliation is not a dotNet application

Nov 17 '05 #2
i believe that SendMessage() is useful when you're not certain that the
application is visible but you want to send it a click anyway. It is
possible however for the receving application to determine that this
was in fact a "fake" keyboard event and consequently ignore it. is that
true.. i know that it is true for mouse events, which is why you'd
prefer to use mouse_event()... is the same also true for keyboard
events?

Michael Cierkowski wrote:
You would use SendMessage also:

The follow will send a 'M' to the targetWindow

SendMessage(targetWindowHandle, WM_KEYDOWN, VK_M, 0)

Michael Cierkowski

<we********@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
does anyone know how to generate keyboard events in another
application?

like
[DllImport ("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int
wParam, int lParam);

can be used for mouse events...

how would you do keyboard events?

assuming that the other appliation is not a dotNet application


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ziv Forshtat | last post by:
Hi All, I'm in the process of implementing a virtual keypad: I have a wxFrame which contains a photo the keypad of some device, and I'm using it to enter special keywords into an editor window...
3
by: Lachlan Hunt | last post by:
Hi, I've been looking up lots of documentation and trying to work out a cross-platform method of capturing a keyboard event and working out which key was pressed. From what I can find, there...
16
by: dfaber | last post by:
Hi all, I have been searching for a keyboard and mouse tracker on linux. I've read solutions (watch at sourceforge) which look at /proc/interrupts to check keyboard or mouse activity. I also read...
6
by: Kürþat | last post by:
Hi, I want to get all key press messages and for some keys I want to generate extra key press messages to simulate fast typing. For example if someone press 'H' my app should catch and change...
0
by: Gamey | last post by:
I have an application that NEEDS (don't ask) to handle additional mouse and keyboard processing during DoDragDrop. Normally, DoDragDrop kindly squashes all keyboard and mouse events. Alternate,...
3
by: wbyeats | last post by:
Hi, I would like to enable my VC++ application to capture general mouse and keyboard events (click, double-click, key press) that occur outside of my application's frame (eg. clicking inside the...
9
by: Gandalf | last post by:
I use WX on windows XP and I try to generate an event when the user is clicking the keyboard while the application frame is not in focus. All I manged to do were while the application frame is in...
12
by: =?ISO-8859-1?Q?Joaqu=EDn_Zuazo?= | last post by:
I'm trying to find what character was pressed, using an accent with a dead letter, e.g an á, on an input box. I have made an small program to check the keyboard events keydown, keypress and...
13
by: andypb123 | last post by:
Hello, The onchange event fires in IE6 in a SELECT element when scrolling through the list with the up and down arrows on the keyboard. In Firefox it only fires after you hit the enter key, which...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.