-
Notifications
You must be signed in to change notification settings - Fork 0
/
Window.cs
39 lines (31 loc) · 1.1 KB
/
Window.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
namespace P1.Primitives;
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Windows.Interop;
public partial class Window : System.Windows.Window, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
[DllImport("uxtheme.dll")]
static extern int SetWindowThemeAttribute(IntPtr hWnd, WindowThemeAttributeType wtype, ref WTA_OPTIONS attributes, uint size);
public enum WindowThemeAttributeType : uint
{
WTA_NONCLIENT = 1,
}
public struct WTA_OPTIONS
{
public uint Flags;
public uint Mask;
}
static readonly uint WTNCA_NODRAWCAPTION = 0x00000001;
readonly static uint WTNCA_NODRAWICON = 0x00000002;
WTA_OPTIONS wta = new ()
{
Flags = WTNCA_NODRAWCAPTION | WTNCA_NODRAWICON,
Mask = WTNCA_NODRAWCAPTION | WTNCA_NODRAWICON
};
public Window()
{
SourceInitialized += (s, ea) => SetWindowThemeAttribute(new WindowInteropHelper(this).Handle, WindowThemeAttributeType.WTA_NONCLIENT, ref wta, (uint)Marshal.SizeOf(typeof(WTA_OPTIONS)));
}
}