예제 #1
0
 public static EnumWindowsItem GetChildWindow(string title, string className)
 {
     if ((title != "") || (className != ""))
     {
         EnumWindows windows = new EnumWindows();
         windows.GetWindows();
         foreach (EnumWindowsItem item in windows.Items)
         {
             if ((className == "") && (item.Text == title))
             {
                 return(item);
             }
             if ((item.Text == title) && (item.ClassName == className))
             {
                 return(item);
             }
             if ((title == "") && (item.ClassName == className))
             {
                 return(item);
             }
         }
     }
     return(null);
 }
예제 #2
0
        public static EnumWindowsItem GetChildWindow(string title, string className)
        {
            if (title == "" && className == "")
            {
                return null;
            }

            EnumWindows windows = new EnumWindows();
            windows.GetWindows();

            foreach (EnumWindowsItem child in windows.Items)
            {
                if (className == "")
                {
                    if (child.Text == title)
                    {
                        return child;
                    }
                }
                if (child.Text == title && child.ClassName == className)
                {
                    return child;
                }
                else if (title == "")
                {
                    if (child.ClassName == className)
                    {
                        return child;
                    }
                }
            }

            return null;
        }