Click to See Complete Forum and Search --> : Using RegisterHotKey API


stonemw
September 30th, 1999, 12:08 PM
Can you help?
I am trying to figure out how to use the RegisterHotKey and UnregisterHotKey API calls. I do not know how to use them and to top it off it can not find the .DLL it uses. Which dll is it looking for? Can anybody tell me how I can use the 2 API calls? I need to notify other applications if a key or keys are pressed. Any help would be greatly appreciated!

Matt Stone

Lothar Haensler
October 1st, 1999, 01:48 AM
I haven't used that API, but from the description you need to use subclassing in order to trap the WM_HOTKEY message in your VB application.
The first parameter is the window handle of the VB window that is supposed to receive the WM_HOTKEY message.
The other parameters are self-explanatory.

Registerhotkey is contained in user32.dll.

Chris Eastwood
October 1st, 1999, 02:19 AM
There's some excellent articles on creating 'Hot-Keys' and system-wide hooks using the downloadable code from vbAccelerator (http://vbaccelerator.com)

Look at :

vbAccelerator Hook Library - http://www.vbaccelerator.com/codelib/hook/vbalhook.htm

vbAccelerator Accelerator Control - http://www.vbaccelerator.com/codelib/hook/vbalacel.htm

Creating and Responding to HotKeys - http://www.vbaccelerator.com/codelib/ssubtmr/hotkeyr.htm


Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb