voila a force de trainer sur le net et les forum on trouve donc si qqn a besoin de l'utiliser une fois je vous colle le code trouvé sur www.vbfrance.com
Option Explicit
Private Const MOD_ALT = &H1
Private Const MOD_CONTROL = &H2
Private Const MOD_SHIFT = &H4
Private Const PM_REMOVE = &H1
Private Const WM_HOTKEY = &H312
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type Msg
hWnd As Long
Message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
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 Msg, 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 bCancel As Boolean
Private Sub ProcessMessages()
Dim Message As Msg
'répéter tant que bCancel ne vaut pas True
Do While Not bCancel
'en attante de message
WaitMessage
'vérifie si c'est un HOTKEY-message
If PeekMessage(Message, Me.hWnd, WM_HOTKEY, WM_HOTKEY, PM_REMOVE) Then
'minimize the form
WindowState = vbMinimized
End If
'laisse les progs travailler
DoEvents
Loop
End Sub
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim ret As Long
bCancel = False
'Enregistre le raccourcis Ctrl-F
ret = RegisterHotKey(Me.hWnd, &HBFFF&, MOD_CONTROL, vbKeyF)
'Affiche des informations
Me.AutoRedraw = True
Me.Print "Presser CTRL-F pour réduire ce form"
'Affiche le form et
Show
'active le raccourcis
ProcessMessages
End Sub
Private Sub Form_Unload(Cancel As Integer)
bCancel = True
'Supprimer l'enregistrement du raccourcis
Call UnregisterHotKey(Me.hWnd, &HBFFF&)
End Sub
---------------
L'Internet serait une toile comme les autres si elle n'avait ses millions d'araignées ...