This simple function allows you to toggle win10 taskbar in a way that I find extremely pleasant and seamless.
The typical way to do this is by defining a hotkey that alternately calls WinHide and WInShow on "ahk_class Shell_TrayWnd".
There are 3 problems with this approach:
* when taskbar is WInHidden, the area of screen it formerly occupies is left blank. That kinda defeats the whole purpose of hiding the taskbar doesn't it? You want that screen real estate!
* if you have a background app switched into fullscreen mode (and your foreground app isn't also in fullscreen), you can see a little bit of it in that area, which can bother you a lot.
* the toggling simply doesn't work if your foreground app is in fullscreen mode (which 90% of my apps are) --- callling WinShow on taskbar doesn't display the taskbar, even if you use WinSet Top/AlwaysOnTop)
The natural alternative is to make the hotkey toggle, not the visibility of taskbar, but its autohide status.
But if you've ever tried that, you know that each time you toggle it on/off, all of your maximized windows are resized to adapt to the new maximized window size. It's anything but "smooth". (Although, if you only want to very occasionally toggles autohide status, you can perhaps live with that)
A third idea is to set taskbar to autohide always, but define a hotkey to alternately move to/away from the (say) bottom edge of the screen, to show/hide the taskbar.
But this is undesirable because:
* mouse movement is distracting
* there's a distracting delay both when you toggle on, and especially when you toggle off the taskbar. The taskbar takes 1 second to disappear
After much experimentation I finally found a way to toggle the taskbar that I find completely satisfactory, at least for me.
For it to work, you must set taskbar to autohide
Then make some key (F1 for purpose of illustration) call this function.
Code: Select all
F1:
Fast_And_Pleasant_Taskbar_Toggle(){
if (WinActive("ahk_class Shell_TrayWnd"))
{
WinHide, ahk_class Shell_TrayWnd
Send !{Esc}
}
else
{
WinShow ahk_class Shell_TrayWnd
WinActivate ahk_class Shell_TrayWnd
}
}
https://gfycat.com/ifr/MelodicShrillJavalina