Window.SetMask

Window.SetMask (

number WindowHandle,

string MaskFile,

boolean FitToWindow = true,

number TransparentColor = 0 )

Description

Applies an image mask to the specified window. This allows you to change the shape of your application's window at runtime.

Note: On Windows 9x systems, this action will only work on AutoPlay created windows at runtime. This means masks cannot be applied to any windows belonging to other programs on Windows 9x systems.

Tip: You can use this action to change the shape of certain objects which are actually windows within your autoplay application. The following objects are technically windows within your application: Video, Flash, ComboBox, ListBox, Input, Tree, Progress, Web, PDF, QuickTime and xButton. You can get the window handles for any of these objects by using their respective GetProperties actions.

Parameters

WindowHandle

(number) The integer value that represents the specific window on the user's desktop. (Commonly referred to as an hWnd.)

MaskFile

(string) The path to the file to be used as the window mask.

Tip: Pass an empty string ("") as MaskFile to clear the window mask.

FitToWindow

(boolean) True if the mask file should be resized to match the dimensions of the window, false if it should not be. The default is true.

TransparentColor

(number) The decimal value of the color to use as the transparent color for your window mask. The default is 0 (black). Click the select button to bring up a color chooser.

Note: We recommend using black (0) as your window mask transparent color for ease of use. As well, always using the same color for all of your masks ensures compatibility.

Tip: You can calculate the decimal value of your transparent color from its hex value using the Math.HexColorToNumber action.

Returns

Nothing. You can use Application.GetLastError to determine whether this action failed, and why.

See also: Related Actions