Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/150.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ CreateWindowEx发布WM_大小?_C++_Windows_Winapi - Fatal编程技术网

C++ CreateWindowEx发布WM_大小?

C++ CreateWindowEx发布WM_大小?,c++,windows,winapi,C++,Windows,Winapi,CreateWindowExAPI真的发布了WM\u SIZE消息吗 当我通过CreateWindowEx作为全屏模式创建窗口时 CreateWindowExpostsWM_SIZE但窗口模式没有 我的代码如下设置窗口样式: if(bFullscr) { //When the window is in full screen mode. nStyle = WS_POPUP; nExtraStyle = WS_EX_APPWINDOW; } else { //Oth

CreateWindowEx
API真的发布了
WM\u SIZE
消息吗

当我通过
CreateWindowEx
作为全屏模式创建窗口时

CreateWindowEx
posts
WM_SIZE
窗口模式没有

我的代码如下设置窗口样式:

if(bFullscr)
{
    //When the window is in full screen mode.
    nStyle = WS_POPUP;
    nExtraStyle = WS_EX_APPWINDOW;
}
else
{
    //Otherwise.
    nStyle = WS_OVERLAPPEDWINDOW;
    nExtraStyle = (WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);
}
并更改如下显示设置(仅限全屏模式):


我真想知道为什么
CreateWindowEx
会有选择地发布
WM\u SIZE
消息。

如果您只是想调整窗口大小,那么在代码中的某个地方应该有
ShowWindow(hWnd,nCmdShow)更改如下:

ShowWindow(hWnd, SW_SHOWDEFAULT);//show normal
ShowWindow(hWnd, SW_SHOWMAXIMIZED);//show maximized (full screen)
SetWindowPos(hWnd, NULL, 10, 10, 300, 300, SWP_SHOWWINDOW);//show at specific position
您还可以在CreateWindow中使用
WS\u MAXIMIZE
,但这可能会使事情复杂化。窗口通常有
WS_重叠窗口
WS_弹出窗口| WS_字幕| WS_系统菜单
。你应该选择一个并保持简单

当窗口大小改变时,它会接收到
WM_size
,您可以捕获并检查它

ShowWindow(hWnd, SW_SHOWDEFAULT);//show normal
ShowWindow(hWnd, SW_SHOWMAXIMIZED);//show maximized (full screen)
SetWindowPos(hWnd, NULL, 10, 10, 300, 300, SWP_SHOWWINDOW);//show at specific position