Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically changing a window's background

Status
Not open for further replies.

AmkG

Programmer
May 12, 2001
366
0
0
PH
How do I change the background of a window dynamically, other than having to Rectangle the whole thing in my Paint procedure? And how do I dynamically change the mouse cursor? "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
void FillClient( HDC hdc,RECT* rDim,COLORREF crColor )
{
HBRUSH hbOldBrush;
HBRUSH hbColor;

hbColor=CreateSolidBrush( crColor );
hbOldBrush=SelectObject( hdc,hbColor );

PatBlt( hdc,rDim->left,rDim->top,
rDim->right,rDim->bottom,
PATCOPY );

SelectObject( hdc,hbOldBrush );
DeleteObject( hbOldBrush );
DeleteObject( hbColor );
}

You can do somthing like this. Just pass a Device context for the window you want to change,your client area RECT dimensions i.e. GetClientRect(),and the color you want to paint your client area with ->RGB(255,0,0) etc... Mike L.G.
mlg400@blazemail.com
 
Like I said, other than putting it in the Paint procedure? Is there ABSOLUTELY NO OTHER WAY so that Windows will handle it instead of me? "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top