Jump to content

Disk Manager - V2 with source code!


James
 Share

Recommended Posts

Hey all,

NEW VERSION: Uses AutoIt V3.3.9.6 syntax. 

DMan4AutoIt3.au3

Still more to do, but you can look at it!

Any feedback is welcome! I will change it at a later date! Latest version is still 2.0.3 I am not releasing this for a while.

To-do:

  • Re-make the GUI: Menu, Size, Colours - Colour schemes :P , re-made the menu
  • Add more information about the drives - I copied Saunders listview :)
  • Export data to file - Finally
  • Console support - Now looks for default settings
  • More functions - Copy data to clipboard
  • Allow you to select different types of drives - I am removing this function, however you will eventually be able to hide empty drives.
  • Timeout when retrieving devices - 1 minute of timeout!
  • Minimize to tray - No right click menu
  • Show in tooltip on hover (regards to above) - Sort of works when compiled
  • Save data in a config file - At the moment only colour schemes
  • Bug reporting - Works even uncompiled
  • New icon (There is one for the compiled version) - Changed icon
  • Fix the sizing issue
  • Resize listview
  • Colour listview items based on different factors - Drive space, temprature etc - works on whether a drive has a READY key
  • Custom colour schemes (I lost my backup)
  • CSV export
  • CPU details - Rasims functions
  • Drive type - SATA or IDE
  • Option to hide drives - Type of drive, specific letters - this has been replaced by Drive Type
  • Right click listview menu - Open drive, hide drive etc - only opening of a drive works
  • Format selected disk - Of course drive checking will be added
  • Full row select - Works and it's nifty!
  • Memory type - KB, MB, GB, TB etc
  • Cluster size on disc - If this can be added properly
  • Drive temprature - Shouldn't be too hard
  • Import DMA and CSV data - HTML is not being added, still need to add CSV
  • Command line based export for specified drives

Winner of People's choice 2007! (No image yet)

catutilitiesvr1.jpg

Thankyou,
James

NEW VERSION: DMan4AutoIt3.au3

Old version < 3.3.9.6: DMan4AutoIt3.au3

Last download count for V2.0.2: Over 500!

Edited by James
Link to comment
Share on other sites

  • Replies 130
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

@JamesB

add the following code right below GUISetState(@SW_SHOW)

this will live update the GUI when files are added or deleted (files in recyclebin aren't really deleted)..

_HDDUpdate ()

AdlibEnable ("_HDDUpdate", 1000) 

Func _HDDUpdate ()
    For $a = 1 To $Drives[0]
        $Space = DriveSpaceFree($Drives[$a])
        $Totals = DriveSpaceTotal($Drives[$a])
        $Quarter = $Space / 4
        $Tenth = $Space / 10
        $EquationNew = Int(($Space * 100) / $Totals)
        GUICtrlSetData ($Progress[$a], $Space / $Totals * 100)
        GuiCtrlSetData ($Size[$a],(Int($SPACE / 1024) & " GB"))
        GUICtrlSetData ($Percent[$a],$EquationNew & "%")
        If $Space >= $Totals - $Quarter Then
            GUICtrlSetColor($Percent[$a], 0x00f9000)
        Else
            GUICtrlSetColor($Percent[$a], 0xff0000)
        EndIf
    Next
EndFunc
Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Link to comment
Share on other sites

Weird.

As you can see I tried to put the colours in a 2D array, yet when I went to use them, they colours had all swapped around.

To-do:

Auto Update Sizes

Minimize to tray with results showing

Select the drive type you wish to look at

Different colour schemes, plus saving them to a file

Save data to a file

Temprature

If anyone else has ideas please tell me! Jango, I have added your ideas to the list!

Link to comment
Share on other sites

#include <Array.au3>

$Drives = DriveGetDrive("FIXED")
$Drives2= DriveGetDrive("REMOVABLE")
if @Error <>  1 then 
    For $i = 1 to $Drives[0]
        _ArrayAdd($Drives, $Drives2[$i])
    Next
EndIf
; If you want to add network drives
;$Drives3 = DriveGetDrive("NETWORK")
;if @Error <>  1 then 
;   For $i = 1 to $Drives3[0]
;       _ArrayAdd($Drives, $Drives3[$i])
;   Next
;EndIf

this will display also the Removable Drives

would it be possible to remove DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)

because it take the GUI back into time (W2K look)

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Link to comment
Share on other sites

Ace!

Experience is good! Can I see yours if you don't mind?

I'm only four days late.. hehe. Here's mine:

Posted Image

#include <GUIConstantsEx.au3>
#include <GUIListView.au3>
#include <StaticConstants.au3>
#include <ProgressConstants.au3>

Opt('GUIOnEventMode', 1)
Opt('RunErrorsFatal', 0)

Global $aCtrlRange[2]

$gui = GUICreate('Drive Stats', 500, 200)
    GUISetOnEvent($GUI_EVENT_CLOSE, '_Exit')
    $cm_Main = GUICtrlCreateContextMenu(-1)
    GUICtrlCreateMenuItem('&Refresh', $cm_Main)
        GUICtrlSetOnEvent(-1, '_Refresh')

$pg_Used = GUICtrlCreateProgress(0, 180, 380, 20, $PBS_SMOOTH)
    GUICtrlSetColor(-1, 0xff)
