CreateWindow失败的原因

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/dong1528313271/article/details/82903435

Before returning, CreateWindow sends a WM_CREATE message to the window procedure. For overlapped, pop-up, and child windows, CreateWindow sends WM_CREATE, WM_GETMINMAXINFO, and WM_NCCREATE messages to the window. The lParam parameter of the WM_CREATE message contains a pointer to a CREATESTRUCT structure. If the WS_VISIBLE style is specified, CreateWindow sends the window all the messages required to activate and show the window.
If the created window is a child window, its default position is at the bottom of the Z-order. If the created window is a top-level window, its default position is at the top of the Z-order (but beneath all topmost windows unless the created window is itself topmost).
For information on controlling whether the Taskbar displays a button for the created window, see Managing Taskbar Buttons.
For information on removing a window, see the DestroyWindow function.
The following predefined system classes can be specified in the lpClassName parameter. Note the corresponding control styles you can use in the dwStyle parameter.


在返回之前,CreateWindow会向窗口过程发送WM_CREATE消息。对于重叠,弹出窗口和子窗口,CreateWindow将WM_CREATE,WM_GETMINMAXINFO和WM_NCCREATE消息发送到窗口。 WM_CREATE消息的lParam参数包含指向CREATESTRUCT结构的指针。如果指定了WS_VISIBLE样式,则CreateWindow会向窗口发送激活和显示窗口所需的所有消息。
如果创建的窗口是子窗口,则其默认位置位于Z顺序的底部。如果创建的窗口是顶级窗口,则其默认位置位于Z顺序的顶部(但在所有最顶层窗口之下,除非创建的窗口本身位于最顶层)。
有关控制任务栏是否显示已创建窗口的按钮的信息,请参阅管理任务栏按钮。
有关删除窗口的信息,请参阅DestroyWindow函数。
可以在lpClassName参数中指定以下预定义的系统类。请注意可以在dwStyle参数中使用的相应控件样式。


但是在CreateWindow创建窗口时,系统回调窗口过程,需要窗口过程返回非0值,CreateWindow才能创建成功。

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/dong1528313271/article/details/82903435