龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VC开发 >

用vc++穷举windows应用程序密码(下)(6)

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
{//通过子窗口标题寻找指定按钮 ::GetWindowText(hwnd,(LPSTR) szTemp,sizeof(szTemp)); if(strstr(szTemp,(const char *)lpszButtonConfirmCaption)!=NULL) {hButton1=hwnd; if (m_bPasswordStyle)//若

        {//通过子窗口标题寻找指定按钮

        ::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;

}

精彩图集

赞助商链接