• 0

[VB.NET] Event Handling


Question

I wrote a small app in VB.net 2003, and I want to make it so that when I hit Ctrl-F12, the application shows its main page(the app can be minimized to the tray). The shortcut should world no matter what app is running. I was looking through MSDN and I found some code, however, the event only worked after I minimized to the tray and re-maximized, and it would only work once. I'm a bit new to this whole thing. :blush: Thanks in advance. :)

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

If you want this to be system-global, you'll need to set an OS keyboard hook (the SetWindowsHookEx API function).

http://msdn.microsoft.com/library/default....ndowshookex.asp

It can be complicated (you're inserting yourself into a chain of applications, so you need to take care of the next app in line). A word to the wise: This is one of those Windows things where if you don't understand what the documentation is trying to tell you, you shouldn't be attempting this. If you don't do it right, your app can muck up other apps and/or become a security problem.

Link to comment
Share on other sites

  • 0
This is one of those Windows things where if you don't understand what the documentation is trying to tell you, you shouldn't be attempting this. If you don't do it right, your app can muck up other apps and/or become a security problem.

:pinch: Damn, looks like I wont be doing that. :( Thanks for the info though. :cool:

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.