Udo Liess
June 9th, 1998, 05:58 AM
Some days ago I posted a note about a problem with CListCtrl. But no reactions. Now I found out a little bit more about it.
Here is the BUG:
(I use WinNT 4.0, VC5)
Create a MFC application as dialog based (MainDialog).
Create a dialog resource (ChildDialog).
Set dialog style to CHILD.
Place a list control on this dialog.
In MainDialog::OnInit() call ChildDialog::Create().
--> ChildDialog is a child of MainDialog
Thats all!
Now run the application.
Use ALT+TAB to switch to another application that hides our MFC application. Then switch back to our application the same way. All OK? Yes, no problem.
BUT: Click on the list control (--> set the (unvisible) focus to the list control).
Now switch to another application and back again... You will see: THERE IS NO REPAINT OF LIST CONTROL!!!
I found out what happend (but dont know why it happens):
For "debugging" in ChildDialog::OnPaint() I called Beep(1000,1000),
in CListCtrlOwn::OnPaint() I called Beep(2000,1000).
And then I hear and see: If the list control has the focus, Windows first calls CListCtrlOwn::OnPaint() and then ChildDialog::OnPaint(). But that is NOT the right way, isn't it?
Udo
Here is the BUG:
(I use WinNT 4.0, VC5)
Create a MFC application as dialog based (MainDialog).
Create a dialog resource (ChildDialog).
Set dialog style to CHILD.
Place a list control on this dialog.
In MainDialog::OnInit() call ChildDialog::Create().
--> ChildDialog is a child of MainDialog
Thats all!
Now run the application.
Use ALT+TAB to switch to another application that hides our MFC application. Then switch back to our application the same way. All OK? Yes, no problem.
BUT: Click on the list control (--> set the (unvisible) focus to the list control).
Now switch to another application and back again... You will see: THERE IS NO REPAINT OF LIST CONTROL!!!
I found out what happend (but dont know why it happens):
For "debugging" in ChildDialog::OnPaint() I called Beep(1000,1000),
in CListCtrlOwn::OnPaint() I called Beep(2000,1000).
And then I hear and see: If the list control has the focus, Windows first calls CListCtrlOwn::OnPaint() and then ChildDialog::OnPaint(). But that is NOT the right way, isn't it?
Udo