It's unlikely that Microsoft is going to fix this for Win7 since it doesn't affect security and doesn't seem to affect a huge number of users. From their POV it's probably just not worth the risk. With that in mind, I created a powershell script that
monitors if Aero is enabled or not and will kill/restart the uxsms service (the service that runs Aero) if Windows (in its not-so-infinite wisdom) stops Aero.
Note that this will cause the desktop to flash whenever Aero is disabled and re-enabled. Some may find this more annoying, but I really like the transparency of Aero.
Put this in a file named something like MonitorAero.ps1:
(note you might have to run "powershell set-executionpolicy unrestricted" from a command prompt first)
#requires -version 2
param()
add-type -namespace local -name Aero -memberdefinition @"
[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern bool DwmIsCompositionEnabled();
"@
Function WriteTimestampedLine($line) {
$timestamp = get-date -format G
Write-Host $timestamp "-" $line
}
while ($true) {
if ([Environment]::OSVersion.Version.Major -le 5) {
WriteTimestampedLine "Aero is not available"
} elseif ([local.aero]::DwmIsCompositionEnabled()) {
WriteTimestampedLine "Aero is working fine"
} else {
WriteTimestampedLine "Aero is not enabled.. restarting the uxsms service"
Restart-Service uxsms
#Check again
if ([local.aero]::DwmIsCompositionEnabled()) {
WriteTimestampedLine "Aero recovered successfully"
} else {
WriteTimestampedLine "Aero could not be recovered"
sleep 60
}
}
sleep 1
}