piccaso Posted July 17, 2006 Share Posted July 17, 2006 (edited) I didnt want to sacrifice Scite's Syntax highlighting and keep it a bit simpler so thats what came out Ok its not that simple any more.Revision 30 CoProc.zipUpdate Notes:Revision 24Fixed Memory Leak in _ProcSuspend() and _ProcResume()Fixed Example_Download.au3 LinksRevision 25New Optional Parameter $sRegistryBase for _SuperGlobalGet() and _SuperGlobalSet()Revision 30Fixed for To work with current Autoit VersionAdded wrapper for DuplicateHandle ApiFunction List_CoProc([$sFunction],[$vParameter]) Starts another Process and Calls $sFunc, Returns PID _SuperGlobalSet($sName,[$vValue],[$sRegistryBase]) Sets or Deletes a Superglobal Variable _SuperGlobalGet($sName,[$fOption],[$sRegistryBase]) Returns the Value of a Superglobal Variable _ProcSuspend($vProcess) Suspends all Threads in $vProcess (PID or Name) _ProcResume($vProcess) Resumes all Threads in $vProcess (PID or Name) _ProcessGetWinList($vProcess, $sTitle = Default, $iOption = 0) Enumerates Windows of a Process _CoProcReciver([$sFunction = ""]) Register/Unregister Reciver Function _CoProcSend($vProcess, $vParameter,[$iTimeout = 500],[$fAbortIfHung = True]) Send Message to Process _ConsoleForward($iPid1, [$iPid2], [$iPid3], [$iPidn]) _ProcessEmptyWorkingSet($vPid = @AutoItPID,[$hDll_psapi],[$hDll_kernel32]) Removes as many pages as possible from the working set of the specified process. _DuplicateHandle($dwSourcePid, $hSourceHandle, $dwTargetPid = @AutoItPID, $fCloseSource = False) Returns a Duplicate handle _CloseHandle($hAny) Close a HandleExample_Download.au3 doesent work right no more because the link is deadPlease read this bevore using _ProcSuspend() and _ProcResume().i did this some time ago and i remeber taking something from someone somwhere.if you find a piece of code inside, please forgive me.if you want credit for it or want me to remove it dorp me a line...Here are some examples:#include "coproc.au3" $iPidChild = _CoProc(Default, "_recv") ; Create new Procces, Set _recv() as Reciever function Sleep(2000) ; Give some time to load new Process _CoProcSend($iPidChild,"Something...") ; Send a Message to new process Func _recv($vParm) MsgBox(0,"Recieved",$vParm) EndFuncoÝ÷ Ø.Ø®²ÄÜ¥'«½êÚºÚ"µÍÔÝ HÑÜ[ØÙÜÙÂÚ[ÛYH ][ÝÐÛÔØË]LÉ][ÝÂÈH ÌÎNÝ[]ØØ[ÜÝL ÌÎNÈ[È[Ý[Þ ÒSÑVJÔBÈÈÛÛXÝÈHÙÈXZ[ØÙÜÂ^TÙ]ÛÛ ][ÝÓXZ[ØÙÜÈ ][ÝÈ [È]]Ò]Q BÌÍÚÛØÚÙ]HÔÝ[ ][ÝÉ][ÝËL BÚ[HBIÌÍÚXØÙHÔXØÙ ÌÍÚÛØÚÙ] BRY ÌÍÚXØÙ ÝÈ[BWÐÛÔØÈ ][Ý×Ó]ÐÛÛXÝ[Û][ÝË ÌÍÚXØÙ BBNÈÈYYÈÛÜÙHHÛØÚÙ]H]ÂBNÈØÙÜÈÚ[È]Q[YTÛY L BÑ[ÈÛÜÙØÙÜÂ[ÈÓ]ÐÛÛXÝ[Û ÌÍÚXØÙ BIÌÍÚXØÙHÑXØ]R[H ÌÍÙÚWÐÛÔØÔ[ÈÈÝYYHÛÔØÂBBIÌÍÚXØÙÂNÈH[HÈXØ]BBBP]]Ò]QÈÈÝ[YBBUYJHÈÛÜÙHHÛØÚÙ][H[ØÙÜÂRYÜ[^]U^TÙ]ÛÛ ][ÝÕÛÜÙØÙÜÈ ][ÝÈ [È]]Ò]Q BSØØ[ ÌÍÜÐYUÔÙ[ ÌÍÚXØÙ ][ÝÖ[ÝÛÛXÝYÈY ][ÝÈ [È]]Ò]Q [ÈÔBUÔÙ[ ÌÍÚXØÙ ][ÝÒ[H[ ][ÝÈ [ÈÔBUÚ[HBBIÌÍÜÐY [ÏHÔXÝ ÌÍÚXØÙMBBRYÜ[^]BRYÝ[Ó[ ÌÍÜÐYH ÝÈ[Ý[Ò[Ý ÌÍÜÐYÔH[BBRYÝ[Ò[Ý ÌÍÜÐY ][ÝÙ^] ][ÝÊHHH[^]BBRYÝ[Ò[Ý ÌÍÜÐY ][ÝÓÙÐÞ ][ÝÊHHH[BBBSÙÐÞ ]]Ò]QÝ[ÓZY ÌÍÜÐY ÊJBBBQ[YBBRYÝ[Ò[Ý ÌÍÜÐY ][ÝÚ[ ][ÝÊHHH[BBBUÔÙ[ ÌÍÚXØÙ ][ÝÐÛÛ[X[Î][ÝÈ [ÈÔBBBBUÔÙ[ ÌÍÚXØÙ ][ÝÒ[HÈ[É][ÝÈ [ÈÔBBBBUÔÙ[ ÌÍÚXØÙ ][ÝÓÙÐÞ ÓÙÉÝÈHH]I][ÝÈ [ÈÔBBBBUÔÙ[ ÌÍÚXØÙ ][ÝÑ^]H]Z] ][ÝÈ [ÈÔBBBQ[YBBIÌÍÜÐYH ][ÝÉ][ÝÂBQ[YUÑ[[[ÈÏOIÝ×Ó]ÐÛÛXÝ[Û Edited June 7, 2007 by piccaso CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
RazerM Posted July 17, 2006 Share Posted July 17, 2006 It works really well picasso. I like your method of doing this. My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
WTS Posted July 17, 2006 Share Posted July 17, 2006 (edited) It works really well picasso. I like your method of doing this.yeah nice job picasso Edited July 17, 2006 by WTS Link to comment Share on other sites More sharing options...
w0uter Posted July 17, 2006 Share Posted July 17, 2006 Assign("gi_CoProcParent", Number(EnvGet("CoProcParent")), 2) Is BAD! lol. Also i remember a glitch where BinaryString did not convert it to hex if it did not contain NON alphanumeric characters. Dont know if it is fixed or an error on my part. I usually just fixed it by adding a Chr(0) at the front and then stripping the first 2 bytes My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
piccaso Posted July 18, 2006 Author Share Posted July 18, 2006 @RazerM,WTS Thanks :"> Assign("gi_CoProcParent", Number(EnvGet("CoProcParent")), 2) Is BAD! lol.Why?Also i remember a glitch where BinaryString did not convert it to hex if it did not contain NON alphanumeric characters. Dont know if it is fixed or an error on my part. I usually just fixed it by adding a Chr(0) at the front and then stripping the first 2 bytes MsgBox(0,"",BinaryString("0x" & Hex(BinaryString("Hello")))) works fine, but you made me nervous CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
erifash Posted July 18, 2006 Share Posted July 18, 2006 Also i remember a glitch where BinaryString did not convert it to hex if it did not contain NON alphanumeric characters.That's only if you are using String(BinaryString("Text")) to convert to hex. I had that same problem in another program but I fixed it using Hex(BinaryString("Text")). My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver Link to comment Share on other sites More sharing options...
piccaso Posted November 18, 2006 Author Share Posted November 18, 2006 (edited) after keeping the changes secret for some months i finaly managed to update it ... i'm getting old, i had to read my own function headers to understand my code. so let this be a lesson to all you non documenting function authors out there Edited November 18, 2006 by piccaso CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 18, 2006 Moderators Share Posted November 18, 2006 after keeping the changes secret for some months i finaly managed to update it ... i'm getting old, i had to read my own function headers to understand my code.so let this be a lesson to all you non documenting function authors out there I'm going to play with these over the weekend, but the work looks really good ... thanks Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
piccaso Posted November 18, 2006 Author Share Posted November 18, 2006 I'm going to play with these over the weekend, but the work looks really good ... thanks your welcome, Thanks let me know what you think of it...Updated first post, added changelog too... CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
RazerM Posted November 18, 2006 Share Posted November 18, 2006 (edited) i really like the changes piccaso. I have used your UDF's quite a few times but I always change these to functions: Func _SuperGlobalSet($sName, $vValue = "", $regkey = "HKEY_CURRENT_USER\Software\AutoIt v3\CoProc") Local $vTmp If $vValue = "" Then RegDelete($regkey, $sName) If @error Then Return SetError(2, 0, False) ; Registry Problem Else $vValue = StringTrimLeft(Hex(BinaryString(Chr(0) & $vValue)), 2) If @error Then Return SetError(1, 0, False) ; Wrong variable type Else RegWrite($regkey, $sName, "REG_BINARY", $vValue) If @error Then Return SetError(2, 0, False) ; Registry Problem EndIf EndIf Return True EndFunc ;==>_SuperGlobalSet Func _SuperGlobalGet($sName, $fOption = False, $regkey = "HKEY_CURRENT_USER\Software\AutoIt v3\CoProc") Local $vTmp $vTmp = RegRead($regkey, $sName) If @error Then Return SetError(1, 0, "") ; Registry Problem If $fOption Then _SuperGlobalSet($sName) If @error Then SetError(2) EndIf Return BinaryString("0x" & $vTmp) EndFunc ;==>_SuperGlobalGetThe only thing I have changed is a paramater so I can choose my own registry key. This is because in a compiled exe I want it to write to its own registry key. Edited November 18, 2006 by RazerM My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
piccaso Posted November 18, 2006 Author Share Posted November 18, 2006 my idea was to use the global variable $gs_SuperGlobalRegistryBase to point to a costum location but i will make it compatible to your version (if you dont mind) so both methods will work. nice idea CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
RazerM Posted November 19, 2006 Share Posted November 19, 2006 No problem. Thanks. My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
59FIFTY Posted January 17, 2007 Share Posted January 17, 2007 (edited) This UDF is very nice, except for one problem: If you have 2 scripts running communicating witch each other and the active window is a third app, the communication doesn't work at all. Edited January 17, 2007 by 59FIFTY Link to comment Share on other sites More sharing options...
piccaso Posted June 7, 2007 Author Share Posted June 7, 2007 Sorry 59FIFTY, i didn't get notified by the forum... could you be more specific? because it works for me... Updated to work with the current autoit version. And i added an example on how to use a socket in another process. i wonder why nobody ever posed a way to use sockets that way, after all that multithread whining CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
mrbond007 Posted June 7, 2007 Share Posted June 7, 2007 ... i'm getting old, i had to read my own function headers to understand my code.For someone who's getting old, you sure make some kickass scriptsExcellent job Projects : Space Regain - Memory Fusion - PWGT - Chip-ITGames : BrainPain - BrainPain Director's Cut - ProSpeed Games Pack (New)Vista vs XP : the forbidden fight Link to comment Share on other sites More sharing options...
Armand Posted October 8, 2007 Share Posted October 8, 2007 can you supply us with some more info regarding how to use coproc with parameterS (more than 1!!!) ?! [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?! Link to comment Share on other sites More sharing options...
ReCoder Posted October 8, 2007 Share Posted October 8, 2007 can you supply us with some more info regarding how to use coproc with parameterS (more than 1!!!) ?!Hi Armand, please look at the attachement "CoProc.zip" in the first post.@picassoThanks for this amazing UDF, i take it to my favorites.Multiprozessing looks like more professional with your functions. Link to comment Share on other sites More sharing options...
Armand Posted October 9, 2007 Share Posted October 9, 2007 @ReCoder wow... that helped alot (NOT...) but thanks anyhow... [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?! Link to comment Share on other sites More sharing options...
Skizmata Posted October 9, 2007 Share Posted October 9, 2007 Thank you very much Picasso I have been using your suspend/resume in a project of mine the updates are appreciated. I have learned much from study of your work thank you. AutoIt changed my life. Link to comment Share on other sites More sharing options...
N4rk0 Posted December 20, 2007 Share Posted December 20, 2007 (edited) I think that need update for current version , when try to use it says that are useddeprecated var types calling dll.... Edit I did it by myself , replase long_ptr with long Edited December 20, 2007 by N4rk0 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