Game Development Community

Weird Window Class prob

by Andy "Code" Cook · in Technical Issues · 02/09/2002 (9:57 pm) · 3 replies

Ok so am making a window and get to field for background and I put in the GetStockObject(...,...) function for it to get a colored brush, but this doesn't work it keeps giving me an errer.. something like cont convert so so and variable to int.

Then as I am looking through help I found this:

(HBRUSH)(COLOR_APPWORKSPACE+1)

I change the number at the end a diffrent colors appear... what is it?

#1
02/09/2002 (10:11 pm)
HA HA well I fixed my problem with GetStockObject. So I am using that now, but I still dont't know what that other code is.

Any expalanation would greatly help thanks in advance.
#2
02/11/2002 (3:37 am)
All I can get MSDN to admit is that it's the background colour of MDI applications...

I think that by adding numbers, you're going from 12 to 13, and so on... What I'm not getting his how typecasting this to HBRUSH gets the colour... (I think it has something to do with the fact that it's an operator of some sort to CBRUSH, you'll have to look that up yourself though...)

You could try looking at your system colours to see if this is actually what happens.


The COLOR_ wotsits around COLOR_APPWORKSPACE:

COLOR_ACTIVEBORDER 10 Active window border
COLOR_INACTIVEBORDER 11 Inactive window border
COLOR_APPWORKSPACE 12 Background color of multiple
document interface (MDI)
applications
COLOR_HIGHLIGHT 13 Items selected item in a
control
COLOR_HIGHLIGHTTEXT 14 Text of item selected in a
control
#3
02/13/2002 (12:41 am)
Wow ya that is it... what a shitty way of doing color. What Microsoft idiot thought this up?