Bon j'ai réussi à descendre tout en bas ou monter tout en haut mais Axe Z+1 ou Axe Z-1 ne fonctionne pas
Voici mon code, une idée
Code : Tout sélectionner
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <APIConstants.au3>
$GUI = GUICreate("Test", 320, 200)
GUISetState()
$LABEL1 = GUICtrlCreateLabel("1", 20, 20, 200, 100)
GUICtrlSetBkColor(-1, 0xFF0000)
$LABEL2 = GUICtrlCreateLabel("2", 40, 40, 200, 100)
GUICtrlSetBkColor(-1, 0x00FF00)
$LABEL3 = GUICtrlCreateLabel("3", 60, 60, 200, 100)
GUICtrlSetBkColor(-1, 0x00AAFF)
Sleep(1000)
GuiCtrlSetOrderZ( $LABEL1, "FRONT")
Sleep(1000)
GuiCtrlSetOrderZ( $LABEL1, "BACK")
Sleep(1000)
GuiCtrlSetOrderZ( $LABEL1, "FORWARD") ; <--- Monte d'un niveau
Sleep(1000)
GuiCtrlSetOrderZ( $LABEL1, "BACKWARD") ; <--- Descend d'un niveau
Do
Sleep(50)
Until GUIGetMsg() = -3
Exit
Func GuiCtrlSetOrderZ( $id_Ctrl, $Z_Order)
;Need to include <WinAPI.au3> and <APIConstants.au3>
Local $hWnd = $id_Ctrl
If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($id_Ctrl)
If $Z_Order = "BACK" Then Return _WinAPI_SetWindowPos($hWnd, $HWND_TOP, 0, 0, 0, 0, $SWP_NOMOVE + $SWP_NOSIZE + $SWP_NOCOPYBITS)
If $Z_Order = "FRONT" Then Return _WinAPI_SetWindowPos($hWnd, $HWND_BOTTOM, 0, 0, 0, 0, $SWP_NOMOVE + $SWP_NOSIZE + $SWP_NOCOPYBITS)
If $Z_Order = "BACKWARD" Then Return _WinAPI_SetWindowPos($hWnd, $HWND_TOPMOST, 0, 0, 0, 0, $SWP_NOMOVE + $SWP_NOSIZE + $SWP_NOCOPYBITS)
If $Z_Order = "FORWARD" Then Return _WinAPI_SetWindowPos($hWnd, $HWND_NOTOPMOST, 0, 0, 0, 0, $SWP_NOMOVE + $SWP_NOSIZE + $SWP_NOCOPYBITS)
EndFunc