有关wm_create消息

来源:互联网 发布:陶瓷击穿电压算法 编辑:程序博客网 时间:2024/05/12 19:17

msdn中查询有关wm_create消息的结果如下:

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消息的发送发生在窗口创建之后 窗口变为可见之前,在CreateWindow或CreateWindowEx函数返回之前

WM_CREATE消息是发送到窗口的第一条消息,windows在处理CreateWindow函数时发送它,所以此时该窗口还没有被完全创建好。在WM_CREATE消息相应代码中进行窗口数据的初始化很合适,不过有些windows函数(查询窗口大小和位置的GetWindowRect函数)将返回不确定的值。

在WM_CREATE消息响应函数中可以进行一些窗口的初始化工作。