Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return to setting of the system display colors?
Message
From
25/07/2002 19:34:42
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00682779
Message ID:
00682833
Views:
17
Thanks Sergey !

And for anyone else who needs this, I am showing a code to return many others informations... this code was send me by Nilton Paulino , from FoxTotal Network (www.foxtotal.com.br).
Here is how it goes:


#DEFINE DRIVERVERSION 0
#DEFINE TECHNOLOGY 2
#DEFINE HORZSIZE 4
#DEFINE VERTSIZE 6
#DEFINE HORZRES 8
#DEFINE VERTRES 10
#DEFINE LOGPIXELSX 88
#DEFINE LOGPIXELSY 90
#DEFINE BITSPIXEL 12
#DEFINE PLANES 14
#DEFINE NUMBRUSHES 16
#DEFINE NUMPENS 18
#DEFINE NUMFONTS 22
#DEFINE NUMCOLORS 24
#DEFINE ASPECTX 40
#DEFINE ASPECTY 42
#DEFINE ASPECTXY 44
#DEFINE CLIPCAPS 36
#DEFINE SIZEPALETTE 104
#DEFINE NUMRESERVED 106
#DEFINE COLORRES 108
#DEFINE PHYSICALWIDTH 110
#DEFINE PHYSICALHEIGHT 111
#DEFINE PHYSICALOFFSETX 112
#DEFINE PHYSICALOFFSETY 113
#DEFINE SCALINGFACTORX 114
#DEFINE SCALINGFACTORY 115
#DEFINE RASTERCAPS 38
#DEFINE CURVECAPS 28
#DEFINE LINECAPS 30
#DEFINE POLYGONALCAPS 32
#DEFINE TEXTCAPS 34

DO decl

LOCAL hdc
hdc = GetDC(0) && entire screen

CREATE CURSOR csResult (name C(30), prm N(12))

= addLog ("Driver version", GetDeviceCaps(hdc, DRIVERVERSION))
= addLog ("Device technology", GetDeviceCaps(hdc, TECHNOLOGY))
= addLog ("Physical screen, width, mm", GetDeviceCaps(hdc, HORZSIZE))
= addLog ("Physical screen, height, mm", GetDeviceCaps(hdc, VERTSIZE))
= addLog ("Screen, width, pixels", GetDeviceCaps(hdc, HORZRES))
= addLog ("Screen, height, pixels", GetDeviceCaps(hdc, VERTRES))
= addLog ("Pixels per inch, X", GetDeviceCaps(hdc, LOGPIXELSX))
= addLog ("Pixels per inch, Y", GetDeviceCaps(hdc, LOGPIXELSY))
= addLog ("Bits per pixel", GetDeviceCaps(hdc, BITSPIXEL))
= addLog ("Color planes", GetDeviceCaps(hdc, PLANES))
= addLog ("Device-spec. brushes", GetDeviceCaps(hdc, NUMBRUSHES))
= addLog ("Device-spec. pens", GetDeviceCaps(hdc, NUMPENS))
= addLog ("Device-spec. fonts", GetDeviceCaps(hdc, NUMFONTS))
= addLog ("Colors in table", GetDeviceCaps(hdc, NUMCOLORS))
= addLog ("Pixel relative width", GetDeviceCaps(hdc, ASPECTX))
= addLog ("Pixel relative height", GetDeviceCaps(hdc, ASPECTY))
= addLog ("Pixel relative diagonal", GetDeviceCaps(hdc, ASPECTXY))
= addLog ("Clipping capab.", GetDeviceCaps(hdc, CLIPCAPS))
= addLog ("Entries in sys.palette", GetDeviceCaps(hdc, SIZEPALETTE))
= addLog ("Res.entries in sys.palette", GetDeviceCaps(hdc, NUMRESERVED))
= addLog ("Actual color resolution", GetDeviceCaps(hdc, COLORRES))
= addLog ("Physical page width", GetDeviceCaps(hdc, PHYSICALWIDTH))
= addLog ("Physical page height", GetDeviceCaps(hdc, PHYSICALHEIGHT))
= addLog ("Physical offset X", GetDeviceCaps(hdc, PHYSICALOFFSETX))
= addLog ("Physical offset Y", GetDeviceCaps(hdc, PHYSICALOFFSETY))
= addLog ("Printer scaling factor X", GetDeviceCaps(hdc,
SCALINGFACTORX))
= addLog ("Printer scaling factor Y", GetDeviceCaps(hdc,
SCALINGFACTORY))
= addLog ("Raster caps", GetDeviceCaps(hdc, RASTERCAPS))
= addLog ("Curve caps", GetDeviceCaps(hdc, CURVECAPS))
= addLog ("Line caps", GetDeviceCaps(hdc, LINECAPS))
= addLog ("Polygon caps", GetDeviceCaps(hdc, POLYGONALCAPS))
= addLog ("Text caps", GetDeviceCaps(hdc, TEXTCAPS))

= ReleaseDC (0, hdc)

GO TOP
BROW NORMAL NOWAIT

PROCEDURE addLog (lcName, lnPrm)
INSERT INTO csResult VALUES (m.lcName, m.lnPrm)

PROCEDURE decl
DECLARE INTEGER GetDC IN user32 INTEGER hwnd
DECLARE INTEGER ReleaseDC IN user32 INTEGER hwnd, INTEGER hdc
DECLARE INTEGER GetDeviceCaps IN gdi32 INTEGER hdc, INTEGER nIndex
Juliano Martins Terterola
Microsoft Certified Professional
Porto Alegre - RS - Brazil
9 years of Visual FoxPro experience

"Though we know that time has wings
We're the ones who have to fly..."
Neil Peart - Rush
Previous
Reply
Map
View

Click here to load this message in the networking platform