I've finally got static text control windows (WS_STATIC, SS_TEXT) working with a different color pres. parameter set ! Thanks, Rick, Dan and Wayne. Code as follows:
RGB2 rgb2 ; // RGB2 structure
HWND hwnd ; // window handle
// Set RGB values for a SYSCLR_BACKGROUND (light gray) color
rgb2.bred = 204 ; // Found these in 'WinSetSysColors' API
rgb2.bgreen = 204 ;
rgb2.bblue = 204 ;
rgb2.fcOptions = 0 ;
// Set background color
WinSetPresParam (hwnd, PP_BACKGROUNDCOLOR, (ULONG) sizeof (RGB2),
&rgb2) ;
// Set RGB values for black
rgb2.bred = 0 ;
rgb2.bgreen = 0 ;
rgb2.bblue = 0 ;
rgb2.fcOptions = 0 ;
// Set text foreground color
WinSetPresParam (hwnd, PP_FOREGROUNDCOLOR, (ULONG) sizeof (RGB2),
&rgb2) ;
// Set text border color (important for outline fonts)
WinSetPresParam (hwnd, PP_BORDERCOLOR, (ULONG) sizeof (RGB2), &rgb2) ;
Three big caveats here:
Credit: Bill Kenning