GetDeviceCoordinates() private method

Recalculates OS coordinates in order to support WPFs coordinate system if OS scaling (DPIs) is not 100%.
private GetDeviceCoordinates ( Point point ) : Point
point Hardcodet.Wpf.TaskbarNotification.Interop.Point
return Hardcodet.Wpf.TaskbarNotification.Interop.Point
示例#1
0
文件: Util.cs 项目: ijat/byteflood
        public static Interop.Point GetMousePosition(TaskbarIcon icon)
        {
            Interop.Point cursorPosition = new Interop.Point();
            if (icon.MessageSink.Version == NotifyIconVersion.Vista)
            {
                //physical cursor position is supported for Vista and above
                WinApi.GetPhysicalCursorPos(ref cursorPosition);
            }
            else
            {
                WinApi.GetCursorPos(ref cursorPosition);
            }

            return(icon.GetDeviceCoordinates(cursorPosition));
        }