The Windows taskbar provides quick access to your most-used apps, but it can also take up valuable screen space when you're working in full-screen applications or watching videos. If you prefer your taskbar to remain visible and locked only when you're on the desktop, but hidden during other activities, you can achieve this behavior with a few simple adjustments. This guide explains how to configure your taskbar so it stays locked and visible while on the desktop, yet automatically hides when you open applications or use full-screen mode.

Method 1: Using Windows Built-in Taskbar Settings

Step 1: Right-click on an empty area of your taskbar and select "Taskbar settings" from the context menu. This will open the Taskbar settings page in the Windows Settings app.

Step 2: Under the "Taskbar behaviors" section, locate the option labeled "Automatically hide the taskbar." Enable this option by clicking inside the checkbox to enable it. This setting ensures the taskbar automatically hides whenever you open an application or window, giving you more screen space for your work.

Step 3: Return to your desktop screen. You'll notice the taskbar is now hidden by default. To make it visible again, simply move your cursor to the bottom edge of the screen (or wherever your taskbar is positioned), and it will temporarily reappear.

While this method effectively hides the taskbar when apps are open, it also hides the taskbar on the desktop unless you move your cursor to its location. If you specifically want the taskbar always visible on the desktop and hidden only when apps are running full-screen or maximized, you may need to use third-party software instead.


Method 2: Using AutoHotkey for Custom Taskbar Behavior

If you prefer a more customizable, script-based approach, AutoHotkey allows you to create a custom taskbar behavior script. This method is suitable for advanced users comfortable with scripting.

Step 1: Download and install AutoHotkey from the official website. After installation, create a new text document (script) on your desktop and rename it with a ".ahk" extension, such as "TaskbarVisibility.ahk."

Step 2: Right-click the newly created ".ahk" file and select "Edit script." In the opened text editor, copy and paste the following basic script snippet to hide the taskbar when windows are maximized or in full-screen mode, and show it again when you're on the desktop:


#Persistent
SetTimer, CheckActiveWindow, 500
return

CheckActiveWindow:
WinGet, activeWindow, ID, A
WinGet, windowState, MinMax, ahk_id %activeWindow%

if (windowState = 1) ; Window is maximized
{
    WinHide, ahk_class Shell_TrayWnd
}
else
{
    WinShow, ahk_class Shell_TrayWnd
}
return
    

Step 3: Save the file and double-click it to run the script. AutoHotkey will now manage your taskbar visibility based on the active window's state. To stop the script, right-click the AutoHotkey icon in your system tray and select "Exit."

Note: This script provides basic functionality. You may need to further customize it based on your specific requirements. AutoHotkey's documentation offers extensive details to help you refine the script.

With these methods, you can easily set your Windows taskbar to stay locked while on the desktop yet automatically hide when using apps, optimizing your workspace, and improving your productivity.