Commands & Syntax > Commands > Window Manipulation >

CLOSE - < winclose >() ... [Pro]

www.perfectkeyboard.com

 

Window CLOSE
<winclose>("Window",Match)
Available in: Professional edition

This command closes specified window. If the window is main application window this command causes the application is closed.

 

#

Parameter name

Parameter description

1

Window

Window identifier in form of Window Identification Path (WIP) or HWND. It identifies the window that is to be closed.

2

Match

Takes effect only if a window is identified using WIP parameter. Can be one of these values:
0 - match substrings in WIP
1 - match exact strings in WIP

 

Example (Macro Steps):

 

1

<#> <#> This macro closes "Notepad" window

2

Macro execution: ONLY COMMANDS

3

IF WINDOW "[* - Notepad|Notepad|#566|#124]" Is Open (Match=Partial)

4

Window CLOSE "[* - Notepad|Notepad|#566|#124]"

5

ELSE activate

6

Message SHOW "" : "'Notepad' is not opened!" (other parameters: x = 100, y = 100, Window title = Message, Buttons = OK, Timeout (seconds) = , Always on top = ).

7

ENDIF

Example (Plain Text):

 

<#> This macro closes "Notepad" window

<#>

<cmds>

 

<if_win>("[* - Notepad|Notepad|#566|#124]","OPEN",0)

   <winclose>("[* - Notepad|Notepad|#566|#124]",0)

<else>

   <msg>(100,100,"'Notepad' is not opened!","Message",1)

<endif>