Results 1 to 3 of 3

Thread: Closing an Invisible using Key Strokes [RESOLVED]

  1. #1

    Thread Starter
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349

    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.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Try GetAsyncKeyState in a timer
    VB Code:
    1. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    2.  
    3. Private Const GAKS_KEYDOWN = &H8000
    4. Private Const VK_CONTROL = &H11
    5. Private Const VK_SHIFT = &H10
    6.  
    7. Private Sub Timer1_Timer()
    8.  
    9.     If GetAsyncKeyState(VK_CONTROL) And GAKS_KEYDOWN Then
    10.         If GetAsyncKeyState(VK_SHIFT) And GAKS_KEYDOWN Then
    11.             If GetAsyncKeyState(vbKeyQ) And GAKS_KEYDOWN Then
    12.                 Unload Me
    13.             End If
    14.         End If
    15.     End If
    16.  
    17. End Sub

    CTRL + SHIFT + Q

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Hyperactive Member Blinky Bill's Avatar
    Join Date
    Mar 2002
    Location
    Happily munching on the greenery in your garden
    Posts
    349
    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
  •  



Click Here to Expand Forum to Full Width