Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Sending Windows messages – PB Docs 100 – PowerBuilder Library

Sending Windows messages – PB Docs 100

Sending Windows messages

To send Windows messages to a window that you created in PowerBuilder or to
an external window (such as a window you created using an external function),
use the Post or Send function.
To trigger a PowerBuilder event, use the EVENT syntax or the TriggerEvent or PostEvent function.

Using Post and Send

You usually use the Post and Send functions
to trigger Windows events that are not PowerBuilder-defined events.
You can include these functions in a script for the window in which
the event will be triggered or in any script in the application.

Post is asynchronous: the message is posted
to the message queue for the window or control. Send is
synchronous: the window or control receives the message immediately.

As of PowerBuilder 6.0, all events posted by PowerBuilder are
processed by a separate queue from the Windows system queue. PowerBuilder posted messages
are processed before Windows posted messages.

note.gif Obtaining the window’s handle To obtain the handle of the window, use the Handle function.
To combine two integers to form the Long value
of the message, use the Long function. Handle and Long are
utility functions, which are discussed later in this chapter.

Triggering PowerBuilder events

To trigger a PowerBuilder event, you can use the techniques
listed in Table 22-2.

Table 22-2: Triggering PowerBuilder events
Technique Description
TriggerEvent function A synchronous function that triggers
the event immediately in the window or control
PostEvent function An asynchronous function: the event is
posted to the event queue for the window or control
Event call syntax A method of calling events directly for
a control using dot notation

All three methods bypass the messaging queue and are easier
to code than the Send and Post functions.

Example All three statements shown below click the CommandButton cb_OK and
are in scripts for the window that contains cb_OK.

The Send function uses the Handle utility
function to obtain the handle of the window that contains cb_OK,
then uses the Long function to combine the handle
of cb_OK with 0 (BN_CLICK)
to form a Long that identifies the object and
the event:

The TriggerEvent function identifies the
object in which the event will be triggered and then uses the enumerated
datatype Clicked! to specify the clicked event.

The dot notation uses the EVENT keyword
to trigger the Clicked event. TRIGGER is the
default when you call an event. If you were posting the clicked event,
you would use the POST keyword:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x