diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000..5a5216f
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+ 10.0
+
+
\ No newline at end of file
diff --git a/MapTP.App/AboutWindow.xaml b/MapTP.App/AboutWindow.xaml
index 7994a16..0a9b685 100644
--- a/MapTP.App/AboutWindow.xaml
+++ b/MapTP.App/AboutWindow.xaml
@@ -6,6 +6,9 @@
xmlns:local="clr-namespace:MapTP.App"
mc:Ignorable="d"
Title="About MapTP" Height="237" Width="400">
+
+
+
@@ -16,5 +19,6 @@
Source code
+
diff --git a/MapTP.App/AboutWindow.xaml.cs b/MapTP.App/AboutWindow.xaml.cs
index f1902be..d1533fd 100644
--- a/MapTP.App/AboutWindow.xaml.cs
+++ b/MapTP.App/AboutWindow.xaml.cs
@@ -1,17 +1,9 @@
using System;
-using System.Collections.Generic;
using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
using System.Windows.Documents;
-using System.Windows.Input;
using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
+using Walterlv.Windows.Effects;
namespace MapTP.App
{
@@ -27,6 +19,13 @@ private void Hyperlink_Click(object sender, RoutedEventArgs e)
Hyperlink link = sender as Hyperlink;
Process.Start(new ProcessStartInfo(link.NavigateUri.AbsoluteUri));
}
+
+
+
+ private void Close(object sender, RoutedEventArgs e)
+ {
+ Close();
+ }
}
diff --git a/MapTP.App/App.config b/MapTP.App/App.config
index 56efbc7..4bfa005 100644
--- a/MapTP.App/App.config
+++ b/MapTP.App/App.config
@@ -1,6 +1,6 @@
-
+
-
+
-
\ No newline at end of file
+
diff --git a/MapTP.App/CalibrateWindow.xaml b/MapTP.App/CalibrateWindow.xaml
index bbffcff..89e694a 100644
--- a/MapTP.App/CalibrateWindow.xaml
+++ b/MapTP.App/CalibrateWindow.xaml
@@ -7,7 +7,7 @@
mc:Ignorable="d"
Title="Touchpad size calibration" Height="200" Width="400">
-
+
diff --git a/MapTP.App/CalibrateWindow.xaml.cs b/MapTP.App/CalibrateWindow.xaml.cs
index 546349c..e01877c 100644
--- a/MapTP.App/CalibrateWindow.xaml.cs
+++ b/MapTP.App/CalibrateWindow.xaml.cs
@@ -1,26 +1,16 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using MapTP.App.Touchpad;
+using System;
using System.Windows;
using System.Windows.Interop;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using HandyControl.Controls;
-using MapTP.App.Touchpad;
+using Walterlv.Windows.Effects;
namespace MapTP.App
{
///
/// CalibrateWindow.xaml 的交互逻辑
///
- public partial class CalibrateWindow : System.Windows.Window
+ public partial class CalibrateWindow : Window
{
private int X=0, Y=0;
private HwndSource MainWindowHwnd;
@@ -39,6 +29,7 @@ public CalibrateWindow(HwndSource _MainWindowHwnd) : base()
}
+
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
switch (msg)
diff --git a/MapTP.App/MainWindow.xaml b/MapTP.App/MainWindow.xaml
index 5d49527..0081d84 100644
--- a/MapTP.App/MainWindow.xaml
+++ b/MapTP.App/MainWindow.xaml
@@ -1,4 +1,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Title="MapTP" Height="500" Width="800"
+ Background="{x:Null}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MapTP
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/MapTP.App/MainWindow.xaml.cs b/MapTP.App/MainWindow.xaml.cs
index 2eb06ce..1bc3a0c 100644
--- a/MapTP.App/MainWindow.xaml.cs
+++ b/MapTP.App/MainWindow.xaml.cs
@@ -1,20 +1,21 @@
-using HandyControl.Controls;
-using MapTP.App.Touchpad;
+using MapTP.App.Touchpad;
using System;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
+using System.Windows.Media;
using System.Xml;
using System.Xml.Serialization;
+using Walterlv.Windows.Effects;
namespace MapTP.App
{
///
/// MainWindow.xaml
///
- public partial class MainWindow : BlurWindow
+ public partial class MainWindow : Window
{
///
/// This variable describes if a PTP exists
@@ -106,12 +107,13 @@ public void ReceiveTouchpadSize(int X, int Y)
public MainWindow()
{
InitializeComponent();
+ Loaded += OnLoaded;
}
private void About_Click(object sender, RoutedEventArgs e)
{
var w = new AboutWindow();
- w.ShowDialog();
+ w.Show();
}
private void SuggestButtonClick(object sender, RoutedEventArgs e)
@@ -133,6 +135,23 @@ private void SuggestButtonClick(object sender, RoutedEventArgs e)
}
}
+ private void OnTitleBarMouseDown(object sender, MouseButtonEventArgs e)
+ {
+ this.DragMove();
+ return;
+ }
+
+ private void OnMinButtonClick(object sender, RoutedEventArgs e)
+ {
+ WindowState = WindowState.Minimized;
+ }
+
+ private void OnCloseButtonClick(object sender, RoutedEventArgs e)
+ {
+ Close();
+ System.Windows.Application.Current.Shutdown();
+ }
+
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
@@ -168,7 +187,23 @@ protected override void OnSourceInitialized(EventArgs e)
}
}
-
+ private void OnLoaded(object sender, RoutedEventArgs e)
+ {
+
+ var WalterlvCompositor = new WindowAccentCompositor(this)
+ {
+ Color = Color.FromArgb(0x33, 0x87, 0xce, 0xfa)
+ };
+ WalterlvCompositor.IsEnabled = true;
+
+ if (!(Environment.OSVersion.Version > new Version(10, 0, 17763)))
+ {
+ this.Background = Brushes.Aqua;
+ WalterlvCompositor.IsEnabled = false;
+ }
+ }
+
+
///
/// This method is for limiting TextBoxes only to accept numbers
///
@@ -384,7 +419,6 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref b
InputX = x.X;
InputY = x.Y;
- ValueTextBox.Text = $"{x.X},{x.Y}";
if (started && (tpsx <= x.X && x.X <= tpex) && (tpsy <= x.Y && x.Y <= tpey))
{
try
diff --git a/MapTP.App/MapTP.App.csproj b/MapTP.App/MapTP.App.csproj
index 15418cf..a2673f4 100644
--- a/MapTP.App/MapTP.App.csproj
+++ b/MapTP.App/MapTP.App.csproj
@@ -1,125 +1,20 @@
-
-
-
+
- Debug
- AnyCPU
- {F5217DE5-48E8-404D-A4F0-15B88C21B5E4}
+ net7.0-windows10.0.18362.0
WinExe
- MapTP.App
- MapTP.App
- v4.7.2
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
- true
- true
+ false
+ true
+ true
-
- AnyCPU
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
+
+ app.manifest
+ 10.0.18362.0
-
- ..\packages\HandyControl.3.4.0\lib\net472\HandyControl.dll
-
-
-
-
-
- ..\packages\System.Drawing.Common.7.0.0\lib\net462\System.Drawing.Common.dll
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- AboutWindow.xaml
-
-
- CalibrateWindow.xaml
-
-
-
-
-
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- App.xaml
- Code
-
-
- MainWindow.xaml
- Code
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
+
+
+
+
+
-
\ No newline at end of file
diff --git a/MapTP.App/Properties/AssemblyInfo.cs b/MapTP.App/Properties/AssemblyInfo.cs
deleted file mode 100644
index 51cc4c0..0000000
--- a/MapTP.App/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// 有关程序集的一般信息由以下
-// 控制。更改这些特性值可修改
-// 与程序集关联的信息。
-[assembly: AssemblyTitle("MapTP.App")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("MapTP.App")]
-[assembly: AssemblyCopyright("Copyright © 2023")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 将 ComVisible 设置为 false 会使此程序集中的类型
-//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
-//请将此类型的 ComVisible 特性设置为 true。
-[assembly: ComVisible(false)]
-
-//若要开始生成可本地化的应用程序,请设置
-//.csproj 文件中的 CultureYouAreCodingWith
-//在 中。例如,如果你使用的是美国英语。
-//使用的是美国英语,请将 设置为 en-US。 然后取消
-//对以下 NeutralResourceLanguage 特性的注释。 更新
-//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //主题特定资源词典所处位置
- //(未在页面中找到资源时使用,
- //或应用程序资源字典中找到时使用)
- ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
- //(未在页面中找到资源时使用,
- //、应用程序或任何主题专用资源字典中找到时使用)
-)]
-
-
-// 程序集的版本信息由下列四个值组成:
-//
-// 主版本
-// 次版本
-// 生成号
-// 修订号
-//
-//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
-//通过使用 "*",如下所示:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/MapTP.App/Properties/Resources.Designer.cs b/MapTP.App/Properties/Resources.Designer.cs
index 85bd9fc..303128c 100644
--- a/MapTP.App/Properties/Resources.Designer.cs
+++ b/MapTP.App/Properties/Resources.Designer.cs
@@ -1,69 +1,61 @@
//------------------------------------------------------------------------------
//
// 此代码由工具生成。
-// 运行时版本: 4.0.30319.42000
+// 运行时版本:4.0.30319.42000
//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,则所做更改将丢失。
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
//
//------------------------------------------------------------------------------
-namespace MapTP.App.Properties
-{
-
-
+namespace MapTP.App.Properties {
+ using System;
+
+
///
- /// 强类型资源类,用于查找本地化字符串等。
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
///
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
+ internal class Resources {
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
+ internal Resources() {
}
-
+
///
- /// 返回此类使用的缓存 ResourceManager 实例。
+ /// 返回此类使用的缓存的 ResourceManager 实例。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MapTP.App.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
-
+
///
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
return resourceCulture;
}
- set
- {
+ set {
resourceCulture = value;
}
}
diff --git a/MapTP.App/Properties/Settings.Designer.cs b/MapTP.App/Properties/Settings.Designer.cs
index 8be6989..37478a7 100644
--- a/MapTP.App/Properties/Settings.Designer.cs
+++ b/MapTP.App/Properties/Settings.Designer.cs
@@ -1,28 +1,24 @@
//------------------------------------------------------------------------------
//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
//
//------------------------------------------------------------------------------
-namespace MapTP.App.Properties
-{
-
-
+namespace MapTP.App.Properties {
+
+
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
+
+ public static Settings Default {
+ get {
return defaultInstance;
}
}
diff --git a/MapTP.App/app.manifest b/MapTP.App/app.manifest
new file mode 100644
index 0000000..91c3140
--- /dev/null
+++ b/MapTP.App/app.manifest
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MapTP.App/packages.config b/MapTP.App/packages.config
deleted file mode 100644
index 6f4f866..0000000
--- a/MapTP.App/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/MapTP.sln b/MapTP.sln
index e2f4b9e..efd7f33 100644
--- a/MapTP.sln
+++ b/MapTP.sln
@@ -1,9 +1,9 @@
-
+
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34031.279
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapTP.App", "MapTP.App\MapTP.App.csproj", "{F5217DE5-48E8-404D-A4F0-15B88C21B5E4}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapTP.App", "MapTP.App\MapTP.App.csproj", "{F5217DE5-48E8-404D-A4F0-15B88C21B5E4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution