Jump to content

Computer Information


Skrip
 Share

Recommended Posts

Simple program for reading computer information.

Needs beta

VERSION 1.0

-Detects Computer Name.

-Detects IP Address.

-Able to run a .exe though it. (Not Finished)

-Detects Operating System.

-Detects drives.

-Detects cd-rom drives.

-Detects removeable drives.

-Detects Total space on any drive.

-Detects FREE space on any drive.

-Detects Monitor pixels.

-Detects Montior refresh rate.

-Detects where you place the program on your drive.

-Detects Processes.

VERSION 1.1

-Adds Process system.

-Adds Title system.

VERSION 1.2

-Fixed an error.

-Detects if you're connected to the internet.

VERSION 1.4 (LATEST)

-Adds Winshow.

-Adds WinHide.

-Fixes WinKill.

-Adds Retest internet connection button.

-Adds Credits,

-Fixes Winlist

-Fixes Process list

;VERSION 1.4
#region Vars
$Cname = @ComputerName
$Width = @DesktopWidth
$Height = @DesktopHeight
$Refresh = @DesktopRefresh
$Ip = @IPAddress1
$OS = @OSVersion
$HomeD = @HomeDrive
$scriptdir = @ScriptFullPath
#endregion Vars
#include <GuiConstants.au3>
#include <Process.au3>
#region Main Script

