筆者找到了一個在 PowerShell 上 顯示桌面/所有視窗最小化 的指令:
在 C# 中可以這樣做:
執行後就會顯示桌面了!
參考資料:
Microsoft.Learn - Shell.MinimizeAll method
(New-Object -ComObject Shell.Application).MinimizeAll()
在 C# 中可以這樣做:
var shellType = Type.GetTypeFromProgID("Shell.Application");
if (shellType != null)
{
dynamic? shell = Activator.CreateInstance(shellType);
shell?.MinimizeAll();
}
執行後就會顯示桌面了!
參考資料:
Microsoft.Learn - Shell.MinimizeAll method
留言
張貼留言
如果有任何問題、建議、想說的話或文章題目推薦,都歡迎留言或來信: a@ruyut.com