Voilà, j'ai trouvé un bon petit début :
Etape 1 - Chercher les différents process en cour
Public Declare Function EnumWindows& Lib "user32" (ByVal lpEnumFunc As Long, _
ByVal lParam As Long)
Public Declare Function GetWindowText Lib "user32" _
Alias "GetWindowTextA" (ByVal hwnd As Long, _
ByVal lpString As String, _
ByVal cch As Long) As Long
Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wFlag As Long) As Long
Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Public Declare Function GetDesktopWindow Lib "user32" () As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare Function IsWindow Lib "user32" (ByVal hwnd As Long) As Long
' GetWindow() Constants
Const GW_HWNDFIRST = 0
Const GW_HWNDLAST = 1
Const GW_HWNDNEXT = 2
Const GW_HWNDPREV = 3
Const GW_OWNER = 4
Const GW_CHILD = 5
Const GW_MAX = 5
' SetWindowPos Flags
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOZORDER = &H4
Const SWP_NOREDRAW = &H8
Const SWP_NOACTIVATE = &H10
Const SWP_FRAMECHANGED = &H20 ' The frame changed: send WM_NCCALCSIZE
Const SWP_SHOWWINDOW = &H40
Const SWP_HIDEWINDOW = &H80
Const SWP_NOCOPYBITS = &H100
Const SWP_NOOWNERZORDER = &H200 ' Don't do owner Z ordering
' SetWindowPos() hwndInsertAfter values
Const HWND_TOP = 0
Const HWND_BOTTOM = 1
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Public Sub GetWinHandles()
' permet de connaitre toutes les applications en cours
Dim lonstatus As Long
Dim londummy As Long
iWnd = 0&
lonstatus = EnumWindows&(AddressOf EnumWindowsproc, ByVal iWnd)
end sub
Function EnumWindowsproc(ByVal addhWnd As Long, ByVal optparam As Long) As Long
' extrait les proccess en cours
Dim st As String
Dim cc As Long
Dim X As Long
Dim Y
Dim z As Long
Dim sclass As String
sclass = String(250, " ")
Y = addhWnd
cc = 250
st = Space(250)
X = GetWindowText(addhWnd&, st, cc)
If Asc(Left(st, 1)) > 0 Then
If iWnd > 0 Then
ReDim Preserve atabwhnd(iWnd)
ReDim Preserve atabwhnd1(iWnd)
ReDim Preserve atabwhnd2(iWnd)
Else
ReDim Preserve atabwhnd(1)
ReDim Preserve atabwhnd1(1)
ReDim Preserve atabwhnd2(1)
iWnd = 1
End If
z = GetClassName(addhWnd&, sclass, 250)
atabwhnd(iWnd) = Left(st, X)
atabwhnd1(iWnd) = addhWnd&
atabwhnd2(iWnd) = Left(sclass, z)
'MsgBox atabwhnd(iWnd) ' & " " & atabwhnd1(iWnd) & " " & atabwhnd2(iWnd)
Variable_du_process = atabwhnd1(iWnd)
iWnd = iWnd + 1
End If
EnumWindowsproc = True
End Function
Etape 2 - Déplacer les fenetres :p
SetWindowPos NuméroProcess, HWND_TOP, Pos X, Pos Y, Largeur, hauteur, SWP_SHOWWINDOW
J'espere que ca en aidra d'autre que moi :p
M'enfin ~~