Jump to content
Sign in to follow this  
egymma

Window Ender

Recommended Posts

egymma

I hope you like it

Posted Image

Posted Image

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.0.0
 Author:         egymma [Mohamed Ashraf]

 Script Function:
    Close,Hide and Show running window or not responding window + more tools.

#ce ----------------------------------------------------------------------------

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=FILER.ICO
#AutoIt3Wrapper_Outfile=WE V0.12.exe
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_Res_Fileversion=0.0.0.20
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=y
#AutoIt3Wrapper_Run_Tidy=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; *** Start added by AutoIt3Wrapper ***
#include <ListViewConstants.au3>
; *** End added by AutoIt3Wrapper ***
#include <GUIConstants.au3>
#include <ProgressConstants.au3>
#include <GuiListView.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <GuiButton.au3>
#include <GuiStatusBar.au3>

Dim $vlist
Dim $hlist
Dim $abort
Dim $flash
Dim $memval


$font = "Arial"

Global $defaultstatus = "Ready"
Global $status

HotKeySet("^+!{f8}", "mma")


$timer = 1
$me = "Window Ender"
$ver = "v0.12"
$vlist = 0
$hlist = 0
$s = 0
Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown.
Opt("GUIDataSeparatorChar", "")

$start_check = WinGetProcess($me)
If ProcessExists($start_check) Then

    $ok = MsgBox(4 + 8192 + 262144 + 48, $me, "Window Ender allready running, Do you want to reopen it ?")
    If $ok = 7 Then Exit
    If $ok = 6 Then
        ProcessClose($start_check)
    EndIf
EndIf



$max = TrayCreateItem("Show")
TrayItemSetState($max, $TRAY_DISABLE)
$min = TrayCreateItem("Hide")
TrayCreateItem("", -1)
$tshutdown = TrayCreateItem("Shutdown")
$trestart = TrayCreateItem("Restart")
TrayCreateItem("", -1)
$aboutitem = TrayCreateItem("About")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")


TraySetState()
TraySetClick(16)
TrayItemSetState($min, $TRAY_DEFAULT)


$gui = GUICreate($me, 600, 490, -1, -1)




$file = GUICtrlCreateMenu("&File")
$menu_exit = GUICtrlCreateMenuItem("Exit", $file)

$view = GUICtrlCreateMenu("View")
$menu_hide = GUICtrlCreateMenuItem("Hide", $view)
GUICtrlCreateMenuItem("", $view)
$viewstatus = GUICtrlCreateMenuItem("Statusbar", $view)
GUICtrlSetState(-1, $GUI_CHECKED)
$help = GUICtrlCreateMenu("Help")
$menu_about = GUICtrlCreateMenuItem("About", $help)








$visibleprogramlist = GUICtrlCreateListView("Opened Windows                     ", 10, 35, 180, 300, $LVS_SORTASCENDING + $LVS_REPORT + $LVS_SINGLESEL)
$hiddenprogramlist = GUICtrlCreateListView("Opened Windows                     ", 200, 35, 180, 300, $LVS_SORTASCENDING + $LVS_REPORT + $LVS_SINGLESEL)




$vscan = GUICtrlCreateButton("Scan", 398, 55, 80)
$vhide = GUICtrlCreateButton("Hide", 398, 85, 80)
$vshow = GUICtrlCreateButton("Show", 398, 115, 80)

$hscan = GUICtrlCreateButton("Scan", 502, 55, 80)
$hhide = GUICtrlCreateButton("Hide", 502, 85, 80)
$hshow = GUICtrlCreateButton("Show", 502, 115, 80)

$sys = GUICtrlCreateButton("System Properties", 391, 250, 97)
$msconfig = GUICtrlCreateButton("MS Config", 488, 250, 97)
$sfc = GUICtrlCreateButton("System File Check", 391, 275, 97)
$regedit = GUICtrlCreateButton("Registry Editor", 488, 275, 97)
$tmgr = GUICtrlCreateButton("Task Manager", 391, 300, 97)
$compmgmt = GUICtrlCreateButton("Comp. Manage.", 488, 300, 97) ;compmgmt.msc
;~ GUICtrlSetFont($compmgmt,7.5,350)
$rstrui = GUICtrlCreateButton("System Restore", 391, 325, 97)
$eventvwr = GUICtrlCreateButton("Event Viewer", 488, 325, 97)



$shutdown = GUICtrlCreateButton("Force Shutdown", 391, 370, 97)
$restart = GUICtrlCreateButton("Force Restart", 488, 370, 97)



GUICtrlCreateGroup("Visible Windows", 388, 35, 100, 110)
GUICtrlCreateGroup("ALL Windows", 492, 35, 100, 110)
GUICtrlCreateGroup("Visible Windows", 13, 340, 174, 100)
GUICtrlCreateGroup("All Windows", 203, 340, 174, 100)
GUICtrlCreateGroup("Windows Tools", 388, 230, 200, 170)
$memval = "0"
$memgroup = GUICtrlCreateGroup("Memory Usage : (" & $memval & "%) ", 388, 150, 200, 55)

$membar = GUICtrlCreateProgress(393, 170, 190, 25)

$vend = GUICtrlCreateButton("End Window", 40, 355, 120, 23)
$vpend = GUICtrlCreateButton("Process Terminate", 40, 382, 120, 23)
$vclear = GUICtrlCreateButton("Clear List", 40, 410, 120, 23)

$hend = GUICtrlCreateButton("End Window", 230, 355, 120, 23)
$hpend = GUICtrlCreateButton("Process Terminate", 230, 382, 120, 23)
$hclear = GUICtrlCreateButton("Clear List", 230, 410, 120, 23)

GUICtrlCreateLabel("Visible Windows", 55, 10, -1, -1, $WS_BORDER + $SS_CENTER)
GUICtrlCreateLabel("All Windows", 255, 10, -1, -1, $WS_BORDER + $SS_CENTER)


$priority = WinGetProcess($me)
ProcessSetPriority($priority, 4)





Func about()
    MsgBox(8192 + 262144 + 64, $me & " " & $ver, "Coded by Mohamed Ashraf. All rights reserved" & @CRLF & "برمجة محمد اشرف. جميع الحقوق محفوظة" & @CRLF & "May 20, 2009")
;~  MsgBox(8192 + 64 + 262144, $me & " " & $ver, "Coded by 'Mohamed Ashraf'")
EndFunc   ;==>about


Func vlist()
    $visibleprogramlist = GUICtrlCreateListView("Opened Windows                     ", 10, 35, 180, 300, $LVS_SORTASCENDING + $LVS_REPORT + $LVS_SINGLESEL)
EndFunc   ;==>vlist

Func hlist()
    $hiddenprogramlist = GUICtrlCreateListView("Opened Windows                     ", 200, 35, 180, 300, $LVS_SORTASCENDING + $LVS_REPORT + $LVS_SINGLESEL)
EndFunc   ;==>hlist

Func disable()
    GUISetState(@SW_DISABLE)
EndFunc   ;==>disable

Func enable()
    GUISetState(@SW_ENABLE)
;~  WinActivate($me)
EndFunc   ;==>enable

Func activate()
    WinActivate($me)
EndFunc   ;==>activate


Func IsVisible($handle)
    If BitAND(WinGetState($handle), 2) Then
        Return 1
    Else
        Return 0
    EndIf

EndFunc   ;==>IsVisible

Func vscan()
    ;;;;;;;;;;;;;;;;;visible;;;;;;;;;;;;;;
    GUICtrlDelete($visibleprogramlist)
    vlist()

    $vlist = WinList()
    For $i = 1 To $vlist[0][0]

        If $vlist[$i][0] <> "" And IsVisible($vlist[$i][1]) And $vlist[$i][0] <> ($me) And $vlist[$i][0] <> ("AutoIt v3") Then
            GUICtrlCreateListViewItem($vlist[$i][0], $visibleprogramlist)
        EndIf
    Next
