/// <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()); }
/// <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)); }