tags:

views:

395

answers:

1

Hi - 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?

Thanks!

Dan

A: 

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.

Gene Goykhman
Hi - I am not talking about the WM_CREATE message, but ratherabout general message suchas WM_KEYDOWN : I want to deal with them in both windows. I asked another question with some code examples as well right now.
dan