/* This script is used in conjunction with SendMsg1.rex. See the * comment in that other script. */ LIBRARY rexxgui, rxclip GuiErr = "SYNTAX" GuiHeading = 1 /* Get the window handle for the other script's window. * That other script should have stored it on the * clipboard using a custom format named "WindowHandle". * Let's store it in our "SomeWindowHandle" variable. */ format = ClipNewFormat("WindowHandle") IF ClipAvailable(format) THEN DO ClipGet("SomeWindowHandle", format) /* Send that window a custom event of 40000, with * two additional args of 1 and -1. Using the * "POST" option means that this GuiSendMsg call * returns before the other script's window actually * handles this custom event. The one caveat with * POST is that you can't get a return value back * from the other script. */ GuiSendMsg(SomeWindowHandle, "POST" 40000, 1, -1) /* Send that window a custom event of 40001, with * no additional args. We expect the other script * to return some numeric value. We'll wait for it * to return that (which GuiSendMsg stores in our * GuiSignal variable). */ GuiSendMsg(SomeWindowHandle, 40001) SAY "The other script returned the value" GuiSignal END ELSE SAY "The other script didn't put its window handle on the clipboard"