Set Control and Window Properties - SENDMSG() Function 1

Syntax

SENDMSG(sysgui,id,1,int,string${,context})

Description

For BBj-specific documentation, see Set Control and Window Properties - SENDMSG() Function 1 BBj.

This version of the SENDMSG() function sets common properties for the id-specified control or window and returns a formatted string.

This string is formatted as "NAME= oldname", where NAME is the property name, and oldname is the window or control value that existed before the function was issued. The following table identifies the entries for the int, string$, and context parameters:

Parameter

Description

sysgui

Valid SYSGUI channel.

id

Control or Window ID.

int

0 = Set property.

1 = Get Property.

string$

String containing one of the following values:

 

"NAME=value "

Name of the control, must comply with PRO/5 variable naming conventions.

 

"TITLE=value "

Control title.

 

"WIDTH=value"

Control width.

 

"HEIGHT=value"

Control height.

 

"X=value "

Control x position.

 

"Y=value"

Control y position.

 

"NAVIGATE=value" where value = 'TAB' or 'ENTER'

Sets window navigation.

context

Window context, if not current.

Examples

Example 1

The following sets the NAME property of the window to "ASKDLG":

oldname$=sendmsg(sysgui,0,1,0,"NAME=ASKDLG")

Example 2

The following sets the NAME property of the window or control with an ID of 10 in context 8 to "CUST": 

oldname$=sendmsg(sysgui,10,1,0,"NAME=CUST",8)

Example 3

The following retrieves the red, green, and blue values of the system color used on the button face in a format that the 'COLOR' mnemonic can use. The id parameter value of -1 indicates that the function is meant to work with a system value rather than a specific control. The string$ parameter value of $02$ specifies the face color of three-dimensional objects.

Btnface$=sendmsg(sysgui,-1,1,1,$02$)
red=asc(btnface$),green=asc(btnface$(2)),blue=asc(btnface$(3))

Example 4

The following restricts the primary window to the Tab key in navigation:

Oldnav$=sendmsg(5,0,1,0,"NAVIGATE=TAB")