SetForeGroundWindow() and SetFocus() Issues with Child Modeless Dialog Inside a Dialog

  • Thread starter Thread starter MatthewBQ
  • Start date Start date
M

MatthewBQ

Guest
Hello Everyone,

I'm doing some legacy MFC work and I'm trying to set focus on a child modeless dialog inside a dialog. As a simple test, I've made calls to SetForeGroundWindow() and SetFocus() during OnInitDialog(). My dialog will not get focus; however, when I attach a breakpoint and step through the code, SetForeGroundWindow() will properly set the focus and the focus persists after.

I'm not sure why the code works only with a breakpoint and no longer works without a breakpoint.

Does anyone have any insight into this?

Thanks,

Matthew

Continue reading...
 
Back
Top