Exemplo n.º 1
0
 public static Tuple <int, int> GetApplicationSize2(IntPtr window)
 {
     // todo rename method
     return(FindWindow.GetApplicationWidthAndHeight(window));
 }
Exemplo n.º 2
0
        //public static IntPtr GetWindowByWindowTitle(string windowTitle)
        //{
        //    var window = ExternDLLUtilities.FindWindow(null, windowTitle);
        //    if (window != IntPtr.Zero)
        //    {
        //        return window;
        //    }
        //    throw new ArgumentException("No window for " + windowTitle + " exists.");
        //}
        //public static IntPtr GetWindowByClass(string className) //e.g. notepad
        //{
        //    var window = ExternDLLUtilities.FindWindow(className, null);
        //    if (window != IntPtr.Zero)
        //    {
        //        return window;
        //    }
        //    throw new ArgumentException("No window for " + className + " exists.");
        //}

        public static IntPtr GetWindowHandle(Regex windowTitleText = null, Regex className = null, Regex process = null)
        {
            return(FindWindow.GetWindowHandle(windowTitleText, className, process));
        }