How can use RegisterHotKey?

  • Thread starter Thread starter LiuMin
  • Start date Start date
L

LiuMin

RegisterHotKey in "Hotkey.lib":
BOOL RegisterHotKey(
HWND hWnd,
int id,
UINT fsModifiers,
UINT vk
);How Can Use it in .net
 
Well, you'd rewrite that declaration to reference corelib.dll. To use it,
you'd have to be able to get your main window handle or the window handle to
a MessageWindow subclass that you create (for the first parameter), make up
an id for the second parameter, set the modifiers to some combination of

MOD_ALT
MOD_CONTROL
MOD_KEYUP
MOD_SHIFT
MOD_WIN

and specify the virtual key code for the key you want. The values for the
flags and the virtual key codes would be in the C++ header files for the SDK
for the device you are targeting.

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top