EndFunc   ;==>vscan
;;;;;;;;;;;;;;;;;;;;Hidden;;;;;;;;;;;;;;;
Func hscan()
    GUICtrlDelete($hiddenprogramlist)
    hlist()

    $hlist = WinList()
    $mma = GUICtrlRead(GUICtrlRead($visibleprogramlist))

    For $i = 1 To $hlist[0][0]

        If $hlist[$i][0] <> "" And $hlist[$i][0] <> ($me) And $hlist[$i][0] <> ("AutoIt v3") Then
            $mma2 = GUICtrlCreateListViewItem($hlist[$i][0], $hiddenprogramlist)
        EndIf
    Next
EndFunc   ;==>hscan

Func mma()
    Exit
EndFunc   ;==>mma




$StatusBar = _GUICtrlStatusBar_Create($gui, -1, $defaultstatus)
;~ _GUICtrlStatusBar_SetText($StatusBar, "Ready...")
GUISetState()

Func vstatusprogress()
    $but = GUICtrlRead($vend)
    GUICtrlSetData($vend, "Abort..")
    $ProgressBar = GUICtrlCreateProgress(390, 408, 190, 30, $PBS_SMOOTH)
    For $i = 0 To 100
        _GUICtrlStatusBar_SetText($StatusBar, "Ending window in progress...")
        GUICtrlSetData($ProgressBar, $i)
        Sleep(15)
        $m = GUIGetMsg()
        If $m = $vend Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Aborted...")
            $abort = 0
            $timer = -400
            ExitLoop

        ElseIf $i = 100 Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Waiting for result...")
            $abort = 1
            ExitLoop
        EndIf
    Next

    GUICtrlSetData($vend, $but)
EndFunc   ;==>vstatusprogress


Func hstatusprogress()
    $but = GUICtrlRead($hend)
    GUICtrlSetData($hend, "Abort..")
    $ProgressBar = GUICtrlCreateProgress(390, 408, 190, 30, $PBS_SMOOTH)
    For $i = 0 To 100
        _GUICtrlStatusBar_SetText($StatusBar, "Ending window in progress...")
        GUICtrlSetData($ProgressBar, $i)
        Sleep(15)
        $m = GUIGetMsg()
        If $m = $hend Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Aborted...")
            $abort = 0
            $timer = -400
            ExitLoop

        ElseIf $i = 100 Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Waiting for result...")
            $abort = 1
            ExitLoop
        EndIf
    Next

    GUICtrlSetData($hend, $but)
EndFunc   ;==>hstatusprogress

Func vpstatusprogress()
    $but = GUICtrlRead($vpend)
    GUICtrlSetData($vpend, "Abort..")
    $ProgressBar = GUICtrlCreateProgress(390, 408, 190, 30, $PBS_SMOOTH)
    For $i = 0 To 100
        _GUICtrlStatusBar_SetText($StatusBar, "Terminating window in progress...")
        GUICtrlSetData($ProgressBar, $i)
        Sleep(15)
        $m = GUIGetMsg()
        If $m = $vpend Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Aborted...")
            $abort = 0
            ExitLoop

        ElseIf $i = 100 Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Waiting for result...")
            $abort = 1
            ExitLoop
        EndIf
    Next

    GUICtrlSetData($vpend, $but)
EndFunc   ;==>vpstatusprogress

Func hpstatusprogress()
    $but = GUICtrlRead($hpend)
    GUICtrlSetData($hpend, "Abort..")
    $ProgressBar = GUICtrlCreateProgress(390, 408, 190, 30, $PBS_SMOOTH)
    For $i = 0 To 100
        _GUICtrlStatusBar_SetText($StatusBar, "Terminating window in progress...")
        GUICtrlSetData($ProgressBar, $i)
        Sleep(15)
        $m = GUIGetMsg()
        If $m = $hpend Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Aborted...")
            $abort = 0
            ExitLoop

        ElseIf $i = 100 Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Waiting for result...")
            $abort = 1
            ExitLoop
        EndIf
    Next

    GUICtrlSetData($hpend, $but)
