可以在Windows 10上使用代码更改Windows主题,但在Windows Server 2016上不能。
从cmd提示符运行命令“ C:\ WINDOWS \ Resources \ Themes \ aero.theme”可在Win2016上运行。 使用Windows C ++命令运行它:_tsystem或ShellExecuteEx在Windows Server 2016上不起作用,但在Windows 10上起作用。经过用户和管理员测试的程序。
示例代码:_tsystem("C:\\WINDOWS\\Resources\\Themes\\aero.theme");
或
_tsystem("rundll32.exe %SystemRoot%\system32\themecpl.dll,OpenThemeAction %SystemRoot%\Resources\Themes\aero.theme");
预期Windows主题将更改为Aero,并且Windows设置对话框打开。 实际结果是没有更改主题,也没有显示设置对话框。