Get help with using AutoHotkey and its commands and hotkeys
6 posts • Page 1 of 1
So if i have two instances of the same script then how can i (using Postmessage and onmessage) send a message from the second instance to the first instance and not to itself
Did you try making the script disable OnMessage for a few seconds right before it sends a message?
Store the scripts hwnd and when getting the window to post to ensure the hwnd of the found window is not the hwnd of the current window before sending (you'll also need the other hwnd, since all other things will be identical you have to use other hwnd as part of the wintitle to send to in the postmessage).
Use WinGet List to find all instances of your script, or give the two instances different window titles and use the correct one when sending the message.
I already gave code for this in your previous thread: https://autohotkey.com/boards/viewtopic ... 46#p134946
Oh yeah, sorry didn't read that!