469,272 Members | 1,448 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,272 developers. It's quick & easy.

Hooking the Keyboard and redirecting keystrokes

Ok... so call me crazy, but I have an idea and I'm looking for where to
start...

I want to write an application that catches keystrokes and then either
redirects them to the in focus window or another window based on some
simple rules... in some cases the keystrokes would need to be sent out
to multiple windows.

I've done part of this in the past using a C++ application to hook the
Win32 keyboard API and dispose of unwanted keystrokes (Specifically a
windows key killer). But since I've never tried to go on and send
those keys to a final destination I figured I'd ask for some help on
where to start.
>From what I see SendKeys isn't suited for this as it requires the app
to be focused to receive input...

Thanks,

Zanthor

Jan 23 '07 #1
1 3569
As mentioned in the original post SendKeys isn't appropriate as it
requires focus. I need to send input to non-focused applications. Any
other ideas?

Thanks,

Will
RizwanSharp wrote:
System.Windows.Forms.SendKeys.Send(...);
Should help You.
But for this to work you need to activate the window to which you want to
send the keys. Because Send Keys sends Key Strokes to the current Active
Window.
Bes Regards,
Rizwan aka RizwanSharp

"zanthor" wrote:
Ok... so call me crazy, but I have an idea and I'm looking for where to
start...

I want to write an application that catches keystrokes and then either
redirects them to the in focus window or another window based on some
simple rules... in some cases the keystrokes would need to be sent out
to multiple windows.

I've done part of this in the past using a C++ application to hook the
Win32 keyboard API and dispose of unwanted keystrokes (Specifically a
windows key killer). But since I've never tried to go on and send
those keys to a final destination I figured I'd ask for some help on
where to start.
>From what I see SendKeys isn't suited for this as it requires the app
to be focused to receive input...

Thanks,

Zanthor
Jan 23 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Tony Pirkle | last post: by
1 post views Thread by Matthew Kelly | last post: by
7 posts views Thread by hokiegal99 | last post: by
8 posts views Thread by pigeonrandle | last post: by
1 post views Thread by Louis Cypher | last post: by
1 post views Thread by Louis Cypher | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.