2

I want to use a keyboard shortcut (if possible one which I can choose myself) to manually hide/show the Windows taskbar in Windows 7. I prefer a manual way to set up the shortcut. If this is not possible I take a portable software (one that works from a flash drive) that will do it for me. But in the end I'm open to any suggestions.

I already know about:

  • AutoHotkey (individual keyboard shortcut, portable software based)
  • Aviassin Taskbar Eliminator (pre-set keyboard shortcut, portable software based)
  • RocketDock (software based - installation required)

Please note: this is not a duplicate of this question (which ask how to enable/disable the auto hide feature): Script/Tool to Auto Hide/Unhide Windows Taskbar

1 Answer 1

0

I'm not quite sure how mine works, it's just a batch script that is made of some clips of code I took from the internet but here ya go.

:: Settings: 0) Enable, 1) Disable
@echo off

set /p setting=<"C:\Auto-hide Taskbar CLI\currentSettings.txt"
echo %setting%

if %setting%==0 (
powershell -command "&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3';$v=(Get-ItemProperty -Path $p).Settings;$v[8]=3;&Set-ItemProperty -Path $p -Name Settings -Value $v;&Stop-Process -f -ProcessName explorer}"
del "C:\Auto-hide Taskbar CLI\currentSettings.txt"
echo 1 1> "C:\Auto-hide Taskbar CLI\currentSettings.txt"
)

if %setting%==1 (
powershell -command "&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3';$v=(Get-ItemProperty -Path $p).Settings;$v[8]=2;&Set-ItemProperty -Path $p -Name Settings -Value $v;&Stop-Process -f -ProcessName explorer}"
del "C:\Auto-hide Taskbar CLI\currentSettings.txt"
echo 0 1> "C:\Auto-hide Taskbar CLI\currentSettings.txt"
)

Basically it just calls up powershell and changes the settings of the registry key that is supposed to control the auto-hide settings (built on windows 10). It then keeps the current settings in a text file so I can create somekind of switch. I then use the iexpress program from System32 to create an exe of it, and so I can make a silent run of the batch. I create a shortcut of the exe (.lnk) and assign a keyboard shortcut to it. The problem I have with it is that it restarts the explorer, which hinders my work.

Update, I found a autohotkey script that does well. Here's the code

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

VarSetCapacity(APPBARDATA, A_PtrSize=4 ? 36:48)

Lctrl & MButton::
NumPut(DllCall("Shell32\SHAppBarMessage", "UInt", 4 ; ABM_GETSTATE
, "Ptr", &APPBARDATA
, "Int")
? 2:1, APPBARDATA, A_PtrSize=4 ? 32:40) ; 2 - ABS_ALWAYSONTOP, 1 - ABS_AUTOHIDE
, DllCall("Shell32\SHAppBarMessage", "UInt", 10 ; ABM_SETSTATE
, "Ptr", &APPBARDATA)
KeyWait, % A_ThisHotkey
Return

The shortcut for this is the left ctrl and the middle mouse button or the scroll button. To change the hotkey change this part "Lctrl & MButton::"

The only problem from this is that if you have virtual desktop enabled and have multiple chrome windows open on each virtual desktop, it would shuffle the virtual desktop, so you'd be teleporting, this happens sometimes only.

5
  • Thanks for the answer, did you check the solutions only with win7 or with win10 as well?
    – Albin
    Oct 13, 2020 at 18:51
  • @Albin I don't own windows 7 so I'm unable to test it in windows 7 Oct 15, 2020 at 2:16
  • Which WinVersion did you test it with?
    – Albin
    Oct 15, 2020 at 10:25
  • @Albin I used windows 10 Oct 16, 2020 at 14:07
  • that's great, since I don't use win7 anymore after the support ran out. I'll give it a try and let you know.
    – Albin
    Oct 16, 2020 at 14:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .