是的,我想获得另一个应用程序的子窗口。 给我总结想法或代码
答案 0 :(得分:1)
以下是如何使用FindWindow检索窗口句柄的标题:
class Program
{
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
static void Main(string[] args)
{
var hWnd = FindWindow(null, "Untitled - Notepad");
if (hWnd != IntPtr.Zero)
{
Console.WriteLine("window found");
}
else
{
Console.WriteLine("No window with given title has been found");
}
}
}