$lb_UsedSh = GUICtrlCreateLabel('', 1, 181, 380, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE))
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetColor(-1, 0)
$lb_Used = GUICtrlCreateLabel('', 0, 180, 380, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE))
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetColor(-1, 0xffffff)

GUICtrlCreateButton('E&xplore', 380, 180, 60, 20)
    GUICtrlSetOnEvent(-1, '_Explore')
GUICtrlCreateButton('&Refresh', 440, 180, 60, 20)
    GUICtrlSetOnEvent(-1, '_Refresh')
$lv_Drives = GUICtrlCreateListView('Drive|Label|Type|Status|File System|Serial Number|Free Space|Used Space|Total Space', 0, 0, 500, 180)
Opt('GUIDataSeparatorChar', @LF)
GUISetState()
$aCtrlRange = _ListView()

$iLvSel = 0
$iLvSelMem = -1
While 1
    $iLvSel = _GUICtrlListView_GetNextItem($lv_Drives)
    If $iLvSel <> -1 And $iLvSel <> $iLvSelMem Then
        $sUsedSpace = _GUICtrlListView_GetItemText($lv_Drives, $iLvSel, 7)
        $sUsedSpace = StringRegExpReplace($sUsedSpace, '.*\((\d+)%\)', '\1')
        If Not @error And @extended Then
            GUICtrlSetData($pg_Used, $sUsedSpace)
            GUICtrlSetData($lb_Used, 'Used space (' & $sUsedSpace & '%)')
            GUICtrlSetData($lb_UsedSh, 'Used space (' & $sUsedSpace & '%)')
        Else
            GUICtrlSetData($pg_Used, 0)
            GUICtrlSetData($lb_Used, '')
            GUICtrlSetData($lb_UsedSh, '')
        EndIf
        $iLvSelMem = $iLvSel
    EndIf
    Sleep(10)
WEnd

Func _Exit()
    GUIDelete($gui)
    Exit
EndFunc

Func _Refresh()
    For $iCtrl = $aCtrlRange[0] To $aCtrlRange[1]
        GUICtrlDelete($iCtrl)
    Next
    Global $aCtrlRange = _ListView()
EndFunc

Func _Explore()
    $iLvSel = _GUICtrlListView_GetNextItem($lv_Drives)
    If $iLvSel <> -1 Then
        $sDrive = _GUICtrlListView_GetItemText($lv_Drives, $iLvSel, 0)
        ShellExecute($sDrive)
    EndIf
EndFunc

Func _ListView()
    Local $aCtrlRange[2]
    $aCtrlRange[0] = GUICtrlCreateDummy()
    $aDrives = DriveGetDrive('all')
    For $i = 1 To $aDrives[0]
        $sDrive = StringUpper($aDrives[$i])
        $iTotalSpace = DriveSpaceTotal($sDrive)
        If $iTotalSpace <= 0 Then
            $sFreeSpace = '-'
            $sUsedSpace = '-'
            $sTotalSpace = '-'
        Else
            $sTotalByteAmt = 'MB'
            $sFreeByteAmt = 'MB'
            $sUsedByteAmt = 'MB'
            $iFreeSpace = DriveSpaceFree($sDrive)
            $iUsedSpace = $iTotalSpace - $iFreeSpace
            
            $iFreePercent = 0
            $iUsedPercent = 0
            If $iTotalSpace > 0 Then
                $iFreePercent = Round($iFreeSpace / $iTotalSpace * 100)
                $iUsedPercent = 100 - $iFreePercent
            EndIf
            
            If $iTotalSpace > 1024 Then
                $iTotalSpace /= 1024
                $sTotalByteAmt = 'GB'
            EndIf
            If $iFreeSpace > 1024 Then
                $iFreeSpace /= 1024
                $sFreeByteAmt = 'GB'
            EndIf
            If $iUsedSpace > 1024 Then
                $iUsedSpace /= 1024
                $sUsedByteAmt = 'GB'
            EndIf
            
            $sTotalSpace = StringFormat('%.2f %s', $iTotalSpace, $sTotalByteAmt)
            $sFreeSpace = StringFormat('%.2f %s (%d%%)', $iFreeSpace, $sFreeByteAmt, $iFreePercent)
            $sUsedSpace = StringFormat('%.2f %s (%d%%)', $iUsedSpace, $sUsedByteAmt, $iUsedPercent)
        EndIf
        
        $sLabel = DriveGetLabel($sDrive)
        If $sLabel = '' Then $sLabel = '[None]'
        GUICtrlCreateListViewItem( _
            StringFormat('%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s', _
                $sDrive, _
                $sLabel, _
                DriveGetType($sDrive), _
                DriveStatus($sDrive), _
                DriveGetFileSystem($sDrive), _
                DriveGetSerial($sDrive), _
                $sFreeSpace, _
                $sUsedSpace, _
                $sTotalSpace), _
            $lv_Drives)
    Next
    $aCtrlRange[1] = GUICtrlCreateDummy()
    Return $aCtrlRange
EndFunc
Link to comment
Share on other sites

@JustinReno,

Could you explain .. why you are spamming this post

@JamesB

If you remove your line DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)

and add the following line right under $Progress[$i]

DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Progress[$i]), "wstr", "", "wstr", "")

You will preserve the colors in the progress bar but regain the XP looks of the GUI (Thnx Siao and Valuator)

Best regards,Emiel Wieldraaijer

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