Jump to content

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

[How To] Hide, Disable or Replace Windows Start Button


  • Please log in to reply
25 replies to this topic
SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

How to Hide , Disable or Replace Windows Start Button ?
http://www.autohotke...p?p=54863#54863


[*:1yntjc1j]To Hide/Show "Windows Start Button"

Control, Hide, , Button1, ahk_class Shell_TrayWnd
Sleep, 5000
Control, Show, , Button1, ahk_class Shell_TrayWnd
[*:1yntjc1j]To Disable/Enable "Windows Start Button"
Control, Disable, , Button1, ahk_class Shell_TrayWnd
Sleep, 5000
Control, Enable, , Button1, ahk_class Shell_TrayWnd

Replacing the "Windows Start Button" :

We have to Hide the Start Button first! The space occupied by Start Button will be empty now.
I guess we cannot add a button directly to it.

BUT!... With a DllCall to "User32.dll\SetParent" function you can set a GUI to be a
"child window" to the Taskbar & the GUI will contain the button.

Thats it .. 8)

Important : The child GUI has a Button whose ClassNN will be Button1 (the same as Start Button !!!).
It is therefore imperative to issue a "GUI, Destroy" before attempting to Control, Show the "Start Button"


Putting the above theory into practical use, I present my

Posted Image

Posted Image . . . . . . . . . Posted Image

You may Download the version for XP : Button_Clock_WINXP.ahk
or View the code : Button_Clock_WINXP.ahk.txt

Posted Image . . . . . . . . . . . . Posted Image

You may Download the version for 9x : Button_Clock_WIN9X.ahk
or View the code : Button_Clock_WIN9X.ahk.txt
Related Posts for Reference :
[*:1yntjc1j]SysInfo in Task bar by Veovis
[*:1yntjc1j]Start Button Clock + cpu and memory usage (mod of Laszlo's) by evl
[*:1yntjc1j]Taskbar Clock/Calendar with Processor and Memory Load bars by Laszlo
[*:1yntjc1j]Desktop Sidebar ( The first use of "User32.dll\SetParent" Function !! ) by Rajat

[*:1yntjc1j]Posts by Serenity & Peter in Ask for Help Topic : How to bring up the Start Menu? - ralphh85
[*:1yntjc1j]evl's post in Ask for Help Topic : Change Start Menu Icon - Pef
[*:1yntjc1j]Shimanov's Post in Wish List Topic : Putting a gui in the taskbar - Phoenix
[*:1yntjc1j]Chris' Post in Ask for Help Topic : Docking on top of specific window - freakkk [as Guest]Edit: Feedback will be highly appreciated!
Edit: Posted @ WISH LIST : I wish some examples were given for "Control" Command...


Posted: 02-Apr-2006

I have an "Always Running Script" which has a very large & deep "Tray Menu". (My own "Start Menu")
When I forget the assigned Hotkeys to various tasks, this "Tray Menu" comes to my rescue.
I was calling the "Tray Menu" with a Hotkey Command - #Q::Menu,Tray,Show,5,5


I present a more effective way of Showing the Tray menu of a Script

Posted Image. ____________Posted Image

#Persistent
#SingleInstance, Ignore
#NoTrayIcon

Control, Hide, , Button1, ahk_class Shell_TrayWnd
OnExit, Exitt  

Gui, +ToolWindow -Caption           
Gui, +Lastfound                     
GUI_ID := WinExist()                
WinGet, TaskBar_ID, ID, ahk_class Shell_TrayWnd
DllCall("SetParent", "uint", GUI_ID, "uint", Taskbar_ID)

Gui, Margin,0,0
Gui, Font, S12 Bold, Times New Roman
Gui, Add,Button, w45 h30 gStartM, Start
Gui, Font, S8 Bold, Arial
Gui, Add,Button, x+0 w63 h30 gQuickM, My Menu
Gui, Show,x0 y0 AutoSize

Return

StartM:
Send ^{ESCAPE}
return

QuickM:
Menu,Tray,Show
return

Exitt:
  Gui,Destroy
  Control, Show, , Button1, ahk_class Shell_TrayWnd
  ExitApp  
Return


Posted : 03-Apr-2006

I recieved the following code as a "Personal Message" from Thalon and I am posting it here.

@Thalon: Thanks!. Its nicely written.

Posted Image

Download Thalon's Code : ButtonClock_CDT_WINXP.ahk
or View it : ButtonClock_CDT_WINXP.ahk.txt

Post your Comments/Suggestions..



Thalon
  • Members
  • 641 posts
  • Last active: Jan 02 2017 12:17 PM
  • Joined: 12 Jul 2005
I really enjoy your tips and tricks!
There are many interesting thing to learn about windows :)

Line 46 and 47 in Button_Clock_WINXP.ahk do not work at my pc (do not know why)
IfExist, Clock.ico
  Menu, Tray, Icon, Clock.ico
The script is located at my desktop (tested in subfolders too) and Clock.ico-File exists. But the script throws an error on execute line 47.

Error: Can't load icon. The current thread will exit.
Specifically: Clock.ico

