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

WinSetTransColor Color , WinTitle, WinText, ExcludeTitle, ExcludeText



Type: String or Integer

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.

If the value is a string, any numeric color value must be in hexadecimal format. The color value can be omitted; for example, WinSetTransColor " 150" (with the leading space) is equivalent to WinSetTransparent 150.

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).


Type: String, Integer or Object

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


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.


Type: String

Windows whose titles include this value will not be considered.


Type: String

Windows whose text include this value will not be considered.

Error Handling

A TargetError is thrown if the window could not be found.

An OSError is thrown if the change could not be applied.


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.

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 #4 on the WinSetTransparent page.

WinSetTransparent, Win functions, Control functions


Makes all white pixels in Notepad invisible. This example may not work well with the new Notepad on Windows 11 or later.

WinSetTransColor "White", "Untitled - Notepad"