Can I somehow disable the glass/transparency for my WPF application window?
Note: I don't want to disable Aero, just the glass/transparency, and for my window, not the entire system.
Something like this (the Enable Transparency
checkbox), but just for my application:
Is this possible?
I know this is late, but for others looking you can use the following. It might not strictly answer the question as this could be considered "disabling Aero", but it does disable transparency for the client window alone.
[DllImport("DwmApi.dll")]
public static extern int DwmSetWindowAttribute(IntPtr hwnd, int dwAttribute, ref int pvAttribute, int cbAttribute);
private const int DWMWA_NCRENDERING_POLICY = 2;
private const int DWMNCRP_DISABLED = 1;
private void OnLoaded(object sender, RoutedEventArgs e)
{
var mainWindowHandle = new WindowInteropHelper(this).Handle;
var policyParameter = DWMNCRP_DISABLED;
DwmSetWindowAttribute(mainWindowHandle, DWMWA_NCRENDERING_POLICY, ref policyParameter, sizeof(int));
}
You can find more information here DwmSetWindowAttribute function.