IsIconic())
return;
// get appropriate bitmap
CDC memDC;
CDC* pDC = GetWindowDC();
memDC.CreateCompatibleDC(pDC);
memDC.SelectObject(m_bPressed ?
&m_bitmapPressed : &m_bitmapUnpressed);
// get button rect and convert it into non
-client area coordinates
CRect rect, rectWnd;
GetButtonRect(rect);
GetWindowRect(rectWnd);
rect.OffsetRect(-rectWnd.left, -rectWnd.top);
int width,height;
BITMAP *pBitMap;
pBitMap = new BITMAP;
if (m_bPressed)
m_bitmapPressed.GetBitmap(pBitMap);
else
m_bitmapUnpressed.GetBitmap(pBitMap);
width=pBitMap->bmWidth;
height=pBitMap->bmHeight;
// draw it
pDC->StretchBlt( rect.left, rect.top, rect.Width(),
rect.Height(), &memDC, 0, 0,
width,height,SRCCOPY );
memDC.DeleteDC();
ReleaseDC(pDC);
delete pBitMap;
}
然后画出标题栏:
void CTestDlg::DrawCaption()
{
if (!IsWindowVisible()
关键词:在Windows95/98中完成苹果窗口界面