WinClose

Closes an open window.

Syntax:

WinClose (partial-winname)

Parameters:

(s) partial-winname either an initial portion of, or an entire window name.  The most-recently used window whose title matches the name will be closed.

Returns:

(i)  @TRUE if a window was found to close. @FALSE if no windows were found.

 

Use this function to close windows.

WinClose will not close the window which contains a currently executing WIL program. See TerminateApp.

You can use EndSession to end the current Windows session.

This function works only with top-level (parent) application windows.

Example:


Run("notepad.exe", "")
Message("WinClose","Window is about to close.")
WinClose("~Notepad")
See Also:

EndSession, WinHide, WinIconize, WinItemize, WinWaitClose, TerminateApp, Partial Window Names, IntControl 46