关于WM_CREATE消息

所有窗口都是在注册窗口类之后调用CreateWindowEx来创建的,创建成功之后(HWND有效但CreateWindowEx尚未返回)系统自动发送WM_CREATE消息,所以你的OnCreate将被执行,在这里窗口已经创建成功了,你可以安全地创建各种子窗口。

The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. The window procedure of the new window receives this message after the window is created, but before the window becomes visible. The message is sent before the CreateWindowEx or CreateWindow function returns.
这个消息在线程创建时不会发生,而是在窗口创建时发生。

你可能感兴趣的:(关于WM_CREATE消息)