public static IntPtr FindChildWindowByClassName(IntPtr parenthWnd, string className) { List <IntPtr> list = AppManipulation.GetChildWindows(parenthWnd); string listString = String.Empty; int nRet; IntPtr match = IntPtr.Zero; int count = 0; foreach (IntPtr item in list) { StringBuilder ClassName = new StringBuilder(100); nRet = AppManipulation.GetClassName(item, ClassName, ClassName.Capacity); if (nRet != 0) { if (className.ToString() == className) { if (match == IntPtr.Zero) { match = item; } Console.WriteLine(count.ToString() + " " + className + " " + item.ToString("X8")); count++; } } } return(match); }
public static IntPtr FindLastChildWindowByClassName(IntPtr parenthWnd, string className) { List <IntPtr> list = AppManipulation.GetChildWindows(parenthWnd); if (list.Count > 0) { return(list[list.Count - 1]); } return(IntPtr.Zero); }
public static IntPtr FindChildWindowByClassNameByIndex(IntPtr parenthWnd, string className, int index) { List <IntPtr> list = AppManipulation.GetChildWindows(parenthWnd); if (index < list.Count) { return(list[index]); } return(IntPtr.Zero); }
public static void WriteInNotepad(string text) { AppManipulation.SetText(AppManipulation.FindChildWindowByClassName(AppManipulation.FindWindowByWindowName("Untitled - Notepad"), "Edit"), text); }
public static int FindChildWindowCountByClassName(IntPtr parenthWnd, string className) { List <IntPtr> list = AppManipulation.GetChildWindows(parenthWnd); return(list.Count); }