开发者

Win32 , WndProc, and parent-child windows

开发者 https://www.devze.com 2022-12-11 04:50 出处:网络
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'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
di开发者_开发技巧spatch
. 
}

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

What am I doing wrong?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号