$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
What is an Event ID in PowerBuilder? How can I use it?
////////////////////////////////////////////////////////
An event ID is really a Windows message ID. Most windows "events" are mapped by PowerBuilder to a PB-specific Event ID. Of course, there are exceptions to this rule, but I won't get into those.
When an action occurs, like clicking on a button, Windows sends a message to the application, and PB in turn sends it to the object. If the object has script for that message (i.e., that Event ID), it is executed. Not all windows messages, like the timer event, can be activated my the user.
When you create a new event, you are really mapping a Windows message to the custom event. You can select one of the standard PB events (such as pbm_rbuttondown, which is Right Mouse Button Down), or a custom event such as pbm_custom01. Windows / PowerBuilder reserves 75 events for this purpose. There is no action that a user can take to trigger a custom event - it must be called, or triggered, from another event or function.
For the sake of completeness, there is an Other event (pbm_other) that get's called if the message Windows sends does not directly map to any event defined for that object. I suggest not normally using this event since it get's called all the time.
Lastly, the PowerBuilder manuals do not describe all the possible events. To see what a specific event does, you'll have to reference a Windows API guide - just strip off the pbm_ of the Event ID and look it up. Please note that not ALL events are described in the API manuals since PB creates some of it's own
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
I created a user-defined event and mapped it to pbm_custom01. How can I trigger that event from another PowerBuilder application?
//////////////////////////////////////////////////////////////////
Well, you need the handle of the window where the event was declared. In 32-bit PB, you will pretty much need to pass it on the command line via Handle(This) to the other PB application (if you start it using the Run() command) or get it to the other application some how.
With that in mind, just use the code "Send(Application_Handle, EventID , 0, 0)" where EventID is 1023 + the the XX in pbm_customXX. For example, if you want to trigger pbm_custom51, then the EventID is 1023 + 51 = 1074.