示例#1
0
        public static List <WindowHandle> GetWindows()
        {
            List <WindowHandle> list = new List <WindowHandle>();

            foreach (IntPtr ptr in HwndInterface.EnumHwnds())
            {
                list.Add(new WindowHandle(ptr));
            }

            return(list);
        }
示例#2
0
 public static WindowHandle GetActiveWindow()
 {
     return(new WindowHandle(HwndInterface.GetActiveWindow()));
 }
示例#3
0
 public static WindowHandle GetWindowByTitle(string title)
 {
     return(new WindowHandle(HwndInterface.GetHwndFromTitle(title)));
 }
示例#4
0
 public WindowHandle GetParent()
 {
     return(new WindowHandle(HwndInterface.GetHwndParent(Hwnd)));
 }
示例#5
0
 public string GetMessageString(WM msg, uint param)
 {
     return(HwndInterface.GetMessageString(Hwnd, msg, param));
 }
示例#6
0
 public int GetMessageInt(WM msg)
 {
     return(HwndInterface.GetMessageInt(Hwnd, msg));
 }
示例#7
0
 public List <WindowHandle> GetChildren()
 {
     return(HwndInterface.EnumChildren(Hwnd)
            .Select(ptr => new WindowHandle(ptr))
            .ToList());
 }
示例#8
0
 public WindowHandle GetChild(string cls, string title)
 {
     return(new WindowHandle(HwndInterface.GetHwndChild(Hwnd, cls, title)));
 }
示例#9
0
 // <summary>
 // Maximize this window
 // </summary>
 public bool Maximize()
 {
     return(HwndInterface.MaximizeWindow(Hwnd));
 }
示例#10
0
 // <summary>
 // Bring this window to the foreground
 // </summary>
 public bool Activate()
 {
     return(HwndInterface.ActivateWindow(Hwnd));
 }
示例#11
0
 public void Click()
 {
     HwndInterface.ClickHwnd(Hwnd);
 }
示例#12
0
 public void SendMessage(WM msg, uint param1, uint param2)
 {
     HwndInterface.SendMessage(Hwnd, msg, param1, param2);
 }
示例#13
0
 public static WindowHandle GetWindowByClassName(string className)
 {
     return(new WindowHandle(HwndInterface.GetHwndFromClass(className)));
 }