I'm trying to create a fake fullscreen mode for Reaper. I want to move the menu bar out of the visible screen area by making the window 20 points higher than the screen's dimensions.
Issue: the task bar gets visible as soon as the window size is anything else than the actual screen dimensions.
Is there anything I can do about that? Any alternative to removing WS_OVERLAPPEDWINDOW?
WINDOWPLACEMENT g_wpPrev = { sizeof(g_wpPrev) };
DWORD dwStyle = GetWindowLong(hWnd, GWL_STYLE);
MONITORINFO mi = { sizeof(mi) };
if (GetWindowPlacement(hWnd, &g_wpPrev) &&
GetMonitorInfo(MonitorFromWindow(hWnd,
MONITOR_DEFAULTTOPRIMARY), &mi)) {
SetWindowLong(hWnd, GWL_STYLE,
dwStyle & ~WS_OVERLAPPEDWINDOW);
BOOL res = SetWindowPos(hWnd, HWND_TOP,
mi.rcMonitor.left, mi.rcMonitor.top - MENU_HEIGHT,
mi.rcMonitor.right - mi.rcMonitor.left,
mi.rcMonitor.bottom - mi.rcMonitor.top + MENU_HEIGHT,
SWP_NOOWNERZORDER | SWP_FRAMECHANGED | SWP_SHOWWINDOW);
To address the issue of the taskbar becoming visible when manipulating window size in a fake fullscreen mode, you may consider expanding the window size beyond the screen dimensions without removing the WS_OVERLAPPEDWINDOW style. This can be achieved by modifying the SetWindowPos function parameters to position the window off-screen without triggering the taskbar visibility.
Here is an adjusted version of the code snippet provided:
WINDOWPLACEMENT g_wpPrev = { sizeof(g_wpPrev) };
DWORD dwStyle = GetWindowLong(hWnd, GWL_STYLE);
MONITORINFO mi = { sizeof(mi) };
if (GetWindowPlacement(hWnd, &g_wpPrev) &&
GetMonitorInfo(MonitorFromWindow(hWnd,
MONITOR_DEFAULTTOPRIMARY), &mi)) {
SetWindowLong(hWnd, GWL_STYLE,
dwStyle & ~WS_OVERLAPPEDWINDOW);
BOOL res = SetWindowPos(hWnd, HWND_TOP,
mi.rcMonitor.left - 10, mi.rcMonitor.top - 10 - MENU_HEIGHT, // Adjust position to be slightly off-screen
mi.rcMonitor.right - mi.rcMonitor.left + 20, mi.rcMonitor.bottom - mi.rcMonitor.top + MENU_HEIGHT + 20, // Adjust size to be larger than the screen dimensions
SWP_NOOWNERZORDER | SWP_FRAMECHANGED | SWP_SHOWWINDOW);
}
By offsetting the window position by a small amount and expanding the window size slightly larger than the screen dimensions, you may be able to simulate a fake fullscreen mode for Reaper while preventing the taskbar from becoming visible.