更新至 net 8.0

This commit is contained in:
ZouJin 2024-02-23 02:45:18 +08:00
parent 7fdd54a437
commit 48f1bc88f0
13 changed files with 134 additions and 302 deletions

View File

@ -1,63 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VPet_Simulator.Core.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[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 {
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() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VPet_Simulator.Core.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VPet_Simulator.Core.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.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 {
return defaultInstance;
}
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net462;net6.0-windows</TargetFrameworks> <TargetFramework>net8.0-windows</TargetFramework>
<RootNamespace>VPet_Simulator.Core</RootNamespace> <RootNamespace>VPet_Simulator.Core</RootNamespace>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>

View File

@ -5,8 +5,6 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Xml.Linq; using System.Xml.Linq;
using VPet_Simulator.Core;
using static VPet_Simulator.Core.GraphCore;
namespace VPet_Simulator.Tool namespace VPet_Simulator.Tool
{ {

View File

@ -26,7 +26,4 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VPet-Simulator.Core\VPet-Simulator.Core.csproj" />
</ItemGroup>
</Project> </Project>

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net462</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>VPet_Simulator.Windows.Interface</RootNamespace> <RootNamespace>VPet_Simulator.Windows.Interface</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>

View File

@ -249,7 +249,7 @@ namespace VPet_Simulator.Windows
continue; continue;
LoadedDLL.Add(path); LoadedDLL.Add(path);
Assembly dll = Assembly.LoadFrom(tmpfi.FullName); Assembly dll = Assembly.LoadFrom(tmpfi.FullName);
var certificate = dll.GetModules()?.First()?.GetSignerCertificate(); var certificate = Win32.GetCertificateFromSignedFile(path);
if (certificate != null) if (certificate != null)
{ {
if (certificate.Subject == "CN=\"Shenzhen Lingban Computer Technology Co., Ltd.\", O=\"Shenzhen Lingban Computer Technology Co., Ltd.\", L=Shenzhen, S=Guangdong Province, C=CN, SERIALNUMBER=91440300MA5H8REU3K, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.1=Shenzhen, OID.1.3.6.1.4.1.311.60.2.1.2=Guangdong Province, OID.1.3.6.1.4.1.311.60.2.1.3=CN" if (certificate.Subject == "CN=\"Shenzhen Lingban Computer Technology Co., Ltd.\", O=\"Shenzhen Lingban Computer Technology Co., Ltd.\", L=Shenzhen, S=Guangdong Province, C=CN, SERIALNUMBER=91440300MA5H8REU3K, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.1=Shenzhen, OID.1.3.6.1.4.1.311.60.2.1.2=Guangdong Province, OID.1.3.6.1.4.1.311.60.2.1.3=CN"

View File

@ -1,7 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -9,6 +11,111 @@ namespace VPet_Simulator.Windows
{ {
static partial class Win32 static partial class Win32
{ {
[DllImport("Crypt32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern bool CryptQueryObject(
int dwObjectType,
string pvObject,
int dwExpectedContentTypeFlags,
int dwExpectedFormatTypeFlags,
int dwFlags,
IntPtr pdwMsgAndCertEncodingType,
IntPtr pdwContentType,
IntPtr pdwFormatType,
IntPtr phStore,
IntPtr phMsg,
ref IntPtr ppvContext
);
private const int CERT_QUERY_OBJECT_FILE = 0x00000001;
private const int CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED = 0x00004000;
private const int CERT_QUERY_FORMAT_FLAG_BINARY = 0x00000002;
public static X509Certificate2? GetCertificateFromSignedFile(string filePath)
{
IntPtr certificateContext = IntPtr.Zero;
if (!CryptQueryObject(
CERT_QUERY_OBJECT_FILE,
filePath,
CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED,
CERT_QUERY_FORMAT_FLAG_BINARY,
0,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
ref certificateContext))
{
throw new Win32Exception(Marshal.GetLastWin32Error());
}
try
{
return new X509Certificate2(certificateContext);
}
catch
{
return null;
}
//finally
//{
// if (certificateContext != IntPtr.Zero)
// {
// X509Certificate2Collection certificates = new X509Certificate2Collection();
// certificates.ImportFromPemFile(filePath);
// foreach (var certificate in certificates)
// {
// Console.WriteLine($"Subject: {certificate.Subject}");
// Console.WriteLine($"Issuer: {certificate.Issuer}");
// }
// }
//}
}
[ComImport]
[Guid("00021401-0000-0000-C000-000000000046")]
internal class ShellLink
{
}
[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("000214F9-0000-0000-C000-000000000046")]
internal interface IShellLink
{
void GetPath([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile, int cchMaxPath, out IntPtr pfd, int fFlags);
void GetIDList(out IntPtr ppidl);
void SetIDList(IntPtr pidl);
void GetDescription([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszName, int cchMaxName);
void SetDescription([MarshalAs(UnmanagedType.LPWStr)] string pszName);
void GetWorkingDirectory([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir, int cchMaxPath);
void SetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] string pszDir);
void GetArguments([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs, int cchMaxPath);
void SetArguments([MarshalAs(UnmanagedType.LPWStr)] string pszArgs);
void GetHotkey(out short pwHotkey);
void SetHotkey(short wHotkey);
void GetShowCmd(out int piShowCmd);
void SetShowCmd(int iShowCmd);
void GetIconLocation([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszIconPath, int cchIconPath, out int piIcon);
void SetIconLocation([MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, int iIcon);
void SetRelativePath([MarshalAs(UnmanagedType.LPWStr)] string pszPathRel, int dwReserved);
void Resolve(IntPtr hwnd, int fFlags);
void SetPath([MarshalAs(UnmanagedType.LPWStr)] string pszFile);
}
[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("0000010b-0000-0000-C000-000000000046")]
internal interface IPersistFile
{
void GetClassID(out Guid pClassID);
void IsDirty();
void Load([MarshalAs(UnmanagedType.LPWStr)] string pszFileName, uint dwMode);
void Save([MarshalAs(UnmanagedType.LPWStr)] string pszFileName, bool fRemember);
void SaveCompleted([MarshalAs(UnmanagedType.LPWStr)] string pszFileName);
void GetCurFile([MarshalAs(UnmanagedType.LPWStr)] out string ppszFileName);
}
/// <summary> /// <summary>
/// 扩展的窗口风格 /// 扩展的窗口风格
/// 这是 long 类型的,如果想要使用 int 类型请使用 <see cref="WindowExStyles"/> 类 /// 这是 long 类型的,如果想要使用 int 类型请使用 <see cref="WindowExStyles"/> 类

View File

@ -1,4 +1,4 @@
using CSCore.CoreAudioAPI; using NAudio.CoreAudioApi;
using LinePutScript; using LinePutScript;
using LinePutScript.Dictionary; using LinePutScript.Dictionary;
using LinePutScript.Localization.WPF; using LinePutScript.Localization.WPF;
@ -28,12 +28,13 @@ using Timer = System.Timers.Timer;
using ToolBar = VPet_Simulator.Core.ToolBar; using ToolBar = VPet_Simulator.Core.ToolBar;
using MessageBox = System.Windows.MessageBox; using MessageBox = System.Windows.MessageBox;
using ContextMenu = System.Windows.Forms.ContextMenu; using ContextMenu = System.Windows.Forms.ContextMenuStrip;
using MenuItem = System.Windows.Forms.MenuItem; using MenuItem = System.Windows.Forms.ToolStripMenuItem;
using Application = System.Windows.Application; using Application = System.Windows.Application;
using Line = LinePutScript.Line; using Line = LinePutScript.Line;
using static VPet_Simulator.Windows.Interface.ExtensionFunction; using static VPet_Simulator.Windows.Interface.ExtensionFunction;
using Image = System.Windows.Controls.Image; using Image = System.Windows.Controls.Image;
using System.Data;
#if SteamOutput #if SteamOutput
using VPet.Solution; using VPet.Solution;
#endif #endif
@ -79,11 +80,11 @@ namespace VPet_Simulator.Windows
/// <summary> /// <summary>
/// 版本号 /// 版本号
/// </summary> /// </summary>
public int version { get; } = 109; public int version { get; } = 11000;
/// <summary> /// <summary>
/// 版本号 /// 版本号
/// </summary> /// </summary>
public string Version => $"{version / 100}.{version % 100}"; public string Version => $"{version / 10000}.{version % 10000 / 100}.{version % 100:00}";
public List<LowText> LowFoodText { get; set; } = new List<LowText>(); public List<LowText> LowFoodText { get; set; } = new List<LowText>();
@ -867,42 +868,10 @@ namespace VPet_Simulator.Windows
/// </summary> /// </summary>
public float AudioPlayingVolume() public float AudioPlayingVolume()
{ {
if (AudioPlayingVolumeOK == null)
{//第一调用检查是否支持
try
{
float vol = 0;
using (var enumerator = new MMDeviceEnumerator()) using (var enumerator = new MMDeviceEnumerator())
{ {
using (var meter = AudioMeterInformation.FromDevice(enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia))) var device = enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Console);
{ return device.AudioMeterInformation.MasterPeakValue;
vol = meter.GetPeakValue();
AudioPlayingVolumeOK = true;
}
}
}
catch
{
AudioPlayingVolumeOK = false;
}
}
else if (AudioPlayingVolumeOK == false)
{
return -1;
}
try
{//后续容错可能是偶发性
using (var enumerator = new MMDeviceEnumerator())
{
using (var meter = AudioMeterInformation.FromDevice(enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia)))
{
return meter.GetPeakValue();
}
}
}
catch
{
return -1;
} }
} }
/// <summary> /// <summary>
@ -1661,14 +1630,14 @@ namespace VPet_Simulator.Windows
m_menu = new ContextMenu(); m_menu = new ContextMenu();
m_menu.Popup += (x, y) => { GameSavesData.Statistics[(gint)"stat_menu_pop"]++; }; m_menu.Opening += (x, y) => { GameSavesData.Statistics[(gint)"stat_menu_pop"]++; };
var hitThrough = new MenuItem("鼠标穿透".Translate(), (x, y) => { SetTransparentHitThrough(); }) var hitThrough = new MenuItem("鼠标穿透".Translate(), null, (x, y) => { SetTransparentHitThrough(); })
{ {
Name = "NotifyIcon_HitThrough", Name = "NotifyIcon_HitThrough",
Checked = HitThrough Checked = HitThrough
}; };
m_menu.MenuItems.Add(hitThrough); m_menu.Items.Add(hitThrough);
m_menu.MenuItems.Add(new MenuItem("操作教程".Translate(), (x, y) => m_menu.Items.Add(new MenuItem("操作教程".Translate(), null, (x, y) =>
{ {
if (LocalizeCore.CurrentCulture == "zh-Hans") if (LocalizeCore.CurrentCulture == "zh-Hans")
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial.html"); ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial.html");
@ -1677,25 +1646,25 @@ namespace VPet_Simulator.Windows
else else
ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_en.html"); ExtensionSetting.StartURL(ExtensionValue.BaseDirectory + @"\Tutorial_en.html");
})); }));
m_menu.MenuItems.Add(new MenuItem("重置位置与状态".Translate(), (x, y) => m_menu.Items.Add(new MenuItem("重置位置与状态".Translate(), null, (x, y) =>
{ {
Main.CleanState(); Main.CleanState();
Main.DisplayToNomal(); Main.DisplayToNomal();
Left = (SystemParameters.PrimaryScreenWidth - Width) / 2; Left = (SystemParameters.PrimaryScreenWidth - Width) / 2;
Top = (SystemParameters.PrimaryScreenHeight - Height) / 2; Top = (SystemParameters.PrimaryScreenHeight - Height) / 2;
})); }));
m_menu.MenuItems.Add(new MenuItem("反馈中心".Translate(), (x, y) => { new winReport(this).Show(); })); m_menu.Items.Add(new MenuItem("反馈中心".Translate(), null, (x, y) => { new winReport(this).Show(); }));
m_menu.MenuItems.Add(new MenuItem("开发控制台".Translate(), (x, y) => { new winConsole(this).Show(); })); m_menu.Items.Add(new MenuItem("开发控制台".Translate(), null, (x, y) => { new winConsole(this).Show(); }));
m_menu.MenuItems.Add(new MenuItem("设置面板".Translate(), (x, y) => m_menu.Items.Add(new MenuItem("设置面板".Translate(), null, (x, y) =>
{ {
winSetting.Show(); winSetting.Show();
})); }));
m_menu.MenuItems.Add(new MenuItem("退出桌宠".Translate(), (x, y) => Close())); m_menu.Items.Add(new MenuItem("退出桌宠".Translate(), null, (x, y) => Close()));
LoadDIY(); LoadDIY();
notifyIcon.ContextMenu = m_menu; notifyIcon.ContextMenuStrip = m_menu;
notifyIcon.Icon = new System.Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/vpeticon.ico")).Stream); notifyIcon.Icon = new System.Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/vpeticon.ico")).Stream);

View File

@ -497,7 +497,7 @@ namespace VPet_Simulator.Windows
//uint extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE); //uint extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
//SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT); //SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT);
HitThrough = !HitThrough; HitThrough = !HitThrough;
notifyIcon.ContextMenu.MenuItems.Find("NotifyIcon_HitThrough", false).First().Checked = HitThrough; (notifyIcon.ContextMenuStrip.Items.Find("NotifyIcon_HitThrough", false).First() as ToolStripMenuItem).Checked = HitThrough;
if (HitThrough) if (HitThrough)
{ {
Win32.User32.SetWindowLongPtr(_hwnd, Win32.GetWindowLongFields.GWL_EXSTYLE, Win32.User32.SetWindowLongPtr(_hwnd, Win32.GetWindowLongFields.GWL_EXSTYLE,

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net462</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>VPet_Simulator.Windows</RootNamespace> <RootNamespace>VPet_Simulator.Windows</RootNamespace>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
@ -33,6 +33,7 @@
<FileVersion>1.0.0.0</FileVersion> <FileVersion>1.0.0.0</FileVersion>
<Product>VPet-Simulator.Windows</Product> <Product>VPet-Simulator.Windows</Product>
<Copyright>Copyright © exLB.org 2022</Copyright> <Copyright>Copyright © exLB.org 2022</Copyright>
<StartupObject>VPet_Simulator.Windows.App</StartupObject>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
@ -157,29 +158,6 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<COMReference Include="IWshRuntimeLibrary">
<Guid>{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.2 %28x86 和 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" /> <None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup> </ItemGroup>
@ -224,18 +202,14 @@
<Resource Include="Res\img\r_worktime_5.png" /> <Resource Include="Res\img\r_worktime_5.png" />
<Resource Include="Res\img\r_worktime_6.png" /> <Resource Include="Res\img\r_worktime_6.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System.Web" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CSCore" Version="1.2.1.2" />
<PackageReference Include="Facepunch.Steamworks" Condition="'$(Platform)' == 'x64'" Version="2.3.3" /> <PackageReference Include="Facepunch.Steamworks" Condition="'$(Platform)' == 'x64'" Version="2.3.3" />
<PackageReference Include="Facepunch.Steamworks.win32" Condition="'$(Platform)' == 'x86'" Version="2.3.3" /> <PackageReference Include="Facepunch.Steamworks.win32" Condition="'$(Platform)' == 'x86'" Version="2.3.3" />
<PackageReference Include="LinePutScript" Version="1.10.2" /> <PackageReference Include="LinePutScript" Version="1.10.2" />
<PackageReference Include="LinePutScript.Localization.WPF" Version="1.0.6" /> <PackageReference Include="LinePutScript.Localization.WPF" Version="1.0.6" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> <PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Panuon.WPF" Version="1.0.3" /> <PackageReference Include="NAudio" Version="2.2.1" />
<PackageReference Include="Panuon.WPF" Version="1.0.4" />
<PackageReference Include="Panuon.WPF.UI" Version="1.1.17.3" /> <PackageReference Include="Panuon.WPF.UI" Version="1.1.17.3" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>