Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dual monitor screen size?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00921392
Message ID:
00921555
Views:
18
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform