Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Monitor info
Message
De
21/05/1999 08:12:23
 
 
À
21/05/1999 08:06:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00221260
Message ID:
00221306
Vues:
13
>I've seen this question many times here. Maybe you can add it as a new FAQ... if you have time. Thanks.
>

Actually, after doing this, I noticed that George Tasker already has a FAQ entry that covers this (from a FoxTools perspective) in Win32 and Other APIs. George's code is actually a bit better, since it takes into account color planes, and returns the number of colors available in the pallette as an integer, rather than just the number of bits per pixel.

>Vlad
>
>>You need several API calls:
>>
>>
DECLARE INTEGER GetDC IN WIN32API INTEGER hWnd
>>DECLARE INTEGER GetActiveWindow IN WIN32API
>>DECLARE INTEGER GetDeviceCaps IN WIN32API ;
>>   INTEGER hDC, ;
>>   INTEGER nIndex
>>DECLARE INTEGER ReleaseDC IN WIN32API INTEGER hDC
>>#DEFINE BITSPIXEL 12
>>LOCAL nDC, nBitsPerPixel
>>nDC = GetDC(GetActiveWindow())
>>nBitsPerPixel = GetDeviceCaps(nDC, BITSPIXEL)
>>=ReleaseDC(nDC)
>>
>>nBitsPerPixel returns the color depth; 8 = 256 Color, 16 = High Color (64K), 24 or 32 are TrueColor modes. There are other values; these are the most common ones encountered.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform