How to Piggyback a Keypress?
- From: NvrBst <nvrbst@xxxxxxxxx>
- Date: Tue, 05 Jun 2007 22:33:37 -0000
Is there a easy way to resend the KeyPress to the window after
capturing a hotkey?
protected override void WndProc(ref Message m) {
base.WndProc(ref m);
if(m.Msg == WM_HOTKEY) {
if(m.WParam == myHotkeyID) /* Do What I Want to
Do */
Resend the Key Pressed to the application without
triggering the hotkey message again.
}
}
}
it works if I use the C# "SendKeys.Send(...)", and mimics the "ctrl/
shift/alt modifiers" nicely, but the hotkeys are defined by the user,
and converting the "Keys.___" to a string manually is hard at times...
"IE Keys.OemTilda.ToString()" != "`"
Is using PostMessage the easiest? Getting the SYSKEYDOWN, KEYDOWN,
lParam Mimic etc all perfect would take a tiny bit..
Would there be a trick with the DefWndProc/DefWindowProc I could use?
.
- Follow-Ups:
- Re: How to Piggyback a Keypress?
- From: Nicholas Paldino [.NET/C# MVP]
- Re: How to Piggyback a Keypress?
- Prev by Date: Re: Splitting a string with Regex and keep the separator
- Next by Date: Re: Splitting a string with Regex and keep the separator
- Previous by thread: Calling MS Word Letter Wizard?
- Next by thread: Re: How to Piggyback a Keypress?
- Index(es):
Relevant Pages
|