Jump to content
Sign in to follow this  
Cigam

An AutoIt Tech Toolbox

Recommended Posts

Cigam

Hello all on AutoIt :) I know I am new but wanted to get this post started because I know I will have a lot of questions. First off I really love what autoit is capable of, and I know I am probably going to be pushing the limits with what it can do, but with all that said let me explain some of what im wanting to do. I have a lot of notes, links and documents but am in the process of arranging them in a more user friendly way. right now its haphazard. (1,000s of links and such)

I have worked with various tech companies and places and done a lot of tech work myself in repairing windows, removing viruses etc. So I want to make 2 main programs. First being a Tech Hub program that you would run on your own computer or your tech center main computer. This Hub will manage all of the program updates, downloads, configurations, reports, etc of the USB toolbox.

The second program being the USB toolbox which would be syncronizhed / updating by the Hub to be the latest version (most likely each day). The Toolbox, will do all of the automated work, (or nearly fully automated) to do various Tuneups, diagnostics, malware removal, analysis, etc. With an array of portable programs, but I would like to write as many of the portable programs as modules or components that can be easily changed in autoit format, so that it would be no 3rd party software. (or very little at least)

#######

My first question though. is there a way to have a compiled autoit exe program that reads separate files (like config scripts in autoit format) that would be what defines the menus and routines/programs that the compiled program does and looks like?

Secondly how autoit can do various keyboard and mouse commands automatically, is there a way to block the hardware keyboard and mouse inputs without blocking the autoit keyboard and mouse commands? Meaning I have various keylock programs and it blocks autoit from working, but I would want a way to automatically do various tasks without it being interrupted or broken by someone pushing a key on the keyboard or using the mouse.

Lastly is there a way I can easily make a report in html format? I saw some posts on how to convert to pdf but I didnt know how complete it was but html is a relatively easy format, but I just cant figure out how to copy data from various logs of portable programs into one coherant report.

#######

Again I know I am new and I have searched the forums some and there is a lot for me to learn but those were my 3 main questions. but I will try to update this post or make a new post when I have all of my notes organized I just really need to start working on making a usable toolbox since its something I need to do my tech work more quickly. So I want to start working on the mechanics of the programs I need and then work on the more intricate aspects.

Thanks

Aaron

Share this post


Link to post
Share on other sites
0xdefea7

Yes this is all possible. I have written and maintain several scripts that do exactly what you are asking. I can't give you any of my new code, because it does not belong to me, but I can give something I wrote a loooong time ago called CAT (http://crisistool.sourceforge.net). Here is the tool and the source, it should get you started:

https://dl.dropboxusercontent.com/u/17659346/CAT_Source.zip

This should have a working example of most of what you want, aside from the HTML. You should be able to handle that easily if you know HTML well enough and use something like FileWriteLine()

Let me know if you have any questions.

Disclaimer: some of the code is broken so if you want to compile, you will have to fix it. I don't have time. But the source should get you on the right track. Spend some time looking through it.

Edited by 0xdefea7

Share this post


Link to post
Share on other sites
Cigam

Wow I did not realize that CAT tool was written in AutoIt! I had never checked, because I have used that program before ;) but yeah I want to do similar but have like 100 more things but its just going to take a long time to do. But thank you very much for that source download. I need to study it more. Hopefully I will have a version (even in simplistic form) of a beginning of my program eventually,

Share this post


Link to post
Share on other sites
0xdefea7

Glad I could help :) 

Let me know if you have any questions, I'll be around.

Share this post


Link to post
Share on other sites
Cigam

Well I am slowly making progress, I have been trying to figure out how I want to do the menu structure and process, but I think I have an idea. Currently I have the start of my gui, but the problem is for my computer (SolydK Linux 64 bit using Wine to run the programs) it runs all the other autoit programs fine but for mine when I try to get a child window to close it does not work correctly or it closes all of the windows. Can yall tell me what im doing wrong?

I have attached the latest version of my file. The "Configure the Intake Analysis" button is used to launch another window, but the "apply changes" button is supposed to close that child window, but instead it does nothing. So I have to push my main windows "exit" button to close all of the windows... If you all have a better way you think I should have the code for the menu or gui let me know.

Thanks.

; toolbox start

