Hey everyone, I have searched high and low for this, but none of the solns seemed to help. I'm trying to toggle taskbar grouping by writing to the registry, but I have to resort to restarting explorer to make it work. Is there a solution for this already?
I'm running 64-bit Win 7.
Getting explorer to 'reload' registry changes
-
- Posts: 3
- Joined: 05 Nov 2017, 17:54
Re: Getting explorer to 'reload' registry changes
Restart explorer:
Code: Select all
list := ""
explorer_path := ""
; Get fullpath of all opened explorer windows:
If WinExist("ahk_class CabinetWClass") ; explorer
{
; https://autohotkey.com/boards/viewtopic.php?p=28751#p28751
for window in ComObjCreate("Shell.Application").Windows
{
try explorer_path := window.Document.Folder.Self.Path
list = %list%%explorer_path%`n
}
list := trim(list, "`n")
}
; restart the explorer.exe process:
RunWait, %comspec% /c taskkill /f /im explorer.exe ,,hide
Process, WaitClose, explorer.exe
Run, explorer.exe
; open all explorer windows we had open previously:
If (list != "")
{
Process, wait, explorer.exe
Loop, parse, list, `n
Run %A_LoopField%
}
-
- Posts: 3
- Joined: 05 Nov 2017, 17:54
Re: Getting explorer to 'reload' registry changes
This is the only way? I was looking for a more elegant solution. Is there a way to change taskbar settings some other way?GEV wrote:Restart explorer:Code: Select all
list := "" explorer_path := "" ; Get fullpath of all opened explorer windows: If WinExist("ahk_class CabinetWClass") ; explorer { ; https://autohotkey.com/boards/viewtopic.php?p=28751#p28751 for window in ComObjCreate("Shell.Application").Windows { try explorer_path := window.Document.Folder.Self.Path list = %list%%explorer_path%`n } list := trim(list, "`n") } ; restart the explorer.exe process: RunWait, %comspec% /c taskkill /f /im explorer.exe ,,hide Process, WaitClose, explorer.exe Run, explorer.exe ; open all explorer windows we had open previously: If (list != "") { Process, wait, explorer.exe Loop, parse, list, `n Run %A_LoopField% }
Re: Getting explorer to 'reload' registry changes
Some ideas that may or may not work:
- SHChangeNotify.
- Change something else about the taskbar to refresh it.
Get taskbar autohide state? Solved - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=39123
- Apply SystemParametersInfo to something related to the taskbar.
- WinSet Redraw.
What have you tried so far?
Also, if you post your code then people can run it and then test refresh methods.
- SHChangeNotify.
- Change something else about the taskbar to refresh it.
Get taskbar autohide state? Solved - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=39123
- Apply SystemParametersInfo to something related to the taskbar.
- WinSet Redraw.
What have you tried so far?
Also, if you post your code then people can run it and then test refresh methods.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
-
- Posts: 3
- Joined: 05 Nov 2017, 17:54
Re: Getting explorer to 'reload' registry changes
Thank you for the suggestions. None of them worked though, except SytemParametersInfo which I haven't been able to check out. I was hopeful about toggling the lock state of the taskbar, but alas...
Re: Getting explorer to 'reload' registry changes
I checked the taskbar with Microsoft Spy++, while changing the setting manually, it was receiving the message WM_SETTINGCHANGE.
Btw:
[get/set auto-hide/lock states]
Get taskbar autohide state? Solved - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 81#p179081
Code: Select all
q:: ;taskbar - toggle always/never combine (tested on Windows 7)
;do it manually: right-click taskbar, Properties, Taskbar tab, Taskbar buttons:
;vState := 0 ;Always combine, hide labels
;vState := 1 ;Combine when taskbar is full
;vState := 2 ;Never combine
RegRead, vState, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, TaskbarGlomLevel
vState := !vState * 2
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, TaskbarGlomLevel, % vState
;note: WM_SETTINGCHANGE is the same as WM_WININICHANGE
SendMessage, 0x1A,,,, ahk_class Shell_TrayWnd ;WM_SETTINGCHANGE := 0x1A
WinSet, Redraw,, ahk_class Shell_TrayWnd
return
;==================================================
;this is a fallback method, I recommend using the RegWrite/SendMessage/WinSet Redraw method
;w:: ;taskbar - toggle always/never combine (tested on Windows 7)
Run, % "rundll32 shell32.dll,Options_RunDLL 1" ;Taskbar and Start Menu Properties, Taskbar tab
vWinCriteria := "Taskbar and Start Menu Properties ahk_class #32770"
WinWaitActive, % vWinCriteria
SendMessage, 0x147, 0, 0, ComboBox2, % vWinCriteria
vNum := ErrorLevel+1
vNum := vNum=1?3:1
Control, Choose, % vNum, ComboBox2, % vWinCriteria
ControlSend, Button11, {Enter}, % vWinCriteria
return
[get/set auto-hide/lock states]
Get taskbar autohide state? Solved - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 81#p179081
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Who is online
Users browsing this forum: Google [Bot], roysubs and 170 guests