Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get windows desktop dimensions
Message
From
28/04/2003 09:59:57
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
25/04/2003 10:13:46
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00781479
Message ID:
00782214
Views:
13
>Hi
>I want to get the height and width of the user's desktop. I know I have to use GetWindowRect in the WIN32API but am confused about how to get the 4 parameters it should return (height, width, top, left) into foxfro numeric variables.
>Any help available?
>Cheers
>Neil Shumsky

Neil,
You could use VFP's sysmetric(). However it gives wrong results if user changes resolution on his box. Instead use GetSystemMetrics winAPI. Sample code (originally provided by George Tasker) :
#define SM_CXSCREEN             0 && Screen width in pixels
#define SM_CYSCREEN             1 && Screen height in pixels
#define SM_CXFULLSCREEN         16 && Client area width
#define SM_CYFULLSCREEN         17 && Client area height
DECLARE INTEGER GetSystemMetrics IN Win32API;
  INTEGER nIndex
* Example
? GetSystemMetrics(SM_CXSCREEN)
? GetSystemMetrics(SM_CYSCREEN)
? GetSystemMetrics(SM_CXFULLSCREEN)
? GetSystemMetrics(SM_CYFULLSCREEN)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform