Why is a modal CDIalogEx does not flash when you click outside of it?

  • Thread starter Thread starter KennyL.Liu
  • Start date Start date
K

KennyL.Liu

Guest
To reproduce the issue, simply create a dialog based MFC application from Visual Studio wizard (with an About dialog enabled by default), build and run the program, bring up the About dialog via title bar, then click outside of it (but within the area of main dialog), you will notice that the About dialog does not flash.

Change the base class of CAboutDlg from CDialogEx to CDialog, then you will see that the standard behavior (flashing itself) works now.

A simple investigation shows that its caused by the code of CDialogImpl::OnActivate. For example, if you add your own message handler OnActivate for WM_ACTIVATE in CAboutDlg, and simply calls Default() without calling m_Impl.OnActivate(nState, pWndOther); then flashing will come back!

So I am just wondering why it behaves like this, is this by design or perhaps a bug?

Continue reading...
 
Back
Top