Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get windows desktop dimensions
Message
De
28/04/2003 09:59:57
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
25/04/2003 10:13:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00781479
Message ID:
00782214
Vues:
12
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform