Jump to content

Disk Manager - V2 with source code!


James
 Share

Recommended Posts

  • Replies 130
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I tried it already but it gives me errors.

----------------------------------------------------------------------

Line 12 (File "E:...) - my drive

TraySetOnEvents($TRAY_EVENT_PRIMARYUP, "Minimize")

TraySetOnEvent(^ ERROR

Error: Variable used without being declared

----------------------------------------------------------------------

I used saunders too. and error.

----------------------------------------------------------------------

Line 38 (File "C:\Documents and Settings\crystal\Desktop\driveStat.au3"):

$iLvSel = _GUICtrlListView_GetNextItem($lv_Drives)

$iLvSel = ^ ERROR

Error: Unknown function name.

----------------------------------------------------------------------

Edited by epoy
Link to comment
Share on other sites

Hi, very nice job,...

just update this...

instead of:

$RAM = GUICtrlCreateLabel(Int($MemStats[1] / 1024) & "MB RAM", 10, 270)
$Free_RAM = GUICtrlCreateLabel(Int($MemStats[2] / 1024) & "MB FREE RAM", 10, 287)

$Time_Taken = GUICtrlCreateLabel("", 10, 314, 100)

; Create the Statusbar
$StatusBar = _GUICtrlStatusBar_Create($GUI)
_GUICtrlStatusBar_SetParts($StatusBar, $Parts)
_GUICtrlStatusBar_SetText($StatusBar, "Loading Drive Data...")

; Create the listview to display the drives ~ Saunders Edited by Me
$DriveList = _GUICtrlListView_Create($GUI, "Drive|Label|Type|Status|File System|Serial Number|Free Space|Used Space|Total Space", 10, 10, 500, 120)

; Create a group to hold the progress bars
For $i = 1 To $_AllD[0]
    $Labels[$i] = GUICtrlCreateLabel(StringUpper($_AllD[$i]), 20, ($i * 20) + 140, 121, 17)
    $Progress[$i] = GUICtrlCreateProgress(40, ($i * 20) + 140, 121, 17, 1)
    DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", " ", "wstr", " ")
    If Not FileExists($Config_File) Then
        GUICtrlSetColor($Progress[$i], 0x94FF00)
        GUICtrlSetBkColor($Progress[$i], 0xFFFFFF)
        GUICtrlSetStyle($Progress[$i], 1)
    ElseIf FileExists($Config_File) Then
        GUICtrlSetColor($Progress[$i], IniRead($Config_File, "Scheme", "Front", ""))
        GUICtrlSetBkColor($Progress[$i], IniRead($Config_File, "Scheme", "Back", ""))
        GUICtrlSetStyle($Progress[$i], IniRead($Config_File, "Scheme", "Progress", ""))
    EndIf
Next

I put this:

Create a group to hold the progress bars
For $i = 1 To $_AllD[0]
    $Labels[$i] = GUICtrlCreateLabel(StringUpper($_AllD[$i]), 20, ($i * 20) + 140, 121, 17)
    $Progress[$i] = GUICtrlCreateProgress(40, ($i * 20) + 140, 121, 17, 1)
    DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", " ", "wstr", " ")
    If Not FileExists($Config_File) Then
        GUICtrlSetColor($Progress[$i], 0x94FF00)
        GUICtrlSetBkColor($Progress[$i], 0xFFFFFF)
        GUICtrlSetStyle($Progress[$i], 1)
    ElseIf FileExists($Config_File) Then
        GUICtrlSetColor($Progress[$i], IniRead($Config_File, "Scheme", "Front", ""))
        GUICtrlSetBkColor($Progress[$i], IniRead($Config_File, "Scheme", "Back", ""))
        GUICtrlSetStyle($Progress[$i], IniRead($Config_File, "Scheme", "Progress", ""))
    EndIf
Next

$i-=1
$RAM = GUICtrlCreateLabel(Int($MemStats[1] / 1024) & "MB RAM", 20, (($i*20)+20+ 140))
$Free_RAM = GUICtrlCreateLabel(Int($MemStats[2] / 1024) & "MB FREE RAM", 20, (($i*20)+37+ 140))

$Time_Taken = GUICtrlCreateLabel("", 20, ($i*20)+57+ 140, 100)

I coud'nt read the RAM because I have too much drive... (6)...

Nice Job !!!!

Link to comment
Share on other sites

This basically lets you graphically see the size of drives etc. Nothing amazing yet.

Interesting tool.

One issue though, it doesn't display properly when there are more then 5 drives in the system:

Posted Image

cramaboule's changes didn't help either...

P.S. anyway retrieve drive size BEFORE the format? Like how many bytes physically can a drive store?

Edited by vanowm
Link to comment
Share on other sites

  • 3 weeks later...

I will be updating the source code tonight to work with the CPUMon by rasim and hopefully fix the sizing issue with lots of drives.

List of things I want to add:

  • CPUMon by Rasim
  • Fix resizing issue
  • Export results in HTML
  • Memory and Speed testing
  • Option to explicitly hide any drives which are empty
  • Option to remove listing of A:\ and B:\ through registry
  • Themes will become packages, which are externally linked (saves memory from Disk Manager)
  • Add a built-in exported file GUI, which runs when you open the file type
  • Option to show/hide hidden folders throughout the computer
  • Run selected drives
  • Maybe run Chkdisk but with cmd parameters and export the data to Disk manager
That's about it for now. Any comments, suggestions and I would be happy. Edited by JamesBrooks
Link to comment
Share on other sites

So I have added _ReduceMemory(), not sure if it needs to be in the While statement but there we go. I am also working on export to HTML, drive type (SMART/IDE/SATA), import *.DMA and add .DMA extension when exporting if it hasn't been added already.

Most of these updates will be done over the weekend along with my college work. Stay tuned!

Link to comment
Share on other sites

HI Jiim,

the first thing above the while should be _ReduceMemory ()

Example code

; Code here

_ReduceMemory()

While 1
  $msg = GUIGetMsg()
;    More code
Wend

Func _ReduceMemory($i_PID = -1)
    If $i_PID <> -1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf

    Return $ai_Return[0]
EndFunc   ;==>_ReduceMemory

Best regards,Emiel Wieldraaijer

Link to comment
Share on other sites

HI Jiim,

the first thing above the while should be _ReduceMemory ()

Example code

; Code here

_ReduceMemory()

While 1
  $msg = GUIGetMsg()
;    More code
Wend

Func _ReduceMemory($i_PID = -1)
    If $i_PID <> -1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf

    Return $ai_Return[0]
EndFunc   ;==>_ReduceMemory
Thanks. I read it's used when you need to free memory, so I placed it where functions which require lots of processing.
Link to comment
Share on other sites

@JamesB, JamesBrooks and Jiim.

Very off-subject, but I find it a bit confusing when the display name keeps changing. Not that it's anything to do with me you might say, but why change it?

Martin (aka Neophobe)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...