mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
30 lines
723 B
C#
30 lines
723 B
C#
using System;
|
|
using System.Drawing;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner
|
|
{
|
|
/// <summary>
|
|
/// win8下wpf程序测试成功
|
|
/// </summary>
|
|
public class CursorPointManager
|
|
{
|
|
#region 得到光标在屏幕上的位置
|
|
[DllImport("user32")]
|
|
private static extern bool GetCursorPos(out Point lpPoint);
|
|
|
|
/// <summary>
|
|
/// 获取光标相对于显示器的位置
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static Point GetCursorPosition()
|
|
{
|
|
Point showPoint = new Point();
|
|
GetCursorPos(out showPoint);
|
|
return showPoint;
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
}
|