By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 991 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Hooking the Keyboard and redirecting keystrokes

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.