Jump to content

Nucleus

Members
  • Posts

    15
  • Joined

  • Last visited

Nucleus's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Come to think of it, the question should be, how do I combine your code, with mine?
  2. It seems to be working very nice. The only problem is that, to get the status of the service, I have to press the button. It should be able to automatically get the status of the service, when I start or stop a service by clicking on the buttons on this form. #include <GuiConstants.au3> If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("CYCMS WebServer v0.21",350,350) $Filemenu = GuiCtrlCreateMenu ("File") $Exititem = GuiCtrlCreateMenuitem ("Exit",$Filemenu) $Toolmenu = GuiCtrlCreateMenu ("Tools") $Toolitem = GuiCtrlCreateMenuitem ("IP Detect",$Toolmenu) $Helpmenu = GuiCtrlCreateMenu ("Help") $Helpitem = GuiCtrlCreateMenuitem ("Help Topics",$Helpmenu) $Aboutitem = GuiCtrlCreateMenuitem ("About CYCMS WebServer",$Helpmenu) $Separator1 = GuiCtrlCreateMenuitem ("",$Helpmenu) $Homepageitem = GuiCtrlCreateMenuitem ("CYCMS WebServer Homepage",$Helpmenu) $Button1 = GuiCtrlCreateButton("Start Apache", 100, 40, 75, 25) $Button2 = GuiCtrlCreateButton("Stop Apache", 100, 72, 75, 25) $Button3 = GuiCtrlCreateButton("Start MySQL", 177, 40, 75, 25) $Button4 = GuiCtrlCreateButton("Stop MySQL", 177, 72, 75, 25) $Button5 = GuiCtrlCreateButton("Configure PHPMyAdmin", 177, 160, 125, 25) $Button6 = GuiCtrlCreateButton("Configure MySQL", 177, 128, 125, 25) $Button7 = GuiCtrlCreateButton("Configure Apache", 50, 128, 125, 25) $Button8 = GuiCtrlCreateButton("Configure PHP", 50, 160, 125, 25) $Button9 = GuiCtrlCreateButton("Open Localhost", 50, 190, 125, 25) $Button10 = GuiCtrlCreateButton("Open PHPMyAdmin", 177, 190, 125, 25) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $MSG = $Button1 Run(@ComSpec & " /c " & 'net start Apache2', "", @SW_HIDE) Run("ProgressBar.exe") Case $MSG = $Button2 Run(@ComSpec & " /c " & 'net stop Apache2', "", @SW_HIDE) Run("ProgressBar.exe") Case $MSG = $Button3 Run(@ComSpec & " /c " & 'net start MySQL', "", @SW_HIDE) Run("ProgressBar.exe") Case $MSG = $Button4 Run(@ComSpec & " /c " & 'net stop MySQL', "", @SW_HIDE) Run("ProgressBar.exe") Case $MSG = $Button5 Run("C:\webserver\services\3rdparty\Wordpad.exe C:\webserver\wwwroot\phpmyadmin\config.default.php") Case $MSG = $Button6 Run("C:\webserver\services\3rdparty\Wordpad.exe C:\WINDOWS\my.ini") Case $MSG = $Button7 Run("C:\webserver\services\3rdparty\Wordpad.exe C:\webserver\Apache2\conf\httpd.conf") Case $MSG = $Button8 Run("C:\webserver\services\3rdparty\Wordpad.exe C:\WINDOWS\php.ini") Case $MSG = $Button9 Run (@ComSpec & ' /c start explorer http://localhost/', "", @SW_HIDE) Case $MSG = $Button10 Run (@ComSpec & ' /c start explorer http://localhost/phpmyadmin/', "", @SW_HIDE) Case $MSG = $Toolitem Run (@ComSpec & ' /c start explorer http://www.whatismyip.com/', "", @SW_HIDE) Case $MSG = $Helpitem Run (@ComSpec & ' /c start explorer C:\webserver\services\htmlhelp\index.html', "", @SW_HIDE) Case $MSG = $Aboutitem Msgbox(0,"About CYCMS WebServer","CYCMS WebServer Version 0.21") Case $MSG = $Homepageitem Run (@ComSpec & ' /c start explorer http://www.cypruscms.com/', "", @SW_HIDE) Case $MSG = $Exititem ExitLoop Case Else ;;; EndSelect WEnd Exit
  3. I am asking about somehow detecting if a service is started or stopped, and displaying a red or green light, depending on the status of the service.
  4. I have found a way to solve the progress bar problem, by using an example I found on this site. ProgressOn("Processing Service", "Status...", "0 percent") For $i = 10 to 100 step 10 sleep(300) ProgressSet( $i, $i & " percent") Next ProgressSet(100 , "Done", "Complete") sleep(500) ProgressOff() Compiled as exe, and run when a Start/Stop Service button is pressed. So that it appears as if the process is starting or stopping. eg. Case $MSG = $Button1 Run(@ComSpec & " /c " & 'net start Apache2', "", @SW_HIDE) Run("ProgressBar.exe") However if the process fails to start, it will not report it, that's why I need to implement the red/green indicators. I haven't found a way to do it though, because of my minimal experience with autoit. Examples anyone?
  5. When using this Run (@ComSpec & '/c start http://www.site.com/', "", @SW_HIDE) I get the following error.
  6. Ok let's take out the progress bar, just the indicators configuration. How can i do that?
  7. This is my first attempt to create a GUI, and I must say its very exiting to discover such an easy way to create something out of nothing. I tried doing the same thing with Visual basic, but that was WAY too complicated. With autoit, so far I have learned how to create buttons, how to start an application using a button, how to hide the command prompt window from appearing, when executing a command and creating menus/submenus. So, my first project is to create a web server control GUI. Someting lke this. What I don't know how to do, is make the progress bar indicate when Apache and MySQL services are starting and stopping. I also need some kind of indicator to show if Apache and MySQL are started or stopped. Maybe a green and a red dot or something. And last, how do Imake the html files open with the deafult html viewer insted of IE like I have it configured now? This is what i have so far. #include <GuiConstants.au3> If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("CYCMS WebServer v0.21", 270, 250, 400,250 ,BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Filemenu = GuiCtrlCreateMenu ("File") $Exititem = GuiCtrlCreateMenuitem ("Exit",$Filemenu) $Toolmenu = GuiCtrlCreateMenu ("Tools") $Toolitem = GuiCtrlCreateMenuitem ("IP Detect",$Toolmenu) $Helpmenu = GuiCtrlCreateMenu ("Help") $Helpitem = GuiCtrlCreateMenuitem ("Help Topics",$Helpmenu) $Aboutitem = GuiCtrlCreateMenuitem ("About CYCMS WebServer",$Helpmenu) $Separator1 = GuiCtrlCreateMenuitem ("",$Helpmenu) $Homepageitem = GuiCtrlCreateMenuitem ("CYCMS WebServer Homepage",$Helpmenu) $Button1 = GuiCtrlCreateButton("Start Apache", 56, 40, 75, 25) $Button2 = GuiCtrlCreateButton("Stop Apache", 56, 72, 75, 25) $Button3 = GuiCtrlCreateButton("Start MySQL", 136, 40, 75, 25) $Button4 = GuiCtrlCreateButton("Stop MySQL", 136, 72, 75, 25) $Button5 = GuiCtrlCreateButton("Configure PHPMyAdmin", 136, 160, 123, 25) $Button6 = GuiCtrlCreateButton("Configure MySQL", 136, 128, 123, 25) $Button7 = GuiCtrlCreateButton("Configure Apache", 8, 128, 123, 25) $Button8 = GuiCtrlCreateButton("Configure PHP", 8, 160, 123, 25) $Button9 = GuiCtrlCreateButton("Open Localhost", 8, 190, 123, 25) $Button10 = GuiCtrlCreateButton("Open PHPMyAdmin", 136, 190, 123, 25) $ProgressBar1 = GuiCtrlCreateProgress(56, 104, 158, 16) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $MSG = $Button1 Run(@ComSpec & " /c " & 'net start Apache2', "", @SW_HIDE) Case $MSG = $Button2 Run(@ComSpec & " /c " & 'net stop Apache2', "", @SW_HIDE) Case $MSG = $Button3 Run(@ComSpec & " /c " & 'net start MySQL', "", @SW_HIDE) Case $MSG = $Button4 Run(@ComSpec & " /c " & 'net stop MySQL', "", @SW_HIDE) Case $MSG = $Button5 Run("C:\webserver\services\3rdparty\Wordpad.exe C:\webserver\wwwroot\phpmyadmin\config.default.php") Case $MSG = $Button6 Run("C:\webserver\services\3rdparty\Wordpad.exe C:\WINDOWS\my.ini") Case $MSG = $Button7 Run("C:\webserver\services\3rdparty\Wordpad.exe C:\webserver\Apache2\conf\httpd.conf") Case $MSG = $Button8 Run("C:\webserver\services\3rdparty\Wordpad.exe C:\WINDOWS\php.ini") Case $MSG = $Button9 Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE http://localhost/") Case $MSG = $Button10 Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE http://localhost/phpmyadmin/") Case $MSG = $Exititem ExitLoop Case $MSG = $Toolitem Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.whatismyip.com/") Case $MSG = $Helpitem Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE C:\webserver\services\htmlhelp\index.html") Case $MSG = $Aboutitem Msgbox(0,"About CYCMS WebServer","CYCMS WebServer Version 0.21") Case $MSG = $Homepageitem Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.cypruscms.com/") Case Else ;;; EndSelect WEnd Exit Thank you.
  8. Could you please describe exactly the process of doing this?
  9. You were right to be pissed with bitdefender. It's really annoying trying to register bitdefender using an autoit script, while bitdefender stopping it from running because it detects it as a virus. That totally screwed up my unattended installation. I don't suppose there's a workaround this problem??
  10. Thank you very much for your replies. I have tested both scripts. The first one works just fine. The second one gives me 2 error messages. If I'm guessing right, the second one should be better than the first one? Gives back feedback? Anyway, I will use which ever one you tell me.
  11. Hello, I am very new to autoit, i have no experience whatsoever, and the only method i used to create any autoit scripts i have created, is by using the SciTe ScriptWriter tool, which is no good with this program, and that is why i need your help. After the installation of BitDefender 9 Professional Plus, 2 screens appear, instead of 4 in BitDefender 8 Professional Plus. and I have tried modifying the the old AutoIT (that worked with BitDefender 8 Professional Plus), but that crashed and burned. The AutoIT window Info tool shows no Control ID: or Text: So i was told instead of using controlclick to use mouseclick. HELP! How?
×
×
  • Create New...