/// <summary>Calls <see cref="Uxtheme.SetWindowThemeAttribute" /> to set various attributes on the window.</summary> /// <param name="attributes">Attributes to set on the window.</param> private void SetWindowThemeAttributes(WTNCA attributes) { WTA_OPTIONS options = new WTA_OPTIONS { dwFlags = attributes, dwMask = WTNCA.VALIDBITS }; // The SetWindowThemeAttribute API call takes care of everything Uxtheme.SetWindowThemeAttribute(Handle, WINDOWTHEMEATTRIBUTETYPE.WTA_NONCLIENT, ref options, (uint)Marshal.SizeOf(typeof(WTA_OPTIONS))); }
public static void HideTitleInfo(Window window, WTNCA attributes) { if (!hide_done) { hide_done = true; if (CanAero) { WTA_OPTIONS options = new WTA_OPTIONS(); options.dwFlags = attributes; options.dwMask = WTNCA.VALIDBITS; SetWindowThemeAttribute(new WindowInteropHelper(window).Handle, WINDOWTHEMEATTRIBUTETYPE.WTA_NONCLIENT, ref options, (uint)Marshal.SizeOf(typeof(WTA_OPTIONS))); } } }
/// <summary>Sets attributes to control how visual styles are applied to a specified window.</summary> /// <param name="window">The window.</param> /// <param name="attr">The attributes to apply or disable.</param> /// <param name="enable">if set to <c>true</c> enable the attribute, otherwise disable it.</param> public static void SetWindowThemeAttribute(this IWin32Window window, WTNCA attr, bool enable = true) { try { UxTheme.SetWindowThemeNonClientAttributes(window.Handle, attr, enable); } catch (EntryPointNotFoundException) { } }
/// <summary>Calls <see cref="Uxtheme.SetWindowThemeAttribute" /> to set various attributes on the window.</summary> /// <param name="attributes">Attributes to set on the window.</param> private void SetWindowThemeAttributes(WTNCA attributes) { WTA_OPTIONS options = new WTA_OPTIONS { dwFlags = attributes, dwMask = WTNCA.VALIDBITS }; // The SetWindowThemeAttribute API call takes care of everything Uxtheme.SetWindowThemeAttribute(Handle, WINDOWTHEMEATTRIBUTETYPE.WTA_NONCLIENT, ref options, (uint) Marshal.SizeOf(typeof (WTA_OPTIONS))); }