public static QQMessageAssistant FromHwnd(IntPtr hwnd, out string errorText) { QQMessageAssistant qqMessageAssistant = new QQMessageAssistant() { Handle = hwnd }; if (qqMessageAssistant.ObtainVerifyHwnd()) { errorText = string.Empty; return(qqMessageAssistant); } errorText = qqMessageAssistant.LastError; return(null); }
public static QQMessageAssistant FromInformation(string qq, string specifyQQ, string windowName, string selfName, out string errorText) { if (string.IsNullOrWhiteSpace(qq) || string.IsNullOrWhiteSpace(specifyQQ) || string.IsNullOrWhiteSpace(windowName) || string.IsNullOrWhiteSpace(selfName)) { errorText = "辅助信息不完整!"; } else { QQMessageAssistant qqMessageAssistant = new QQMessageAssistant() { QQ = qq, SpecifyQQ = specifyQQ, SpecifyName = windowName, Name = selfName }; if (qqMessageAssistant.ObtainVerifyHwnd()) { errorText = string.Empty; return(qqMessageAssistant); } errorText = qqMessageAssistant.LastError; } return(null); }