I know i can set the background color of my program when I compile using hbrBackground
but how can i change the color while the programe is running.
Thanks.
I know i can set the background color of my program when I compile using hbrBackground
but how can i change the color while the programe is running.
Thanks.
One of many ways is to handle the WM_ERASEBKGND message.
gg
To change the background color of your window you could use the SetClassLong function with the GCL_HBRBACKGROUND parameter like so:
happy coding!Code:DeleteObject((HBRUSH)SetClassLong(hwnd, GCL_HBRBACKGROUND, (LONG)CreateSolidBrush (RGB (color1, color2, color3 ) )));
Thanks both of you.I used andyhunter's and it worked fine.