优化功能 beta
This commit is contained in:
@@ -5,6 +5,10 @@ using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 热键注册
|
||||
/// </summary>
|
||||
namespace GeekDesk.Util
|
||||
{
|
||||
|
||||
|
||||
35
Util/MouseUtil.cs
Normal file
35
Util/MouseUtil.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace GeekDesk.Util
|
||||
{
|
||||
class MouseUtil
|
||||
{
|
||||
[DllImport("user32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
internal static extern bool GetCursorPos(ref Win32Point pt);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct Win32Point
|
||||
{
|
||||
public Int32 X;
|
||||
public Int32 Y;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 获取鼠标坐标
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Point GetMousePosition()
|
||||
{
|
||||
var w32Mouse = new Win32Point();
|
||||
GetCursorPos(ref w32Mouse);
|
||||
return new Point(w32Mouse.X, w32Mouse.Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Util/ScreenUtil.cs
Normal file
15
Util/ScreenUtil.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GeekDesk.Util
|
||||
{
|
||||
class ScreenUtil
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace GeekDesk.Util
|
||||
{
|
||||
class VisibilityConvert : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
int v = (int)value;
|
||||
|
||||
if (v == (int)Visibility.Visible)
|
||||
{
|
||||
return Visibility.Visible;
|
||||
} else if (v == (int)Visibility.Collapsed)
|
||||
{
|
||||
return Visibility.Collapsed;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user