McGod Posted January 30, 2008 Share Posted January 30, 2008 (edited) This is a wrapper for WM_COPYDATA to commiuncate between scripts.Using some code from:http://www.autoitscript.com/forum/index.php?showtopic=59590andhttp://www.autoitscript.com/forum/index.php?showtopic=43112Example:Recv:#include <scriptComm.au3> _ScriptComCreateRecv("Recv", "Recv") While 1 Sleep(100) WEnd Func Recv($iHwnd, $iMsg) Local $sSplit = StringSplit($iMsg, "|") Switch $sSplit[1] Case "MSG" MsgBox(1, "Recv", $sSplit[2]) Case "EXIT" Exit EndSwitch EndFuncoÝ÷ Ù'§u«·jëh×6#include <scriptComm.au3> _ScriptComSend("Recv", "MSG|Test for comm.") _ScriptComSend("Recv", "EXIT")A rough example to use:Example.au3UDF:ScriptComm.au3 Edited January 30, 2008 by Chip [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
JustinReno Posted January 31, 2008 Share Posted January 31, 2008 This doesn't work with the latest version of AutoIt and has many errors. Link to comment Share on other sites More sharing options...
bluebearr Posted January 31, 2008 Share Posted January 31, 2008 The Send/Recv pair works with one little change: in the ScriptComm.au3 file, change line 2 from this #include <SendMessage.au3>oÝ÷ Ø¥µêÞvØ^Eç/±Êâ¦Ö¬~e£ºÚ"µÍÚ[ÛYH ÍÜØÜÛÛ[K]LÉÝÂÔØÜÛÛPÜX]TXÝ ][ÝÔXÝ][ÝË ][ÝÔXÝ][ÝÊBÚ[HBÛY L BÑ[[ÈXÝ ÌÍÚRÛ ÌÍÚSÙÊBØØ[ ÌÍÜÔÜ]HÝ[ÔÜ] ÌÍÚSÙË ][Ýß ][ÝÊBÝÚ]Ú ÌÍÜÔÜ]ÌWBØÙH ][ÝÓTÑÉ][ÝÂÙÐÞ K ][ÝÔXÝ][ÝË ÌÍÜÔÜ]ÌJBØÙH ][ÝÑVU ][ÝÂBBSÙÐÞ K ][ÝÔXÝ][ÝË ][ÝÒHØÈÛÈ^] ][ÝÊB^][ÝÚ]Ú[[oÝ÷ Ù©Ýi×^u§^¬zÜz{azÜ(ë,j¬~º&IéÝjíÚºÚ"µÍÚ[ÛYH ÍÜØÜÛÛ[K]LÉÝÂÔØÜÛÛTÙ[ ][ÝÔXÝ][ÝË ][ÝÓTÑßÝÜÛÛ[K][ÝÊBÛY Ì BÔØÜÛÛTÙ[ ][ÝÔXÝ][ÝË ][ÝÑVU ][ÝÊBÙÐÞ ][ÝÔÙ[ ][ÝË ][ÝÒIÌÎNÛH]H[][ÝÊ I was surprised to see that if I left the first Recv Msgbox open for over three seconds that there was still a delay of 3 seconds before the second Msgbox came up. Can someone explain why that is - why does the Send script stop until the Recv script accepts the message? Is there a way to change this behavior - like for the Send script to keep working and maybe resend the message? BlueBearrOddly enough, this is what I do for fun. Link to comment Share on other sites More sharing options...
McGod Posted January 31, 2008 Author Share Posted January 31, 2008 I forgot to mention I'm using the latest beta which split up the SendMessage.au3 [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now