Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="windowName"></param>
        /// <returns></returns>
        public static WindowHandle GetWindowHandle(string windowName)
        {
            var windowHanles = Win.GetAllDesktopWindows();

            foreach (var item in windowHanles)
            {
                if (item.szWindowName.IndexOf(windowName) > -1)
                {
                    return(item);
                }
            }
            throw new Exception("未找到 " + windowName + " 窗口,请打开并置顶!");
        }