How to fire off my VB.NET code when user hits Print Screen on their keyboard

How can I tie a VB.NET console appliction to the print screen key?  Is there any way to capture that and then run some VB.NET code if a user clicks their Print Screen button?  I'd just put an exe or something on their hard disk and want them to push the print screen key then my code would fire off
LVL 1
dba123Asked:
Who is Participating?
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
dba123,

I wouldn't use a Console application to do this.  Console apps are NOT designed to sit around waiting for an event to happen.

Use the code I gave you in your other question:
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21864637.html

You can load up the app and then make the main form invisible so that it isn't apparent to the end user...

Or you can build a class based on the ApplicationContext() class and set it up to be the "message loop" loaded up from a Sub Main().

~IM
0
 
davidrichardsonCommented:
not sure if this is what your looking for

http://www.codeproject.com/vb/net/mclhotkeynet.asp
0
 
mydasxCommented:
this is a shady post...  you want to essentially keep tabs on key press events at all times the computer is running.  and when your key press event happens fire and exe.  That sounds like virus, spyware development to me.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
mydasxCommented:
however, i'm sure your a nice guy... soo...

create a windows service that starts at startup and captures the keypress event using windows api.  then using system.diagnostics fire your exe.
0
 
davidrichardsonCommented:
dont forget the printscreen button only fires the Keyup event
0
 
mydasxCommented:
what david said.
0
 
dba123Author Commented:
>>>this is a shady post...  you want to essentially keep tabs on key press events at all times the computer is running.  and when your key press event happens fire and exe.  That sounds like virus, spyware development to me.

no, this is for our IT department.  We h ave a shitty 3rd party app which I dno't support and I've been asked to create this because our users are morons...more than regular moron users and they do not have access to Outlook and therefore cannot send us print screens when these criptic errors keep coming up....which has hosed our systems for 2 weeks.  Basically my boss and the network admins are going nuts and have asked the users to send them screen shots.  Well, only the managers can do this.  So they need a simply way, other than having to create 200 email accounts, to allow them to print screen so we can collect screen shots and save time in troubleshooting our issue.

I do not work for a software company so this definitely isn't spam.  I just want to trigger my VB.NET code off a keystroke, this has to be a common items people have coded for legit purposes...it's simple to think about but I can't find anything about doing this on the print screen button
0
 
mydasxCommented:
fair enough, you do however, see the danger of explaining how to create a keystroke recorder is made on this forum.
0
 
mydasxCommented:
** stupid fingers Nix the is made part.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.