;scripting help links
;http://www.autoitscript.com/autoit3/docs/
;http://www.autoitscript.com/autoit3/docs/guiref/GUIRef.htm
;http://www.autoitscript.com/autoit3/docs/functions/GUICreate.htm
;http://www.autoitscript.com/autoit3/docs/appendix/GUIStyles.htm
;http://www.autoitscript.com/autoit3/docs/tutorials/notepad/notepad.htm
;http://www.autoitscript.com/autoit3/docs/intro/windowsadvanced.htm
;http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreate%20Management.htm

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Main() ;run specified function
Func Main() ;function main
   ;define local variables
   Local $WindowWidth, $WindowHeight ;window dimensions
   Local $pad, $sizer ;spaces for the various objects
   Local $TableWidth, $TableHeight  ;table dimensions
   Local $GroupWidth, $GroupHeight ;group dimensions
   Local $PositionLat, $Position1Long, $Position2Long, $Position3Long, $Position4Long, $Position5Long, $Position6Long, $Position7Long ;the positions for each group
   Local $Group1Long, $Group2Long, $Group3Long, $Group4Long, $Group5Long, $Group6Long, $Group7Long ;group positions
   Local $ButtonWidth, $ButtonHeight ;button dimensions
   
   Local $ExitButton, $ConfigIntake
   
   Local $msg ;msg needed for when buttons are pressed

   ;now define the values for the variables, nearly all of them are dynamic.
   $WindowWidth = 520
   $WindowHeight = 460
   $pad = 5
   $sizer = 7
   $TableWidth = $WindowWidth-$pad
   $TableHeight = $WindowHeight-10*$pad
   $GroupWidth = $TableWidth-2*$pad
   $GroupHeight = ($TableHeight+$pad)/$sizer
   $PositionLat = $pad
   $Position1Long = 4*$pad
   $Position2Long = $GroupHeight+$Position1Long-$pad
   $Position3Long = $GroupHeight+$Position2Long-$pad
   $Position4Long = $GroupHeight+$Position3Long-$pad
   $Position5Long = $GroupHeight+$Position4Long-$pad
   $Position6Long = $GroupHeight+$Position5Long-$pad
   $Position7Long = $GroupHeight+$Position6Long-$pad
   $Group1Long = $Position1Long
   $Group2Long = $Position2Long
   $Group3Long = $Position3Long
   $Group4Long = $Position4Long
   $Group5Long = $Position5Long
   $Group6Long = $Position6Long
   $Group7Long = $Position7Long
   $ButtonWidth = ($GroupWidth/$sizer)+$pad+2
   $ButtonHeight = $GroupHeight-3*$pad

   ;create the window
   GUICreate("Cigam Automated Technician Toolbox", $WindowWidth, $WindowHeight, -1, -1, $WS_BORDER)
   
   $ExitButton = GUICtrlCreateButton("Exit", $WindowWidth-$pad-$ButtonWidth, $WindowHeight-$pad/2-$ButtonHeight, $ButtonWidth, $ButtonHeight/2)
   
      ;create a tabbox in the window
      GUICtrlCreateTab(0, 0, $TableWidth, $TableHeight)
         ;create the main menu tab
         GUICtrlCreateTabItem("Main Menu")
            ;group1
            GUICtrlCreateGroup("", $PositionLat, $Group1Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateButton("Run Selected Tasks", $PositionLat+$pad, $Group1Long+2*$pad, $ButtonWidth*2+$pad, $ButtonHeight)
               GUICtrlCreateLabel("Select from the 6 options below, then push the 'Run Selected Tasks' to start the automated process. It will disable any keyboard/mouse commands until all selected tasks are complete. (Type in the word 'control' to regain keyboard/mouse usage, this will stop the tasks)", $PositionLat+3*$pad+2*$ButtonWidth, $Group1Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group2
            GUICtrlCreateGroup("", $PositionLat, $Group2Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Intake Analysis", $PositionLat+$pad, $Group2Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               $ConfigIntake = GUICtrlCreateButton("Configure the Intake Analysis", $PositionLat+2*$pad+$ButtonWidth, $Group2Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("The intake analysis will scan the computer system for any hardware, malware, software, or known issues. As well as compile a detailed report of recommended changes and/or fixes required to get the computer back to a better condition. (About 15+ minutes needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group2Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group3
            GUICtrlCreateGroup("", $PositionLat, $Group3Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Diagnostics", $PositionLat+$pad, $Group3Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the Diagnostics", $PositionLat+2*$pad+$ButtonWidth, $Group3Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("The diagnostics will run through various quality, error, and stress tests to multiple parts of the computer to enusre that all of the hardware is working at correct levels. If not it will provide options to fix/repair/replace the damaged parts. (About 3+ hours needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group3Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group4
            GUICtrlCreateGroup("", $PositionLat, $Group4Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Virus Removal", $PositionLat+$pad, $Group4Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the Virus Removal", $PositionLat+2*$pad+$ButtonWidth, $Group4Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("The virus removal scans and removes all forms of malware, including junkware, toolbars, and potentially unneeded programs as well. Using multiple scan engines it should remove all the of the malicious software and files from the computer. (About 2+ hours needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group4Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group5
            GUICtrlCreateGroup("", $PositionLat, $Group5Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) System Repair", $PositionLat+$pad, $Group5Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the System Repair", $PositionLat+2*$pad+$ButtonWidth, $Group5Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("Numerous system files and essential resources of Windows can become corrupted or not defined, which causes issues or failures. This will repair all or at least most of those files to get the system back to a correct runnable state. (About 1+ hours needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group5Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group6
            GUICtrlCreateGroup("", $PositionLat, $Group6Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) PC Tuneup", $PositionLat+$pad, $Group6Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the PC Tuneup", $PositionLat+2*$pad+$ButtonWidth, $Group6Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("Clutter and temporary files accumulate on the system as well as a lot of registry errors and drive fragmentation can occur over time. The pc tuneup will help to enhance settings on the system to increase the speed/startup time some. (About 30+ minutes needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group6Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group7
            GUICtrlCreateGroup("", $PositionLat, $Group7Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Final Analysis", $PositionLat+$pad, $Group7Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the Final Analysis", $PositionLat+2*$pad+$ButtonWidth, $Group7Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("This final analysis report is like the intake analysis, but also includes extended information from the other full tasks, depending on which of them have been completed. As well as a comparison showing the changes from the intake analysis. (About 15+ minutes needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group7Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)

         ;create a tab for tools now
         GUICtrlCreateTabItem("Tools")



   GUISetState() ; display the GUI
   Do
      $msg = GUIGetMsg()
         Select
            Case $msg = $ConfigIntake
               ;MsgBox(0, "You clicked on", "Yes")
               ConfigIntake()
         EndSelect
   Until $msg = $ExitButton

EndFunc   ;==>Main

Func ConfigIntake()
   Local $WindowWidth, $WindowHeight ;window dimensions
   Local $pad, $sizer ;spaces for the various objects
   Local $ApplyChanges
   $WindowWidth = 320
   $WindowHeight = 260
   $pad = 5
   $sizer = 7
   GUICreate("Configuration for the Intake Analysis", $WindowWidth, $WindowHeight, -1, -1, $WS_BORDER)
   $ApplyChanges = GUICtrlCreateButton("Apply Changes", 200, 100, 200, 100)
   GUISetState()
   Do
      $msg = GUIGetMsg()
   Until $msg = $ApplyChanges
EndFunc

cigam010.au3

Edited by Cigam

Share this post


Link to post
Share on other sites
kylomas

Cigam,

See the comment in the code...

; toolbox start

;scripting help links
;http://www.autoitscript.com/autoit3/docs/
;http://www.autoitscript.com/autoit3/docs/guiref/GUIRef.htm
;http://www.autoitscript.com/autoit3/docs/functions/GUICreate.htm
;http://www.autoitscript.com/autoit3/docs/appendix/GUIStyles.htm
;http://www.autoitscript.com/autoit3/docs/tutorials/notepad/notepad.htm
;http://www.autoitscript.com/autoit3/docs/intro/windowsadvanced.htm
;http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreate%20Management.htm

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Main() ;run specified function
Func Main() ;function main
   ;define local variables
   Local $WindowWidth, $WindowHeight ;window dimensions
   Local $pad, $sizer ;spaces for the various objects
   Local $TableWidth, $TableHeight  ;table dimensions
   Local $GroupWidth, $GroupHeight ;group dimensions
   Local $PositionLat, $Position1Long, $Position2Long, $Position3Long, $Position4Long, $Position5Long, $Position6Long, $Position7Long ;the positions for each group
   Local $Group1Long, $Group2Long, $Group3Long, $Group4Long, $Group5Long, $Group6Long, $Group7Long ;group positions
   Local $ButtonWidth, $ButtonHeight ;button dimensions

   Local $ExitButton, $ConfigIntake

   Local $msg ;msg needed for when buttons are pressed

   ;now define the values for the variables, nearly all of them are dynamic.
   $WindowWidth = 520
   $WindowHeight = 460
   $pad = 5
   $sizer = 7
   $TableWidth = $WindowWidth-$pad
   $TableHeight = $WindowHeight-10*$pad
   $GroupWidth = $TableWidth-2*$pad
   $GroupHeight = ($TableHeight+$pad)/$sizer
   $PositionLat = $pad
   $Position1Long = 4*$pad
   $Position2Long = $GroupHeight+$Position1Long-$pad
   $Position3Long = $GroupHeight+$Position2Long-$pad
   $Position4Long = $GroupHeight+$Position3Long-$pad
   $Position5Long = $GroupHeight+$Position4Long-$pad
   $Position6Long = $GroupHeight+$Position5Long-$pad
   $Position7Long = $GroupHeight+$Position6Long-$pad
   $Group1Long = $Position1Long
   $Group2Long = $Position2Long
   $Group3Long = $Position3Long
   $Group4Long = $Position4Long
   $Group5Long = $Position5Long
   $Group6Long = $Position6Long
   $Group7Long = $Position7Long
   $ButtonWidth = ($GroupWidth/$sizer)+$pad+2
   $ButtonHeight = $GroupHeight-3*$pad

   ;create the window
   GUICreate("Cigam Automated Technician Toolbox", $WindowWidth, $WindowHeight, -1, -1, $WS_BORDER)

   $ExitButton = GUICtrlCreateButton("Exit", $WindowWidth-$pad-$ButtonWidth, $WindowHeight-$pad/2-$ButtonHeight, $ButtonWidth, $ButtonHeight/2)

      ;create a tabbox in the window
      GUICtrlCreateTab(0, 0, $TableWidth, $TableHeight)
         ;create the main menu tab
         GUICtrlCreateTabItem("Main Menu")
            ;group1
            GUICtrlCreateGroup("", $PositionLat, $Group1Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateButton("Run Selected Tasks", $PositionLat+$pad, $Group1Long+2*$pad, $ButtonWidth*2+$pad, $ButtonHeight)
               GUICtrlCreateLabel("Select from the 6 options below, then push the 'Run Selected Tasks' to start the automated process. It will disable any keyboard/mouse commands until all selected tasks are complete. (Type in the word 'control' to regain keyboard/mouse usage, this will stop the tasks)", $PositionLat+3*$pad+2*$ButtonWidth, $Group1Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group2
            GUICtrlCreateGroup("", $PositionLat, $Group2Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Intake Analysis", $PositionLat+$pad, $Group2Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               $ConfigIntake = GUICtrlCreateButton("Configure the Intake Analysis", $PositionLat+2*$pad+$ButtonWidth, $Group2Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("The intake analysis will scan the computer system for any hardware, malware, software, or known issues. As well as compile a detailed report of recommended changes and/or fixes required to get the computer back to a better condition. (About 15+ minutes needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group2Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group3
            GUICtrlCreateGroup("", $PositionLat, $Group3Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Diagnostics", $PositionLat+$pad, $Group3Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the Diagnostics", $PositionLat+2*$pad+$ButtonWidth, $Group3Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("The diagnostics will run through various quality, error, and stress tests to multiple parts of the computer to enusre that all of the hardware is working at correct levels. If not it will provide options to fix/repair/replace the damaged parts. (About 3+ hours needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group3Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group4
            GUICtrlCreateGroup("", $PositionLat, $Group4Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Virus Removal", $PositionLat+$pad, $Group4Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the Virus Removal", $PositionLat+2*$pad+$ButtonWidth, $Group4Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("The virus removal scans and removes all forms of malware, including junkware, toolbars, and potentially unneeded programs as well. Using multiple scan engines it should remove all the of the malicious software and files from the computer. (About 2+ hours needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group4Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group5
            GUICtrlCreateGroup("", $PositionLat, $Group5Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) System Repair", $PositionLat+$pad, $Group5Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the System Repair", $PositionLat+2*$pad+$ButtonWidth, $Group5Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("Numerous system files and essential resources of Windows can become corrupted or not defined, which causes issues or failures. This will repair all or at least most of those files to get the system back to a correct runnable state. (About 1+ hours needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group5Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group6
            GUICtrlCreateGroup("", $PositionLat, $Group6Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) PC Tuneup", $PositionLat+$pad, $Group6Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the PC Tuneup", $PositionLat+2*$pad+$ButtonWidth, $Group6Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("Clutter and temporary files accumulate on the system as well as a lot of registry errors and drive fragmentation can occur over time. The pc tuneup will help to enhance settings on the system to increase the speed/startup time some. (About 30+ minutes needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group6Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group7
            GUICtrlCreateGroup("", $PositionLat, $Group7Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Final Analysis", $PositionLat+$pad, $Group7Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the Final Analysis", $PositionLat+2*$pad+$ButtonWidth, $Group7Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("This final analysis report is like the intake analysis, but also includes extended information from the other full tasks, depending on which of them have been completed. As well as a comparison showing the changes from the intake analysis. (About 15+ minutes needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group7Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)

         ;create a tab for tools now
         GUICtrlCreateTabItem("Tools")



   GUISetState() ; display the GUI
   Do
      $msg = GUIGetMsg()
         Select
            Case $msg = $ConfigIntake
               ;MsgBox(0, "You clicked on", "Yes")
               ConfigIntake()
         EndSelect
   Until $msg = $ExitButton

EndFunc   ;==>Main

Func ConfigIntake()
   Local $WindowWidth, $WindowHeight ;window dimensions
   Local $pad, $sizer ;spaces for the various objects
   Local $ApplyChanges
   $WindowWidth = 320
   $WindowHeight = 260
   $pad = 5
   $sizer = 7

   ; changed the following gui def to add a handle so it can be deleted later
   ;GUICreate("Configuration for the Intake Analysis", $WindowWidth, $WindowHeight, -1, -1, $WS_BORDER)
   local $APCH_GUI = GUICreate("Configuration for the Intake Analysis", $WindowWidth, $WindowHeight, -1, -1, $WS_BORDER)
   ;$ApplyChanges = GUICtrlCreateButton("Apply Changes", 200, 100, 200, 100)
   $ApplyChanges = GUICtrlCreateButton("Apply Changes", 20, 20, 280, 20)  ; <<<< ------ button was off the gui
   GUISetState()

   do
      $msg = GUIGetMsg()
   Until $msg = $ApplyChanges

    guidelete($APCH_GUI)    ; <<<-------------  to remove the gui
    return          ; <<<-------------  go back to who ever called you

EndFunc

Did you look at the code that 0Xdefea7 pointed you to?

kylomas

edit: Is the purpose of the second gui to confirm changes?

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites
Cigam

Thanks that works well :) now all I have to do is get the variables of checkboxes and such in those to work. And yes I did look at his code and there are things he does that I will do a similar style but I did not see any guidelete, so was stuck. Thank you again though im going to see how much further I can get and will post back if I got stuck again, but also to show my progress.

Did most of the code look ok though or is there something that you think might could cause problems later on?

*edit -- yes the second gui is where I will have it modify various checkboxes/variables so that it will change how the programs will run or how the final output will be, I just have not worked out what all the variables will be yet until I figure out for sure which programs I am going to be using for each step. that I will probably sort out once I get most of the gui worked out.

Edited by Cigam

Share this post


Link to post
Share on other sites
kylomas

Cigam,

Did most of the code look ok though

 

Your label text overruns the boundries of the grouplines, at least on my PC.

I would not choose to use buttons as they are both limiting and high maintenance if you need to add/delete items/tasks.  My initial take is to use a dropdown box and key events from whatever is selected.  This is just spitballing off the top of my head.

is there something that you think might could cause problems later on?

 

Without knowing specifics of your design that is impossible to say.  I did not see anything glaringly obvious.

kylomas

edit: additional info

 now all I have to do is get the variables of checkboxes and such in those to work

 

Read the Help file carefully to understand what checkboxes represent and how to use state and value.

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites
Cigam

Ok I added a GUISetFont parameter to hopefully have it as a consistent size across the platforms, does the text fit into the groups on yours? attached is how it looks on mine: *edit* I need to adjust the size a little but its supposed to fit in the groups, on my system default it did, but I think I need to adjust the size down to 8 to make it all fit.

; toolbox start

;scripting help links
;http://www.autoitscript.com/autoit3/docs/
;http://www.autoitscript.com/autoit3/docs/guiref/GUIRef.htm
;http://www.autoitscript.com/autoit3/docs/functions/GUICreate.htm
;http://www.autoitscript.com/autoit3/docs/appendix/GUIStyles.htm
;http://www.autoitscript.com/autoit3/docs/tutorials/notepad/notepad.htm
;http://www.autoitscript.com/autoit3/docs/intro/windowsadvanced.htm
;http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreate%20Management.htm
;http://www.autoitscript.com/autoit3/docs/functions/GUISetParameters%20Management.htm
;http://www.autoitscript.com/autoit3/docs/functions/GUISetFont.htm

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Main() ;run specified function
Func Main() ;function main
   ;define local variables
   Local $WindowWidth, $WindowHeight ;window dimensions
   Local $pad, $sizer ;spaces for the various objects
   Local $TableWidth, $TableHeight  ;table dimensions
   Local $GroupWidth, $GroupHeight ;group dimensions
   Local $PositionLat, $Position1Long, $Position2Long, $Position3Long, $Position4Long, $Position5Long, $Position6Long, $Position7Long ;the positions for each group
   Local $Group1Long, $Group2Long, $Group3Long, $Group4Long, $Group5Long, $Group6Long, $Group7Long ;group positions
   Local $ButtonWidth, $ButtonHeight ;button dimensions

   Local $ExitButton, $ConfigIntake

   Local $msg ;msg needed for when buttons are pressed

   ;now define the values for the variables, nearly all of them are dynamic.
   $WindowWidth = 520
   $WindowHeight = 460
   $pad = 5
   $sizer = 7
   $TableWidth = $WindowWidth-$pad
   $TableHeight = $WindowHeight-10*$pad
   $GroupWidth = $TableWidth-2*$pad
   $GroupHeight = ($TableHeight+$pad)/$sizer
   $PositionLat = $pad
   $Position1Long = 4*$pad
   $Position2Long = $GroupHeight+$Position1Long-$pad
   $Position3Long = $GroupHeight+$Position2Long-$pad
   $Position4Long = $GroupHeight+$Position3Long-$pad
   $Position5Long = $GroupHeight+$Position4Long-$pad
   $Position6Long = $GroupHeight+$Position5Long-$pad
   $Position7Long = $GroupHeight+$Position6Long-$pad
   $Group1Long = $Position1Long
   $Group2Long = $Position2Long
   $Group3Long = $Position3Long
   $Group4Long = $Position4Long
   $Group5Long = $Position5Long
   $Group6Long = $Position6Long
   $Group7Long = $Position7Long
   $ButtonWidth = ($GroupWidth/$sizer)+$pad+2
   $ButtonHeight = $GroupHeight-3*$pad

   ;create the window
   GUICreate("Cigam Automated Technician Toolbox", $WindowWidth, $WindowHeight, -1, -1, $WS_BORDER)
   GUISetFont(8.5, 400, 0, "Arial") ;adjust font as specific style for consistency across systems

   $ExitButton = GUICtrlCreateButton("Exit", $WindowWidth-$pad-$ButtonWidth, $WindowHeight-$pad/2-$ButtonHeight, $ButtonWidth, $ButtonHeight/2)

      ;create a tabbox in the window
      GUICtrlCreateTab(0, 0, $TableWidth, $TableHeight)
         ;create the main menu tab
         GUICtrlCreateTabItem("Main Menu")
            ;group1
            GUICtrlCreateGroup("", $PositionLat, $Group1Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateButton("Run Selected Tasks", $PositionLat+$pad, $Group1Long+2*$pad, $ButtonWidth*2+$pad, $ButtonHeight)
               GUICtrlCreateLabel("Select from the 6 options below, then push the 'Run Selected Tasks' to start the automated process. It will disable any keyboard/mouse commands until all selected tasks are complete. (Type in the word 'control' to regain keyboard/mouse usage, this will stop the tasks)", $PositionLat+3*$pad+2*$ButtonWidth, $Group1Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group2
            GUICtrlCreateGroup("", $PositionLat, $Group2Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Intake Analysis", $PositionLat+$pad, $Group2Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               $ConfigIntake = GUICtrlCreateButton("Configure the Intake Analysis", $PositionLat+2*$pad+$ButtonWidth, $Group2Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("The intake analysis will scan the computer system for any hardware, malware, software, or known issues. As well as compile a detailed report of recommended changes and/or fixes required to get the computer back to a better condition. (About 15+ minutes needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group2Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group3
            GUICtrlCreateGroup("", $PositionLat, $Group3Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Diagnostics", $PositionLat+$pad, $Group3Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the Diagnostics", $PositionLat+2*$pad+$ButtonWidth, $Group3Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("The diagnostics will run through various quality, error, and stress tests to multiple parts of the computer to enusre that all of the hardware is working at correct levels. If not it will provide options to fix/repair/replace the damaged parts. (About 3+ hours needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group3Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group4
            GUICtrlCreateGroup("", $PositionLat, $Group4Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Virus Removal", $PositionLat+$pad, $Group4Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the Virus Removal", $PositionLat+2*$pad+$ButtonWidth, $Group4Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("The virus removal scans and removes all forms of malware, including junkware, toolbars, and potentially unneeded programs as well. Using multiple scan engines it should remove all the of the malicious software and files from the computer. (About 2+ hours needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group4Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group5
            GUICtrlCreateGroup("", $PositionLat, $Group5Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) System Repair", $PositionLat+$pad, $Group5Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the System Repair", $PositionLat+2*$pad+$ButtonWidth, $Group5Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("Numerous system files and essential resources of Windows can become corrupted or not defined, which causes issues or failures. This will repair all or at least most of those files to get the system back to a correct runnable state. (About 1+ hours needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group5Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group6
            GUICtrlCreateGroup("", $PositionLat, $Group6Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) PC Tuneup", $PositionLat+$pad, $Group6Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the PC Tuneup", $PositionLat+2*$pad+$ButtonWidth, $Group6Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("Clutter and temporary files accumulate on the system as well as a lot of registry errors and drive fragmentation can occur over time. The pc tuneup will help to enhance settings on the system to increase the speed/startup time some. (About 30+ minutes needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group6Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)
            ;group7
            GUICtrlCreateGroup("", $PositionLat, $Group7Long, $GroupWidth, $GroupHeight)
               GUICtrlCreateCheckbox("(Select to run) Final Analysis", $PositionLat+$pad, $Group7Long+2*$pad, $ButtonWidth, $ButtonHeight, BitOR($BS_MULTILINE, $BS_PUSHLIKE))
               GUICtrlCreateButton("Configure the Final Analysis", $PositionLat+2*$pad+$ButtonWidth, $Group7Long+2*$pad, $ButtonWidth, $ButtonHeight, $BS_MULTILINE)
               GUICtrlCreateLabel("This final analysis report is like the intake analysis, but also includes extended information from the other full tasks, depending on which of them have been completed. As well as a comparison showing the changes from the intake analysis. (About 15+ minutes needed)", $PositionLat+3*$pad+2*$ButtonWidth, $Group7Long+$pad, $GroupWidth-3*$pad-2*$ButtonWidth, $ButtonHeight+2*$pad, $SS_LEFT)

         ;create a tab for tools now
         GUICtrlCreateTabItem("Tools")



   GUISetState() ; display the GUI
   Do
      $msg = GUIGetMsg()
         Select
            Case $msg = $ConfigIntake
               ;MsgBox(0, "You clicked on", "Yes")
               ConfigIntake()
         EndSelect
   Until $msg = $ExitButton

EndFunc   ;==>Main

Func ConfigIntake()
   Local $WindowWidth, $WindowHeight ;window dimensions
   Local $pad, $sizer ;spaces for the various objects
   Local $ApplyChanges
   $WindowWidth = 320
   $WindowHeight = 260
   $pad = 5
   $sizer = 7

   ; changed the following gui def to add a handle so it can be deleted later
   ;GUICreate("Configuration for the Intake Analysis", $WindowWidth, $WindowHeight, -1, -1, $WS_BORDER)
   local $APCH_GUI = GUICreate("Configuration for the Intake Analysis", $WindowWidth, $WindowHeight, -1, -1, $WS_BORDER)
   ;$ApplyChanges = GUICtrlCreateButton("Apply Changes", 200, 100, 200, 100)
   $ApplyChanges = GUICtrlCreateButton("Apply Changes", 20, 20, 280, 20)  ; <<<< ------ button was off the gui
   GUISetState()

   do
      $msg = GUIGetMsg()
   Until $msg = $ApplyChanges

    guidelete($APCH_GUI)    ; <<<-------------  to remove the gui
    return          ; <<<-------------  go back to who ever called you

EndFunc

post-81494-0-90582900-1382590156_thumb.p

Edited by Cigam

Share this post


Link to post
Share on other sites
kylomas

Cigam,

It looks better when I change the font to size "8".

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×