mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-06 01:06:37 +08:00
整理一下项目文件
This commit is contained in:
29
AIStudio.Wpf.DiagramDesigner/Helpers/CursorPointManager.cs
Normal file
29
AIStudio.Wpf.DiagramDesigner/Helpers/CursorPointManager.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user