anyone know a good technique for detecting alt tab or general loss of focus in my app as I have an agent character, and when they leave the app I want to hide the agent...
TIA
Printable View
anyone know a good technique for detecting alt tab or general loss of focus in my app as I have an agent character, and when they leave the app I want to hide the agent...
TIA
Use the GetAsyncKeyState API call.... If I'm right (and I usually am :)) one of the gurus will come bursting into this thread and post an example-
Try this: Make a Form with a Timer and set it's Interval to 1.
Code:Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Const VK_MENU = &H12
Private Const VK_TAB = &H9
Private Sub Timer1_Timer()
If GetAsyncKeyState(VK_MENU) And GetAsyncKeyState(VK_TAB) Then
Print "Alt Tab as pressed"
End If
End Sub
Looks as if i'm right once again!