/// <summary> /// Seeks all children of this Hwnd Object. /// </summary> /// <returns></returns> public List <HwndObject> GetChildren() { var result = new List <HwndObject>(); foreach (var hwnd in HwndInterface.EnumChildren(NativePtr)) { result.Add(new HwndObject(hwnd)); } return(result); }
/// <summary> /// Retrieves all top-level Hwnd Objects. /// </summary> /// <returns></returns> public static List <HwndObject> GetWindows() { var result = new List <HwndObject>(); foreach (var hwnd in HwndInterface.EnumHwnds()) { result.Add(new HwndObject(hwnd)); } return(result); }
public bool MoveWindow(Point location, Size size) { return(HwndInterface.MoveWindow(NativePtr, location.X, location.Y, size.Width, size.Height)); }
/// <summary> /// Retrieves a child Hwnd Object by its class and title. /// </summary> /// <param name="cls"></param> /// <param name="title"></param> /// <returns></returns> public HwndObject GetChild(string cls, string title) { var hwnd = HwndInterface.GetHwndChild(NativePtr, cls, title); return(new HwndObject(hwnd)); }
/// <summary> /// Seeks a parent for this Hwnd Object (if any). /// </summary> /// <returns></returns> public HwndObject GetParent() { return(new HwndObject(HwndInterface.GetHwndParent(NativePtr))); }
/// <summary> /// Simulates a user-click on this object. /// </summary> public void Click() { HwndInterface.ClickHwnd(NativePtr); }
/// <summary> /// Returns an integer result from a message. /// </summary> /// <param name="msg"></param> /// <returns></returns> public int GetMessageInt(WM msg) { return(HwndInterface.GetMessageInt(NativePtr, msg)); }
/// <summary> /// Returns a string result from a message. /// </summary> /// <param name="msg"></param> /// <param name="param"></param> /// <returns></returns> public string GetMessageString(WM msg, uint param) { return(HwndInterface.GetMessageString(NativePtr, msg, param)); }
/// <summary> /// Sends a message to this Hwnd Object /// </summary> /// <param name="msg"></param> /// <param name="param1"></param> /// <param name="param2"></param> public void SendMessage(WM msg, uint param1, uint param2) { HwndInterface.SendMessage(NativePtr, msg, param1, param2); }
/// <summary> /// Gets the first top-level HwndObject with the given title. /// </summary> /// <param name="title"></param> /// <returns></returns> public static HwndObject GetWindowByTitle(string title) { return(new HwndObject(HwndInterface.GetHwndFromTitle(title))); }