Line#
041: IfNotExist,Clock.ico
042: URLDownloadToFile,https://ahknet.autohotkey.com/~goyyah/Tips-N-Tricks/TaskBar/Clock.ico,Clock.ico
046: IfExist,Clock.ico
---> 047: Menu,Tray,Icon,Clock.ico

I have removed the 2 lines and it works fine now. But maybe you do have an idea why this can be?

Thalon

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Dear Thalon, :)

I really enjoy your tips and tricks!


I feel glad about it.. :D :D
I thought I should refrain from updating this Topic.. but I was encouraged by having a watch
on the "Total Views" of this topic.

Your reply to this Topic boosts my morale.... :)

Thanks.. :D

I like have more of your opinions :

1) Do you find my Communication effective? (not Grammar!) ?
2) Will the info be easily understood by a New user (Newbie) ?
3) Is the Layout of my post "Viewer Friendly" ?

Line 46 and 47 in Button_Clock_WINXP.ahk do not work at my pc (do not know why)

IfExist, Clock.ico
  Menu, Tray, Icon, Clock.ico
... maybe you do have an idea why this can be?


:shock: I am not able to reproduce this error. Could there be some strange character between the two lines? If that is the case
IfExist, Clock.ico, Menu, Tray, Icon, Clock.ico
should help.

Please give me feedback. I am not sure whether I should update the code.

Thanks, :)

Thalon
  • Members
  • 641 posts
  • Last active: Jan 02 2017 12:17 PM
  • Joined: 12 Jul 2005
It seems the "UrlDownloadToFile" does something strange at my pc!
I have downloaded the clock.ico by using the link specified an I got a 766 Byte File which can be used well in script (no error).
With "UrlDownloadToFile" I get a 2.384 ByteFile of unknown format...

Could someone test this behaviour at his pc, too? I am using Version 1.0.42.07.

Thalon

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
I ran the line you gave:
URLDownloadToFile,https://ahknet.autohotkey.com/~goyyah/Tips-N-Tricks/TaskBar/Clock.ico,Clock.ico
I got that 766 byte file, displayed OK.
Isn't that you that have IE7beta? URLDownloadToFile is based on IE code, so a bug in IE may mean a but in the command.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

Thalon
  • Members
  • 641 posts
  • Last active: Jan 02 2017 12:17 PM
  • Joined: 12 Jul 2005
I am using IE 6.0.2900.2180 and normally I am using Firefox...
Seems not to be a general bug. I think I'll test it at home. Maybe there is some problem with our router or something like this...

Thalon

Thalon
  • Members
  • 641 posts
  • Last active: Jan 02 2017 12:17 PM
  • Joined: 12 Jul 2005
I have tested it at home now (same AHK-Version) and it works without any problems. I think it's some problem of our high security (software-development).

All fine :)

Thalon

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

Post update Notification: One More Example Added!.

[*:3hwaziac]How to Hide , Disable or Replace Windows Start Button ? posted 31-Mar-2006 - Updated 02-Apr-2006



SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

Post update Notification: One More Example Added - Thalon's Countdown Timer.

[*:4c8jvtdu]How to Hide , Disable or Replace Windows Start Button ? posted 31-Mar-2006 - Updated 03-Apr-2006



evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
The countdown display is a good idea - I'm almost tempted to switch to the Windows XP theme for the wider start button :lol: As I recall, someone else made use of an extra toolbar in the taskbar (like the Quicklaunch bar) to reserve space for their display, so I might give that a try too.

Thalon
  • Members
  • 641 posts
  • Last active: Jan 02 2017 12:17 PM
  • Joined: 12 Jul 2005
Thx to Goyyah for posting it :)
I am using it for several notifications and I think it will be extended soon.
Also Thx to Laszlo for the core-code of the Countdown-Timer.

Thalon

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

The countdown display is a good idea - I'm almost tempted to switch to the Windows XP theme for the wider start button :lol: As I recall, someone else made use of an extra toolbar in the taskbar (like the Quicklaunch bar) to reserve space for their display, so I might give that a try too.


Dear evl, :)
Thats Interesting.. Please share it with us once done.

Dear Thalon, :)
Please make any corrections to your code that I have posted on your behalf & PM me. I will update it.

I Thank you both for showing interest in this topic. Regards, :D

rbt137
  • Guests
  • Last active:
  • Joined: --
This is awesome!

I have looked for a countdown timer, seemingly forever. I have even thought of making it myself. Thankfully, you have done it for me.

Now I'm scared that microsoft will hire you and creative stuff like this will be forever gone.

this clock/timer combination is so much more useful than the start button.

Thanks!!!

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

Posted : 03-Apr-2006 @ http://www.autohotke...p?p=54863#54863

I recieved the following code as a "Personal Message" from Thalon and I am posting it here.

@Thalon: Thanks!. Its nicely written.

Posted Image

Download Thalon's Code : ButtonClock_CDT_WINXP.ahk
or View it : ButtonClock_CDT_WINXP.ahk.txt


rbt137 is referring to the above post.

Regards, :)

ballyhairs
  • Members
  • 112 posts
  • Last active: Sep 14 2009 10:02 PM
  • Joined: 02 Feb 2009
Hi Skan.. Is it possible you make a working solution to hide/disable Vista start button? Because the one you have doesn't work on Vista :(