Public Declare Function GetDesktopWindow Lib "user32" () As Long Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long Public Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal X As Long, ByVal Y As Long, _ ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPublic Sub Hwnd_Site() Dim hwnd As Long Dim Wind_Title As String hwnd = GetDesktopWindow() 'Retrieves a handle to the desktop window if hwnd <> 0 then hwnd = GetWindow(hwnd, GW_CHILD) ' get the handle of the first window Do While hwnd <> 0 Wind_Title = GetCaption(hwnd) If Len(Wind_Title) > 0 And InStr(1, Wind_Title, "Jouez") Then MoveWindow hwnd, 0, 0, 1150, 620, 1 ' dernier paramètre = 1 pour RePaint Form Exit Do End If hwnd = GetWindow(hwnd, GW_HWNDNEXT) ' get the handle of the next window Loop end if End Sub