Dec 18, 2012 Through the standard, no. The screen doesn't even exist in C, so neither do colors. Purely text and a standard input and output, and they're not even defined as to what it has to be. However, there is several possibilities. If you're on windows, you can call the batch command 'color' using the system function. Feb 06, 2003 Somebody tell me please what is the function of Win Api or way to change: - color - text size and font ot button. Of a Control, for example check box or pushbutton. Other Topic how can change the BackGround color of a created Window.
Hi I got a quick question. Is there any way i can change the background color and the text color within my compiler of dev-c++. I'm not trying to change the color of the output when I run the program, I'm talking about the actual code itself and its compiler.
Dec 13, 2017 I will assume you are referring to DevCpp IDE. If that is true then you are dabbling with IDE that was abandoned a way back to 2005. While this does not address your surface question, It is practically valuable. Be wary of using the technique described by PigBen. It will change the background color for all instances of that window class, unless they implement WMPAINT/WMERASBKGND that overrides the windows' default background. I would make the extra effort of implementing WMERASEBKGND for your window, and draw the background explicitly.
How To Change The Background Color In Dev C++
I'm using Dev-C++ 4.9.9.2
- 3 Contributors
- forum 5 Replies
- 3,051 Views
- 5 Hours Discussion Span
- commentLatest Postby nullptrLatest Post
rubberman1,355
This is likely a code editor issue. What editor are you using? The Windows VS editor, Eclipse, or something else?
Your program must have a Window Procedure. If you've created child window controls on your main program window, Windows (the Operating System) will send WM_CTLCOLORSTATIC messages to the parent window's Window Procedure. Here is what MSDN says (just as tath told you to look up)...A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control. WM_CTLCOLORSTATIC hdcStatic = (HDC) wParam; // handle to display context hwndStatic = (HWND) lParam; // handle to static control Parameters hdcStatic Value of wParam. Handle to the device context for the static control window. hwndStatic Value of lParam. Handle to the static control. |