Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the aero shake for whole system?

Tags:

c#

wpf

I created a simple WPF application for enable and disable the aero shake behavior. My code is like this:

using System.Windows;
using System.Runtime.InteropServices;

namespace TestDisableShaking
{
    public partial class MainWindow : Window
    {
        const uint DWM_EC_DISABLECOMPOSITION = 0;
        const uint DWM_EC_ENABLECOMPOSITION = 1;

        [DllImport("dwmapi.dll", EntryPoint = "DwmEnableComposition")]
        extern static uint DwmEnableComposition(uint compositionAction);

        [DllImport("dwmapi.dll", EntryPoint = "DwmEnableComposition")]
        protected static extern uint Win32DwmEnableComposition(uint uCompositionAction);

        public MainWindow()
        {
            InitializeComponent();
            DwmEnableComposition(DWM_EC_DISABLECOMPOSITION);
            Win32DwmEnableComposition(DWM_EC_DISABLECOMPOSITION);
        }
    }
}

Why my code does not function?

What this application do now: When I shake my window, the others windows are minimized.

What I want to do: When I shake my window, or I shake any window, no window should be minimized.

like image 323
user3617708 Avatar asked May 08 '14 18:05

user3617708


People also ask

How to disable Aero Shake in Windows 10?

Windows 10 Disable Aero 1 Windows 10 Disable Shake to Minimize via Settings Open Settings. Select System. ... 2 Disable Aero Shake Windows 10 in Group Policy Open Windows Local Group Policy Editor. Go to User Configuration -> Administrative Templates -> Desktop. ... 3 Disable Aero Shake Windows 10 Using Registry Editor

What is Aero Shake and how to use it?

The feature enables you to quickly minimize all open windows except the currently active window by shaking the currently active window or using Windows logo + Home keyboard shortcut. In earlier versions of Windows operating system, there was a dedicated option to enable or disable Aero Shake.

How to disable shake to minimize in Windows 10?

Windows 10 Disable Shake to Minimize via Settings 1 Open Settings. 2 Select System. 3 Shift to Multitasking. 4 Turn the corresponding option to Off.

What is Aero Snap and Aero Peek in Windows 10?

Aero Peek Windows 10: putting your cursor over a taskbar thumbnail to preview the entire window. Aero Snap Windows 10: dragging a window to the right or left side of the desktop to fill it to the respective half of the screen.


1 Answers

Try this:

[DllImport("User32.dll")]
private static extern bool SystemParametersInfo(uint iAction, uint iParameter, ref uint pParameter, uint iWinIni);

[DllImport("User32.dll")]
private static extern bool SystemParametersInfo(uint iAction, uint iParameter, uint pParameter, uint iWinIni);

and

SystemParametersInfo(0x0083, (Convert.ToUInt32(0)), (Convert.ToUInt32(0)), Convert.ToUInt32(1));
like image 172
cindywmiao Avatar answered Oct 06 '22 00:10

cindywmiao