Jump to content

Skip a "module"


raedts
 Share

Recommended Posts

I am making a program that cleans your pc.

This program is made out of "Modules" there by i mean that there are 4 different programs separated by a line (;--------------------- easycleaner --------------------- etc).

Now i am making a menu with check boxes so the user can select what modules to be run.

Is there some kind of Goto command so when the program comes to a module which the user did deactivate it just goes to the next module?

This is the code of the menu.

#include <GUIConstants.au3>

$sluitccleaner = 0
GUICreate("Clean It 2 - How hello 2 u 2 how do u do?", 366, 125) 
GUISetIcon ("CI2.ico")
GUISetState(@SW_SHOW)
GuiCtrlCreatePic("logo.jpg",0,0, 366,125)
;SoundPlay ( "DATA\sound\cleanit2.wav",1)
;SoundPlay ( "DATA\sound\version.wav",1)
GUIDelete()

Opt("GUIOnEventMode", 1)  
$mainwindow = GUICreate("Clean It 2 - How hello 2 u 2 how do u do?", 400, 250) 
Guisetbkcolor (16777215)
GUISetIcon ("CI2.ico")
GuiCtrlCreatePic("head.jpg",0,0, 400,75)
Guictrlcreatelabel ("Version 0.55 BETA", 2, 235)

$start = GUICtrlCreateButton("", 300, 90,100,50, $BS_BITMAP)
$stop = Guictrlcreatebutton("", 300,150,100,50, $BS_BITMAP)
Guictrlsetimage($start, "DATA\afbeeldingen\start.bmp")
Guictrlsetimage($stop, "DATA\afbeeldingen\stop.bmp")
GUICtrlCreateLabel ("Modules", 50,80)
$easycleaner = GUICtrlCreateCheckbox ( "Easycleaner", 20, 100) 
$ccleaner = GUICtrlCreateCheckbox ( "CCleaner", 20, 120) 
$tweaknow = GUICtrlCreateCheckbox ( "Tweaknow Regcleaner", 20, 140) 
$ntregoptimizer = GUICtrlCreateCheckbox ( "Nt Regoptimizer", 20, 160) 
Guictrlsetstate($easycleaner, $GUI_CHECKED)
Guictrlsetstate($ccleaner, $GUI_CHECKED)
Guictrlsetstate($tweaknow, $GUI_CHECKED)
Guictrlsetstate($ntregoptimizer, $GUI_CHECKED)

$men = "stop"


GUICtrlSetOnEvent($start, "start")
Guictrlsetonevent($stop, "stop")
GUISetState(@SW_SHOW)

While 1
  Sleep(1000) ; Idle around
  if $men = "start" then exitloop
WEnd

Func start()
   $men = "start"
EndFunc

Func stop()
   exit
EndFunc
GUIDelete()
Link to comment
Share on other sites

I am making a program that cleans your pc.

This program is made out of "Modules" there by i mean that there are 4 different programs separated by a line (;--------------------- easycleaner --------------------- etc).

Now i am making a menu with check boxes so the user can select what modules to be run.

Is there some kind of Goto command so when the program comes to a module which the user did deactivate it just goes to the next module?

This is the code of the menu.

#include <GUIConstants.au3>

$sluitccleaner = 0
GUICreate("Clean It 2 - How hello 2 u 2 how do u do?", 366, 125) 
GUISetIcon ("CI2.ico")
GUISetState(@SW_SHOW)
GuiCtrlCreatePic("logo.jpg",0,0, 366,125)
;SoundPlay ( "DATA\sound\cleanit2.wav",1)
;SoundPlay ( "DATA\sound\version.wav",1)
GUIDelete()

Opt("GUIOnEventMode", 1)  
$mainwindow = GUICreate("Clean It 2 - How hello 2 u 2 how do u do?", 400, 250) 
Guisetbkcolor (16777215)
GUISetIcon ("CI2.ico")
GuiCtrlCreatePic("head.jpg",0,0, 400,75)
Guictrlcreatelabel ("Version 0.55 BETA", 2, 235)

$start = GUICtrlCreateButton("", 300, 90,100,50, $BS_BITMAP)
$stop = Guictrlcreatebutton("", 300,150,100,50, $BS_BITMAP)
Guictrlsetimage($start, "DATA\afbeeldingen\start.bmp")
Guictrlsetimage($stop, "DATA\afbeeldingen\stop.bmp")
GUICtrlCreateLabel ("Modules", 50,80)
$easycleaner = GUICtrlCreateCheckbox ( "Easycleaner", 20, 100) 
$ccleaner = GUICtrlCreateCheckbox ( "CCleaner", 20, 120) 
$tweaknow = GUICtrlCreateCheckbox ( "Tweaknow Regcleaner", 20, 140) 
$ntregoptimizer = GUICtrlCreateCheckbox ( "Nt Regoptimizer", 20, 160) 
Guictrlsetstate($easycleaner, $GUI_CHECKED)
Guictrlsetstate($ccleaner, $GUI_CHECKED)
Guictrlsetstate($tweaknow, $GUI_CHECKED)
Guictrlsetstate($ntregoptimizer, $GUI_CHECKED)

$men = "stop"
GUICtrlSetOnEvent($start, "start")
Guictrlsetonevent($stop, "stop")
GUISetState(@SW_SHOW)

While 1
  Sleep(1000); Idle around
  if $men = "start" then exitloop
WEnd

Func start()
   $men = "start"
EndFunc

Func stop()
   exit
EndFunc
GUIDelete()
there is no GOTO. just use conditions:

if GuiCtrlRead($Program1Checkbox) = $GUI_CHECKED Then InstallIt(1)
if GuiCtrlRead($Program2Checkbox) = $GUI_CHECKED Then InstallIt(2)
if GuiCtrlRead($Program3Checkbox) = $GUI_CHECKED Then InstallIt(3)
Func InstallIt($NoGoTo)
Select 
Case $NoGoTo = 1
      run(@temp& "\prog1\setup.exe)
Case $NoGoTo = 2
      run(@temp& "\prog2\setup.exe)
Case $NoGoTo = 3
      run(@temp& "\prog3\setup.exe)
EndSelect
EndFunc
Edited by cameronsdad
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...