void DrawTitleBar(CDC *pDC);
void *****::DrawTitleBar( CDC *pDC )
{
HWND hWndNew;
hWndNew=GetSafeHwnd();
if (hWndNew)
{
CRect rectClient;
GetClientRect(&rectClient);
CDC* pDisplayMemDC=new CDC;
pDisplayMemDC->CreateCompatibleDC(pDC);
CBitmap *pBitmap=new CBitmap;
BITMAP bm;
CRect rtWnd;
GetWindowRect(&rtWnd);
//重绘标题栏左上角
pBitmap->LoadBitmap(IDB_JZ_ADDBTL);
pBitmap->GetBitmap(&bm);
pDisplayMemDC->SelectObject(pBitmap);
pDC->StretchBlt(0,0,52,29,pDisplayMemDC,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);//539
pBitmap->DeleteObject();
//重绘标题栏
pBitmap->LoadBitmap(IDB_JZ_NEWBTLBK);
pBitmap->GetBitmap(&bm);
pDisplayMemDC->SelectObject(pBitmap);
pDC->StretchBlt(rectClient.left+52,0,rectClient.right,29,pDisplayMemDC,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);//539
pBitmap->DeleteObject();
//重绘左边边框
pBitmap->LoadBitmap(IDB_JZ_BK);
pBitmap->GetBitmap(&bm);
pDisplayMemDC->SelectObject(pBitmap);
pDC->StretchBlt(0,29,4,rtWnd.Height(),pDisplayMemDC,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
pBitmap->DeleteObject();
//重绘右边边框
pBitmap->LoadBitmap(IDB_JZ_BK);
pBitmap->GetBitmap(&bm);
pDisplayMemDC->SelectObject(pBitmap);
pDC->StretchBlt(rtWnd.Width()-6,29,6,rtWnd.Height(),pDisplayMemDC,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
pBitmap->DeleteObject();
//重绘底部边框
pBitmap->LoadBitmap(IDB_JZ_BK);
pBitmap->GetBitmap(&bm);
pDisplayMemDC->SelectObject(pBitmap);
pDC->StretchBlt(0,rtWnd.Height()-4,rtWnd.Width(),4,pDisplayMemDC,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
pBitmap->DeleteObject();
ReleaseDC(pDisplayMemDC);
delete pDisplayMemDC;
delete pBitmap;
}
}