I'm having problems getting child windows to behave correctly when creating them with CreateWindowEx. They never seem to take focus (though elements within the child such as edits will take focus) and don't automatically repaint themselves.

It is also possible to 'click-thru' them, i.e. if there is an empty portion of the child window and there is an edit on the parent behind that empty area, clicking on the empty area will activate the parent's edit which will be drawn on top of the child.

I do not get this problem when using CreateDialog.

This is the line where I create the window:
     hSearchwin = CreateWindowEx(WS_EX_DLGMODALFRAME,"Jason'sSearchWindow","Search for",WS_CAPTION | WS_VISIBLE | WS_CHILD,50,50,250,150,hwnd,(void *)55,GetModuleHandle(NULL),NULL);