Compare commits

..

9 Commits

Author SHA1 Message Date
DismissedLight
7c03ce3486 1.7.11 hotfix package 2023-10-18 19:54:55 +08:00
DismissedLight
83e187ea9e fix launch args 2023-10-18 19:54:55 +08:00
Lightczx
d86232f413 fix #1028 2023-10-18 19:54:55 +08:00
Masterain
4e6691ac51 Update FUNDING.yml 2023-10-18 19:54:55 +08:00
Masterain
84ad39b192 Update FUNDING.yml 2023-10-18 19:54:55 +08:00
DismissedLight
ce50fc41e0 1.7.10 package 2023-10-17 22:14:50 +08:00
Masterain
1d71048f56 New Crowdin updates (#1019) 2023-10-17 22:14:50 +08:00
DismissedLight
08cf823156 auto select existed account when detecting 2023-10-17 22:14:50 +08:00
Lightczx
cca65635a6 investigate into CoreWindow 2023-10-17 14:52:38 +08:00
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Runtime.InteropServices;
using Windows.UI.Core;
using Windows.Win32.Foundation;
namespace Snap.Hutao.Win32;
internal static class UnsafePInvoke
{
private enum WINDOW_TYPE : uint
{
IMMERSIVE_BODY,
IMMERSIVE_DOCK,
IMMERSIVE_HOSTED,
IMMERSIVE_TEST,
IMMERSIVE_BODY_ACTIVE,
IMMERSIVE_DOCK_ACTIVE,
NOT_IMMERSIVE,
}
[DllImport("Windows.UI.dll", CharSet = CharSet.None, EntryPoint = "#1500", ExactSpelling = false, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
private static extern HRESULT PrivateCreateCoreWindow(WINDOW_TYPE WindowType, PWSTR pWindowTitle, int x, int y, uint uWidth, uint uHeight, uint dwAttributes, HWND hOwnerWindow, Guid riid, out nint ppv);
public static unsafe CoreWindow PrivateCreateCoreWindow(string title, HWND hOwnerWindow)
{
fixed(char* pTitle = title)
{
PrivateCreateCoreWindow(WINDOW_TYPE.NOT_IMMERSIVE, pTitle, 0, 0, 400, 400, 0, hOwnerWindow, typeof(ICoreWindow).GUID, out nint thisPtr);
return CoreWindow.FromAbi(thisPtr);
}
}
}

View File

@@ -8,9 +8,11 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Snap.Hutao.Core.Setting;
using Snap.Hutao.Service;
using Snap.Hutao.Win32;
using System.IO;
using Windows.Graphics;
using Windows.UI;
using Windows.UI.Core;
using Windows.Win32.Foundation;
using Windows.Win32.Graphics.Dwm;
using Windows.Win32.UI.WindowsAndMessaging;
@@ -55,6 +57,7 @@ internal sealed class WindowController
ExtendsContentIntoTitleBar();
RecoverOrInitWindowSize();
CoreWindow coreWindow = UnsafePInvoke.PrivateCreateCoreWindow("Snap Hutao CoreWindow", options.Hwnd);
UpdateImmersiveDarkMode(options.TitleBar, default!);
// appWindow.Show(true);