Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dual monitor screen size?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00921392
Message ID:
00921555
Vues:
19
>I have 2 monitors one 1690x1050 (dell inspiron 9100) the other is a viewsonic VA800 at 1280x1024
>
>how can I find out in a program what the size of both are, so I can put a window on one (oForm1.left=0) and th other on the second(centered) oForm2.left=1680+1/2 of secondmonitor width - 1/2 of oForm2.width ...
>
>Thanks in advance
>
>
>Peter

Peter, you can try using WMI to do this:
loLocator			= createObject("wbemScripting.SwbemLocator")
loWMI				= loLocator.ConnectServer()

loMonitors			= loWMI.ExecQuery('Select * from Win32_DesktopMonitor')

for each loMonitor in loMonitors
	? loMonitor.DeviceID, loMonitor.ScreenWidth, loMonitor.ScreenHeight
endfor
I do not have 2 monitors to test, so let me know if I got the correct class :)
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform