| Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 | 1. guisendmsg #13310 | I have a window script that creates a child window. I would like to trigger an event in the parent script from the child window. I have been playing around with guisendmsg but can't seem to get it to work from a window. For example I open my parent window and them run your sendmsg2.rex script in your example and it works. But if I try to run this script by pasting the code in my child script and calling it, it doesn't work. I do not get an error message, and I have checked to make sure I am using the correct handle for my parent window, but I can't seem to get it to work. Is guisendmsg supposed to work from window to window? Chuck Simmons | 2. #13311 | Yes, it works. Your child script should call GuiSendMsg, and pass the parent's window handle. Of course, you should use a large message number, and the parent needs to have a WM_EXTRA subroutine looking for that.
One other thing, your parent script doesn't actually get around to receiving the message until your child subroutine (calling GuiSendMsg) actually finishes up and returns (ie, when the next call to GuiGetMsg happens).
GuiSendMsg is primarily intended to send messages to Windows controls or non-REXXGUI windows. If you just want to trigger some event, it's easier for the child script to call GuiWake() like:guiwake("My signal") Then in your parent's GuiGetMsg loop, check for GuiSignal equal to "My signal". | Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 |
|
|