Lägg till en timer med cirka 10 i interval och följande kod:
Private Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
Private Const VK_F9 = &H78
Private Sub Timer1_Timer()
If CBool(GetAsyncKeyState(VK_F9)) Then
frmMain.WindowState = vbNormal
End If
End Sub
Private Declare Function SetFocusAPI Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
Private Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
Private Const VK_F9 = &H78
Private Sub Timer1_Timer()
If CBool(GetAsyncKeyState(VK_F9)) Then
frmMain.WindowState = vbNormal
SetFocusAPI frmMain.hWnd
End If
End Sub