Click here to Skip to main content
15,915,771 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A basic question on creating a window Pin
Joaquín M López Muñoz19-May-02 11:03
Joaquín M López Muñoz19-May-02 11:03 
GeneralRe: A basic question on creating a window Pin
Still learning how to code20-May-02 19:29
Still learning how to code20-May-02 19:29 
Generalwtf!! Pin
l a u r e n19-May-02 11:02
l a u r e n19-May-02 11:02 
GeneralRe: wtf!! Pin
Joaquín M López Muñoz19-May-02 11:00
Joaquín M López Muñoz19-May-02 11:00 
Generalmessages Pin
S van Leent19-May-02 10:14
S van Leent19-May-02 10:14 
GeneralRe: messages Pin
Paul M Watt19-May-02 21:53
mentorPaul M Watt19-May-02 21:53 
GeneralRe: messages Pin
S van Leent20-May-02 5:03
S van Leent20-May-02 5:03 
GeneralLSD and the Windows Desktop Pin
Shog919-May-02 9:53
sitebuilderShog919-May-02 9:53 
(this was a reply to a lounge post, but given that i'm now posting code, i'm replying here Smile | :) )

Here's some code (C++/MFC) to implement the effect; you can put it in a timer handler, loop, etc. just put a delay of some kind in so it doesn't get called too fast.
// start of next color sequence
static int rot = 0;
// aw, pastels.  how nice.
static const COLORREF colors[] = { RGB(255,166,166),
                        RGB(244,244,176),
                        RGB(179,245,175),
                        RGB(175,245,245),
                        RGB(189,174,247),
                        RGB(243,177,201),
                        RGB(204,183,238),
                        RGB(189,232,220),
                        RGB(237,184,184),
                        RGB(255,241,166),
                        RGB(166,253,255),
                        RGB(166,255,170),
                        RGB(172,166,255),
                        RGB(241,166,255),
                        RGB(233,188,192),
                        RGB(222,197,224),
                        RGB(198,219,223),
                        RGB(203,228,192),
                        RGB(228,192,192),
                        RGB(187,194,234)};
static const int NumColors = sizeof(colors)/sizeof(COLORREF);
static const int SysElements[] = {  COLOR_3DDKSHADOW,
                                    COLOR_3DFACE,
                                    COLOR_3DHILIGHT,
                                    COLOR_3DLIGHT,
                                    COLOR_3DSHADOW,
                                    COLOR_ACTIVEBORDER,
                                    COLOR_ACTIVECAPTION,
                                    COLOR_APPWORKSPACE,
                                    COLOR_BACKGROUND,
                                    COLOR_BTNTEXT,
                                    COLOR_CAPTIONTEXT,
                                    COLOR_GRAYTEXT,
                                    COLOR_HIGHLIGHT,
                                    COLOR_HIGHLIGHTTEXT,
                                    COLOR_INACTIVEBORDER,
                                    COLOR_INACTIVECAPTION,
                                    COLOR_INACTIVECAPTIONTEXT,
                                    COLOR_INFOBK,
                                    COLOR_INFOTEXT,
                                    COLOR_MENU,
                                    COLOR_MENUTEXT,
                                    COLOR_SCROLLBAR,
                                    COLOR_WINDOW,
                                    COLOR_WINDOWFRAME,
                                    COLOR_WINDOWTEXT };
const int NumSysElements = sizeof(SysElements)/sizeof(int);
COLORREF SysColors[NumSysElements];

for (int i=0, c=rot; i<NumSysElements; ++i, ++c)
{
   if ( c >= NumColors )
      c = 0;

   SysColors[i] = colors[c];
}

::SetSysColors(NumSysElements, SysElements, SysColors);

// prepare for next rotation
++rot;
if ( rot >= NumColors )
   rot = 0;


If the colors i've used aren't psychodelic enough for you, just modify colors appropriately.

--------

From now on we can call C# and MC++ "The square wheel languages"

-- Jack Handy, The Lounge


QuestionWhat is a DDE server? Pin
19-May-02 8:59
suss19-May-02 8:59 
AnswerRe: What is a DDE server? Pin
Michael P Butler19-May-02 9:39
Michael P Butler19-May-02 9:39 
AnswerRe: What is a DDE server? Pin
Paul M Watt19-May-02 9:41
mentorPaul M Watt19-May-02 9:41 
Generaltcp/ip and unicode... Pin
l a u r e n19-May-02 8:59
l a u r e n19-May-02 8:59 
GeneralRe: tcp/ip and unicode... Pin
Paul M Watt19-May-02 9:52
mentorPaul M Watt19-May-02 9:52 
GeneralRe: tcp/ip and unicode... Pin
l a u r e n19-May-02 10:29
l a u r e n19-May-02 10:29 
GeneralCStdioFile::Find() and CStdioFile::Insert() Pin
Emearg19-May-02 8:19
Emearg19-May-02 8:19 
GeneralRe: CStdioFile::Find() and CStdioFile::Insert() Pin
Joaquín M López Muñoz19-May-02 11:47
Joaquín M López Muñoz19-May-02 11:47 
GeneralRe: CString, not CStdioFile Pin
Emearg19-May-02 15:07
Emearg19-May-02 15:07 
GeneralRe: CString, not CStdioFile Pin
Ravi Bhavnani19-May-02 17:35
professionalRavi Bhavnani19-May-02 17:35 
GeneralBlackJack Pin
nywebhead19-May-02 5:44
nywebhead19-May-02 5:44 
GeneralRe: BlackJack Pin
Paul M Watt19-May-02 6:17
mentorPaul M Watt19-May-02 6:17 
GeneralRe: BlackJack Pin
Mazdak19-May-02 8:07
Mazdak19-May-02 8:07 
GeneralRe: BlackJack Pin
Paul M Watt19-May-02 8:37
mentorPaul M Watt19-May-02 8:37 
GeneralRe: BlackJack Pin
Mazdak19-May-02 9:09
Mazdak19-May-02 9:09 
GeneralRe: BlackJack Pin
nywebhead19-May-02 12:24
nywebhead19-May-02 12:24 
GeneralWindow Font Pin
Levon19-May-02 3:53
Levon19-May-02 3:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.