UMESSAGE Command

The UMESSAGE command sends a Windows-style message to the mvBase client linked to the process executing the command, or if the optional TO clause is used, to a Windows application launched by UEXECUTE.

Format

UMESSAGE [TO var,] expr1, expr2, expr3

Parameter(s)

var

Must be an identifier returned by UEXECUTE.

expr1

Windows message number.

expr2

Numeric parameter.

expr3

String parameter.

Description

If the TO clause is used, var must be an identifier returned by the UEXECUTE RETURNING clause.

If the TO clause is not used, the message and parameters are sent to the process’s client. Messages supported by various clients are defined in BASICLIB $includefiles.

For a list of message definitions, see the VTERM.MSGS program in the BASICLIB file. For an example of how to modify the menu options in MVTERM, see the WINMENU program in the BASICLIB file.

Example

*

* Program will launch notepad, Sleep 2 seconds

* then close the window.

*

  UEXECUTE "NOTEPAD.EXE EXISTING.TXT" RETURNING HANDLE

  SLEEP 2

  UMESSAGE TO HANDLE,16,0,""

*

* Program will now display a message in bottom of

* mvTERM Window.

*

  UMESSAGE 1527,0,"Remember to Close your files..."

*

UMESSAGE ON Form

A form of the ON clause was added to the UMESSAGE mvBASIC statement to specify which entity is being requested to take an action, and what the specific action being requested is.

The generic form of the UMESSAGE ON or UMESSAGE TO statements has four parameters:

The target indicates where the message is sent to or what is intended to take action on the message. The existing forms of UMESSAGE are:

UMESSAGE TO var, msg#, numeric_parameter, string_parameter

where the target is the var, which is a handle to a Windows process started by UEXECUTE. This sends the Message Number to that process passing the Numeric parameter and String parameter.

UMESSAGE ON line#, msg#, numeric_parameter, string_parameter

where the target is the Line Number, which is a number >= 0. This sends the Message Number to the client attached to the Line Number passing the Numeric parameter and String parameter.

UMESSAGE msg#, numeric_parameter, string_parameter

where the target is implied to be the current line. This sends the Message Number to the client attached to the current line passing the Numeric parameter and String parameter.

NOTE

The ON form is the same as number 2 except that the first parameter is negative. This indicates that this is a message to some other entity other than a line.

 

UMESSAGE ON target, msg#, numeric_parameter, string_parameter

It is strongly recommended that predefined EQUATES are used in mvBASIC programs. These are supplied in the BASICLIB WIN.MSGS item as:

EQU MV.CLIENT.CONNECT TO 1425

;* Connect a client.

EQU MV.CLIENT.DISCONNECT TO 1474

;* Disconnect a client.

EQU MV.TARGET.PROCESS TO –2

;* Message target is the local process on the server, which takes the action.

This item should be included using INCLUDE in the mvBASIC programs using the UMESSAGE ON statement as below:

$INCLUDE BASICLIB WIN.MSGS

See Also

O/S Interoperability Commands

UCLOSE Command

UCREATE Command

UDELETE Command

UERROR Function

UEXECUTE Command

ULOCK Command

ULSEEK Function

UOPEN Command

UREAD Command

UREADLINE Function

USYSTEM Function

UWAITFOR Command

UWRITE Command