Commands & Syntax > Commands > User Interaction >

www.perfectkeyboard.com

 

Message SHOW - < msg >() ... [Free]

 

Message SHOW
<msg>(x,y,"Message text","Window title",Buttons,Timeout (seconds),Type of message,Always on top)
Available in: Free edition

Shows a message window on the screen.

 

#

Parameter name

Parameter description

1

x

X-coordinate of the message window position. If both X-coordinate and Y-coordinate is equal to -100 then the message window is centered on the screen.

2

y

Y-coordinate of the message window position.

3

Message text

Text that is displayed in the message window.

4

Window title

Title of the message window.

5

Buttons

Button(s) available in the message window. When user clicks the button then the message window is closed. Can be one of these values:

0 - No button to close the message window is available. The "msgoff" command must be used to close the message window.

1 - OK button is shown in the message window.

2 - Yes and No buttons are shown in the message window. If user clicks Yes button, the "_vMsgButton" system variable is set to "YES". Otherwise the "_vMsgButton" variable contains "NO:.

6

Timeout (seconds)

Timeout in seconds. If the message is still showing on the screen after this time period then it is automatically closed.

7

Type of message

Type of icon that will be displayed in the message window.

8

Always on top

Allows to keep the message window always on top of other windows so that it is visible to the user.

 

Example (Macro Steps):

 

1

<#> <#> This macro will show various use of message window

2

Macro execution: ONLY COMMANDS

3

Message SHOW "Information" : "This is an information message...." (other parameters: x = -100, y = -100, Window title = Message, Buttons = OK, Timeout (seconds) = 0, Always on top = ).

4

Message SHOW "Information" : "...and this message has 10 seconds timeout...." (other parameters: x = -100, y = -100, Window title = Message, Buttons = OK, Timeout (seconds) = 10, Always on top = ).

5

Message SHOW "Question" : "...and you can also answer questions...." (other parameters: x = -100, y = -100, Window title = Message, Buttons = Yes and No, Timeout (seconds) = 0, Always on top = ).

6

IF _vMsgButton==YES

7

Message SHOW "Information" : "You clicked YES!" (other parameters: x = -100, y = -100, Window title = Message, Buttons = OK, Timeout (seconds) = 0, Always on top = ).

8

ELSE activate

9

Message SHOW "Error" : "You clicked NO" (other parameters: x = -100, y = -100, Window title = Message, Buttons = OK, Timeout (seconds) = 0, Always on top = ).

10

ENDIF

11

Message SHOW "Information" : "And this message without a button will close if you press 'F10' key." (other parameters: x = -100, y = -100, Window title = Message, Buttons = None, Timeout (seconds) = 0, Always on top = ).

12

WAIT FOR Object = "KEY", Event = "PRESS", Parameter = "", Timeout (seconds) = "15", Exact = "0"

13

Message CLOSE

14

<#> <#>Message content is updated several times:

15

Message SHOW "Information" : "Message content A (Wait for 2 seconds)" (other parameters: x = -100, y = -100, Window title = Message A, Buttons = None, Timeout (seconds) = 0, Always on top = No).

16

WAIT wait "2000" ms (time is constant: "No")

17

Message SHOW "Information" : "Message content B (Wait for 2 seconds)" (other parameters: x = -100, y = -100, Window title = Message B, Buttons = None, Timeout (seconds) = 0, Always on top = No).

18

WAIT wait "2000" ms (time is constant: "No")

19

Message SHOW "Information" : "Message content C (Wait for 2 seconds)" (other parameters: x = -100, y = -100, Window title = Message C, Buttons = None, Timeout (seconds) = 0, Always on top = No).

20

WAIT wait "2000" ms (time is constant: "No")

21

Message CLOSE

Example (Plain Text):

 

<#> This macro will show various use of message window

<cmds>

 

<msg>(-100,-100,"This is an information message....","Message",1,0,0)

<msg>(-100,-100,"...and this message has 10 seconds timeout....","Message",1,10,0)

<msg>(-100,-100,"...and you can also answer questions....","Message",2,0,1)

<if>("_vMsgButton==YES")

   <msg>(-100,-100,"You clicked YES!","Message",1,0,0)

<else>

   <msg>(-100,-100,"You clicked NO","Message",1,0,2)

<endif>

 

<msg>(-100,-100,"And this message without a button will close if you press 'F10' key.","Message",0,0,0)

<waitfor>("KEY","PRESS","<F10>",15,0)

<msgoff>

 

<#>Message content is updated several times:

<msg>(-100,-100,"Message content A

(Wait for 2 seconds)","Message A",0,0,0,0)

<wx>(2000,0)

<msg>(-100,-100,"Message content B

(Wait for 2 seconds)","Message B",0,0,0,0)

<wx>(2000,0)

<msg>(-100,-100,"Message content C

(Wait for 2 seconds)","Message C",0,0,0,0)

<wx>(2000,0)

<msgoff>