EndFunc   ;==>hpstatusprogress

Func hide()
    GUISetState(@SW_HIDE)
    TrayItemSetState($min, $TRAY_DISABLE)
    TrayItemSetState($max, $tray_enable)
    TrayItemSetState($max, $TRAY_DEFAULT)
EndFunc   ;==>hide

Func show()
    GUISetState(@SW_SHOW)
    TrayItemSetState($max, $TRAY_DISABLE)
    TrayItemSetState($min, $tray_enable)
    TrayItemSetState($min, $TRAY_DEFAULT)
EndFunc   ;==>show


Func trayflash()

    TraySetState(4)
    For $flash = 0 To 200


        $tray = TrayGetMsg()

        If $tray = $TRAY_EVENT_SECONDARYUP Then
            TraySetState(8)
            ExitLoop
        ElseIf $tray = $TRAY_EVENT_PRIMARYUP Then
            TraySetState(8)
            ExitLoop
;~      ElseIf $tray = $max Then
;~          TraySetState(8)
;~          show()
;~          ExitLoop


        EndIf
    Next
    TraySetState(8)
EndFunc   ;==>trayflash

Func Shutdownprogress()
    $but = GUICtrlRead($shutdown)
    GUICtrlSetData($shutdown, "Abort..")
    $ProgressBar = GUICtrlCreateProgress(390, 408, 190, 30, $PBS_SMOOTH)
    For $i = 0 To 100
        _GUICtrlStatusBar_SetText($StatusBar, "Shutdown...")
        GUICtrlSetData($ProgressBar, $i)
        Sleep(40)
        $msg = GUIGetMsg()
        If $msg = $shutdown Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Aborted...")
            $abort = 0
            $timer = -400
            ExitLoop

        ElseIf $i = 100 Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Waiting for result...")
            $abort = 1
            ExitLoop
        EndIf
    Next

    GUICtrlSetData($shutdown, $but)
EndFunc   ;==>Shutdownprogress


Func restartprogress()
    $but = GUICtrlRead($restart)
    GUICtrlSetData($restart, "Abort..")
    $ProgressBar = GUICtrlCreateProgress(390, 408, 190, 30, $PBS_SMOOTH)
    For $i = 0 To 100
        _GUICtrlStatusBar_SetText($StatusBar, "Restart...")
        GUICtrlSetData($ProgressBar, $i)
        Sleep(40)
        $msg = GUIGetMsg()
        If $msg = $restart Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Aborted...")
            $abort = 0
            $timer = -400
            ExitLoop

        ElseIf $i = 100 Then
            GUICtrlDelete($ProgressBar)
            _GUICtrlStatusBar_SetText($StatusBar, "Waiting for result...")
            $abort = 1
            ExitLoop
        EndIf
    Next

    GUICtrlSetData($restart, $but)
EndFunc   ;==>restartprogress


While 1


    $timer = $timer + 1

    If $timer = 1 Then
        _GUICtrlStatusBar_SetText($StatusBar, "Ready")
    ElseIf $timer = 45 Then
        _GUICtrlStatusBar_SetText($StatusBar, "Ready.")
    ElseIf $timer = 90 Then
        _GUICtrlStatusBar_SetText($StatusBar, "Ready..")
    ElseIf $timer = 135 Then
        _GUICtrlStatusBar_SetText($StatusBar, "Ready...")
    ElseIf $timer = 180 Then
        $timer = 0
    EndIf

    $msg = GUIGetMsg()
    $tray = TrayGetMsg()
    $mem = MemGetStats()

    GUICtrlSetData($membar, $mem[0])
    GUICtrlSetColor($membar, 0xff0000)
    If $memval <> $mem[0] Then
        GUICtrlSetData($memgroup, "Memory Usage : (" & $mem[0] & "%) ")
        $memval = $mem[0]
    EndIf

    Select

        Case $msg = $GUI_EVENT_CLOSE
            Exit

        Case $msg = $vscan

            vscan()

        Case $msg = $hscan

            hscan()


        Case $msg = $vend
            $mma = GUICtrlRead(GUICtrlRead($visibleprogramlist))
            $title = $mma
