[C#] How can I listen a key of my keyboard

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'd like to listen a key of my keyboard to execute some code when that key
is pressed. I'm not use a Windows Forms that's why I can not use a keydown
event.

In fact I'd like to do a thing like a reboot when 2/3 keys are pressed.

But I don't know how I can do.

Maybe to listen window message ?

Could you help me please ?

Thanks
 
RegisterHotKey(), maybe. It's a call that you'd have to P/Invoke and you'd
have to catch the WM_HOTKEY message in either a MessageWindow subclass or
with something like OpenNETCF's ApplicationEx and an IMessageFilter
subclass. There might even be a declaration for it in there already...

Paul T.
 
Back
Top