C++ Win32 fullscreen windows cause the taskbar, which is set to auto-hide, to not rise properly.

RL Chen 250 Reputation points
2024-06-28T03:28:50.63+00:00

When a window is displayed full screen (or takes up the whole screen), the taskbar can't be raised (the user has set the auto-hide taskbar option), I don't want this window to cause this problem, is it possible to set up this window in C++ so that the raising of the taskbar is not affected?

Windows development | Windows API - Win32
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C++
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,686 Reputation points
    2024-06-28T07:08:49.4333333+00:00

    If it is fullscreen, it is normal that the Taskbar cannot be activated.

    Otherwise, you can reduce the size of 1 pixel to allow Taskbar activation (but it is not real fullscreen then...).

    For example if the Taskbar is at bottom (its location should be checked first) :

    MONITORINFO mi = { sizeof(mi) };
    GetMonitorInfo(MonitorFromWindow(hWnd, MONITOR_DEFAULTTOPRIMARY), &mi);
    SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) & ~WS_OVERLAPPEDWINDOW);
    SetWindowPos(hWnd, HWND_TOP, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right - mi.rcMonitor.left,
    				mi.rcMonitor.bottom - mi.rcMonitor.top - 1,
    				SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
    
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.