Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Desktop Sidebar


  • Please log in to reply
10 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Here's a Desktop Sidebar for your desktop.
You can add as many modules to it as you like.

Script

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Looks pretty cool. I like its creative use of SetParent.

  • Guests
  • Last active:
  • Joined: --
How can you add the it so you can have a right click menu ?
I tried this but it stop the rest of the script .
Like to add to menu to add border and remove border with the
Gui, +ToolWindow -Border
Menu, tray, add, Item1, MenuHandler
return
DetectHiddenWindows, On

;set drives here
Drives = CDEF

Gui, +ToolWindow +Border

;transparency
Gui, Color, FF33FF

;keep updating PosY after every item added
PosY = 7

Loop, Parse, Drives
{
	BarPos := PosY + 2
	Gui, Add, Text, x6 y%PosY% w20 h20, %A_LOOPFIELD%:
	Gui, Add, Progress, x26 y%BarPos% w60 h10 vBar%A_Index%,
	PosY += 20
}
PosY += 10

FormatTime, CurrTime, , h:mm tt 
Gui, Add, Text, x6 y%PosY% w80 h40 vTime, %CurrTime%`n%A_DD% %A_MMM%`, %A_DDDD%
PosY += 40
 
Gui, Show, x684 y250 h%PosY% w95, DeskBar

WinSet, TransColor, FF33FF, DeskBar

WinGet, Prnt, ID, Program Manager
WinGet, Chld, ID, DeskBar
DllCall("SetParent", Int, Chld, Int, Prnt)




Gosub, CheckFree
SetTimer, CheckFree, 30000
SetTimer, TimeShow, 1000
Return

GuiClose:
ExitApp


CheckFree:
	Loop, Parse, Drives
	{
		DriveGet, %A_LOOPFIELD%_Cap, Capacity, %A_LOOPFIELD%:
		DriveSpaceFree, %A_LOOPFIELD%_Free, %A_LOOPFIELD%:
		%A_LOOPFIELD%_Bar := ( %A_LOOPFIELD%_Cap - %A_LOOPFIELD%_Free ) / %A_LOOPFIELD%_Cap * 100
		GuiControl,, Bar%A_Index%, % %A_LOOPFIELD%_Bar
	}
Return

TimeShow:
	FormatTime, CurrTime,, h:mm tt 
	GuiControl,, Time, %CurrTime%`n%A_DD% %A_MMM%`, %A_DDDD%
Return
Menu, tray, add, Item1, MenuHandler
return
MenuHandler:
MsgBox You selected %A_ThisMenuItem% from menu %A_ThisMenu%
return


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
remove 'return' from second line.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


  • Guests
  • Last active:
  • Joined: --
Thank you , this is what I have so far and it works nice .
Menu, tray, add, Addborder, border
RegRead, pname, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion, ProductName
RegRead, pspack, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion, CSDVersion
RegRead, pbuild, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion, CurrentBuildNumber 
DetectHiddenWindows, On
Gui, Add, Text,x5 y175 w100 h100, You're using`n %pname%, %pspack%, Build %pbuild% 
;set drives here
Drives = CDEF

Gui, +ToolWindow +Border

;transparency
Gui, Color, FF33FF

;keep updating PosY after every item added
PosY = 7

Loop, Parse, Drives
{
	BarPos := PosY + 2
	Gui, Add, Text, x6 y%PosY% w20 h20, %A_LOOPFIELD%:
	Gui, Add, Progress, x26 y%BarPos% w60 h10 vBar%A_Index%,
	PosY += 20
}
PosY += 10

FormatTime, CurrTime, , h:mm tt 
Gui, Add, Text, x6 y%PosY% w80 h40 vTime, %CurrTime%`n%A_DD% %A_MMM%`, %A_DDDD%
PosY += 40
 
Gui, Show, x600 y250 h300 w150, DeskBar

WinSet, TransColor, FF33FF, DeskBar

WinGet, Prnt, ID, Program Manager
WinGet, Chld, ID, DeskBar
DllCall("SetParent", Int, Chld, Int, Prnt)




Gosub, CheckFree
SetTimer, CheckFree, 30000
SetTimer, TimeShow, 1000
Return

GuiClose:
ExitApp


CheckFree:
	Loop, Parse, Drives
	{
		DriveGet, %A_LOOPFIELD%_Cap, Capacity, %A_LOOPFIELD%:
		DriveSpaceFree, %A_LOOPFIELD%_Free, %A_LOOPFIELD%:
		%A_LOOPFIELD%_Bar := ( %A_LOOPFIELD%_Cap - %A_LOOPFIELD%_Free ) / %A_LOOPFIELD%_Cap * 100
		GuiControl,, Bar%A_Index%, % %A_LOOPFIELD%_Bar
	}
Return

TimeShow:
	FormatTime, CurrTime,, h:mm tt 
	GuiControl,, Time, %CurrTime%`n%A_DD% %A_MMM%`, %A_DDDD%
Return
Menu, tray, add, Removeborder, MenuHandler
return
MenuHandler:
Gui, +ToolWindow -Border
return
Menu, tray, add, Addborder, border
return
border:
Gui, +ToolWindow +Border
return


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
nice!

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


  • Guests
  • Last active:
  • Joined: --
Anyway to read ram usage and show it like the hard drives ?

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
i don't know of a pure ahk solution to that.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


  • Guests
  • Last active:
  • Joined: --
Ok thanks Rajat .

Tekl
  • Members
  • 814 posts
  • Last active: May 03 2009 03:28 PM
  • Joined: 24 Sep 2004
Hi,

no example here works at my XP Home? Do I understand it right, that a Deskbar is like the searchfield of Google Desktop or MSN Search in the Taskbar?
Tekl

ninja
  • Members
  • 15 posts
  • Last active: Mar 23 2006 03:19 PM
  • Joined: 15 Nov 2005
This is awesome! Question though...Is it possible to use this sidebar as a launchpad for files? Right now I'm using a couple of listview windows, but I like this sidebar due to the fact that it has no taskbar button. Or is this mainly for viewing stats?