mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
rename
This commit is contained in:
@@ -59,7 +59,7 @@ public sealed partial class App : Application
|
||||
|
||||
public new void Exit()
|
||||
{
|
||||
XamlWindowLifetime.ApplicationExiting = true;
|
||||
XamlLifetime.ApplicationExiting = true;
|
||||
base.Exit();
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
|
||||
|
||||
if (serviceProvider.GetRequiredService<AppOptions>().IsNotifyIconEnabled)
|
||||
{
|
||||
XamlWindowLifetime.ApplicationLaunchedWithNotifyIcon = true;
|
||||
XamlLifetime.ApplicationLaunchedWithNotifyIcon = true;
|
||||
serviceProvider.GetRequiredService<App>().DispatcherShutdownMode = DispatcherShutdownMode.OnExplicitShutdown;
|
||||
_ = serviceProvider.GetRequiredService<NotifyIconController>();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
namespace Snap.Hutao.Core.Windowing;
|
||||
|
||||
internal static class XamlWindowLifetime
|
||||
internal static class XamlLifetime
|
||||
{
|
||||
public static bool ApplicationLaunchedWithNotifyIcon { get; set; }
|
||||
|
||||
@@ -99,7 +99,7 @@ internal sealed class XamlWindowController
|
||||
|
||||
private void OnWindowClosed(object sender, WindowEventArgs args)
|
||||
{
|
||||
if (XamlWindowLifetime.ApplicationLaunchedWithNotifyIcon && !XamlWindowLifetime.ApplicationExiting)
|
||||
if (XamlLifetime.ApplicationLaunchedWithNotifyIcon && !XamlLifetime.ApplicationExiting)
|
||||
{
|
||||
args.Handled = true;
|
||||
window.Hide();
|
||||
|
||||
@@ -96,7 +96,7 @@ internal sealed class XamlWindowSubclass : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
if (XamlWindowLifetime.ApplicationExiting)
|
||||
if (XamlLifetime.ApplicationExiting)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
namespace Snap.Hutao.Core;
|
||||
|
||||
// See %PROGRAMFILES(X86)%\Windows Kits\10\Platforms\UAP\
|
||||
// Windows.Foundation.UniversalApiContract
|
||||
internal enum WindowsVersion : ushort
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -11,7 +11,7 @@ using Windows.Graphics.Capture;
|
||||
using Windows.Graphics.DirectX.Direct3D11;
|
||||
using WinRT;
|
||||
using static Snap.Hutao.Win32.ConstValues;
|
||||
using static Snap.Hutao.Win32.D3D11;
|
||||
using static Snap.Hutao.Win32.D3d11;
|
||||
using static Snap.Hutao.Win32.Macros;
|
||||
|
||||
namespace Snap.Hutao.Service.Game.Automation.ScreenCapture;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Snap.Hutao.Win32;
|
||||
|
||||
[SuppressMessage("", "SA1313")]
|
||||
[SuppressMessage("", "SYSLIB1054")]
|
||||
internal static class D3D11
|
||||
internal static class D3d11
|
||||
{
|
||||
[DllImport("d3d11.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||
public static unsafe extern HRESULT CreateDirect3D11DeviceFromDXGIDevice(IDXGIDevice* dxgiDevice, IInspectable** graphicsDevice);
|
||||
15
src/Snap.Hutao/Snap.Hutao/Win32/Dxgi.cs
Normal file
15
src/Snap.Hutao/Snap.Hutao/Win32/Dxgi.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace Snap.Hutao.Win32;
|
||||
|
||||
internal static class Dxgi
|
||||
{
|
||||
[DllImport("dxgi.dll", ExactSpelling = true, PreserveSig = false)]
|
||||
[SupportedOSPlatform("windows8.1")]
|
||||
public unsafe static extern HRESULT CreateDXGIFactory2([In] uint Flags, [In][Const] Guid* riid, [Out][ComOutPtr] void** ppFactory);
|
||||
}
|
||||
Reference in New Issue
Block a user