Attribute VB_Name = "WinApi" 'Déclaration des API Public Declare Function FindWindow _ Lib "user32" Alias "FindWindowA" ( _ ByVal lpClassName As String, _ ByVal lpWindowName As String _ ) As Long Public Declare Function GetActiveWindow _ Lib "user32" () As Long Public Declare Function GetEnvironmentStrings _ Lib "kernel32" Alias "GetEnvironmentStringsA" ( _ ) As String Public Declare Function GetLastError _ Lib "kernel32" ( _ ) As Long Public Declare Function GetWindowText _ Lib "user32" Alias "GetWindowTextA" ( _ ByVal hwnd As Long, _ ByVal lpString As String, _ ByVal cch As Long _ ) As Long Declare Function CloseWindow Lib "user32" ( _ ByVal hwnd As Long _ ) As Long Declare Function CloseWindowStation Lib "user32" ( _ ByVal hWinSta As Long _ ) As Boolean Declare Function SetActiveWindow Lib "user32" ( _ ByVal hwnd As Long _ ) As Long Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long Private Declare Sub ReleaseCapture Lib "user32" () Private Const HTCAPTION = 2 Private Const WM_NCLBUTTONDOWN = &HA1 Public Function FrmMove(frm As Form, Button As Integer) If Button = vbLeftButton Then ReleaseCapture SendMessage frm.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End If End Function