Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / guisendmsg

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. guisendmsg
#13310
Posted by: chucksim 2010-04-24 08:11:42
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
Message2.
#13311
Posted by: Jeff Glatt 2010-04-24 23:48:02
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 • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-4-20  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0