#include-once ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #INDEX# ======================================================================================================================= ; Title .........: _GUIDisable ; AutoIt Version : v3.2.2.0 or higher ; Language ......: English ; Description ...: Creates a dimming effect on the current/selected GUI. ; Note ..........: ; Author(s) .....: guinness ; Remarks .......: ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ; _GUIDisable: Creates a dimming effect on the current/selected GUI. ; =============================================================================================================================== ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIDisable ; Description ...: Creates a dimming effect on the current/selected GUI. ; Syntax.........: _GUIDisable([$hWnd = -1, [$iDelete = 0, [$iBrightness = 5, [$bColor = 0x000000]]]]) ; Parameters ....: $hWnd - [Optional] GUI handle the effect should be applied to. Default = -1 (Current GUI handle created) ; $iDelete - [Optional] Create or Delete the dimming effect. Default = 0 (Create = 0 & Delete = 1) ; $iBrightness - [Optional] Percentage of how bright the effect is. Default = 5% ; $bColor - [Optional] Color of the dimming effect. Default = Black ; Requirement(s).: v3.2.2.0 or higher ; Return values .: Success - Returns handle of dimmed GUI or value of GUIDelete(). ; Failure - Returns 0 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GUIDisable($hWnd = -1, $iDelete = 0, $iBrightness = Default, $bColor = 0x000000) Local $vGUI = 0 If $iBrightness = Default Then $iBrightness = 5 EndIf If $hWnd = -1 Then Local $iLabel = GUICtrlCreateLabel('', -99, -99, 1, 1) $hWnd = _WinAPI_GetParent(GUICtrlGetHandle($iLabel)) If @error Then Return SetError(1, 0 * GUICtrlDelete($iLabel), 0) EndIf GUICtrlDelete($iLabel) EndIf If $iDelete Then $vGUI = GUIDelete($hWnd) Else Local $aWinGetPos = WinGetClientSize($hWnd) $vGUI = GUICreate('', $aWinGetPos[0], $aWinGetPos[1], 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $hWnd) GUISetBkColor($bColor, $vGUI) WinSetTrans($vGUI, '', Round($iBrightness * (255 / 100))) GUISetState(@SW_SHOW, $vGUI) EndIf Return $vGUI EndFunc ;==>_GUIDisable