|
-
Nov 4th, 2002, 08:37 PM
#1
Thread Starter
Hyperactive Member
Closing an Invisible using Key Strokes [RESOLVED]
Guys,
I am developing a monitor program for my computer so that i can track the times that apps have been open for and the times they were opened, etc. Obviously then, the program is running totally invisible to the user, i can get it not to show in the task manager and not on the task bar, but i want to be able to set the form to invisible and be able to shut it down by pressing a key combination like CNTRL-SHFT-ALT-Q or something like that. How would i go about doing that?
Thanx for the help guys
Last edited by Blinky Bill; Nov 4th, 2002 at 09:03 PM.
We don't know what's wrong. . . So the best bet might be to remove something surgically.
-
Nov 4th, 2002, 08:47 PM
#2
Try GetAsyncKeyState in a timer
VB Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Const GAKS_KEYDOWN = &H8000
Private Const VK_CONTROL = &H11
Private Const VK_SHIFT = &H10
Private Sub Timer1_Timer()
If GetAsyncKeyState(VK_CONTROL) And GAKS_KEYDOWN Then
If GetAsyncKeyState(VK_SHIFT) And GAKS_KEYDOWN Then
If GetAsyncKeyState(vbKeyQ) And GAKS_KEYDOWN Then
Unload Me
End If
End If
End If
End Sub
CTRL + SHIFT + Q
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 4th, 2002, 08:59 PM
#3
Thread Starter
Hyperactive Member
Thanx crptcblade, it works perfectly!
We don't know what's wrong. . . So the best bet might be to remove something surgically.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|