|
-
Nov 7th, 2002, 06:10 PM
#1
Thread Starter
Fanatic Member
Wapi
wow, i decided to learn the windows API instead of using MFC, i picked it up pretty quick...and i like it better than MFC. the widnow creation is abit of a pain in the ass..but i got winsock working 
now for my question..
i have:
wcxMain.hbrBackground = (HBRUSH) LTGRAY_BRUSH;
i can't figure out the "normal" gray background color, either i get too light or too dark. ive tried out all the constants listed..any idea?
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Nov 7th, 2002, 07:08 PM
#2
Member
As far as I know windows only defines six brushes these are:
WHITE_BRUSH
BLACK_BRUSH
GRAY_BRUSH
LTGRAY_BRUSH
DKGRAY_BRUSH
NULL_BRUSH
If you need any other colours you will need to create your own.
Code:
HBRUSH hBrush = NULL;
hdc = BeginPaint(hwnd, &ps);
hBrush = CreateSolidBrush(RGB(0,255,0); // Create solid green brush
SelectObject (hdc, hBrush);
EndPaint(hwnd, &ps);
DeleteObject (hBrush) ;
Don't forget to delete the brush once your finished with it to avoid a resource leak.
-
Nov 7th, 2002, 09:12 PM
#3
Thread Starter
Fanatic Member
Oh ok..thanks. Do you know maybe where I can get the RPG values for normal window?
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Nov 7th, 2002, 09:50 PM
#4
Member
There are however several system colours that windows uses you could try this. I think that the system colours can be changed by users using windows settings not sure though, just keep that in mind.
Code:
hBrush = CreateSolidBrush (GetSysColor(COLOR_APPWORKSPACE));
or
Code:
hBrush = CreateSolidBrush (GetSysColor(COLOR_BACKGROUND));
COLOR_BACKGROUND = RGB(00,80,80)
COLOR_APPWORKSPACE = RGB(80,80,80)
Last edited by ISquishWorms; Nov 7th, 2002 at 09:56 PM.
ISquishWorms
-
Nov 8th, 2002, 06:41 AM
#5
Thread Starter
Fanatic Member
Yeah I was about to post I tried those too, heres the ones:
COLOR_ACTIVEBORDER
COLOR_ACTIVECAPTION
COLOR_APPWORKSPACE
COLOR_BACKGROUND
COLOR_BTNFACE
COLOR_BTNSHADOW
COLOR_BTNTEXT
COLOR_CAPTIONTEXT
COLOR_GRAYTEXT
COLOR_HIGHLIGHT
COLOR_HIGHLIGHTTEXT
COLOR_INACTIVEBORDER
COLOR_INACTIVECAPTION
COLOR_MENU
COLOR_MENUTEXT
COLOR_SCROLLBAR
COLOR_WINDOW
COLOR_WINDOWFRAME
COLOR_WINDOWTEXT
None of them are the right color...either too light or dark
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Nov 8th, 2002, 08:28 AM
#6
When using the constants
WHITE_BRUSH
BLACK_BRUSH
GRAY_BRUSH
LTGRAY_BRUSH
DKGRAY_BRUSH
NULL_BRUSH
you have to do
wcxMain.hbrBackground = (HBRUSH)GetStockObject(constant);
When using the COLOR_* constants you have to do
wcxMain.hbrBackground = (HBRUSH)(COLOR_* + 1);
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 8th, 2002, 08:43 AM
#7
Member
Nabeels786, you should feel privileged you have one of the experts around here helping you now. I tried to help but CornedBee will probably be able to give you the answer that you seek (he’s pretty clever you know). He helps me a lot.
Last edited by ISquishWorms; Nov 8th, 2002 at 08:46 AM.
ISquishWorms
-
Nov 8th, 2002, 09:27 AM
#8
Addicted Member
And me quite a few times. I try my best, but these youngsters seem to know what they're doing better than me
HD
-
Nov 8th, 2002, 09:31 AM
#9
On the downside, I don't have a life
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 8th, 2002, 02:31 PM
#10
Thread Starter
Fanatic Member
Originally posted by CornedBee
When using the constants
WHITE_BRUSH
BLACK_BRUSH
GRAY_BRUSH
LTGRAY_BRUSH
DKGRAY_BRUSH
NULL_BRUSH
you have to do
wcxMain.hbrBackground = (HBRUSH)GetStockObject(constant);
When using the COLOR_* constants you have to do
wcxMain.hbrBackground = (HBRUSH)(COLOR_* + 1);
Yeah I got those working, but I can't seem to find the correct shade of gray
Thanks for helping all I guess I'll just go with my lighter gray background, doesn't matter all too much anyway
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Nov 8th, 2002, 02:40 PM
#11
Monday Morning Lunatic
You want COLOR_BTNFACE. That gives the standard background grey colour.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 8th, 2002, 06:12 PM
#12
Thread Starter
Fanatic Member
Originally posted by parksie
You want COLOR_BTNFACE. That gives the standard background grey colour.
I tried that, I get black
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Nov 8th, 2002, 07:05 PM
#13
Monday Morning Lunatic
Uh. Hmm. Try COLOR_BTNFACE + 1.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 8th, 2002, 07:55 PM
#14
A rather dark shadde of grey would be (COLOR_APPWORKSPACE + 1), which is the background color of MDI windows.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 8th, 2002, 09:43 PM
#15
Member
Looks to me like you now have two experts trying to help you out.
-
Nov 9th, 2002, 12:43 PM
#16
Thread Starter
Fanatic Member
Originally posted by parksie
Uh. Hmm. Try COLOR_BTNFACE + 1.
I still got black
COLOR_APPWORKSPACE + 1 worked. Thanks guys
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|