2010-02-17 43 views

回答

3

第三方aplication推出其他窗口不是子窗口。

使用Visual Studio附带的Spy ++工具可以找出结构是什么。在这之后,我能够使用WindowClassName(取自Spy ++)使用FindWindowEx函数找到必要的窗口: lastWindows = FindWindowEx(IntPtr.Zero,lastWindows,m.WindowClassName,null);

2

使用Win32 API EnumWindows(如果你想EnumChildWindows

[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)] 
public static extern bool EnumWindows(EnumThreadWindowsCallback callback, IntPtr extraData); 

然后检查其处理每个窗口属于通过使用Win32 API GetWindowThreadProcessId

[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)] 
public static extern int GetWindowThreadProcessId(HandleRef handle, out int processId); 
相关问题