[comp.windows.ms] Changing System Palette

papa@pollux.usc.edu (Marco Papa) (08/10/90)

Has anybody been able to successfully replace the "system palette" with his
own, by using SetSystemPaletteUse()?  

I used the code description from p. 4-403 of the SDK reference Vol. 1
(shown down here), but it doesn't work. Any ideas?


static void near InstallColorTable(index)
{
	/* create the palette (see Color Palettes, p. 19-5 SDK 
	   Guide to Programming */
	if ((hPal = CreateBIPalette (index)) == NULL) return;

	/* use the full system palette */
	SetSystemPaletteUse(hDC, SYSPAL_NOSTATIC);
	UnrealizeObject(hPal);

	SelectPalette(hDC, hPal, 0);
	RealizePalette(hDC);
 	/* save system colors */
	SaveSysColors();
	/* set some of the system colors */
	...
	/* broadcast message to other windows */
	SendMessage((HWND)0xFFFF, WM_SYSCOLORCHANGE, (WORD)0, (LPSTR)NULL);
}


-- Marco
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Xerox sues somebody for copying?" -- David Letterman
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=