solmention Posted August 16, 2005 Share Posted August 16, 2005 Link to comment Share on other sites More sharing options...
solmention Posted August 16, 2005 Author Share Posted August 16, 2005 i guess my script was too long here the end part. expandcollapse popupCase $msg[0] = $dns_settings ControlDisable($parent_title, "", "");disable parent window so that you have to close child to interact with parent ;Create child window and add the parameter to make it the child of the parent window $dns_settings_win = GUICreate("dns Settings", 500,150, $ParentWin_Pos[0] + 50, $ParentWin_Pos[1] + 50, -1, -1, $ParentWin) GuiSetIcon($icon, 0) ;------------------------- $dns_service_name = GuiCtrlCreateInput(ReadFileMatch1($service_configuration_file,$dns_abbrv,":","",""), 150, 20, 230, 20) GuiCtrlCreateLabel("dns Service Name:", 10, 22, 110, 20) $dns_service_button = GuiCtrlCreateButton("Edit", 400, 17, 50, 30) ;------------------------- $dns_process_name = GuiCtrlCreateInput(ReadFileMatch1($service_configuration_file,$dns_abbrv,":",1,""), 150, 60, 230, 20) GuiCtrlCreateLabel("dns Process Name:", 10, 62, 110, 30) $dns_process_button = GuiCtrlCreateButton("Edit", 400, 57, 50, 30) ;------------------------ $dns_taskShow = GuiCtrlCreateButton("Open Task Manager", 50, 97, 150, 30) ;------------------------ $dns_servShow = GuiCtrlCreateButton("Open MS Service list", 200, 97, 150, 30) ;------------------------ $dns_exit = GuiCtrlCreateButton("Exit", 400, 97, 50, 30) GUISetState(@SW_SHOW) While 1 $child_msg = GUIGetMsg() Select Case $child_msg = $dns_taskShow _RunDOS_N( "taskmgr" ) Case $child_msg = $dns_servShow _RunDOS_N( "%SystemRoot%\system32\services.msc /s" ) Case $child_msg = $dns_service_button $serv_contents = ReadFileMatch1($service_configuration_file,"","","",1);full array of file Conf_Edit($serv_contents,$service_configuration_file,GUICtrlRead ($dns_service_name),$dns_abbrv,2) Case $child_msg = $dns_process_button $serv_contents = ReadFileMatch1($service_configuration_file,"","","",1);full array of file Conf_Edit($serv_contents,$service_configuration_file,GUICtrlRead ($dns_process_name),$dns_abbrv,3) Case $child_msg = $GUI_EVENT_CLOSE or $child_msg = $dns_exit GUISwitch($dns_settings_win) GUIDelete() ControlEnable($parent_title, "", "") Exitloop EndSelect WEnd ;Show the child window/Make the child window visible GUISetState(@SW_SHOW) ;Switch to the parent window GUISwitch($ParentWin) ;Case $msg[0] = 0 ;Sleep(1000) ;ContinueLoop EndSelect WEnd ; ;#comments-end Exit Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 16, 2005 Moderators Share Posted August 16, 2005 Could be that you don't have one active Sleep()... an occassional sleep(10) even would help quite a bit in your While Statements. 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...
Holger Posted August 17, 2005 Share Posted August 17, 2005 (edited) One thing I saw, set:TraySetState() TraySetClick(16)before the While 1-line and try again.Edit: another thing with the memory is a known bug:see here:http://www.autoitscript.com/forum/index.php?showtopic=14723Regards Edited August 17, 2005 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
solmention Posted August 17, 2005 Author Share Posted August 17, 2005 didn't realize, that au3 was a memory hugger, I will try the sleep a few times thru the loop to see if that will help, any other suggestion can help as well. thanks Link to comment Share on other sites More sharing options...
layer Posted August 17, 2005 Share Posted August 17, 2005 AutoIt3 isn't so much the problem. It is usually the structure of your code that depends on quality FootbaG Link to comment Share on other sites More sharing options...
solmention Posted August 17, 2005 Author Share Posted August 17, 2005 This is why I posted the code for help not smart ass comments, plus i responded to what I thought said it might be a known bug. probably I misunderstood what holger postedAutoIt3 isn't so much the problem. It is usually the structure of your code that depends on quality <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
layer Posted August 17, 2005 Share Posted August 17, 2005 This is why I posted the code for help not smart ass comments, plus i responded to what I thought said it might be a known bug. probably I misunderstood what holger posted<{POST_SNAPBACK}>Smart ass comments ? That was a tip. I was telling you that unless it's a bug, AutoIt3 usually is not the problem. It is usually the way the code is written, how certain functions are used, and improper use of functions. I'm not saying your code may have had all that, I didn't even look over all your code at the time. But I'm saying, it's not a good habbit to first blame the program, and then later find out it was your code. FootbaG Link to comment Share on other sites More sharing options...
solmention Posted August 17, 2005 Author Share Posted August 17, 2005 Thank you, my bad, little frustrated I looked over my code a zillion times...I actually assume first it was my code just something i'm missing since i'm new to autoit. this is why I posted to code for help. Thanks for your insight. Smart ass comments ? That was a tip. I was telling you that unless it's a bug, AutoIt3 usually is not the problem. It is usually the way the code is written, how certain functions are used, and improper use of functions. I'm not saying your code may have had all that, I didn't even look over all your code at the time. But I'm saying, it's not a good habbit to first blame the program, and then later find out it was your code.<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
layer Posted August 17, 2005 Share Posted August 17, 2005 Thank you, my bad, little frustrated I looked over my code a zillion times...I actually assume first it was my code just something i'm missing since i'm new to autoit. this is why I posted to code for help. Thanks for your insight.<{POST_SNAPBACK}>No problem... I know how it feels to be frusterated, and be new... It's a weird feeling.Welcome to the forums FootbaG Link to comment Share on other sites More sharing options...
LxP Posted August 17, 2005 Share Posted August 17, 2005 Welcome to the forums!I suggest modifying your script to use the GUI OnEvent mode instead of the MessageLoop mode. This will ultimately make your code cleaner and easier to manage while allowing you the luxury of adding Sleep()s to your code (doing so during a message loop will make your GUI lag between e.g. a button click and its functioning, which you appear to have acknowledged). Link to comment Share on other sites More sharing options...
solmention Posted August 17, 2005 Author Share Posted August 17, 2005 Thanks, I will try this although not familar i'll look it up and change my code any pointer will also be good thanksWelcome to the forums!I suggest modifying your script to use the GUI OnEvent mode instead of the MessageLoop mode. This will ultimately make your code cleaner and easier to manage while allowing you the luxury of adding Sleep()s to your code (doing so during a message loop will make your GUI lag between e.g. a button click and its functioning, which you appear to have acknowledged).<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
solmention Posted August 17, 2005 Author Share Posted August 17, 2005 I have tried what you said the cpu is down very low, i'm still using the beta version and excited. I also change my traymsg to use the tray onevent so as your suggestion for gui onevent. this is much cleaner and only uses cpu time when needed...thanks thanks...but now i have another questions. if best practice is to use the onevent modes options, reduces cpu time all great stuff..then why do we use the while loops for gui when the only good reason i see it for is for array and sleep time...any pointersi mostly use the for loops for my arrays.??Welcome to the forums!I suggest modifying your script to use the GUI OnEvent mode instead of the MessageLoop mode. This will ultimately make your code cleaner and easier to manage while allowing you the luxury of adding Sleep()s to your code (doing so during a message loop will make your GUI lag between e.g. a button click and its functioning, which you appear to have acknowledged).<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
seandisanti Posted August 17, 2005 Share Posted August 17, 2005 I have tried what you said the cpu is down very low, i'm still using the beta version and excited. I also change my traymsg to use the tray onevent so as your suggestion for gui onevent. this is much cleaner and only uses cpu time when needed...thanks thanks...but now i have another questions. if best practice is to use the onevent modes options, reduces cpu time all great stuff..then why do we use the while loops for gui when the only good reason i see it for is for array and sleep time...any pointersi mostly use the for loops for my arrays.??<{POST_SNAPBACK}>without the loop, your script is jsut a script to display a gui. the loop tells it to wait around for more instructions after finish that goal. without the loop, the gui goes away. comment it out and try to run it 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