dan
dan

Reputation: 71

Win32 , WndProc, and parent-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
dispatch
. 
}

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

What am I doing wrong?

Upvotes: 0

Views: 2694

Answers (1)

Gene Goykhman
Gene Goykhman

Reputation: 2001

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.

Upvotes: 0

Related Questions