Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Screen resolution
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00390400
Message ID:
00390404
Views:
21
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform