用vc++穷举windows应用程序密码(下)(3)
if(this->GetCheckedRadioButton(IDC_RADIO1,IDC_RADIO7)==IDC_RADIO4)lpszTemp="大小写字母组合";
if(this->GetCheckedRadioButton(IDC_RADIO1,IDC_RADIO7)==IDC_RADIO5)lpszTemp="数字字母组合";
if(this->GetCheckedRadioButton(IDC_RADIO1,IDC_RADIO7)==IDC_RADIO6)lpszTemp="所有字符";
if(this->GetCheckedRadioButton(IDC_RADIO1,IDC_RADIO7)==IDC_RADIO7)lpszTemp="数据字典";
WritePrivateProfileString("设置","穷举方法",lpszTemp,"Setup.ini");
//按钮互锁
m_OK.EnableWindow(FALSE);
m_Quit.EnableWindow(FALSE);
m_Pause.EnableWindow(TRUE);
m_Pause.SetFocus();
//对话框最小化
this->PostMessage(WM_SYSCOMMAND,SC_MINIMIZE,0);
//如果对话框尚未创建线程,创建线程,且允许线程运行结束自动销毁
if (m_pEnumThread[0].pThread ==NULL)
{ UINT i;
for(i=1;i<=this->m_nThreadCount ;i++)
{//优先级最低可以相应的提高密码应用程序的对话框响应速度
m_pEnumThread[i].pThread=AfxBeginThread((AFX_THREADPROC)EnumProc,(LPVOID)0,THREAD_PRIORITY_LOWEST,0,0,NULL);
m_pEnumThread[i].pThread->m_bAutoDelete =true;
}
}
else //如果线程已经创建,唤醒挂起的线程
{ UINT i;
for(i=1;i<=this->m_nThreadCount;i++)
m_pEnumThread[i].pThread->ResumeThread();
}
}
DWORD WINAPI EnumProc( LPVOID )

