(defun c:xlsfmt_to_OnDragnDropFromControl
(ProjectName FormName ControlName DropPoint / rc dpi)
;; get screen resolution
(setq dpi
(vl-registry-read
"HKEY_CURRENT_USER\\Control Panel\\Desktop\\WindowMetrics"
"AppliedDPI"
)
)
(if (< 96 dpi)
;; the difference in resolution of a 1080p monitor and anything else is calculated
;; say 1080p @ 100% = 96 dpi, 3840 x 2160 @ 150% = 144 dpi
;; 96 / 144 = 0.66667 which is the scaling factor applied to DropPoint
(setq DropPoint
(mapcar '(lambda (x) (roundval (* (/ (float 96) (float dpi)) x) 1))
DropPoint
)
)
;; otherwise do nothing
)
;; HitPointTest then reports the correct relative coordinates
(setq rc (dcl_ListView_HitPointTest xlsfmt_to (car DropPoint) (cadr DropPoint)))
; do something with rc ...
) ; end defun
(defun RoundVal (value to)
(setq to (abs to))
(* to
(fix (/ ((if (minusp value)
-
+
)
value
(* to 0.5)
)
to
)
)
)
)