CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 1999
    Location
    North Carolina
    Posts
    1

    Using RegisterHotKey API

    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


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Using RegisterHotKey API

    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.


  3. #3
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Using RegisterHotKey API

    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...mr/hotkeyr.htm


    Chris Eastwood

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured