This example changes the desktop background to blue and the output text to green.

#define INCL_WINSYS
#define INCL_GPILOGCOLORTABLE
#include <OS2.H>

typedef struct {
LONG index;
LONG color;
               } ENTRY;
LONG R, G ,B;

ENTRY alTable[2];  /* array of two color/index entries. */

R = 5L; G = 5L; B = 200L;
alTable[0].color = (R * 65536L) + (G * 256L) + B;
R = 5; G = 200; B = 5;
alTable[1].color = (R * 65536L) + (G * 256L) + B;
alTable[0].index = SYSCLR_OUTPUTTEXT; /* output text. */
alTable[1].index = SYSCLR_BACKGROUND; /* desktop background. */

WinSetSysColors (HWND_DESKTOP,
                LCOL_RESET,     /* reset system colors before   */
                                   /* processing remainder of this */
                                   /* call.                        */
                LCOLF_INDRGB,   /* Array of (index,RGB) */
                                   /* values. Each pair of */
                                   /* entries is 8 bytes   */
                                   /* long, comprising 4   */
                                   /* bytes for the index, */
                                   /* and 4 bytes for the  */
                                   /* color value. For     */
                                   /* system color indexes,*/
                                   /* see lStart.          */
                0L,                /* not applicable.      */
               (ULONG)4,
               (PLONG)&alTable[0].index);


[Back] [Next]