AutoHotkey Community

It is currently May 27th, 2012, 5:01 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: July 14th, 2006, 9:49 pm 
Offline

Joined: May 9th, 2006, 11:00 pm
Posts: 94
Hello once more folks ^_^
Today i am sharing one of my lil' tool.
Actually its the one i used the most. (almost 1000 times a day)
And when i was relooking it today, i thought that maybe someone would like to use it aswell :o

It's not a kick ass script, like you would see at lazlo's or titan's T_T .... but anyway, im quite proud of it as there wasn't anyone who posted something similar before.

The gui is adaptative, which means depending on how many drives you got, and the size on it, the aligement will still be good, and hopefully the gui will not be messy (Still, if there are bugs report them!).

And yes, there are no useless pixel, everything was calculated just to be slick... using a magnifier proggy to be sure of it x_x

CTRL+SHIFT+S => show the gui.... that's all you need to know...

This tool is made for use with programming fonts (single spaced), or the alignements will be really messy :P
You can change it in the script.
My favourite : S8 Dina ^^"

Download Dina Font

So, here we are :
Code:
#SingleInstance Force
SetBatchLines, -1
SetFormat, float, 5.1

Menu, Tray, Add, Exit
Menu, Tray, Tip, Free Space
Menu, Tray, Nostandard
Return

GuiEscape:
Default:
^+s::
If Toggle
{
   Gui, Destroy
   Toggle--
}
Else
{
   Gosub, Get_List
   Gosub, Gui_Create
   Gui, Show, w178 h%Height%, Free Space
   WinSet, Region, % "0-8 3-6 9-6 9-1 64-1 64-6 176-6 178-8 178-"Height-4 " 175-"Height " 2-"Height " 0-"Height-4, Free Space
   Toggle++
}
Return

Get_List:
DrvNum = 0
DriveGet, FD_List, List, Fixed
Loop Parse, FD_List
{
   
   Spaces := "       "
   DriveGet, Cap_%A_LoopField%, Cap, %A_LoopField%:\
   DriveSpaceFree, Free_Space, %A_LoopField%:\    ;Get the free space in each drive
   Percent_Free :=  Free_Space / (Cap_%A_LoopField%) * 100
   If (Free_Space > 1000)
   {
      SetFormat, Float, 0.3
      Free_Space = %Free_Space%.0            ;Treat free space like a float
      Free_Space /= 1000
      Unit = Go
      StringTrimRight, Spaces, Spaces, % (Strlen(Free_Space) - 1)   ;Reduce the number of spaces
   }
   Else
   {
      StringTrimRight, Spaces, Spaces, %  (Strlen(Free_Space) - 1)
      Unit = Mo
   }
   SetFormat, float, 5.1
   Result := (Result . A_LoopField ":\" Spaces . Free_Space " " Unit " [" Percent_Free "%] `n") ;Create the list
   DrvNum++                        ;Count drives
}

StringTrimRight, Result, Result, 1    ;Delete the tailing linefeed char
Return

Gui_Create:
Height := 17+12*DrvNum          ;Height depends on how many drives are present
Gui, Margin, x0, y0
Gui, Add, GroupBox, x0 y0 w178 h%Height%, Free Space
Gui, -Caption +AlwaysOnTop +ToolWindow
Gui, Font, s8, Dina
Gui, Add, Text, xp+9 yp+13, %Result%
Result =             ;Frees the result list
Return

Exit:
ExitApp


Please feel free to add any comments.




Updates : Fixed bug with number format and unit.

_________________
Image


Last edited by Eleria on July 15th, 2006, 11:25 am, edited 7 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 14th, 2006, 10:03 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Neat! If you need it so often, have you considered putting it in the taskbar, or over the start button and update the data regularly?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 14th, 2006, 10:14 pm 
Offline

Joined: May 9th, 2006, 11:00 pm
Posts: 94
"Its useless to update it from time to time , using processor cycles for about nothing.. just hit ctrl+shift+s when you want to know about your free space, and it will re calculate the date in no time :P..... "
Thats what i came up with ^^"

You can say i am some kind of minimalistic and i like using my keyboard to activate stuff, so the timer thing is not an option... for me ...

But if someone want it that way... just go ahead and modify it ... ^_^

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 15th, 2006, 10:06 am 
Offline

Joined: May 9th, 2006, 11:00 pm
Posts: 94
Now it shows the free space in percentage of the total volume size to the right side ^_^, updated code consequently...

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Up !
PostPosted: April 23rd, 2010, 6:04 pm 
Seems like you should not have too many disks, as the windows does not expand itself.
But useful anyway.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2010, 10:45 am 
Offline

Joined: January 23rd, 2010, 1:13 pm
Posts: 6
Code:
Height := 25+12*DrvNum

in Gui_Create 25 in stead of 17 seems better to me.
I also got rid of Fixed
Code:
DriveGet, FD_List, List,Fixed

in Get_List so that removable devices would be recognized too


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Stigg and 9 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group