► Afficher le texte_GuiCtrlMakeTrans
Code : Tout sélectionner
Func _GuiCtrlMakeTrans($iCtrlID,$iTrans=255)
Local $pHwnd, $nHwnd, $aPos, $a
$hWnd = GUICtrlGetHandle($iCtrlID);Get the control handle
If $hWnd = 0 then Return SetError(1,1,0)
$pHwnd = DllCall("User32.dll", "hwnd", "GetParent", "hwnd", $hWnd);Get the parent Gui Handle
If $pHwnd[0] = 0 then Return SetError(1,2,0)
$aPos = ControlGetPos($pHwnd[0],"",$hWnd);Get the current pos of the control
If @error then Return SetError(1,3,0)
$nHwnd = GUICreate("", $aPos[2], $aPos[3], $aPos[0], $aPos[1], 0x80000000, 0x00080000 + 0x00000040, $pHwnd[0]);greate a gui in the position of the control
If $nHwnd = 0 then Return SetError(1,4,0)
$a = DllCall("User32.dll", "hwnd", "SetParent", "hwnd", $hWnd, "hwnd", $nHwnd);change the parent of the control to the new gui
If $a[0] = 0 then Return SetError(1,5,0)
If NOT ControlMove($nHwnd,'',$hWnd,0,0) then Return SetError(1,6,-1);Move the control to 0,0 of the newly created child gui
GUISetState(@SW_Show,$nHwnd);show the new child gui
WinSetTrans($nHwnd,"",$iTrans);set the transparency
If @error then Return SetError(1,7,0)
GUISwitch($pHwnd[0]);switch back to the parent Gui
$a = DllCall("User32.dll", "hwnd", "SetParent", "hwnd", $nhWnd, "hwnd", $Hwnd);change the parent of the control to the new gui
If $a[0] = 0 then Return SetError(1,5,0)
Return $nHwnd;Return the handle for the new Child gui
EndFunc[/spoiler]
Merci d'avance, milka.


