| | |
| | | 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 |
| | | { |
| | |
| | | } |
| | | } |
| | | #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 |
| | |
| | | |
| | | 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); |