From 295f74ea6f803aede9ce3f78d622369a57566de2 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Tue, 18 Nov 2025 20:54:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=86=97=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SpineViewer/Views/ProgressDialog.xaml.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/SpineViewer/Views/ProgressDialog.xaml.cs b/SpineViewer/Views/ProgressDialog.xaml.cs index d59f955..fd7acf2 100644 --- a/SpineViewer/Views/ProgressDialog.xaml.cs +++ b/SpineViewer/Views/ProgressDialog.xaml.cs @@ -41,21 +41,12 @@ namespace SpineViewer.Views private void ProgressWindow_Loaded(object sender, RoutedEventArgs e) { var hwnd = new WindowInteropHelper(this).Handle; - int currentStyle = GetWindowLong(hwnd, GWL_STYLE); - SetWindowLong(hwnd, GWL_STYLE, currentStyle & ~WS_SYSMENU); + int currentStyle = User32.GetWindowLong(hwnd, User32.GWL_STYLE); + User32.SetWindowLong(hwnd, User32.GWL_STYLE, currentStyle & ~User32.WS_SYSMENU); var vm = (ProgressDialogViewModel)DataContext; vm.WorkFinished += (s, e) => Dispatcher.Invoke(() => { DialogResult = e; }); vm.Start(); } - - private const int GWL_STYLE = -16; - private const int WS_SYSMENU = 0x80000; - - [DllImport("user32.dll", SetLastError = true)] - private static extern int GetWindowLong(IntPtr hWnd, int nIndex); - - [DllImport("user32.dll")] - private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); } }