home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_11_09
/
1109029a
< prev
next >
Wrap
Text File
|
1993-04-20
|
770b
|
45 lines
Listing 2 Removing the Logical Palette and
Reinstalling the System Palette
int FAR PASCAL ResetPalette (hWnd)
/*
*/
HWND hWnd;
{
int result,i,j;
HDC hDC;
HPALETTE aPalette;
result = NO_ERROR;
if (oldPalette != NULL)
{
hDC = GetDC(hWnd);
if (hDC != NULL)
{
aPalette = SelectPalette(hDC,oldPalette,0);
if (aPalette != NULL)
{
SetSystemPaletteUse(hDC,oldPaletteUsage);
UnrealizeObject(oldPalette);
RealizePalette(hDC);
if (newPalette != NULL)
DeleteObject(newPalette);
}
else result = PAL_SELECT_ERROR;
ReleaseDC(hWnd,hDC);
}
else result = PAL_HDC_ERROR;
}
return result;
} /* ResetPalette */