Jump to content
Sign in to follow this  
qwert

Seeking advice on GUI-to-GUI communication

Recommended Posts

qwert

Request for Advice

 

I’m seeking a straightforward way to signal the active copies of a GUI so that they take a particular action at the end of their next “cycle”... the cycle being based on user entries and user-initiated actions.  (As a basis for communicating, I use WinList() to build a roster of the active WinIDs.)

 

The simplest way (that I know of) is probably to set up each GUI to respond to a common hotkey. The controlling script can then sequentially activate each GUI and Send([def’d key]). Upon receiving the key, a script would latch an appropriate flag.  I'll mention: I've never been a fan of hotkeys in runtime situations.  But it's a method I'm familiar with.  I'll also mention that these are independent GUIs, not parent/child.

 

In the best of all worlds, I’d like to be able to fetch a current value from each active GUI. But I’ve looked at what’s involved in methods like Mailslot, Named Pipes and WM_COPYDATA, and I just can’t justify adding such complexity.

 

Is there a simple method that I’m missing?

 

Thanks in advance for any advice.

Share this post


Link to post
Share on other sites
qwert

I ran into a solid wall with the Hotkey alternative:

 

If two AutoIt scripts set the same hotkeys, you should avoid running those scripts simultaneously as the second script cannot capture the hotkey unless the first script terminates or unregisters the key prior to the second script setting the hotkey.

 

I'm back to square one on finding a simple method.

Any help will be appreciated.

Share this post


Link to post
Share on other sites
JLogan3o13

Without seeing your code it is nigh impossible to give you more than broad suggestions. That said, if you're looking more for inter-process communication, I would look at Trancexx's MailSlot UDF in the Examples forum.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
qwert

Thanks for your response.

For a few hours, my code consisted of a WinActivate + WinWaitActive + Send("{Ins}") sequence at the point of transmitting a request ... and then defining HotKeySet("{Ins}") as a universal "receiver" in each active GUI.

But as I said, the brick wall is the limitation of one definition of the same hotkey at a time.

Currently, I'm looking at the possibility of using _SendMessage in some manner.  The msdn description of application messages sounds promising:

 

Application-Defined Messages

An application can create messages to be used by its own windows or to communicate with windows in other processes. If an application creates its own messages, the window procedure that receives them must interpret the messages and provide appropriate processing.

 

Having never seen an example of this, it's taking time to pick through the possibilities.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms644927%28v=vs.85%29.aspx#app_defined

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×