AutoHotkey Community

It is currently May 27th, 2012, 8:28 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: March 30th, 2006, 10:16 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Quote:
How to Hide , Disable or Replace Windows Start Button ?
http://www.autohotkey.com/forum/viewtopic.php?p=54863#54863


  • To Hide/Show "Windows Start Button"
Code:
Control, Hide, , Button1, ahk_class Shell_TrayWnd
Sleep, 5000
Control, Show, , Button1, ahk_class Shell_TrayWnd

  • To Disable/Enable "Windows Start Button"
Code:
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"



Related Posts for Reference :
Edit: Feedback will be highly appreciated!
Edit: Posted @ WISH LIST : I wish some examples were given for "Control" Command...


Quote:
    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

    Image. ____________Image
Code:
#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


Quote:
    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.

    Image

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

    Post your Comments/Suggestions..


Last edited by SKAN on May 19th, 2012, 7:40 am, edited 7 times in total.
fix underline formatting


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 31st, 2006, 7:30 am 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
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)
Code:
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.
Quote:
Error: Can't load icon. The current thread will exit.
Specifically: Clock.ico

Line#
041: IfNotExist,Clock.ico
042: URLDownloadToFile,http://www.autohotkey.net/~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

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 31st, 2006, 9:12 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Dear Thalon, :)

You wrote:
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" ?

You wrote:
Line 46 and 47 in Button_Clock_WINXP.ahk do not work at my pc (do not know why)
Code:
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
Code:
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, :)


Last edited by SKAN on June 16th, 2008, 7:26 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 31st, 2006, 11:19 am 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
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

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 31st, 2006, 11:41 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
I ran the line you gave:
URLDownloadToFile,http://www.autohotkey.net/~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.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 31st, 2006, 12:13 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
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

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 31st, 2006, 4:45 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
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

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 2nd, 2006, 9:13 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Quote:


Last edited by SKAN on June 16th, 2008, 7:27 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2006, 10:40 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Quote:


Last edited by SKAN on June 16th, 2008, 7:27 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2006, 1:06 pm 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2006, 6:58 pm 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
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

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 4th, 2006, 9:46 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
evl wrote:
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


Last edited by SKAN on June 16th, 2008, 7:27 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 24th, 2006, 5:19 pm 
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!!!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 24th, 2006, 5:45 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Quote:
Posted : 03-Apr-2006 @ http://www.autohotkey.com/forum/viewtopic.php?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.

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, :)


Last edited by SKAN on June 16th, 2008, 7:33 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: Vista Start Button
PostPosted: July 26th, 2009, 11:45 am 
Offline

Joined: February 2nd, 2009, 2:03 pm
Posts: 112
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 :(


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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