Hi Scott, I created new reply so I can add code snippets and a table.
Technique described here by Chris I have used personally form 10+ years in many different apps. It works! Just a couple of pitfalls to avoid:
- Sending event to right object
- Know how to pick up the vent that was sent.
Passing zero for both 3rd and 4th arguments are perfectly fine. Here is how parameters of Send function match up to PowerScript features. Syntax for Send function call in PowerScript is:
Send ( handle, message#, lowword, long )
Send Param |
PowerScript Equivalent |
handle |
Handle of your window to receive the event - EX: Handle(w_test) Handle(w_test.tab_data.tabpage_misc.dw_data) |
message# |
ID-number for the PowerScript event to be triggered 1024 => pbm_custom01 1025 => pbm_custom02 1026 => pbm_custom03 . . . |
lowWord |
PBM_customXX's WParam argument |
long |
PBM_customXX's LParam argument |
A word of caution >>>
// Call Send on a WINDOW handle
Send( Handle(W_TEST), 1024, 0, 0)
// Triggers user event on W_TEST mapped to pbm_custom01
// Call Send on any CONTROL handle (DW/Tab/Button/Anything)
Send( Handle(W_TEST.DW_DATA), 1024, 0, 0)
// Triggers OTHER event on W_TEST.DW_DATA
// When OTHER event starts, Message.Number has value 1024 ! ! !
When a window receives the Windows message, it will auto-transfom into the "right" custom user event
When a non-window receives the Windows message, there is no auto-transform. Instead you have to be explicit looking at Message.Number for guidance.
You may be closer to actually solution than you think.
HTH /Michael (PS: I'm also reachable through LinkedIn. Link on my MVP profile page)
Yeah, two events mapped to same EventID can make any app go quirky.
Thank you both for your invaluable help!