1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Private Type ordre
hWnd As Long
notre_message As Long
End Type
Private Declare Function RegisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
Private Declare Function UnregisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long) As Long
Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As ordre, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long
Private Declare Function WaitMessage Lib "user32" () As Long
Private couic As Boolean
Private Sub obeissons()
Dim notre_message As ordre
Do While Not couic
WaitMessage
If PeekMessage(notre_message, Me.hWnd, &H312, &H312, &H1) Then Me.Visible = Not Me.Visible
DoEvents
Loop
End Sub
Private Sub Form_Activate()
couic = False
RegisterHotKey Me.hWnd, &HBFFF&, 0, vbKeyF9
obeissons
End Sub
Private Sub Form_Unload(Cancel As Integer)
couic = True
Call UnregisterHotKey(Me.hWnd, &HBFFF&)
End Sub |
Partager