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

    [RESOLVED] Add-In + Hotkeys: How?

    Hello there. I'm kinda new in the add-in programming, but i'm learning some stuff with other's code and guides.

    This week, i have been trying to create an add-in that support hotkeys. Which means that when the user press Ctrl+F3, a message box will appear saying "Hello".

    As an add-in don't receive focus, i can't use "easy methods", like keypress or keydown events. So, i heard about one API called RegisterHotKey. It worked perfectly on a normal project but when i use it on my add-in, i got a problem: it just freeze the Visual Basic.

    Why?
    Well, after i call the RegisterHotkey function, i need to read the messages that my software receive. I'm doing this using the PeekMessage function inside an "eternal loop" (it only stop when VB is closed). The problem is that this loop freeze my Visual Basic application, even when i use DoEvents.

    I don't mind what can be done to avoid this freezing or another way to create hotkeys on a invisible add-in, so i'm here asking for help.




    Thanks.

  2. #2
    Join Date
    Jul 2009
    Location
    Brazil
    Posts
    25

    Re: Add-In + Hotkeys: How?

    Subclassing saved me

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