예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 public bool MoveWindow(Point location, Size size)
 {
     return(HwndInterface.MoveWindow(NativePtr, location.X, location.Y, size.Width, size.Height));
 }
예제 #4
0
        /// <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));
        }
예제 #5
0
 /// <summary>
 /// Seeks a parent for this Hwnd Object (if any).
 /// </summary>
 /// <returns></returns>
 public HwndObject GetParent()
 {
     return(new HwndObject(HwndInterface.GetHwndParent(NativePtr)));
 }
예제 #6
0
 /// <summary>
 /// Simulates a user-click on this object.
 /// </summary>
 public void Click()
 {
     HwndInterface.ClickHwnd(NativePtr);
 }
예제 #7
0
 /// <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));
 }
예제 #8
0
 /// <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));
 }
예제 #9
0
 /// <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);
 }
예제 #10
0
 /// <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)));
 }