AutoHotkey Community

It is currently May 27th, 2012, 11:57 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: October 25th, 2010, 9:29 pm 
Offline

Joined: June 5th, 2008, 8:26 pm
Posts: 38
In Windows 7, if you view the Taskbar and Start Menu settings, you can toggle how taskbar entries are shown. I like using the "Never Combine" option, but sometimes I have a ton of windows and I'd like to switch to the "Always combine, hide labels" method instead.

Is there a way to do this via a hotkey?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2010, 12:21 pm 
Offline

Joined: May 13th, 2010, 10:11 am
Posts: 352
Location: Houston, Tx.
+1


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2010, 4:05 pm 
Offline

Joined: February 29th, 2008, 8:36 pm
Posts: 901
Location: Vault 7
there might be a better way, but this is what I've got:
Code:
#SingleInstance Force
F1::
   run Rundll32.exe C:\WINDOWS\SYSTEM32\SHELL32.DLL`,Options_RunDLL 1
   title := "Taskbar and Start Menu Properties"
   WinWaitActive %title%,,5
   if ErrorLevel
      TrayTip,, failed (probably) try again
   ControlGet, text, Choice,, ComboBox2, %title%
   other := InStr(text,"Always") ? "never" : "always"
   Control, ChooseString, %other%, ComboBox2, %title%
   ControlSend,,!a,%title%
   WinClose %title%
return
F2::reload



If you push the hotkey too fast, it'll sometimes fail. That's why I added the 5 second timeout. For normal use, it shouldn't matter... but just to be safe.

_________________
ImageDebugging,Container,FileContainer,Object Preferences,ShellFileOperation


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2010, 4:06 pm 
Offline

Joined: May 1st, 2010, 6:01 pm
Posts: 1020
Location: England
i would suggest trying to find the option in registry and using regchange


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2010, 4:26 pm 
Offline

Joined: February 29th, 2008, 8:36 pm
Posts: 901
Location: Vault 7
What is "regchange"? My experience with registry edits is that they don't take effect until Windows feels the need to check for a change. Restarting explorer would be a pain in this situation.

_________________
ImageDebugging,Container,FileContainer,Object Preferences,ShellFileOperation


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2010, 4:29 pm 
Offline

Joined: June 7th, 2010, 3:40 pm
Posts: 553
The registry entry is located here: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\

Key name: TaskbarGlomLevel
Key type: REG_DWORD

Value meaning:
0 (Always combine)
1 (Combine when full)
2 (Never combine)

However, changing it doesn't effect the taskbar until logoff/logon. You would need to find the correct dll call to refresh the view.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 26th, 2010, 4:53 pm 
Offline

Joined: February 29th, 2008, 8:36 pm
Posts: 901
Location: Vault 7
I've always been somewhat curious about this, so I'll keep digging. Something I've found:

http://www.codeguru.com/forum/archive/i ... 32620.html

_________________
ImageDebugging,Container,FileContainer,Object Preferences,ShellFileOperation


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2010, 5:12 pm 
Offline

Joined: June 5th, 2008, 8:26 pm
Posts: 38
Thanks guys, I was thinking of editing the registry too but I knew it wouldn't update the view until logon/logoff. If someone can find out the DLLCall to make, then we'll be golden!

Rapte_Of_Suzaku's method was the other way I would have gone about doing it, but it seems too messy opening up the window and everything.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2010, 5:53 pm 
Offline

Joined: February 29th, 2008, 8:36 pm
Posts: 901
Location: Vault 7
O_o I got it!!!!

Give me a moment to put it all together in a nicer format. I probably did it the wrong way or the hard way or something, but at least it works!

_________________
ImageDebugging,Container,FileContainer,Object Preferences,ShellFileOperation


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2010, 5:55 pm 
Offline

Joined: May 13th, 2010, 10:11 am
Posts: 352
Location: Houston, Tx.
Ahh!! Prove it :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2010, 6:00 pm 
Offline

Joined: February 29th, 2008, 8:36 pm
Posts: 901
Location: Vault 7
Code:
#SingleInstance Force
F1::
    RegRead, current, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, TaskbarGlomLevel
    RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, TaskbarGlomLevel, % abs(current-2)
   
    id := WinExist("ahk_class Shell_TrayWnd")
    DllCall("RedrawWindow",int,id,int,0,int,0,int
                                            , RDW_INVALIDATE  := 0x1
                                            | RDW_ALLCHILDREN := 0x80
                                            | RDW_FRAME       := 0x400
                                            | RDW_UPDATENOW   := 0x100)
    SendMessage, % WM_WININICHANGE := 0x001A
Return
F2::reload

_________________
ImageDebugging,Container,FileContainer,Object Preferences,ShellFileOperation


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2010, 8:47 pm 
Offline

Joined: June 5th, 2008, 8:26 pm
Posts: 38
Rapte_Of_Suzaku wrote:
Code:
#SingleInstance Force
F1::
    RegRead, current, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, TaskbarGlomLevel
    RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, TaskbarGlomLevel, % abs(current-2)
   
    id := WinExist("ahk_class Shell_TrayWnd")
    DllCall("RedrawWindow",int,id,int,0,int,0,int
                                            , RDW_INVALIDATE  := 0x1
                                            | RDW_ALLCHILDREN := 0x80
                                            | RDW_FRAME       := 0x400
                                            | RDW_UPDATENOW   := 0x100)
    SendMessage, % WM_WININICHANGE := 0x001A
Return
F2::reload


It works! :D

Thanks! I'm sure this will be useful for a lot of people!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 24th, 2011, 11:55 am 
Offline

Joined: July 27th, 2005, 9:02 am
Posts: 2
Location: Lausanne (Switzerland)
Thanks for the script, here is my version for french version of Win7 I kept all the debug lines to help beginners like me to better understand what is doing the script.

HTH

Code:
;In Windows 7, if you view the Taskbar and Start Menu settings, you can toggle how taskbar entries are shown.
;I like using the "Never Combine" option, but sometimes I have a ton of windows and I'd like to switch to the "Always combine, hide labels" method instead.
#SingleInstance Force
;!F1 -> Alt + F1
!F1::
 run Rundll32.exe C:\WINDOWS\SYSTEM32\SHELL32.DLL`,Options_RunDLL 1
   title := "Propriétés de la barre des tâches et du menu Démarrer"
   WinWaitActive %title%,,5
   if ErrorLevel
      TrayTip,, failed (probably) try again

      ;ControlGet, List, List,, ComboBox2, %title%
      ;Loop, Parse, List, `n
      ;MsgBox Item number %A_Index% is %A_LoopField%.

    ;Get the currently selected entry in the ComboBox
    ;Choice: Sets OutputVar to be the name of the currently selected entry in a ListBox or ComboBox.
    ControlGet, text, Choice,, ComboBox2, %title%   
   
    ;MsgBox, The currently selected entry is %text%.
     ;other := InStr(text,"Always") ? "never" : "always"
   
    other := InStr(text,"Toujours") ? "Ne jamais combiner" : "Toujours combiner, et masquer le texte"
    ;other := InStr(List,"Ne jamais combiner") ? "Toujours combiner, et masquer le texte" : "Ne jamais combiner"

   ;ControlGet, List, List,, ComboBox2, %title%
   ;other := "Toujours combiner, et masquer le texte"
   ;other := "Combiner lorsque la barre des tâches est pleine"
   ;other := "Ne jamais combiner"
   
   ;MsgBox, The length of InputVar is %other%.
   
   Control, ChooseString, %other%, ComboBox2, %title%
   ControlSend,,!a,%title%
   WinClose %title%
return
!F2::Reload


PS BTW I was not able to use the last version of Rapte_Of_Suzaku on the Win7 french version that's why I used this version

_________________
_________________
Best Regards

Gil

Use what talents you possess;
the woods would be very silent if no
birds sang except those that sang best.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, Google Feedfetcher and 20 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