GuiCreate("Computer Information", 374, 345,(@DesktopWidth-364)/2, (@DesktopHeight-225)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Label_1 = GuiCtrlCreateLabel("Computer Name:", 10, 10, 100, 20)
$Label_2 = GuiCtrlCreateLabel($Cname, 100, 10, 90, 20)
$Label_3 = GuiCtrlCreateLabel("Monitor:", 10, 40, 50, 20)
$Label_4 = GuiCtrlCreateLabel("Width:" & $Width & " Pixels", 60, 40, 90, 20)
$Label_5 = GuiCtrlCreateLabel("Height:" & $Height & " Pixels", 60, 60, 90, 20)
$Label_6 = GuiCtrlCreateLabel("Refresh Rate:" & $Refresh, 60, 80, 110, 20)
$Label_7 = GuiCtrlCreateLabel("IP Address:" & $Ip, 10, 110, 160, 20)
$Group_8 = GuiCtrlCreateGroup("Operating System", 180, 10, 140, 45)
$Credits = GUICtrlCreateButton("Credits", 320, 15, 50, 45)
$Label_9 = GuiCtrlCreateLabel($OS, 190, 30, 120, 20)
$Label_10 = GuiCtrlCreateLabel("Home Drive: " & $HomeD, 180, 70, 150, 20)
$Button_11 = GuiCtrlCreateButton("Find All Drives", 180, 90, 120, 20)
$Button_12 = GuiCtrlCreateButton("Find CD-Drives", 180, 110, 120, 20)
$Button_13 = GuiCtrlCreateButton("Find Removable Drives", 180, 130, 120, 20)
$Label_14 = GuiCtrlCreateLabel("The Full Path for this Program is:   " & $scriptdir, 10, 180, 350, 20)
$Button_15 = GuiCtrlCreateButton("Get size of drive:", 170, 150, 140, 20)
$winClose_R = GUICtrlCreateRadio("WinClose", 117, 240, 80, 17)
$winKill_R = GUICtrlCreateRadio("WinKill", 117, 220, 80, 17)
$winshow_R = GUICtrlCreateRadio("Win Show", 117, 200, 80, 17)
$winhide_R = GUICtrlCreateRadio("Win Hide", 197, 200, 80, 17)
$processCombo_C = GUICtrlCreateCombo("", 10, 290, 201, 21)
$processClose_R = GUICtrlCreateRadio("ProcessClose", 197, 220, 80, 17)
$pid_R = GUICtrlCreateRadio("ProcessID", 197, 240, 80, 17)
$Go_B = GUICtrlCreateButton("GO", 10, 223, 89, 30)
$status_L = GUICtrlCreateLabel("Ready...", 10, 270, 180, 17, $SS_SUNKEN)
$input_exe = GUICtrlCreateInput("Type what program to run", 10, 130, 150, 20)
$button_run = GUICtrlCreateButton("Run", 10, 150, 150, 20)
$Internet = GUICtrlCreateLabel("Testing Internet Connection...", 10, 315, 325, 20, $SS_SUNKEN)
$cd_o = GUICtrlCreateButton("Open Drive", 300, 90, 70, 20)
$retest_c = GUICtrlCreateButton("Retest Internet Connection.", 220, 290, 140, 20)

GuiSetState()

_INITIATE()

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_11
        $pass = 1
        $dr_all = DriveGetDrive("all")
        If @error Then
            Msgbox(0, "ERROR", "No Drives found.")
            $pass = 0
        EndIf
        If $pass = 1 Then
            If NOT @error Then
                MsgBox(4096,"", "Found " & $dr_all[0] & " drives")
            For $i = 1 to $dr_all[0]
                MsgBox(4096,"Drive " & $i, $dr_all[$i])
            Next
            EndIf
        EndIf
    Case $msg = $Button_12
        $pass = 1
        $dr_cd = DriveGetDrive("CDROM")
        If @error Then
            Msgbox(0, "ERROR", "No CDROM Drives found.")
            $pass = 0
        EndIf
        If $pass = 1 Then
            If NOT @error Then
                MsgBox(4096,"", "Found " & $dr_cd[0] & " drives")
            For $i = 1 to $dr_cd[0]
                MsgBox(4096,"Drive " & $i, $dr_cd[$i])
            Next
            EndIf
        EndIf
    Case $msg = $Button_13
        $pass = 1
        $dr_removable = DriveGetDrive("REMOVABLE")
        If @error Then
            Msgbox(0, "ERROR", "No Removable Drives found.")
            $pass = 0
        EndIf
        If $pass = 1 Then
            If NOT @error Then
                MsgBox(4096,"", "Found " & $dr_removable[0] & " drives")
            For $i = 1 to $dr_removable[0]
                MsgBox(4096,"Drive " & $i, $dr_removable[$i])
            Next
            EndIf
        EndIf
    Case $msg = $Button_15
        $SD = InputBox("Selection", "Please Enter the drive path that you want the size of.", "C:\")
        $SDI = DriveSpaceTotal($SD)
        $SDI2 = DriveSpaceFree($SD)
        If Not @error Then
            MsgBox(0, "Drive Space for Drive: " & $SD, "Drive total space: " & $SDI & " MegaBytes")
            MsgBox(0, "Drive Free Space for Drive: " & $SD, "Drive free space: " & $SDI2 & " MegaBytes")
        EndIf
        If @error Then
            MsgBox(0, "ERROR: DRIVE NOT FOUND!!!", "---That is an invalid drive path, please enter correct path!!!---")
        EndIf
    Case $msg = $Go_B
            If GUICtrlRead($winClose_R) = $GUI_CHECKED Then _winClose()
            If GUICtrlRead($winKill_R) = $GUI_CHECKED Then _winKill()
            If GUICtrlRead($winshow_R) = $GUI_CHECKED Then _winshow()
            If GUICtrlRead($winhide_R) = $GUI_CHECKED Then _winhide()
    Case $msg = $processClose_R
        _processCombo()
    Case $msg = $winKill_R Or $msg = $winClose_R
        _winListCombo()
    Case $msg = $button_run
        $read = GUICtrlRead($input_exe)
            MsgBox(0, "Sorry", "i'll fix this in a later version.")
            MsgBox(0, "Sorry", "I'll add a path input box soon don't worry!")
    Case $msg = $cd_o
        $o = InputBox("Open", "Please enter the Drive you want to open. If it is a CD drive the disk will eject", "C:\")
        CDTray($o, "OPEN")
        If @error = 0 Then
            Run('Explorer.exe "' & $o & '"', @WorkingDir, @SW_SHOW)
        EndIf
    Case $msg = $retest_c
        GuiCtrlSetData($Internet, GetToggle3r(GuiCtrlRead($Internet)))
        _Internet()
    Case $msg = $Credits
        MsgBox(0, "Credits", "This program was made by Firestorm.")
        MsgBox(0, "Q/C", "Questions? Comments? Errors? E-mail me at firestorm037@hotmail.com!")
    EndSelect
WEnd
Exit
#endregion Main Script

#region Functions

Func _INITIATE()
    _processCombo()
    _winListCombo()
    _Internet()
EndFunc



Func _winClose()
    If WinExists(GUICtrlRead($processCombo_C)) Then
        WinClose(GUICtrlRead($processCombo_C))
    Else
        GUICtrlSetData($status_L, "Window doesn't exist")
        Sleep(2500)
        GUICtrlSetData($status_L, "Ready...")
    EndIf
EndFunc ;==>_winClose

Func _winKill()
    If WinExists(GUICtrlRead($processCombo_C)) Then
        WinKill(GUICtrlRead($processCombo_C))
    Else
        GUICtrlSetData($status_L, "Window doesn't exist")
        Sleep(2500)
        GUICtrlSetData($status_L, "Ready...")
    EndIf
EndFunc ;==>_winKill

Func _processClose()
    If ProcessExists(GUICtrlRead($processCombo_C)) Then
        ProcessClose(GUICtrlRead($processCombo_C))
    Else
        GUICtrlSetData($status_L, "Process doesn't exist")
        Sleep(2500)
        GUICtrlSetData($status_L, "Ready...") 
    EndIf
EndFunc ;==>_processClose

Func _killByPID()
    If _ProcessGetName(GUICtrlRead($processCombo_C)) <> '' Then
        $rc = _RunDOS("start taskkill /PID " & GUICtrlRead($processCombo_C) & " /T")
        GUICtrlSetData($status_L, "ProcessID " & GUICtrlRead($processCombo_C) & " - (" & _ProcessGetName(GUICtrlRead($processCombo_C)) & ")" & " killed")
        Sleep(2500)
        GUICtrlSetData($status_L, "Ready...")
    Else
        GUICtrlSetData($status_L, "ProcessID doesn't exist")
        Sleep(2500)
        GUICtrlSetData($status_L, "Ready...")
    EndIf
EndFunc ;==>_killByPID

Func _processCombo()
    Dim $processArray = ProcessList()
    For $i = 1 To $processArray[0][0]
        GUICtrlSetData($processCombo_C, $processArray[$i][0])
    Next
EndFunc ;==>_processCombo

Func _winListCombo()
    Dim $windowArray = WinList()
    For $i = 1 To $windowArray[0][0]
   ; Only display visble windows that have a title
        If $windowArray[$i][0] <> "" Then;AND IsVisible($var[$i][1]) Then
            GUICtrlSetData($processCombo_C, $windowArray[$i][0])
        EndIf
    Next
EndFunc ;==>_winListCombo

Func _winshow()
    If WinExists(GUICtrlRead($processCombo_C)) Then
        WinSetState(GUICtrlRead($processCombo_C),"", @SW_SHOW)
    Else
        GUICtrlSetData($status_L, "Window doesn't exist")
        Sleep(2500)
        GUICtrlSetData($status_L, "Ready...")
    EndIf
EndFunc ;==>_winshow

Func _winhide()
    If WinExists(GUICtrlRead($processCombo_C)) Then
        WinSetState(GUICtrlRead($processCombo_C),"", @SW_HIDE)
    Else
        GUICtrlSetData($status_L, "Window doesn't exist")
        Sleep(2500)
        GUICtrlSetData($status_L, "Ready...")
    EndIf
EndFunc ;==>_winhide

Func _Internet()
    Sleep(500)
    $var = Ping("www.hiddensoft.com")
    If $var Then ; also possible:  If @error = 0 Then ...
        GuiCtrlSetData($Internet, GetToggle1(GuiCtrlRead($Internet)))
    Else
        GuiCtrlSetData($Internet, GetToggle2(GuiCtrlRead($Internet)))
    EndIf
EndFunc

Func GetToggle1($stext)
    if $stext = "Testing Internet Connection..." then
        GUICtrlSetColor($Internet, "0x0000ff")
        return "You are connected to the internet!"
        else
        return " "
    endif
 EndFunc

Func GetToggle2($stext)
    if $stext = "Testing Internet Connection..." then
        GUICtrlSetColor($Internet, "0xff0000")
        return "WARNING! You are NOT connected to the internet!"
        else
        return " "
    endif
EndFunc

Func GetToggle3r($stext)
    if $stext = "WARNING! You are NOT connected to the internet!" OR "You are connected to the internet!" then
        GUICtrlSetColor($Internet, "0x000000")
        return "Testing Internet Connection..."
        else
        return " "
    endif
EndFunc
#endregion Functions

Ideas? Want something added? Errors?

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

got an error

E:\Utilities\new computer info.au3(15,79) : ERROR: $WS_CLIPSIBLINGS previously declared as a 'Const'

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

E:\Utilities\new computer info.au3 - 1 error(s), 0 warning(s)

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Hmm, I don't get that error on the normal or beta. But try removing line 14.

And make sure you are using the newest beta.

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

Hmm, I don't get that error on the normal or beta. But try removing line 14.

And make sure you are using the newest beta.

works fine - line 15 only because I copied the top blank line

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Ah, glad it works!

using beta 3.1.1.111

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Is that bad?

no that is the version that I am running that caused the error

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Please re-read first post, provides more information!

Update 1.2

-A few error's fixed

-Now detect's internet connection.

;VERSION 1.2 #region Vars $Cname = @ComputerName $Width = @DesktopWidth $Height = @DesktopHeight $Refresh = @DesktopRefresh $Ip = @IPAddress1 $OS = @OSVersion $HomeD = @HomeDrive $scriptdir = @ScriptFullPath #endregion Vars #include <GuiConstants.au3> #include <Process.au3> #region Main Script GuiCreate("Computer Information", 344, 345,(@DesktopWidth-364)/2, (@DesktopHeight-225)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Label_1 = GuiCtrlCreateLabel("Computer Name:", 10, 10, 100, 20) $Label_2 = GuiCtrlCreateLabel($Cname, 100, 10, 90, 20) $Label_3 = GuiCtrlCreateLabel("Monitor:", 10, 40, 50, 20) $Label_4 = GuiCtrlCreateLabel("Width:" & $Width & " Pixels", 60, 40, 90, 20) $Label_5 = GuiCtrlCreateLabel("Height:" & $Height & " Pixels", 60, 60, 90, 20) $Label_6 = GuiCtrlCreateLabel("Refresh Rate:" & $Refresh, 60, 80, 110, 20) $Label_7 = GuiCtrlCreateLabel("IP Address:" & $Ip, 10, 110, 160, 20) $Group_8 = GuiCtrlCreateGroup("Operating System", 180, 10, 140, 45) $Label_9 = GuiCtrlCreateLabel($OS, 190, 30, 120, 20) $Label_10 = GuiCtrlCreateLabel("Home Drive: " & $HomeD, 180, 70, 150, 20) $Button_11 = GuiCtrlCreateButton("Find All Drives", 180, 90, 120, 20) $Button_12 = GuiCtrlCreateButton("Find CD-Drives", 180, 110, 120, 20) $Button_13 = GuiCtrlCreateButton("Find Removable Drives", 180, 130, 120, 20) $Label_14 = GuiCtrlCreateLabel("The Full Path for this Program is: " & $scriptdir, 10, 180, 350, 30) $Button_15 = GuiCtrlCreateButton("Get size of drive:", 170, 150, 140, 20) $taskkill_R = GUICtrlCreateRadio("Taskkill", 117, 220, 80, 17) $winClose_R = GUICtrlCreateRadio("WinClose", 117, 240, 80, 17) $winKill_R = GUICtrlCreateRadio("WinKill", 197, 260, 80, 17) $processCombo_C = GUICtrlCreateCombo("", 10, 290, 201, 21) $processClose_R = GUICtrlCreateRadio("ProcessClose", 197, 220, 80, 17) $pid_R = GUICtrlCreateRadio("ProcessID", 197, 240, 80, 17) $Go_B = GUICtrlCreateButton("GO", 10, 223, 89, 30) $status_L = GUICtrlCreateLabel("Ready...", 10, 270, 180, 17, $SS_SUNKEN) $input_exe = GUICtrlCreateInput("Type what program to run", 10, 130, 150, 20) $button_run = GUICtrlCreateButton("Run", 10, 150, 150, 20) $Internet = GUICtrlCreateLabel("Testing Internet Connection...", 10, 315, 325, 20, $SS_SUNKEN) GuiSetState() _processCombo() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_11 $pass = 1 $dr_all = DriveGetDrive("all") If @error Then Msgbox(0, "ERROR", "No Drives found.") $pass = 0 EndIf If $pass = 1 Then If NOT @error Then MsgBox(4096,"", "Found " & $dr_all[0] & " drives") For $i = 1 to $dr_all[0] MsgBox(4096,"Drive " & $i, $dr_all[$i]) Next EndIf EndIf Case $msg = $Button_12 $pass = 1 $dr_cd = DriveGetDrive("CDROM") If @error Then Msgbox(0, "ERROR", "No CDROM Drives found.") $pass = 0 EndIf If $pass = 1 Then If NOT @error Then MsgBox(4096,"", "Found " & $dr_cd[0] & " drives") For $i = 1 to $dr_cd[0] MsgBox(4096,"Drive " & $i, $dr_cd[$i]) Next EndIf EndIf Case $msg = $Button_13 $pass = 1 $dr_removable = DriveGetDrive("REMOVABLE") If @error Then Msgbox(0, "ERROR", "No Removable Drives found.") $pass = 0 EndIf If $pass = 1 Then If NOT @error Then MsgBox(4096,"", "Found " & $dr_removable[0] & " drives") For $i = 1 to $dr_removable[0] MsgBox(4096,"Drive " & $i, $dr_removable[$i]) Next EndIf EndIf Case $msg = $Button_15 $SD = InputBox("Selection", "Please Enter the drive path that you want the size of.", "C:\") $SDI = DriveSpaceTotal($SD) $SDI2 = DriveSpaceFree($SD) If Not @error Then MsgBox(0, "Drive Space for Drive: " & $SD, "Drive total space: " & $SDI & " MegaBytes") MsgBox(0, "Drive Free Space for Drive: " & $SD, "Drive free space: " & $SDI2 & " MegaBytes") EndIf If @error Then MsgBox(0, "ERROR: DRIVE NOT FOUND!!!", "---That is an invalid drive path, please enter correct path!!!---") EndIf Case $msg = $Go_B If GUICtrlRead($taskkill_R) = $GUI_CHECKED Then _taskkill() If GUICtrlRead($winClose_R) = $GUI_CHECKED Then _winClose() If GUICtrlRead($winKill_R) = $GUI_CHECKED Then _winKill() Case $msg = $taskkill_R Or $msg = $processClose_R _processCombo() Case $msg = $winKill_R Or $msg = $winClose_R _winListCombo() Case $msg = $button_run $read = GUICtrlRead($input_exe) Run($read & ".exe") If @error = 1 Then MsgBox(0, "ERROR!", "That is an invalid .exe, if it is not, this will be fixed in a later version.") EndIf EndSelect WEnd Exit #endregion Main Script #region Functions Func _taskkill() $rc = _RunDOS("start taskkill /F /IM " & GUICtrlRead($processCombo_C) & " /T") GUICtrlSetData($status_L, "Process " & GUICtrlRead($processCombo_C) & " killed") Sleep(2500) GUICtrlSetData($status_L, "Ready...") EndFunc ;==>_taskkill Func _winClose() If WinExists(GUICtrlRead($processCombo_C)) Then WinClose(GUICtrlRead($processCombo_C)) Else GUICtrlSetData($status_L, "Window doesn't exist") Sleep(2500) GUICtrlSetData($status_L, "Ready...") EndIf EndFunc ;==>_winClose Func _winKill() If WinExists(GUICtrlRead($processCombo_C)) Then WinKill(GUICtrlRead($processCombo_C)) Else GUICtrlSetData($status_L, "Window doesn't exist") Sleep(2500) GUICtrlSetData($status_L, "Ready...") EndIf EndFunc ;==>_winKill Func _processClose() If ProcessExists(GUICtrlRead($processCombo_C)) Then ProcessClose(GUICtrlRead($processCombo_C)) Else GUICtrlSetData($status_L, "Process doesn't exist") Sleep(2500) GUICtrlSetData($status_L, "Ready...") EndIf EndFunc ;==>_processClose Func _killByPID() If _ProcessGetName(GUICtrlRead($processCombo_C)) <> '' Then $rc = _RunDOS("start taskkill /PID " & GUICtrlRead($processCombo_C) & " /T") GUICtrlSetData($status_L, "ProcessID " & GUICtrlRead($processCombo_C) & " - (" & _ProcessGetName(GUICtrlRead($processCombo_C)) & ")" & " killed") Sleep(2500) GUICtrlSetData($status_L, "Ready...") Else GUICtrlSetData($status_L, "ProcessID doesn't exist") Sleep(2500) GUICtrlSetData($status_L, "Ready...") EndIf EndFunc ;==>_killByPID Func _processCombo() Dim $processArray = ProcessList() For $i = 1 To $processArray[0][0] GUICtrlSetData($processCombo_C, $processArray[$i][0]) Next _Internet() EndFunc ;==>_processCombo Func _winListCombo() Dim $windowArray = WinList() For $i = 1 To $windowArray[0][0] ; Only display visble windows that have a title If $windowArray[$i][0] <> "" Then;AND IsVisible($var[$i][1]) Then GUICtrlSetData($processCombo_C, $windowArray[$i][0]) EndIf Next EndFunc ;==>_winListCombo Func _Internet() $var = Ping("www.hiddensoft.com",2500) If $var Then ; also possible: If @error = 0 Then ... GuiCtrlSetData($Internet, GetToggle1(GuiCtrlRead($Internet))) Else GuiCtrlSetData($Internet, GetToggle2(GuiCtrlRead($Internet))) EndIf EndFunc Func GetToggle1($stext) if $stext = "Testing Internet Connection..." then GUICtrlSetColor($Internet, "0x0000ff") return "You are connected to the internet!" else return " " endif EndFunc Func GetToggle2($stext) if $stext = "Testing Internet Connection..." then GUICtrlSetColor($Internet, "0xff0000") return "WARNING! You are NOT connected to the internet!" else return " " endif EndFunc #endregion Functions

Please re-read first post, provides more information!

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

Link to comment
Share on other sites

Ya, Thank you. Nor have I about the taskkill, I got that command for sombody else, obviously didn't work, i'll fix in next build.

UPDATE --> VERSION 1.4 <-- SEE FIRST POST

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

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