2、dWindows和FindWindowEx,第一个遍历指定窗口下的子窗口,第二个查找指定名称的窗口,如果找到返回此窗口Handle。该类的用法:FindWindowfw=newFindWindow(wndHandle,"ChildwndClassName");//实例化,第一个参数是要查找的起始窗口的句柄;第二个参数是要查找的窗口的类的名称。现在我们需要的传的是"InternetExplorer_Server"。IntPtrip=fw.FoundHandle;//FindWindow的公共属性FoundHandle就是查找到的窗口的句柄。完整的类如下: us
3、ing System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;namespace SystemManager.Utility...{ /**//// /// This class is to find the given window's child window accroding to the given child window's name. /// The useage: Fi
4、ndWindow fw = new FindWindow(wndHandle, "ChildwndClassName"); IntPtr ip = fw.FoundHandle; /// I adapt the code from Paul DiLascia,who is the MSDN Magazine's writer. /// The original class is named CFindWnd which is written in C++, and you could get it on Internet. /// www.
5、pinvoke.net is a great website.It includes almost all the API fuctoin to be used in C#. /// class FindWindow ...{ [DllImport("user32")] [return: MarshalAs(UnmanagedType.Bool)] //IMPORTANT : LPARAM must be a pointer (InterPtr) in VS2005, oth
6、erwise an exception will be thrown private static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr i); //the callback function for the EnumChildWindows private delegate bool EnumWindowProc(IntPtr hWnd, IntPtr parameter); //if f