



/ The Window whose Minimize/Maximize buttons will be hidden. / Hides the Minimize and Maximize buttons in a Window. To disable Windows Key hotkeys in Windows 11/10 using Group Policy, follow these steps: Run gpedit.msc and navigate to the following setting. private const int GWL_STYLE = -16, WS_MAXIMIZEBOX = 0x10000, WS_MINIMIZEBOX = 0x20000 Įxtern private static int GetWindowLong(IntPtr hwnd, int index) Įxtern private static int SetWindowLong(IntPtr hwnd, int index, int value) The trick is to subscribe a delegate to the SourceInitialized event within the extension method. This variant of the solution proposed by can (and must) be called in the constructor of the Window.
