Commands & Syntax > Commands > Window Manipulation >

www.perfectkeyboard.com

 

INFO - < wininfo >() ... [Pro]

 

Window INFO
<wininfo>("Window","Unused","Match")
Available in: Professional edition

This command retrieves information about required window. After the command is processed, required information is saved in following system variables:

_vWinRectX1 - X position of upper left corner of the window in screen coordinates
_vWinRectY1 - Y position of upper left corner of the window in screen coordinates
_vWinRectX2 - X position of lower right corner of the window in screen coordinates
_vWinRectY2 - Y position of lower right corner of the window in screen coordinates
_vWinWdt - window width
_vWinHgt - window height
_vWinTitle - window title
_vWinClass - window class
_vWinState - window state (MIN, RESTORE, MAX, HIDDEN)
_vWinActive - YES, if window is active (on top receiving keyboard input), otherwise NO
_vWinHWND - HWND of the window

 

#

Parameter name

Parameter description

1

Window

Window identifier in form of Window Identification Path or HWND. It identifies window the information is to be retrieved from.

2

Unused

Must be empty.

3

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 retrieves information about "Notepad" window

2

Macro execution: ONLY COMMANDS

3

IF WINDOW "Notepad" Is Open (Match=Partial)

4

Window INFO retrieve information about window "Notepad" (Match = Partial)

5

Message SHOW "" : "Window information: %_vWinTitle% %_vWinClass% %_vWinActive% %_vWinState%" (other parameters: x = -100, y = -100, Window title = Message, Buttons = OK, Timeout (seconds) = , Always on top = ).

6

ELSE activate

7

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

8

ENDIF

Example (Plain Text):

 

<#> This macro retrieves information about "Notepad" window

<#>

<cmds>

 

<if_win>("Notepad","OPEN",0)

   <wininfo>("Notepad","",0)

   <msg>(-100,-100,"Window information:

 

%_vWinTitle%

 

%_vWinClass%

 

%_vWinActive%

 

%_vWinState%","Message",1)

 

<else>

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

<endif>