Click here to Skip to main content
15,917,793 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
First, sorry for my poor English. But that can't stop me learn.

I want to draw the border and title with a bitmap. My system is windows 7, and turn on Aero theme. But i found i cannot draw border or title bar. Whereas, when I turn off Aero theme, it works. Here are some of my code. I want to know, how can I make it work when turn on Aero theme? Thanks...
C++
bmp.LoadBitmap(IDB_BITMAP7);
bmp.GetBitmap(&bmpInfo);

pOldBmp = dcMemory.SelectObject(&bmp);

x = bmpInfo.bmWidth;
y = bmpInfo.bmHeight;

lrBorderWidth = ( x > m_nFrameWidth+m_nBorderWidth ) ? x : m_nFrameWidth+m_nBorderWidth;

winDC.StretchBlt( 0,m_nCaptionHeight,lrBorderWidth,winRC.Height()-m_nCaptionHeight,&dcMemory,0,0,x,y,SRCCOPY );
winDC.StretchBlt( winRC.Width()-lrBorderWidth,m_nCaptionHeight,lrBorderWidth,
winRC.Height()-m_nCaptionHeight,&dcMemory,0,0,x,y,SRCCOPY);

dcMemory.SelectObject(pOldBmp);
bmp.DeleteObject();
Posted
Updated 9-Mar-11 7:34am
v3

1 solution

You have to handle all the other NC.. messages (WM_NCCALCSIZE, WM_NCPAINT, WM_NCHITTEST and so on). How to handle them read the SDK documentation. To prevent the roundrect Window layout you should set the window region to 0 (SetWindowRgn(0)).
Regards.
 
Share this answer
 
Comments
Leasangle 10-Mar-11 7:07am    
Yeah..I got it.Thanks very much.mbue

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900