MvGulik Posted December 5, 2009 Share Posted December 5, 2009 (edited) Any tips (or forum links) on altenitives for doing some current script related tasks while also waiting for gui messages. The specific task in my case is content(hasing:CRC,MD5,...) scanning of files. With the need for some intermediate feedback and control possibilities over the task. Using GUIOnEvent mode is this case the lasts desired option. And real multi.task ? treading is way past my skills. currently using this kind of basic test setup. (just for getting the background task up and running properly) Opt('GUIOnEventMode', 0) ; ... Func GuiWait() Do ; ... some GUI related checks. ; ... IF "background task" THEN ... ; ... "check background task status" ; ... IF "new file to scan" THEN ... "update_task" ; ... IF "GUI update needed" THEN ... "update_gui" ; ... ELSEIF "any new file to scan" THEN ... "start_task" Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc It works but is inefficient(overall speed) because of GUIGetMsg() designed autosleep behavior. Edited March 1, 2010 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
martin Posted December 5, 2009 Share Posted December 5, 2009 Any tips (or forum links) on altenitives for doing some current script related tasks while also waiting for gui messages.The specific task in my case is content(hasing:CRC,MD5,...) scanning of files. With the need for some intermediate feedback and control possibilities over the task.Using GUIOnEvent mode is this case the lasts desired option.And real multi.task ? treading is way past my skills.currently using this kind of basic test setup. (just for getting the background task up and running properly)Opt('GUIOnEventMode', 0) ; ... Func GuiWait() Do ; ... some GUI related checks. ; ... IF "background task" THEN ... ; ... "check background task status" ; ... IF "new file to scan" THEN ... "update_task" ; ... IF "GUI update needed" THEN ... "update_gui" ; ... ELSEIF "any new file to scan" THEN ... "start_task" Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFuncIt works but is inefficient because of GUIGetMsg() designed autosleep behavior.Why don't you want to use OnEvent mode? That would be the easiest and most efficient I would expect. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
BinaryBrother Posted December 5, 2009 Share Posted December 5, 2009 (edited) Utilizing Multi-processes in AutoIt might help... I don't fully recommend this as a solution, but it would be alright for any personal project. If $CmdLine[0] > 0 Then If $CmdLine[1] = "CRC" Then MsgBox(0,"CRC","CRC Check code here") Exit EndIf EndIf While 1 ;Doing GUI Stuff here... If $Var = "CRC Check" Then ShellExecute(@ScriptFullPath,"CRC") EndIf WEnd Oh, and keep in kind that logically, the variables used in forked processes don't tie in to the initial program. You must also compile the program to see results. This works in both CLI and GUI compiles. Edited December 5, 2009 by BinaryBrother SIGNATURE_0X800007D NOT FOUND 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