;~          MsgBox(0, "", $title)
            If $mma <> "" Then
                $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to close '" & $title & "'")
                If $ok = 1 Then
                    vstatusprogress()
                    If $abort = 1 Then
                        $handelended = WinGetHandle($mma)
                        $mm = WinGetProcess($mma)
                        ProcessSetPriority($mm, 0)
                        WinClose($mma)
                        $1 = WinWaitClose($mma, "", 3)
                        $yyy = WinGetHandle($mma)
                        If $yyy = $handelended Then
                            MsgBox(8192 + 262144, $me, """" & $title & """ Still opened please try 'Process Terminate'.")
                            _GUICtrlStatusBar_SetText($StatusBar, """" & $title & """ Still opened please try 'Process Terminate'.")
                            vscan()
                            If $hlist <> 0 Then hscan()
                            $timer = -800
                        ElseIf $handelended = "" Then
                            MsgBox(8192 + 262144, $me, "There is no window to close.")
                            _GUICtrlStatusBar_SetText($StatusBar, "There is no window to close.")
                            $timer = -800
                        ElseIf $1 = 0 Then
                            $yyy = WinGetHandle($mma)
                            MsgBox(8192 + 262144, $me, """" & $title & """ Ended Successfully, And there is window with the same name is opened !")
                            _GUICtrlStatusBar_SetText($StatusBar, """" & $title & """ Ended Successfully, And there is window with the same name is opened !")
                            vscan()
                            If $hlist <> 0 Then hscan()
                            $timer = -800
                            ;activate()


                        ElseIf $yyy <> $handelended Then
                            If $hlist <> 0 Then hscan()
                            vscan()
                            _GUICtrlStatusBar_SetText($StatusBar, """" & $title & """ Ended Successfully.")
                            $timer = -800
                        EndIf
                    EndIf
                EndIf
            EndIf




        Case $msg = $vpend

            $mma = GUICtrlRead(GUICtrlRead($visibleprogramlist))
            $title = $mma
            If $mma <> "" Then
                $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to terminate '" & $title & "'")
                If $ok = 1 Then
                    vpstatusprogress()
                    If $abort = 1 Then
                        $handelended = WinGetHandle($mma)
                        $mm = WinGetProcess($mma)
                        ProcessSetPriority($mm, 0)
                        ProcessClose($mm)
                        $1 = WinWaitClose($mma, "", 3)
                        $yyy = WinGetHandle($mma)
                        If $1 = 0 Then
                            MsgBox(8192 + 262144, $me, """" & $title & """ Terminated Successfully, And there is window with the same name is opened !")
                            _GUICtrlStatusBar_SetText($StatusBar, """" & $title & """ Terminated Successfully, And there is window with the same name is opened !")
                            vscan()
                            If $hlist <> 0 Then hscan()
                            $timer = -800
                            ;activate()
                        ElseIf $yyy <> $handelended Then
                            vscan()
                            If $hlist <> 0 Then hscan()

                            _GUICtrlStatusBar_SetText($StatusBar, """" & $title & """ Terminated successfully.")
                            $timer = -800
                        EndIf
                    EndIf
                EndIf
            EndIf


        Case $msg = $hend

            $mma = GUICtrlRead(GUICtrlRead($hiddenprogramlist))
            $title = $mma
            If $mma <> "" Then
                $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to close '" & $title & "'")
                If $ok = 1 Then
                    hstatusprogress()
                    If $abort = 1 Then
                        $handelended = WinGetHandle($mma)
                        $mm = WinGetProcess($mma)
                        ProcessSetPriority($mm, 0)
                        WinClose($mma)
                        $1 = WinWaitClose($mma, "", 3)
                        $yyy = WinGetHandle($mma)
                        If $yyy = $handelended Then
                            MsgBox(8192 + 262144, $me, """" & $title & """ Still opened please try 'Process Terminate'.")
                            _GUICtrlStatusBar_SetText($StatusBar, """" & $title & """ Still opened please try 'Process Terminate'.")
                            $timer = -800
                        ElseIf $handelended = "" Then
                            MsgBox(8192 + 262144, $me, "There is no window to close.")
                            _GUICtrlStatusBar_SetText($StatusBar, "There is no window to close.")
                            $timer = -800
                        ElseIf $1 = 0 Then
                            $yyy = WinGetHandle($mma)
                            MsgBox(8192 + 262144, $me, """" & $title & """ Ended Successfully, And there is window with the same name is opened !")
                            _GUICtrlStatusBar_SetText($StatusBar, """" & $title & """ Ended Successfully, And there is window with the same name is opened !")
                            hscan()
                            If $vlist <> 0 Then vscan()
                            $timer = -800

                        ElseIf $yyy <> $handelended Then
                            hscan()
                            If $vlist <> 0 Then vscan()
                            _GUICtrlStatusBar_SetText($StatusBar, """" & $title & """ Ended Successfully.")
                            $timer = -800
                        EndIf
                    EndIf
                EndIf
            EndIf


        Case $msg = $hpend

            $mma = GUICtrlRead(GUICtrlRead($hiddenprogramlist))
            $title = $mma
            If $mma <> "" Then
                $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to terminate '" & $title & "'")
                If $ok = 1 Then
                    hpstatusprogress()
                    If $abort = 1 Then
                        $handelended = WinGetHandle($mma)
                        $mm = WinGetProcess($mma)
                        ProcessSetPriority($mm, 0)
                        ProcessClose($mm)
                        $1 = WinWaitClose($mma, "", 3)
                        $yyy = WinGetHandle($mma)
                        If $1 = 0 Then
                            MsgBox(8192 + 262144, $me, """" & $title & """ Terminated Successfully, And there is window with the same name is opened !")
                            _GUICtrlStatusBar_SetText($StatusBar, """" & $title & """ Termintaed Successfully, And there is window with the same name is opened !")
                            hscan()
                            If $vlist <> 0 Then vscan()
                            $timer = -800
                            ;activate()
                        ElseIf $yyy <> $handelended Then
                            hscan()
                            If $vlist <> 0 Then vscan()

                            _GUICtrlStatusBar_SetText($StatusBar, """" & $title & """ Terminated successfully.")
                            $timer = -800
                        EndIf
                    EndIf
                EndIf
            EndIf


        Case $msg = $vshow

            $mma = GUICtrlRead(GUICtrlRead($visibleprogramlist))
            WinSetState($mma, "", @SW_SHOW)
            WinActivate($mma)

        Case $msg = $hshow

            $mma = GUICtrlRead(GUICtrlRead($hiddenprogramlist))
            WinSetState($mma, "", @SW_SHOW)
            WinActivate($mma)


        Case $msg = $vhide

            $mma = GUICtrlRead(GUICtrlRead($visibleprogramlist))
            WinSetState($mma, "", @SW_HIDE)


        Case $msg = $hhide

            $mma = GUICtrlRead(GUICtrlRead($hiddenprogramlist))
            WinSetState($mma, "", @SW_HIDE)


        Case $msg = $vclear
            If $vlist <> 0 Then
                GUICtrlDelete($visibleprogramlist)
                $vlist = 0
                vlist()
            EndIf
        Case $msg = $hclear
            If $hlist <> 0 Then
                GUICtrlDelete($hiddenprogramlist)
                $hlist = 0
                hlist()
            EndIf

        Case $msg = $sys
            $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to run System Properties?")
            If $ok = 1 Then
;~  Run("sysdm.cpl",@SystemDir&"\")
                Run(@ComSpec & " /c " & 'sysdm.cpl', "", @SW_HIDE)
                WinWaitActive("System Properties")
                ProcessClose("cmd.exe")
            EndIf



        Case $msg = $rstrui
            $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to run System Restore?")
            If $ok = 1 Then
                ShellExecute("rstrui.exe", "", @SystemDir & "\restore\")
            EndIf

        Case $msg = $msconfig
            $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to run System Configuration Utility?")
            If $ok = 1 Then
                ShellExecute("msconfig")
            EndIf
        Case $msg = $sfc
            $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to run System File Check?")
            If $ok = 1 Then
                $sfcok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "System file check may needs WinXP SP2 CD, Insert WinXP SP2 CD and press OK")
                If $sfcok = 1 Then
                    Run("sfc /scannow")
                EndIf
            EndIf

        Case $msg = $regedit
            $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to run Registry Editor?", $WS_CHILD)
            If $ok = 1 Then
                ShellExecute("regedit")
            EndIf


        Case $msg = $tmgr
            $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to run Task Manager?")
            If $ok = 1 Then
                ShellExecute("taskmgr")
            EndIf

        Case $msg = $compmgmt
            $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to run Computer Management?")
            If $ok = 1 Then
                ShellExecute("compmgmt.msc")
            EndIf

        Case $msg = $eventvwr
            $ok = MsgBox(8192 + 1 + 262144 + 32, "Confirm", "Are you sure you want to run Event Viewer?")
            If $ok = 1 Then
                ShellExecute("Eventvwr.msc")
            EndIf




        Case $msg = $shutdown
            $shutdownok = MsgBox(8192 + 4 + 262144 + 48, "Force Shutdown", "Are you sure you want to force shutdown your coputer?")

            If $shutdownok = 6 Then
                Shutdownprogress()
                If $abort = 1 Then
                    Shutdown(17)
                EndIf

            EndIf

        Case $msg = $restart
            $restartok = MsgBox(8192 + 4 + 262144 + 48, "Force Restart", "Are you sure you want to force restart your coputer?")
            If $restartok = 6 Then
                restartprogress()
                If $abort = 1 Then
                    Shutdown(18)
                EndIf
            EndIf

        Case $tray = $aboutitem

            about()


        Case $msg = $menu_about

            about()


        Case $tray = $exititem
            Exit

        Case $tray = $tshutdown
            $shutdownok = MsgBox(8192 + 4 + 262144 + 48, "Force Shutdown", "Are you sure you want to force shutdown your coputer?")
            If $shutdownok = 6 Then
                Shutdown(5)
            Else
            EndIf

        Case $tray = $trestart
            $restartok = MsgBox(8192 + 4 + 262144 + 48, "Force Restart", "Are you sure you want to force restart your coputer?")
            If $restartok = 6 Then
                Shutdown(6)
            Else
            EndIf

        Case $tray = $min
            hide()
            trayflash()

        Case $tray = $max
            show()

        Case $msg = $viewstatus
            If BitAND(GUICtrlRead($viewstatus), $GUI_CHECKED) = $GUI_CHECKED Then
                GUICtrlSetState($viewstatus, $GUI_UNCHECKED)
                _GUICtrlStatusBar_ShowHide($StatusBar, @SW_HIDE)
            Else
                GUICtrlSetState($viewstatus, $GUI_CHECKED)
                _GUICtrlStatusBar_ShowHide($StatusBar, @SW_SHOW)
            EndIf

        Case $msg = $menu_exit
            Exit

        Case $msg = $menu_hide
            hide()
            trayflash()










    EndSelect

WEnd;### Tidy Error -> if is never closed in your script.;### Tidy Error -> func is never closed in your script.;### Tidy Error -> for is never closed in your script.

WE V0.12.exe

Edited by egymma

[center][/center]My Projects:-[list][*]Window Ender[*]Encryptor-Decryptor[/list]

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  

×