qq自动登陆求助
qq自动登陆求助
//我做qq自动登陆,为什么在2007qq中,密码输入不对,用鼠标点一下,密码就自动清了,请高手指点一下
pWnd = FindWindow(_T("#32770"), _T("QQ用户登录"));
if (pWnd)
{
//获得QQ的号码输入框指针
CComboBox *pCob = (CComboBox *)pWnd->GetDlgItem(138);
if (pCob)
{
m_edtCode.SetSel(0, -1);
m_edtCode.Copy();
//先删除原有号码后向号码输入框发送复制消息
pCob->SetCurSel(0);
pCob->DeleteString(0);
pCob->SendMessage(WM_PASTE, 0, 0);
}
//因为QQ的密码框是包含在主窗口里的子窗口,所以先获得子窗口后再一个个往后找
CWnd *pCwnd = pWnd->GetNextWindow(GW_CHILD);
pCwnd = pCwnd->GetNextWindow(GW_HWNDNEXT);
while (pCwnd != NULL)
{
if (pCwnd)//找到
{
CEdit *pPwd = (CEdit *)pCwnd->GetDlgItem(16038);
if (pPwd)
{
//清除密码框
pPwd->SetSel(0, -1);
pPwd->Clear();
i = 0;
char str[15]="656152635";
//int i;
for(i=0;i<12;i++)
{
pPwd->SendMessage(WM_CHAR,TCHAR(str),0);
Sleep(200); //模拟键盘输入
}