• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

Watching for a double key press

I need a program to sit quitly in the back ground and only come up when the user presses a cirtain key combination, i.e. if the press ctrl twice. I could be in any program when this happens.

Does anyone know how to do this?
0
James_Wyatt
Asked:
James_Wyatt
  • 2
  • 2
  • 2
2 Solutions
 
Maxim10553Commented:
how do you want the listener program to run? manually? on startup? the following is code from a PAQ to implement the hook
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21596242.html
0
 
James_WyattAuthor Commented:
the program will run on startup.

I've implemented the code from the example, it does call the 'New' sub however it doesn't seem to call the 'LowLevelKeyboardProc' function.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
If you're using VB.Net 2005, I've found that the low level keyboard hook only seems to work in the RELEASE version of the application.  For some reason it won't work in the IDE...

In VB.Net 2003 and below you can run the hook in the IDE no problems.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
James_WyattAuthor Commented:
Yep that was the problem (.NET 2005), very very annoying, thanks for your help both of you.
0
 
Maxim10553Commented:
yw, thanks for the points.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
"very very annoying"

Yes...VERY annoying...it took me quite awhile to figure this out!  The same bloody code worked fine in VB.Net 2003 and I tried many, many different versions of the code in VB.Net 2005 before I figured out the code was just fine as it originally was.   Grrrrrrr.....      (I still don't know what the difference in the IDEs is)

=)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now