Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Color window in hbrBackground

Tags:

c++

windows

WNDCLASS wc;
...
wc.hbrBackground = (HBRUSH)GetStockObject(COLOR_WINDOW+1);

I could not undestand what is +1 for and what is HBRUSH?

like image 608
Naveen Gabriel Avatar asked Mar 27 '13 12:03

Naveen Gabriel


1 Answers

Don't you mean?

wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);

GetStockObject gets one of the stock brushes, pens, fonts or palettes. You should not be using COLOR_WINDOW with it.

Use one of the stock brushes with it, so for a white background you could use...

wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);

Whatever works, use it!

like image 68
james82345 Avatar answered Sep 21 '22 18:09

james82345