用vc++穷举windows应用程序密码(下)(6)
{//通过子窗口标题寻找指定按钮
::GetWindowText(hwnd,(LPSTR) szTemp,sizeof(szTemp));
if(strstr(szTemp,(const char *)lpszButtonConfirmCaption)!=NULL)
{hButton1=hwnd;
if (m_bPasswordStyle)//若已经找到密码编辑框,发送键盘鼠标消息,//复位系统变量,退出枚举过程
{::SendMessage(::GetParent(hButton1),WM_COMMAND,(WPARAM)::GetWindowLong(hButton1,GWL_ID),(LPARAM)hButton1);
bFetched=true;
hButton1=NULL;
m_bPasswordStyle=false;
return false;
}
return true;//未找到密码编辑框继续枚举
}
return true;不是确定按钮,继续枚举
}
return true;
break;
case INPUTRETRYDIALOGID:
::GetWindowText(hwnd,(LPSTR) szTemp,sizeof(szTemp));
if(strstr(szTemp,(const char *)lpszButtonRetryCaption)!=NULL)
{hButton2=hwnd;
::SendMessage(::GetParent(hButton2),WM_COMMAND,(WPARAM)GetWindowLong(hButton2,GWL_ID),(LPARAM)hButton2);
hButton2=NULL;
return false;
}
return true;
break;
default:return true;
}

