I have got a SDI application. On selecting a menu option, a modal dialog is shown using dlg.DoModal().

In the InitDialog, 6 comboboxes (5 visible and 1 invisible) are populated with values read from files. But as soon as the dialog is painted on the screen, it looses focus. (The title bar appears gray instead of blue). On clicking on the dialog, focus returns.

I want u to suggest probable reasons of this kind of behaviour. Could it be bcoz of the invisible combo.

Moreover, OnPaint has not been overridden, neither has been PreCreateWindow.