Re-salut gwen49
Tu n'as pas du beaucoup chercher ...
Voilà le code que j'utilise :
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 uFlags As Long) As Long
' Constantes de SetWindowPos :
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const HWND_BOTTOM As Long = 1
Private Const HWND_BROADCAST As Long = &HFFFF&
Private Const HWND_DESKTOP As Long = 0
Private Const HWND_MESSAGE As Long = -3
Private Const HWND_NOTOPMOST As Long = -2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOACTIVATE = &H10
'
Public Sub SetTop(Form As Form, _
ByVal Topmost As Boolean)
Dim hWndInsertAfter As Long
If Topmost Then
hWndInsertAfter = HWND_TOPMOST
Else
hWndInsertAfter = HWND_NOTOPMOST
End If
SetWindowPos Form.hWnd, hWndInsertAfter, 0, 0, 0, 0, _
SWP_NOSIZE Or SWP_NOMOVE Or SWP_NOACTIVATE
Joue avec les paramètres HWND_ : tu devrais trouver ton bonheur.
Vala
Jack