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

后端 未结 4 2091
囚心锁ツ
囚心锁ツ 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:10

    You answered your own question. I too see WM_GETMINMAXINFO, on Windows XP SP3, followed by WM_NCCREATE, WM_NCCALCSIZE, and finally WM_CREATE before CreateWindowEx() has even returned the handle to the window being created. What garabage'

    The general answer is that Microsoft is incompetent when it comes to orderly creation and destruction of objects. They get it wrong with windows, with COM, and with device drivers. There's always some catch-22 where an object is half-created or half-destroyed that requires some roundabout convoluted solution to produce a reliable product.

提交回复
热议问题