Win32 , WndProc, and parent-child windows

不想你离开。 提交于 2019-12-12 03:48:26

问题


I'm developing in C code that uses the Win32 Api to create multiple windows. I used createWindow twice - to create parent and child windows. I have a message loop

while ( GetMssage (&msg, NULL,0,0)){
.
translate
dispatch
. 
}

But I only get the WND_Proc function called once, instead of twice for each of the windows.

What am I doing wrong?


回答1:


If I'm understanding your question correctly, you should expect your WndProc to receive a single WM_CREATE message for each window created of the window class for which the WndProc is registered.

Your WndProc will not receive a WM_CREATE for a window you create of a different class (like the standard Windows UI controls, for example), even if it is a direct child of a window of the WndProc's class. If you gave us some more specifics on what you are trying to accomplish we could provide suggestions or workarounds.

This question may also shed some more light on your situation.



来源:https://stackoverflow.com/questions/1708258/win32-wndproc-and-parent-child-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!