Hello,
Quick question: how do I make sure that the solitary child window in my main window receives the focus when the window is first created?
Just putting SetFocus(hwndChild) in the creation message handler doesn't work.
This is a discussion on Ensuring That Main Child Window Receives Focus within the Windows Programming forums, part of the Platform Specific Boards category; Hello, Quick question: how do I make sure that the solitary child window in my main window receives the focus ...
Hello,
Quick question: how do I make sure that the solitary child window in my main window receives the focus when the window is first created?
Just putting SetFocus(hwndChild) in the creation message handler doesn't work.
Presumably there is also a control in the window that you wish to ensure has focus. Use SetFocus(that_control) as well.
Also make sure you return FALSE is you set the focus to a control or TRUE if you don't set the focus in the WM_CREATE or WM_INITDIALOG msg.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
Cracking stuff, thanks.![]()