/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
internal static class WindowExtensions { [DllImport("user32.dll")] internal extern static int SetWindowLong(IntPtr hwnd, int index, int value); [DllImport("user32.dll")] internal extern static int GetWindowLong(IntPtr hwnd, int index); internal static void HideMinimizeAndMaximizeButtons(this Window window) { const int GWL_STYLE = -16; long value = GetWindowLong(hwnd, GWL_STYLE); SetWindowLong(hwnd, GWL_STYLE, (int)(value & -131073 & -65537)); } } this.SourceInitialized += (x, y) => { this.HideMinimizeAndMaximizeButtons(); };