The Message object is used to process events that are not defined by PowerBuilder, to communicate parameters between windows when you open and close them, and to specify whether optional parameters are used in TriggerEvent or PostEvent.
You can also customize your own version of the Message object by defining a class user object inherited from the built-in Message object.
For more information about creating a custom Message object, see the chapter on user objects in the PowerBuilder User’s Guide.
The first four properties of the Message object correspond to the first four properties of the Microsoft Windows message structure:
Message property |
Datatype |
Description |
---|---|---|
Handle |
Long |
The handle of the window or control. |
Number |
UnsignedInt |
The number that identifies the event (this number comes from Windows). |
WordParm |
Long |
The word parameter for the event (this parameter comes from Windows). The parameter’s value and meaning are determined by the event. |
LongParm |
Long |
The long parameter for the event (this number comes from Windows). The parameter’s value and meaning are determined by the event. |
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control. |
DoubleParm |
Double |
A numeric or a numeric variable. |
StringParm |
String |
A string or a string variable. |
PowerObjectParm |
PowerObject |
Any PowerBuilder object type including structures. |
Processed |
Boolean |
A boolean value set in the script for the user-defined event or the Other event. Values are:
|
ReturnValue |
Long |
When Message.Processed is true, specifies the value you want returned to Windows. This property is ignored when Message.Processed is false. |
Message event |
Occurs |
---|---|
When the user object is created. |
|
When the user object is destroyed. |
Message function |
Datatype returned |
Description |
---|---|---|
String |
Returns the name assigned to the user object. |
|
Integer |
Creates a reference to a context-specific instance of the specified service. |
|
PowerObject |
Returns a reference to the name of the parent object. |
|
Boolean |
Adds an event to the end of the message queue of the user object. |
|
Integer |
Sends an event to the user object and executes the script associated with the event. |
|
Object |
Returns the type of the user object. |