Window.Close

Window.Close ( 

number WndHandle,

number Method = CLOSEWND_SENDMESSAGE )

Description

Closes a specific window on the user's desktop.

Parameters

WndHandle

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

Method

(number) How to close the window. Choose from:

CONSTANT

VALUE

DESCRIPTION

CLOSEWND_SENDMESSAGE

0

Send the program a WM_CLOSE message. This is exactly like clicking the "Close" button on the window's title bar. (Default)

CLOSEWND_TERMINATE

1

Immediately terminate the program's process. The state of global data maintained by the program's dynamic-link libraries (DLLs) may be compromised if this option is used. (When this option is selected, the Setup Factory installation calls the Windows API function "TerminateProcess" to immediately terminate the specified program.)

Returns

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

See also:  Related Actions