最大化 WS_POPUP window 在任务栏前面
Maximized WS_POPUP window goes in front of the taskbar
我正在使用该代码在 C++ 中创建 window:
HWnd = CreateWindow(wc.lpszClassName,
"myapp",
WS_POPUP |WS_VISIBLE,
10, 10, 1000, 800, 0, 0, hInst, NULL);
它显示为我想要的,但是当我像这样最大化它时:
ShowWindow(hwnd, SW_SHOWMAXIMIZED);
然后它就像一个全屏 window 这样任务栏就被隐藏了。
我认为这是因为它是一个 POPUP window 但这就像我希望它出现一样。
我是否需要创建自己的最大化函数,或者是否有一个参数可以避免这种情况?
谢谢
您可以添加 WS_CAPTION | WS_SYSMENU | WS_MAXIMIZEBOX
样式。
如果您希望 window 没有标题,那么您需要手动调整 window 大小以适应桌面工作区,您可以使用 SystemParametersInfo
指定 SPI_GETWORKAREA
旗帜。
这是一项功能 the Taskbar will get out of your full-screen application:
If you want to create a fullscreen window that covers the taskbar, just create a fullscreen window and the taskbar will automatically get out of the way.
I’ve seen people hunt for the taskbar window and then do a ShowWindow(hwndTaskbar, SW_HIDE) on it. This is nuts for many reasons.
Don’t do any of this messing with the taskbar. Just create your fullscreen window and let the taskbar do its thing automatically.
由于这是 Whosebug,维基百科和 Reddit 的结合,我希望为下一个问这个问题的人保存这些相关信息。
我正在使用该代码在 C++ 中创建 window:
HWnd = CreateWindow(wc.lpszClassName,
"myapp",
WS_POPUP |WS_VISIBLE,
10, 10, 1000, 800, 0, 0, hInst, NULL);
它显示为我想要的,但是当我像这样最大化它时:
ShowWindow(hwnd, SW_SHOWMAXIMIZED);
然后它就像一个全屏 window 这样任务栏就被隐藏了。 我认为这是因为它是一个 POPUP window 但这就像我希望它出现一样。
我是否需要创建自己的最大化函数,或者是否有一个参数可以避免这种情况?
谢谢
您可以添加 WS_CAPTION | WS_SYSMENU | WS_MAXIMIZEBOX
样式。
如果您希望 window 没有标题,那么您需要手动调整 window 大小以适应桌面工作区,您可以使用 SystemParametersInfo
指定 SPI_GETWORKAREA
旗帜。
这是一项功能 the Taskbar will get out of your full-screen application:
If you want to create a fullscreen window that covers the taskbar, just create a fullscreen window and the taskbar will automatically get out of the way.
I’ve seen people hunt for the taskbar window and then do a ShowWindow(hwndTaskbar, SW_HIDE) on it. This is nuts for many reasons.
Don’t do any of this messing with the taskbar. Just create your fullscreen window and let the taskbar do its thing automatically.
由于这是 Whosebug,维基百科和 Reddit 的结合,我希望为下一个问这个问题的人保存这些相关信息。