Hi,

In My "SDI" application, I have destroyed the view.

pView->DestroyWindow();

Now I get the grey color background in the empty client space (where
the view should be).
I move wwindows explorer over my application (Alt+Tab) and again bring
my application in front. But now This client area is having default
window O/S background color not the 'grey' color.

I want this grey color to be stored in some variable say
CMymfcApp::bkcolor when my application loses focus i.e. some other
windows come over it and then use this Grey COlorref value to repaint
my empty client space area.

For that I go to

BOOL CMainFrame::OnEraseBkgnd(CDC* pDC)
{
if(first)
{
pDC->GetBkColor(..)
}
else
pDC->SetBkColor(theApp.bkcolor);
CFrameWnd::OnEraseBkgnd(pDC);
}

problem is
1. at which event should I save the background color?
2. What should be the function ..how this should be achieved.

I saved the background color in

BOOL CMainFrame::OnEraseBkgnd(CDC* pDC) only..
but when I bring my application in front it gives white color in the
empltry client area.

Please help.

Cric