TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Peter2 on December 18, 2013, 02:57:19 AM
-
Due to dual/triple monitors and changing of cables and/or monitors I have sometimes the problem that the stored position of a dialogue does not correspond to the current monitor configuration.
So: How to get the min/max coordinates of currents monitor(s) - entire monitors, not only the Acad-windows? There must be a result between approx. -2000 and +4000 (for x-axis) ....
Peter
-
You could use WMI like so:
(defun c:foo (/ _wmi out)
(defun _wmi (device / o out wmi)
(vl-load-com)
(and
(setq wmi (vlax-create-object "WbemScripting.SWbemLocator"))
(setq o (vlax-invoke (vlax-invoke wmi 'connectserver "." "\\root\\cimv2") 'execquery device))
(and wmi (vlax-release-object wmi))
(vlax-for i o (setq out (cons i out)))
)
out
)
(foreach m (_wmi "Select * from Win32_DesktopMonitor")
(vlax-for p (vlax-get m 'properties_)
(if (wcmatch (vlax-get p 'name) "ScreenWidth,ScreenHeight")
(setq out (cons (list (vlax-get p 'name) (vlax-get p 'value)) out))
)
)
)
(alert (vl-princ-to-string out))
)
-
Very good Ron :-)
-
Very good Ron :)
I get one every once in a while ;D
-
You could use WMI like so:..
Thanks, ronjonp
fine :-)