I have a fairly standard C++ program where I create a fullscreen window (with two child windows). On my development computer with Windows 10 this window fills the entire screen and covers the taskbar.
On Windows 7 it does not cover the task-bar. After some experimenting it seems that if I turn off Aero the program will cover the taskbar!
I've also created a quick C#/WPF application and this application is able to cover the taskbar regardless of the state of Aero.
Am I missing a window message or creation option for the window?
Here is the code that positions and creates the Window
// Get a handle to the primary monitor, which by definition has its top
// left corner at (0, 0).
const POINT ptZero = { 0, 0 };
HMONITOR hmon = MonitorFromPoint(ptZero, MONITOR_DEFAULTTOPRIMARY);
MONITORINFO mi = { sizeof(mi) };
GetMonitorInfo(hmon, &mi);
// Fill the entire screen
layout->left = mi.rcMonitor.left;
layout->right = mi.rcMonitor.right;
layout->top = mi.rcMonitor.top;
layout->bottom = mi.rcMonitor.bottom;
// Create a full screen window
m_hwnd = CreateWindowEx(
WS_EX_TOPMOST,
className,
windowName,
WS_POPUP | WS_VISIBLE,
layout.left,
layout.top,
layout.right - layout.left,
layout.bottom - layout.top,
NULL,
NULL,
GetModuleHandle(NULL),
this); // LPARAM is used in WM_CREATE to associate the class instance with the Window
Here is the code that handles the Window messages
switch (uMsg)
{
case WM_PAINT:
OnPaint(hwnd); // Draws a black background
return DefWindowProc(hwnd, uMsg, wParam, lParam);
default:
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
Update: After some Googling I found that this issue might also be DPI related: http://forums.pcsx2.net/Thread-Fullscreen-Windows-7-Taskbar-does-not-auto-hide-w-aero https://productforums.google.com/forum/#!topic/chrome/5dMYLChXeWk
What works and doesn't work at this moment:
Areo + DPI @ 150%: taskbar not covered No Areo + DPI @ !150%: taskbar covered Areo + DPI @ 100%: taskbar covered No Area + DPI @ 100%: taskbar covered
This got me pretty baffled...
WS_MAXIMIZE? And maybeWS_EX_TOPMOSTwill help as well. - Simon KraemerWS_EX_TOPMOST(though it shouldn't be needed). I'll tryWS_MAXIMIZEas well. - Roy T.