From 3f62d18e4361cd1d7a49c126765d95b2ad9c8246 Mon Sep 17 00:00:00 2001 From: chr <chr@mailcom> Date: 星期二, 04 三月 2025 08:42:07 +0800 Subject: [PATCH] 优化插件; --- PdmSwPlugin.Common/Util/UI/MultiExWindow.xaml.cs | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/PdmSwPlugin.Common/Util/UI/MultiExWindow.xaml.cs b/PdmSwPlugin.Common/Util/UI/MultiExWindow.xaml.cs index 0baccba..f5f49a5 100644 --- a/PdmSwPlugin.Common/Util/UI/MultiExWindow.xaml.cs +++ b/PdmSwPlugin.Common/Util/UI/MultiExWindow.xaml.cs @@ -3,8 +3,10 @@ using System.Collections.ObjectModel; using System.ComponentModel; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; using System.Web.UI.WebControls.WebParts; using System.Windows; +using System.Windows.Interop; namespace PdmSwPlugin.Common.Util.UI { @@ -30,6 +32,16 @@ } } #endregion + + // Windows API 鍑芥暟 + [DllImport("user32.dll", SetLastError = true)] + private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); + + [DllImport("user32.dll", SetLastError = true)] + private static extern int GetWindowLong(IntPtr hWnd, int nIndex); + + private const int GWL_STYLE = -16; // 绐楀彛鏍峰紡 + private const int WS_MINIMIZEBOX = 0x00020000; // 鏈�灏忓寲鎸夐挳鏍峰紡 private string _title; public string title @@ -74,6 +86,14 @@ private void Window_Loaded(object sender, RoutedEventArgs e) { + // 鑾峰彇绐楀彛鍙ユ焺 + IntPtr hWnd = new WindowInteropHelper(this).Handle; + + // 鑾峰彇褰撳墠绐楀彛鐨勬牱寮� + int currentStyle = GetWindowLong(hWnd, GWL_STYLE); + + // 绉婚櫎鏈�灏忓寲鎸夐挳 + SetWindowLong(hWnd, GWL_STYLE, currentStyle & ~WS_MINIMIZEBOX); Dispatcher.Invoke(() => { table.ItemsSource = new ObservableCollection<string>(exceptions); -- Gitblit v1.9.1