4
看看這幅畫獲得所有窗口:C#中如何使用MainWindowHandle
我這是怎麼了由黑盒子包圍的窗口的句柄。
Process[] processes = Process.GetProcessesByName("TopazChat");
foreach (Process p in processes)
{
MessageBox.Show(p.MainWindowHandle.ToString());
List<IntPtr> test = GetChildWindows(p.MainWindowHandle);
foreach (IntPtr IGotIt in test)
{
MessageBox.Show("I got the child windows");
}
}
我的問題是:如何獲得被紅色框包圍的窗口句柄? ,我的方法有什麼問題嗎?
有什麼建議?我只是使用這種方法,因爲它是我唯一熟悉的方法。
感謝您的快速回復,我會試試看 – user848682