If you use the WS_CHILD (which you do not have too)
Don't forget to cast the
HMENU param
of the CreateWindowEx()
as the childs int ID resource.
MSDN
"HMENU hMenu, // menu handle or child identifier"
"hMenu
[in] Handle to a menu, or specifies a child-window identifier depending on the window style. For an overlapped or pop-up window, hMenu identifies the menu to be used with the window; it can be NULL if the class menu is to be used. For a child window, hMenu specifies the child-window identifier, an integer value used by a dialog box control to notify its parent about events. The application determines the child-window identifier; it must be unique for all child windows with the same parent window. "
So you should only be able to create one.
Your code is setting them all to 0.
May I suggest a STRUCTURE to hold the ID's, HWND's, HDC's, system objects and dimensions of the child windows.
A loop can then be used to create and later 'clean up' all your allocated / created resources at main window open / close.