Pardon the 'F'. I placed the code in the CAdSheet class, but I am still getting the Windows Flag when I Alt-Tab. CAdSheet is a class defined in CAdSheet.h and .cpp and included in the main program. The code above is called in the InitInstance function of the main program. The class in the main program is: "class CSecAdminApp : public CWinApp". I appreciated your earlier response. Thanks.
Main Topics
Browse All Topics





by: AVaulinPosted on 1997-08-01 at 06:27:36ID: 1302980
Handle WM_PAINT message in like this:
GND, (WPARAM) dc.GetSafeHdc(), 0); ); );
void CAdSheet::OnPaint()
{
if( IsIconic() )
{
CPaintDC dc(this);
SendMessage(WM_ICONERASEBK
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON
int cyIcon = GetSystemMetrics(SM_CYICON
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
dc.DrawIcon(x, y, m_hIcon);
}
else CDialog::OnPaint();
}
This is a fragment from dialog based application created by AppWizard.