With SHAppBarMessage
Taskbar Auto hide is enabled
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),
2 answers
Sort by: Most helpful
-
-
Tong Xu - MSFT 1,061 Reputation points Microsoft Vendor
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.
I set “FALSE” to the taskbar is in the autohide state even though without automatically hide the taskbar.
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.