ficofico Posted December 12, 2007 Share Posted December 12, 2007 Hi huys, i'm not a programmer and I need aid... I've make a gui with autoit , and all works well: The "START WINDOWS" button its $winnormalebutton, and it will start many dos program like mencoder, x264, mp4box ecc ecc. Here a sample of the script: expandcollapse popupwhile 1 $msg = GUIGetMsg() select case $msg = $GUI_EVENT_CLOSE exitloop [b]case $msg = $winnormalebutton[/b] $cartella2 = FileOpen("cartella2.txt", 0) $cartella = FileReadLine($cartella2) $delay2 = FileOpen("delay.txt", 0) $delay = FileReadLine($delay2) $end2 = FileOpen("end.txt", 0) $end = FileReadLine($end2) $start2 = FileOpen("start.txt", 0) $start = FileReadLine($start2) filedelete ("C:\Programmi\Rigenerator-program\rigenerator2\*.mp4") filedelete ($cartella &"\*.*") FileCopy("C:\Programmi\Rigenerator-program\rigenerator2\cartella\*.mp4", "C:\Programmi\Rigenerator-program\rigenerator2\originale.mp4", 8) FileCopy("C:\Programmi\Rigenerator-program\rigenerator2\istruzioniwin640.avs", $cartella &"\istruzioniwin640.avs", 8) FileCopy("C:\Programmi\Rigenerator-program\rigenerator2\x264.exe", $cartella &"\x264.exe", 8) FileCopy("C:\Programmi\Rigenerator-program\rigenerator2\batx264.bat", $cartella &"\batx264.bat", 8) runwait("mencoder.bat","c:\Programmi\Rigenerator-program\rigenerator2",@SW_minimize) runwait("batx264.bat",$cartella,@SW_minimize ) ecc ecc.. Now I want to modify my program like this. when I click $winnormalebutton , the gui have to change like this( it's only an example) I think that i need to work inside the while, but I'm a very beginner user of autoit and i'm not a programer. Below I've write a simple ( incorrect) script for understanding what i want to do: while 1 $msg = GUIGetMsg() select case $msg = $GUI_EVENT_CLOSE exitloop case $msg = $winnormalebutton $cartella2 = FileOpen("cartella2.txt", 0) $cartella = FileReadLine($cartella2) $delay2 = FileOpen("delay.txt", 0) $delay = FileReadLine($delay2) $end2 = FileOpen("end.txt", 0) $end = FileReadLine($end2) $start2 = FileOpen("start.txt", 0) $start = FileReadLine($start2) filedelete ("C:\Programmi\Rigenerator-program\rigenerator2\*.mp4") filedelete ($cartella &"\*.*") FileCopy("C:\Programmi\Rigenerator-program\rigenerator2\cartella\*.mp4", "C:\Programmi\Rigenerator-program\rigenerator2\originale.mp4", 8) FileCopy("C:\Programmi\Rigenerator-program\rigenerator2\istruzioniwin640.avs", $cartella &"\istruzioniwin640.avs", 8) FileCopy("C:\Programmi\Rigenerator-program\rigenerator2\x264.exe", $cartella &"\x264.exe", 8) FileCopy("C:\Programmi\Rigenerator-program\rigenerator2\batx264.bat", $cartella &"\batx264.bat", 8) runwait("mencoder.bat","c:\Programmi\Rigenerator-program\rigenerator2",@SW_minimize) while 2 $stopexecutionbutton = GUICtrlCreateButton("stopexecution button", 400, 300, 100, 20) $runningmencoderbutton = GUICtrlCreateButton("It's running mencoder", 400, 300, 100, 20) $msg = GUIGetMsg() select case $stopexecutionbutton exitloop processclose("mencoder.exe") processclose("x264.exe") processclose("mp4box.exe") endselect wend runwait("batx264.bat",$cartella,@SW_minimize ) ecc ecc.. I know that it's completely wrong, but I've tried hundred of possible combination, outside and inside the while, and when the button it's played there's no way to use the gui for do work, only uf i stop the process of $winnormalebutton the gui respond thank. Link to comment Share on other sites More sharing options...
ficofico Posted December 12, 2007 Author Share Posted December 12, 2007 no one? Link to comment Share on other sites More sharing options...
John117 Posted December 12, 2007 Share Posted December 12, 2007 (edited) Hey not a programmer either, but this is the post that helped me change my coding for the better. (removing button monitoring from while statements)http://www.autoitscript.com/forum/index.php?showtopic=50412btw -using this method with functions, my current project has 1000+ lines and only three of them are in my while statement. Edited December 12, 2007 by Hatcheda Link to comment Share on other sites More sharing options...
ficofico Posted December 12, 2007 Author Share Posted December 12, 2007 thank you 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