Taskbar Auto hide is enabled

XUWANBIN 201 Reputation points
2023-01-17T04:53:23.4633333+00:00

Automatically hide the open state, the mouse moves up, will pop up the taskbar, how to make it always pop up state? (and how to remain hidden),

Windows development | Windows API - Win32
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 90,686 Reputation points
    2023-01-17T07:09:12.68+00:00
    2 people found this answer helpful.

  2. Tong Xu - MSFT 2,546 Reputation points Microsoft External Staff
    2023-01-19T09:23:43.28+00:00

    Hi, @XUWANBIN
    Welcome to Microsoft Q&A!

    Using ABM_SETSTATE is effective.
    This is my sample, it runs well.
    I set “TRUE” to the taskbar is in the always-on-top state even though automatically hide the taskbar.
    task bar setting

    show

    I set “FALSE” to the taskbar is in the autohide state even though without automatically hide the taskbar.
    hide

    Here is my code:

    #include<windows.h>
    
    void AutoHideTaskBar(BOOL bHide)
    {
    
        LPARAM lParam;
        if (bHide == TRUE)
        {
            lParam = ABS_ALWAYSONTOP;
        }
        else
        {
            lParam = ABS_AUTOHIDE;
        }
    
        APPBARDATA apBar;
        memset(&apBar, 0, sizeof(apBar));
        apBar.cbSize = sizeof(apBar);
        apBar.hWnd = FindWindowA(NULL, NULL);
        if (apBar.hWnd != NULL)
        {
            apBar.lParam = lParam;
            SHAppBarMessage(ABM_SETSTATE, &apBar); 
        }
    }
    int main()
    {
        AutoHideTaskBar(FALSE);  //TRUE=The taskbar is in the always-on-top state.
        //FALSE=AUTHIDE
    
    }
    
    
    

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.