At the moment I need to detect in C++/Qt if a taskbar, which is set to \"autohide\" is visible on the screen or not. I have tried already following solution, unfortunately w
HWND hTaskbarWnd = FindWindow("Shell_TrayWnd", null);
bool isVisible = IsWindowVisible(hTaskbarWnd);
or
bool IsTaskbarWndVisible() {
HWND hTaskbarWnd = FindWindow("Shell_TrayWnd", null);
HMONITOR hMonitor = MonitorFromWindow(hTaskbarWnd , MONITOR_DEFAULTTONEAREST);
MONITORINFO info = { sizeof(MONITORINFO) };
if (GetMonitorInfo(hMonitor, &info))
{
RECT rect;
GetWindowRect(hTaskbarWnd , &rect);
if ((rect.top >= info.rcMonitor.bottom - 4) ||
(rect.right <= 2) ||
(rect.bottom <= 4) ||
(rect.left >= info.rcMonitor.right - 2))
return false;
return true;
}