Jump to content

progressbar


Recommended Posts

iam making a programm that can make a administrator to system administrator, the only thing iam missing here is the progressbar in the gui can someone help me with that

#include <GUIConstants.au3>
#include <Process.au3>


GUICreate("System Administrator", 258, 200)
Opt("GUICoordMode",2)
$Button_1 = GUICtrlCreateButton ("System Administrator",  10, 40, 120)
$Button_2 = GUICtrlCreateButton ( "Normal administrator",  0, -1)


GUISetState ()


While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1
$rc = _RunDos('at '&@HOUR&':'&@MIN+1&' /interactive "cmd.exe"')
while 1
if WinExists("C:\WINDOWS\System32\svchost.exe") Then
ProcessClose("explorer.exe")
ProcessWaitClose("explorer.exe")
WinActivate("C:\WINDOWS\System32\svchost.exe")
WinWaitActive("C:\WINDOWS\System32\svchost.exe")
send("explorer.exe")
send("{ENTER}")
send("exit")
send("{ENTER}")
EndIf
WEnd
Case $msg = $Button_2
$rc = _RunDos("taskkill /f /IM explorer.exe")
Sleep("1000")
$rc = _RunDos("explorer.exe")
EndSelect
Wend
Link to comment
Share on other sites

iam making a programm that can make a administrator to system administrator, the only thing iam missing here is the progressbar in the gui can someone help me with that

#include <GUIConstants.au3>
#include <Process.au3>
GUICreate("System Administrator", 258, 200)
Opt("GUICoordMode",2)
$Button_1 = GUICtrlCreateButton ("System Administrator",  10, 40, 120)
$Button_2 = GUICtrlCreateButton ( "Normal administrator",  0, -1)
GUISetState ()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1
$rc = _RunDos('at '&@HOUR&':'&@MIN+1&' /interactive "cmd.exe"')
while 1
if WinExists("C:\WINDOWS\System32\svchost.exe") Then
ProcessClose("explorer.exe")
ProcessWaitClose("explorer.exe")
WinActivate("C:\WINDOWS\System32\svchost.exe")
WinWaitActive("C:\WINDOWS\System32\svchost.exe")
send("explorer.exe")
send("{ENTER}")
send("exit")
send("{ENTER}")
EndIf
WEnd
Case $msg = $Button_2
$rc = _RunDos("taskkill /f /IM explorer.exe")
Sleep("1000")
$rc = _RunDos("explorer.exe")
EndSelect
Wend
Hi,

What do you want to see in progress?

Is the time to process to end?

Can you be more specific?

Cheers

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

i wanna see a normal bar see the example from "ProgressOn" i dont know how to intigrate it into my gui

Do you mean to say you want to progress bar literally integrated into your GUI? I.E you want the bar to be a part of the gui and not have its own dialog?

Dave

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------"I don't need to know everything, I just need to know where to find it when I need it"....EinsteinAnd in our case... That's the AutoIT helpfile ;) Please read before posting!!!

Link to comment
Share on other sites

i wanna see a normal bar see the example from "ProgressOn" i dont know how to intigrate it into my gui

Hi again,

Try this code then!

#include <GUIConstants.au3>
#include <Process.au3>
GUICreate("System Administrator", 258, 200)
$x = 1
;Opt("GUICoordMode",2)
$Button_1 = GUICtrlCreateButton ("System Administrator", 10, 40, 120)
$Button_2 = GUICtrlCreateButton ( "Normal administrator", 130,40, 120)
$progress = GUICtrlCreateProgress ( 20, 100, 200, 20, $PBS_SMOOTH,$WS_EX_WINDOWEDGE  );Creates progress bar
GUISetState ()
While 1
    $msg = GUIGetMsg()
            Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Button_1
                $rc = _RunDos('at '&@HOUR&':'&@MIN+1&' /interactive "cmd.exe"')
                    while 1
                        if WinExists("C:\WINDOWS\System32\svchost.exe") Then
                            ProcessClose("explorer.exe")
                            ProcessWaitClose("explorer.exe")
                            WinActivate("C:\WINDOWS\System32\svchost.exe")
                            WinWaitActive("C:\WINDOWS\System32\svchost.exe")
                            send("explorer.exe")
                            send("{ENTER}")
                            send("exit")
                            send("{ENTER}")
                        EndIf
                    WEnd
            Case $msg = $Button_2
                $rc = _RunDos("taskkill /f /IM explorer.exe")
                Sleep("1000")
                $rc = _RunDos("explorer.exe")
        EndSelect
        $x = $x + 1 
        ;for $x = 1 to 100 Step 1
            GUICtrlSetData($progress, $x)
                if $x = 100 then 
                    $x= 0
                EndIf
            Sleep(10)
        ;next
Wend

Cheers!

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

thx for the help

Well i beliave that helped :)

Cheers

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

i completed the programme thx for helping me

#include <GUIConstants.au3>
#include <Process.au3>
#NoTrayIcon
#RequireAdmin
GUICreate("System Administrator", 258, 200)
$x = 1
$Button_1 = GUICtrlCreateButton ("System Administrator", 10, 40, 120)
$Button_2 = GUICtrlCreateButton ( "Normal administrator", 130,40, 120)
$progress = GUICtrlCreateProgress ( 20, 100, 200, 20, $PBS_SMOOTH,$WS_EX_WINDOWEDGE  );Creates progress bar
GUISetState ()
While 1
    $msg = GUIGetMsg()
            Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            
Case $msg = $Button_1
GUICtrlSetData($progress, 0)
Sleep("500")
GUICtrlSetData($progress, 10)
$rc = _RunDos('at '&@HOUR&':'&@MIN+1&' /interactive "cmd.exe"')
while 2
if WinExists("C:\WINDOWS\System32\svchost.exe")Then
GUICtrlSetData($progress, 20)
$rc3 = _RunDos("taskkill /f /IM explorer.exe")
GUICtrlSetData($progress, 30)
WinActivate("C:\WINDOWS\System32\svchost.exe")
GUICtrlSetData($progress, 40)
WinWaitActive("C:\WINDOWS\System32\svchost.exe")
GUICtrlSetData($progress, 50)
send("explorer.exe")
GUICtrlSetData($progress, 60)
send("{ENTER}")
GUICtrlSetData($progress, 70)
send("exit")
GUICtrlSetData($progress, 80)
send("{ENTER}")
GUICtrlSetData($progress, 90)
GUICtrlSetData($progress, 100)
Sleep("1000")
ProgressOff()
exitloop 1
EndIf
WEnd

Case $msg = $Button_2
GUICtrlSetData($progress, 0)
$rc = _RunDos("taskkill /f /IM explorer.exe")
GUICtrlSetData($progress, 50)
Sleep("1000")
GUICtrlSetData($progress, 100)
Run("explorer.exe")
ProgressOff()

                
                

EndSelect
Wend
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...