Windows API: What is the first message a window is guaranteed to receive?

后端 未结 4 2212
囚心锁ツ
囚心锁ツ 2020-12-16 18:44

I\'ve been used to thinking that WM_CREATE is the first message a window receives. However, when testing this assumption on a top-level window, it turns out to be false. In

4条回答
  •  清歌不尽
    2020-12-16 19:13

    Results by experimentation are better than just trusting the source, especially since the source is composed by a legion of programmers, and none know all the code. That said:

    The fist message I receive is 0x24 (WM_GETMINMAXINFO).

    Can I assume that it will always be the first message? No, since code change between versions of windows, and Microsoft has not documented a message guaranteed to be the first one received.

    Bottom line: Do not assume that WM_CREATE was called before another message.

提交回复
热议问题