Powershell控制台窗口属于windows的ConsoleWindowClass类吗?


PowerShell交流中心分类: Powershell基础Powershell控制台窗口属于windows的ConsoleWindowClass类吗?
0
scl95tx asked 9 年 ago

我用如下代码能发现我所运行PowerShell脚本的控制台(title是TestControl)吗?

public static void WindowHide(string consoleTitle)

{

IntPtr a = FindWindow(“ConsoleWindowClass”, consoleTitle);

if (a != IntPtr.Zero)

///<summary>Hide Window</summary>

ShowWindow(a, 1);

else

throw new Exception(“Can’t hide console window”);

}

 

1 Answers
0
Mooser Lee 管理员 answered 8 年 ago
$host.UI.RawUI.WindowTitle