Tu te trompes d'API, il ne faut pas utiliser SetWindowText mais SetWindowPosition.
PLACE CE CODE DANS UN MODULE :
Option Explicit
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private 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
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
'Pour le premier plan
Private Const Flags = 1
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Public Enum WindowPositionConstants
[Window Top Always] = 0 'TOPMOST : TOUJOURS AU PREMIER PLAN
[Window Top Now] = 1 'FOREGROUND : PLACE AU PREMIER PLAN MAIS NE MAINTIENT PAS
[Window Normal] = 2 'NOTOPMOST : RETIRE LE STATUT TOPMOST
End Enum
Public Function SetWindowPosition(ByVal hWnd As Long, _
ByVal wPosition As WindowPositionConstants) As Long
Dim Success As Long
Dim rPOS As RECT
Select Case wPosition
Case [Window Top Always]
Call GetWindowRect(hWnd, rPOS)
Success = SetWindowPos(hWnd, HWND_TOPMOST, rPOS.Left, rPOS.Top, 0, 0, Flags)
Case [Window Top Now]
Success = SetForegroundWindow(hWnd)
Case [Window Normal]
Call GetWindowRect(hWnd, rPOS)
Success = SetWindowPos(hWnd, HWND_NOTOPMOST, rPOS.Left, rPOS.Top, 0, 0, Flags)
End Select
SetWindowPosition = Success
End Function
Tu peux ensuite utiliser la fonction SetWindowPosition avec le bon parametre pour faire ce que tu veux de ta fenêtre.
Bonne prog
++