Пример #1
0
        /// <summary>
        /// 获取窗体句柄的Text信息
        /// </summary>
        /// <param name="handle">窗体句柄</param>
        /// <returns></returns>
        protected string GetHandleText(IntPtr handle)
        {
            StringBuilder sb = new StringBuilder(256);

            WindowsApi.GetWindowText(handle, sb, sb.Capacity);
            return(sb.ToString());
        }
Пример #2
0
        /// <summary>
        /// 校验当前句柄对应的窗体是否为登陆窗体
        /// </summary>
        /// <param name="handle">窗体句柄</param>
        /// <returns></returns>
        protected bool IsLoginWindows(IntPtr handle)
        {
            StringBuilder sb = new StringBuilder(256);

            WindowsApi.GetWindowText(handle, sb, sb.Capacity);
            string title = sb.ToString();

            return(IsLoginWindows(title));
        }