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

RL Chen 230 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
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,478 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,647 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,754 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 85,701 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.