IsIconic())
return;
// get appropriate bitmap
CDC memDC;
CDC* pDC = GetWindowDC();
memDC.CreateCompatibleDC(pDC);
memDC.SelectObject(m_bitmapCaption);
// get button rect and convert it into non
-client area coordinates
CRect rect, rectWnd;
GetCaptionRect(rect);
GetWindowRect(rectWnd);
rect.OffsetRect(-rectWnd.left, -rectWnd.top);
// draw the caption
int width,height;
BITMAP *pBitMap;
pBitMap = new BITMAP;
m_bitmapCaption.GetBitmap(pBitMap);
width=pBitMap->bmWidth;
height=pBitMap->bmHeight;
pDC->StretchBlt( rect.left, rect.top, rect.Width(),
rect.Height(), &memDC, 0, 0, width,
height, SRCCOPY );
//get the the text of the caption and
draw it with 3D style
pDC->SetBkColor(RGB(209,209,209));
CString caption;
GetWindowText(caption);
caption = “ "+caption+“ ";
rect.OffsetRect(0,4);
//draw the text of the caption with gray color
pDC->SetTextColor(RGB(128,128,128));
pDC->DrawText
(caption,rect,DT_CENTER
关键词:在Windows95/98中完成苹果窗口界面