>I have an application that displays a splash screen created in the 16-bit color palette (high-color). Naturally, it looks beyond horrible in 256 colors. I would like to toggle images depending on what color palette is being used by the operating system.
>
>I am certain foxpro is capable of detecting what color pallet Windows 95 is using, however, the solution eludes me right now. I thought it might be available through declare dll (using the window 95 api). Any thoughts?
Christopher,
This should give you all you need in this area. First, declare the following API functions
DECLARE INTEGER GetDC IN Win32API;
INTEGER hWnd
DECLARE INTEGER GetDeviceCaps IN Win32API;
INTEGER hDC, INTEGER nIndex
DECLARE INTEGER ReleaseDC IN Win32API;
INTEGER hWnd, INTEGER hDC
Next, get a valid (greater than zero) device context
lnhDC = GetDC(0)
Get the number of planes
lnplanes = GetDeviceCaps(lnhDC, 14)
Get the bits per pixel
lnpixels = GetDeviceCaps(lnhDC, 12)
Calculate the number of colors
lnnumclrs = 2 ^ (lnplanes * lnpixels)
Finally, release the device context
= ReleaseDC(0, lnhDC)
HTH,
George
George
Ubi caritas et amor, deus ibi est