home *** CD-ROM | disk | FTP | other *** search
- 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 */
-
-
-
-