James Posted December 29, 2007 Author Posted December 29, 2007 Emiel, thankyou, I shall do that! Piano, thanks man! I'm glad you like it! Justin, it's only a bit of fun, now you have spammed. Please don't get yourself into trouble! Saunders, that is ace, can I nick some things from it please? I am working on the new stuff now! James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted December 29, 2007 Author Posted December 29, 2007 To-do:Re-make the GUI: Menu, Size, ColoursAdd more information about the drivesMore functions: Auto update (I need to add it in), Copy data to clipboardAllow you to select different types of drivesMinimize to trayShow in tooltip on hover (regards to above)Save data in a config fileBug reportingNew icon (There is one for the compiled version) Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted December 29, 2007 Author Posted December 29, 2007 Alright, so before I go any further I want to show you what I have done so far If you can't see this image, my server is down, it will be back up at around 10am GMT+0 soon!Any thoughts, changes I could make? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Emiel Wieldraaijer Posted December 29, 2007 Posted December 29, 2007 Hi JamesB, I would add the option to remove cdrom and other drives which are not ready.. further i would remove the floppy drive.. because checking the space on a floppy drive will slow down the complete computer and causes the computer to make noise while checking it.. and if i were you .. i would spell my name correct Emiel instead om Emeil Best regards,Emiel Wieldraaijer
James Posted December 29, 2007 Author Posted December 29, 2007 (edited) Alright, I should be able to do that. I don't have an A:\ Drive altogether, there is nothing there but ok. This is going to complicate things. I will change your name too Edited December 29, 2007 by JamesB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
JustinReno Posted December 29, 2007 Posted December 29, 2007 Wow, this is really comming along. Good job! I like it.
James Posted December 29, 2007 Author Posted December 29, 2007 Thanks Justin. Any improvements I could make? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
JustinReno Posted December 29, 2007 Posted December 29, 2007 I'm not sure. From the screenshot above it looks really good.
James Posted December 29, 2007 Author Posted December 29, 2007 Thanks again! I am trying to get the data returned from the list into an array, but I am not getting very far. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted December 30, 2007 Author Posted December 30, 2007 I have made a start on the colour schemes They work really well. Has anyone got any colour schemes they would like? Back Colour Front Colour Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted December 30, 2007 Author Posted December 30, 2007 (edited) Here we go. New screenshot I personally like it.Check first post for the To-Do list. Edited December 30, 2007 by JamesB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted December 30, 2007 Author Posted December 30, 2007 I was thinking of maybe exporting the data to a file and then being able to import it as well. That would allow you to look at other people drives data. I don't know if it would be a good idea, but it could work. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
therks Posted December 30, 2007 Posted December 30, 2007 Saunders, that is ace, can I nick some things from it please?Again I am late to reply, but go for it. My AutoIt Stuff | My Github
James Posted December 30, 2007 Author Posted December 30, 2007 Lol, good, because otherwise I need to start again What do you think of the new look? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted December 30, 2007 Author Posted December 30, 2007 No problem Just wait until the next version! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Emiel Wieldraaijer Posted December 30, 2007 Posted December 30, 2007 Hi James, when are you going to release a new test version .. i'm curious Thnx Emiel Best regards,Emiel Wieldraaijer
James Posted December 30, 2007 Author Posted December 30, 2007 (edited) Infact here:You can try it now, unfinished and lots to do, you can also ask me things to add or remove.expandcollapse popup; Includes #include <GUIConstantsEx.au3> #include <GUIStatusBar.au3> #include <GUIListView.au3> #include <GuiEdit.au3> #include <Constants.au3> #include <File.au3> #include <Array.au3> ; Display no Tray Icon #NoTrayIcon ; Options for the program Opt("TrayOnEventMode", 1) Opt("TrayMenuMode", 1) TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "Minimize") ; Retrieve all drive types Global $_AllD = DriveGetDrive("ALL") ; Set the default parameters for the console Global $Warnings = True, $NR_Drives = False ; Location of the config file Global $Config_File = @ScriptDir & '\config.ini' ; Allow the creation of the data from the 1-Dimensional array ~ Martin Global $Data[$_AllD[0]] ; Set the parts for the status bar Local $Parts[2] = [175, 150] ; Allow multi control creation of controls ~ Nahuel Dim $Labels[$_AllD[0] + 1] Dim $Progress[$_AllD[0] + 1] #region GUI ; Create the GUI and the controls inside it $GUI = GUICreate("Disk Manager - James Brooks", 520, 400 + $_AllD[0] * 2) ; Create the menu #region Menu $M_File = GUICtrlCreateMenu("File") $M_Export = GUICtrlCreateMenuItem("Export Data", $M_File) $M_Import = GUICtrlCreateMenuItem("Import Data", $M_File) GUICtrlCreateMenuItem("", $M_File) $M_Copy = GUICtrlCreateMenuItem("Copy Data to Clipboard", $M_File) GUICtrlCreateMenuItem("", $M_File) $M_Exit = GUICtrlCreateMenuItem("Exit", $M_File) $M_Options = GUICtrlCreateMenu("Options") $M_Colours = GUICtrlCreateMenu("Colour Scheme", $M_Options) $M_Colours_Sea = GUICtrlCreateMenuItem("Sea", $M_Colours) $M_Colours_Mystic = GUICtrlCreateMenuItem("Mystic", $M_Colours) $M_Colours_HinSun = GUICtrlCreateMenuItem("Hindered Sun", $M_Colours) $M_Colours_Grass = GUICtrlCreateMenuItem("Grass", $M_Colours) $M_Colours_Simple = GUICtrlCreateMenuItem("Simple", $M_Colours) $M_Progress = GUICtrlCreateMenu("Progress Styles", $M_Options) $M_Progress_Solid = GUICtrlCreateMenuItem("Solid", $M_Progress) $M_Progress_Block = GUICtrlCreateMenuItem("Block", $M_Progress) $M_Help = GUICtrlCreateMenu("Help") $M_About = GUICtrlCreateMenuItem("About", $M_Help) $M_BugReport = GUICtrlCreateMenuItem("Report Bug", $M_Help) $M_HelpTopic = GUICtrlCreateMenuItem("Help Me", $M_Help) #endregion Menu ; 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 GUICtrlCreateGroup("Information", 10, 140, 160, ($_AllD * 2)) 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($Progress[$i]), "wstr", "", "wstr", "") If Not FileExists($Config_File) Then GUICtrlSetColor($Progress[$i], 0x94FF00) GUICtrlSetBkColor($Progress[$i], 0xFFFFFF) ElseIf FileExists($Config_File) Then GUICtrlSetColor($Progress[$i], IniRead($Config_File, "Scheme", "Front", "")) GUICtrlSetBkColor($Progress[$i], IniRead($Config_File, "Scheme", "Back", "")) EndIf Next GUICtrlCreateGroup("", -99, -99, 1, 1) ; Create a group for the console GUICtrlCreateGroup("Console", 180, 140, 330, 220) $ConsoleBox = GUICtrlCreateEdit("Welcome to Disk Manager by James Brooks" & @CRLF & "Commands:" & @CRLF & _ @TAB & "warn [-t = Show -f = Hide]" & @CRLF & @TAB & "clear" & @CRLF & @TAB & "export" & _ @CRLF & @TAB & "help" & @CRLF, 190, 160, 310, 170, $WS_VSCROLL) GUICtrlSetFont(-1, 8.5, 400, Default, "Courier New") GUICtrlSetColor(-1, IniRead($Config_File, "Scheme", "Console", "")) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($ConsoleBox), "wstr", "", "wstr", "") $Console = GUICtrlCreateInput("", 190, 340, 310, 17) GUICtrlSetFont(-1, 8.5, 400, Default, "Courier New") GUICtrlCreateGroup("", -99, -99, 1, 1) ; We have to show the GUI GUISetState(@SW_SHOW) #endregion Menu ; Insert data into the listview made above _Drives() While 1 $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE Exit ; If you press X then close the window Case $iMsg = $GUI_EVENT_MINIMIZE GUISetState(@SW_HIDE) TraySetState(1) ; Minimize the GUI to the tray Case $iMsg = $M_Export _ExportData() ; Export the data NOT WORKING YET Case $iMsg = $Console $Com = StringLower(GUICtrlRead($Console)) If $Com = "warn -t" Then $Warnings = True _GUICtrlEdit_AppendText($ConsoleBox, "Warnings on" & @CRLF) GUICtrlSetData($Console, "") EndIf If $Com = "warn -f" Then $Warnings = False _GUICtrlEdit_AppendText($ConsoleBox, "Warnings off" & @CRLF) GUICtrlSetData($Console, "") EndIf If $Com = "clear" Then GUICtrlSetData($ConsoleBox, "") GUICtrlSetData($Console, "") EndIf If $Com = "help" Then _GUICtrlEdit_AppendText($ConsoleBox, "Commands:" & @CRLF) GUICtrlSetData($Console, "") EndIf If $Com = "about" Then _GUICtrlEdit_AppendText($ConsoleBox, "Disk Manager by James Brooks" & @CRLF & "Thanks to the AutoIt " & _ "Community for helping me with this project. Special thanks to, Nahuel, Saunders, Gary Frost, Valuater, " & _ "Martin & Emiel Wieldraaijer for their help, support and contribution to it!" & @CRLF) GUICtrlSetData($Console, "") EndIf If $Com = "export" Then $Info = _ExportData() _ArrayDisplay($Info) GUICtrlSetData($Console, "") EndIf If $Com = "update" Then _Drives() GUICtrlSetData($Console, "") _GUICtrlEdit_AppendText($ConsoleBox, "Retrieved devices") EndIf ; Read through the console Case $iMsg = $M_About About() ; Display the about box Case $iMsg = $M_BugReport BugReport() Case $iMsg = $M_Import Import() Case $iMsg = $M_Colours_Simple If Not FileExists($Config_File) Then _FileCreate($Config_File) Else IniWrite($Config_File, "Scheme", "Back", "0x8BD1E0") IniWrite($Config_File, "Scheme", "Front", "0xC1C1C1") IniWrite($Config_File, "Scheme", "Console", "0x000000") _GUICtrlStatusBar_SetText($StatusBar, "Config file was created!") For $z = 1 To $_AllD[0] GUICtrlSetColor($Progress[$z], IniRead($Config_File, "Scheme", "Front", "")) GUICtrlSetBkColor($Progress[$z], IniRead($Config_File, "Scheme", "Back", "")) GUICtrlSetColor($ConsoleBox, IniRead($Config_File, "Scheme", "Console", "")) Next EndIf ; Set the colour scheme to a simple blue and grey Case $iMsg = $M_Colours_Mystic If Not FileExists($Config_File) Then _FileCreate($Config_File) Else IniWrite($Config_File, "Scheme", "Back", "0x6F6F6F") IniWrite($Config_File, "Scheme", "Front", "0xCC3300") IniWrite($Config_File, "Scheme", "Console", "0xCC3300") _GUICtrlStatusBar_SetText($StatusBar, "Config file was created!") For $z = 1 To $_AllD[0] GUICtrlSetColor($Progress[$z], IniRead($Config_File, "Scheme", "Front", "")) GUICtrlSetBkColor($Progress[$z], IniRead($Config_File, "Scheme", "Back", "")) GUICtrlSetColor($ConsoleBox, IniRead($Config_File, "Scheme", "Console", "")) Next EndIf ; Set the colour scheme to Grey and Red Case $iMsg = $M_Colours_Sea If Not FileExists($Config_File) Then _FileCreate($Config_File) Else IniWrite($Config_File, "Scheme", "Back", "0x96B6E5") IniWrite($Config_File, "Scheme", "Front", "0xC4E596") IniWrite($Config_File, "Scheme", "Console", "0x508238") _GUICtrlStatusBar_SetText($StatusBar, "Config file was created!") For $z = 1 To $_AllD[0] GUICtrlSetColor($Progress[$z], IniRead($Config_File, "Scheme", "Front", "")) GUICtrlSetBkColor($Progress[$z], IniRead($Config_File, "Scheme", "Back", "")) GUICtrlSetColor($ConsoleBox, IniRead($Config_File, "Scheme", "Console", "")) Next EndIf ; Set the colour scheme to Blue and Green Case $iMsg = $M_Colours_HinSun If Not FileExists($Config_File) Then _FileCreate($Config_File) Else IniWrite($Config_File, "Scheme", "Back", "0xCC3300") IniWrite($Config_File, "Scheme", "Front", "0xE8A03A") IniWrite($Config_File, "Scheme", "Console", "0xCC3300") _GUICtrlStatusBar_SetText($StatusBar, "Config file was created!") For $z = 1 To $_AllD[0] GUICtrlSetColor($Progress[$z], IniRead($Config_File, "Scheme", "Front", "")) GUICtrlSetBkColor($Progress[$z], IniRead($Config_File, "Scheme", "Back", "")) GUICtrlSetColor($ConsoleBox, IniRead($Config_File, "Scheme", "Console", "")) Next EndIf Case $iMsg = $M_Colours_Grass If Not FileExists($Config_File) Then _FileCreate($Config_File) Else IniWrite($Config_File, "Scheme", "Back", "0x89d464") IniWrite($Config_File, "Scheme", "Front", "0xC5D464") IniWrite($Config_File, "Scheme", "Console", "0x508238") _GUICtrlStatusBar_SetText($StatusBar, "Config file was created!") For $z = 1 To $_AllD[0] GUICtrlSetColor($Progress[$z], IniRead($Config_File, "Scheme", "Front", "")) GUICtrlSetBkColor($Progress[$z], IniRead($Config_File, "Scheme", "Back", "")) GUICtrlSetColor($ConsoleBox, IniRead($Config_File, "Scheme", "Console", "")) Next EndIf EndSelect WEnd Func _Drives() For $a = 1 To $_AllD[0] $Total = DriveSpaceTotal($_AllD[$a]) $Free = Round(DriveSpaceFree($_AllD[$a])) $Used = Round($Total - $Free) $Letter = StringUpper($_AllD[$a]) $Label = DriveGetLabel($_AllD[$a]) If $Label = '' Then $Label = "[None]" $Type = DriveGetType($_AllD[$a]) If $Type = 'UNKNOWN' Then $Type = "[Unknown]" $Status = DriveStatus($_AllD[$a]) $FSys = DriveGetFileSystem($_AllD[$a]) If $FSys = '' Then $FSys = "[None]" $Serial = DriveGetSerial($_AllD[$a]) If $Serial = '' Then $Serial = "[None]" $sItem = $Letter & "|" & $Label & "|" & $Type & "|" & $Status & "|" & $FSys & "|" & $Serial & "|" & $Free & "|" & _ $Used & "|" & $Total $iItem = _GUICtrlListView_InsertItem($DriveList, "", -1, 1) _GUICtrlListView_SetItemText($DriveList, $iItem, $sItem, -1) GUICtrlSetData($Progress[$a], $Used / 1024); not precise ~ Valuater edited my Me $Data[$a - 1] = StringSplit($sItem, "|") Next TrayTip("Disk Manager", "Drive data was loaded!", 10, 1) If @error Then If $Warnings = True Then _GUICtrlEdit_AppendText($ConsoleBox, "There was an error reading disk data!" & @CRLF) EndIf _GUICtrlStatusBar_SetText($StatusBar, "Drive Data was loaded!") ; Retrieve all device data EndFunc ;==>_Drives Func _CopyToClipBoard() ; Copies all data to the clipboard for further analysis EndFunc ;==>_CopyToClipBoard Func Minimize() TraySetState(2) GUISetState(@SW_SHOW) TraySetToolTip("Disk Manager") ; Minimize function EndFunc ;==>Minimize Func About() $About = GUICreate("About Disk Manager", 300, 200) GUICtrlCreateLabel("Disk Manager by James Brooks" & @CRLF & @CRLF & "Thanks to the AutoIt " & _ "Community for helping me with this" & @CRLF & "project. Special thanks to, Nahuel, Saunders, " & _ @CRLF & "Gary Frost, Valuater, Martin and" & @CRLF & "Emiel Wieldraaijer for their help, support and contribution to it!", 10, 10) $Link = GUICtrlCreateLabel("Please visit my site for more programs!", 10, 100, 280) GUICtrlSetColor(-1, 0x0000FF) GUICtrlSetFont(-1, Default, Default, 4) GUICtrlSetCursor(-1, 2) GUISetState(@SW_SHOW, $About) While WinActive($About) $aMsg = GUIGetMsg() Switch $aMsg Case $GUI_EVENT_CLOSE GUIDelete($About) Case $Link ShellExecute("http://www.james-brooks.net") EndSwitch WEnd ; About window EndFunc ;==>About Func BugReport() MsgBox(0, "Disk Manager", "Bug reporting is only installed in the Compiled Version!") EndFunc ;==>BugReport Func Help() ; ShellExecute("http://www.james-brooks.net/help/prog-man/index.php") ; Pages not setup yet EndFunc ;==>Help Func Import() $File = FileOpenDialog("Disk Manager", @ScriptDir, "DMan Files (*.dma)", 1 + 2) If @error Then MsgBox(4096, "", "No File chosen") _GUICtrlStatusBar_SetText($StatusBar, "Error importing external deivce data") Else _GUICtrlListView_DeleteAllItems($DriveList) MsgBox(0, "Disk Manager", "Import soon") EndIf EndFunc ;==>Import Func _ExportData() For $n = 0 To UBound($Data) - 1 _ArrayDisplay($Data[$n]);each element is an array so specify the element Next If @error Then _GUICtrlEdit_AppendText($ConsoleBox, "Error exporting data!" & @CRLF) Else _GUICtrlStatusBar_SetText($StatusBar, "Data was exported" & @CRLF) EndIf ; Export the data into a specified file ~ Martin EndFunc ;==>_ExportDataLots of improvements.Martin has sped up the array and made it smaller! If you haven't already copy the code again! I have just fixed the problem that if there is no config file the progress bar will set a "default" colour. Please get yet again! Edited December 30, 2007 by JamesB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted December 30, 2007 Author Posted December 30, 2007 Update:At the moment, I am working on the export function Unfortunatley it's not so easy. Martin provided me with some code:Func _ExportData() $io_file = FileOpen(@ScriptDir & '\Export.DMA', 2) If FileExists(@ScriptDir & '\Export.DMA') Then FileDelete(@ScriptDir & '\Export.DMA') ; Delete the file if it exists FileWrite($io_file, "// Export data for computer: " & @ComputerName & @CRLF) FileWrite($io_file, "// Exported on: " & @MDAY & "/" & @MON & "/" & @YEAR & @CRLF) FileWrite($io_file, "// Exported by: " & @UserName & @CRLF) For $n = 0 To UBound($Data) - 1 FileWrite($io_file, $Data[$n] & @CRLF) ;_ArrayDisplay($Data[$n]);each element is an array so specify the element Next FileClose($io_file) If @error Then _GUICtrlEdit_AppendText($ConsoleBox, "Error exporting data!" & @CRLF) Else _GUICtrlStatusBar_SetText($StatusBar, "Data was exported" & @CRLF) EndIf ; Export the data into a specified file ~ Martin edited by Me EndFunc ;==>_ExportDataYet, it doesn't work how I need it to, which is, to write all the data in a "list" for each drive. Well if anyone can make it work please tell me After the export function I will start work on an Import function so that you can import other peoples drive data into the program. Once the export is done, this will be really simple! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ptrex Posted December 30, 2007 Posted December 30, 2007 @JamesbMaybe look at my export function in this script DFFIt creates a CSV file that can be read by Excel.regards,ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now