CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2009
    Posts
    2

    show() via keybinds

    Hey, I'm making a small program that shows a small frame just under the mouse. What I want it to do is show the frame when I press a specific key combination, like Shift + tab or something. However, the program won't have any focus.

    Any ideas on how to implement this?

  2. #2
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: show() via keybinds

    try to handle for the key press events and show up your frame in the event handler delegates...

  3. #3
    Join Date
    Jun 2008
    Posts
    2,477

    Re: show() via keybinds

    Quote Originally Posted by vcdebugger View Post
    try to handle for the key press events and show up your frame in the event handler delegates...
    Keyboard events will not fire when the form does not have focus.

    You can do this a couple of ways. You can register a hot key with the OS (some example code here, or you can use a system hook. A system level keyboard hook can be a little tricky, but if you want to go that route search for documentation on the SetWindowsHookEx API.

  4. #4
    Join Date
    Oct 2009
    Posts
    2

    Re: show() via keybinds

    Thanks BigEd781, I'll take a look into those.

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