Example #1
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);
        }
Example #2
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(Hwnd))
            {
                result.Add(new HwndObject(hwnd));
            }
            return(result);
        }
Example #3
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)));
 }
Example #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(Hwnd, cls, title);

            return(new HwndObject(hwnd));
        }
Example #5
0
 /// <summary>
 /// Seeks a parent for this Hwnd Object (if any).
 /// </summary>
 /// <returns></returns>
 public HwndObject GetParent()
 {
     return(new HwndObject(HwndInterface.GetHwndParent(Hwnd)));
 }
Example #6
0
 /// <summary>
 /// Simulates a user-click on this object.
 /// </summary>
 public void Click()
 {
     HwndInterface.ClickHwnd(Hwnd);
 }
Example #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(Hwnd, msg));
 }
Example #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(Hwnd, msg, param));
 }
Example #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(Hwnd, msg, param1, param2);
 }