WinGetTransparent()

Auto Hotkey

WinGetTransparent

Retrieves the degree of transparency of a window (see WinSetTransparent for how to set transparency).

OutputVar := WinGetTransparent(WinTitle, WinText, ExcludeTitle, ExcludeText)
Function Example: Trans := WinGetTransparent("ahk_class Notepad")
Function Example:

Parameters

OutputVar

The name of the variable in which to store a number between 0 and 255, where 0 indicates an invisible window and 255 indicates an opaque window. OutputVar is made blank if: 1) the OS is older than Windows XP; 2) there are no matching windows; 3) the window has no transparency level; or 4) other conditions (caused by OS behavior) such as the window having been minimized, restored, and/or resized since it was made transparent.

WinTitle (optional)

The title or partial title of the target window (the matching behavior is determined by SetTitleMatchMode). If this and the other 3 window parameters are blank or omitted, the Last Found Window will be used. To use a window class, specify ahk_class ExactClassName (shown by Window Spy). To use a process identifier (PID), specify ahk_pid %VarContainingPID%. To use a window group, specify ahk_group GroupName. To use a window's unique ID number, specify ahk_id %VarContainingID%. The search can be narrowed by specifying multiple criteria. For example: My File.txt ahk_class Notepad. The use correct child window when multiple window with same criteria exist specify ahk_parent %VarContainingID%. For example: ahk_class #32770 ahk_parent %MyWinID%

WinText (optional)

If present, this parameter must be a substring from a single text element of the target window (as revealed by the included Window Spy utility). Hidden text elements are detected if DetectHiddenText is ON.

ExcludeTitle (optional)

Windows whose titles include this value will not be considered.

ExcludeText (optional)

Windows whose text include this value will not be considered.

Remarks

Controls are sorted according to their Z-order, which is usually the same order as TAB key navigation if the window supports tabbing. Hidden windows are included only if DetectHiddenWindows has been turned on.

Examples

MsgBox % WinGetTransparent("A")

WinGetTransparent,transparency,A
MsgBox % transparency