Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Screen resolution
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00390400
Message ID:
00390404
Vues:
20
>All,
>
>Do you know any simple function can check the display settings(colors and screen area)in VFP?
>
>
>
Ricky,

Look at the sysmetric() functions in VFP to get screen height and width. To retrieve the number of colors, the following is from my FAQ on the subject
FUNCTION NumColors
* 32 bit version for use with
* VFP under Win 95 and above,
* and Win NT 3.51 and above

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
LOCAL lnresult, lnhDC, lnplanes, lnpixels
lnresult = 0
lnhDC = GetDC(0)
IF lnhDC > 0
  * Get the number of color planes
  lnplanes = GetDeviceCaps(lnhDC, 14)
  * Get the number of bits per pixel
  lnpixels = GetDeviceCaps(lnhDC, 12)
  * Calculate the return value
  lnresult = 2 ^ (lnplanes * lnpixels)
  = ReleaseDC(0, lnhDC)
ENDIF
RETURN lnresult
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform