WinSetTransColor

Makes all pixels of the chosen color invisible inside the specified window.

WinSetTransColor Color , WinTitle, WinText, ExcludeTitle, ExcludeText

Parameters

Color

Type: String

Specify a color name or RGB value (see the color chart for guidance, or use PixelGetColor in its RGB mode). To additionally make the visible part of the window partially transparent, append a space (not a comma) followed by the transparency level (0-255). For example: WinSetTransColor "EEAA99 150", WinTitle.

The word "Off" (case-insensitive) may be specified to completely turn off transparency for a window. This is functionally identical to WinSetTransparent "Off", WinTitle. Specifying "Off" is different than specifying 255 because it may improve performance and reduce usage of system resources (but probably only when desktop composition is disabled).

WinTitle

Type: String, Integer or Object

A window title or other criteria identifying the target window. See WinTitle.

WinText

Type: String

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

Type: String

Windows whose titles include this value will not be considered.

ExcludeText

Type: String

Windows whose text include this value will not be considered.

Error Handling

An exception is thrown if the window could not be found or the change could not be applied.

Remarks

This allows the contents of the window behind it to show through. If the user clicks on an invisible pixel, the click will "fall through" to the window behind it.

To change a window's existing TransColor, it may be necessary to turn off transparency before making the change.

The ID of the window under the mouse cursor can be retrieved with MouseGetPos.

Window titles and text are case sensitive. Hidden windows are not detected unless DetectHiddenWindows has been turned on.

Related

WinSetTransparent, Win functions, Control functions

Examples

This function is often used to create on-screen displays and other visual effects. There is an example of an on-screen display at the bottom of the Gui object page. For a simple demonstration via hotkeys, see example #3 on the WinSetTransparent page.