![]() |
|
#1
|
|||
|
|||
Changing window start colourI have this basic template set up to create a blank window to start drawing in, how do i change the colour of the background, so I dont get black when it starts up (instad of actually drawing a green rectangle to fill the window)
Main_Prog.cpp CPP / C++ / C Code:
Globals.cpp CPP / C++ / C Code:
Globals.h CPP / C++ / C Code:
Last edited by dsmith : 17-Jan-2005 at 17:10.
Reason: Please use [c] & [/c] for posting C code.
|
|
#2
|
|||
|
|||
|
It's the hbrBackground struct element. You're calling GetStockObject() with BLACK_BRUSH, so, naturally, the background will be black. Try GREEN_BRUSH or look up the other definitions to see what the possible colors are.
|
|
#3
|
|||
|
|||
|
I've tried that. GREEN_BRUSH not recognised. It only does BLACK_BRUSH and WHITE_BRUSH
|
|
#4
|
|||
|
|||
|
try the RGB Macro like :
... winclass.hbrBackground =(HBRUSH)CreateSolidBrush(RGB(0,255,0)); ... |
|
#5
|
|||
|
|||
|
Ofcouse, the CreateSolidBrush function returns a HBRUSH so you dont have to cast it... a litte to fast copy/paste by me.
Regards // Veppe |
|
#6
|
|||
|
|||
|
Thanks ill give it a go
|
Recent GIDBlog
Observations of Iraq by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FLTK && fluid In Motion | cable_guy_67 | FLTK Forum | 4 | 20-Mar-2008 03:52 |
| Urgent ! Pls Help Me ! | mycashmoney | C Programming Language | 4 | 01-Jul-2006 22:49 |
| Simple FLTK dialog box sample | cable_guy_67 | FLTK Forum | 4 | 02-Nov-2004 08:46 |
| Looking for Reliable, Cheap ASP, ASP.NET MSSQL Hosting start from $4 | stevewatt88 | Web Hosting Advertisements & Offers | 1 | 31-Jul-2004 04:27 |
| Athlon system locking up on start up. Is it MoBo, Processor, PSU or what? | ebolaosu | Computer Hardware Forum | 8 | 26-Feb-2004 11:19 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The