

4 Ways on How To Enable Aero in Windows 10 & 11 Download Aero Glass for Windows 10/11Īero Glass for Win 8.X+ now offers users some experimental support and it may not work as many of the users expect it to. To put the long story short, it was removed to create a more battery dynamic user interface. For this, it had to make the Operating system a bit more battery efficient. String err = new Win32Exception(Marshal.GetLastWin32Error()).It was removed by Microsoft as it wanted to create unified UI targetings battery-powered devices such as laptops, tablets, and smartphones. Uint result = Win32DwmEnableComposition(DWM_EC_DISABLECOMPOSITION) IntPtr hdesk = OpenInputDesktop(0, false, 0x10000000 /* GENERIC_ALL */) If (!SetProcessWindowStation(winStation)) String err = new Win32Exception(Marshal.GetLastWin32Error()).Message If (winStation = null || winStation.ToInt32() = 0) IntPtr winStation = OpenWindowStation("winsta0", true, 0x10000000 /* GENERIC_ALL */) I've not included the PInvoke declarations for brevity. It sets the window station and desktop, and it seems to be correct, but the call to DwmEnableComposition results in the same error. I also tried changing the entire thing to the following code, but got the same result. Seems like a strange error, since the code works when not running as a service. It turns out that the DwmEnableComposition call is returning HRESULT 0x80070018, or ERROR_BAD_LENGTH. Win32DwmEnableComposition(DWM_EC_ENABLECOMPOSITION) Protected static extern uint Win32DwmEnableComposition(uint uCompositionAction) Public static readonly uint DWM_EC_ENABLECOMPOSITION = 1

Here is the code I am working with: public static readonly uint DWM_EC_DISABLECOMPOSITION = 0

I realise that running code in a service is a different scope than running code in an application, but in this case, how would I enable/disable Aero from the service? Is this even possible? The code works in a standalone application, but when I run it from a Service, nothing happens. I have some code to enable/disable the Windows Aero service in Vista, and I would like to run it in a Windows Service.
