1 开始相关函数
void CHashToolDlg::BeginComputeHashInfo(CString filePath)
{
CString *tmp = new CString();
*tmp = filePath.GetBuffer();
if(PathIsDirectory(*tmp))
{
MessageBox("Does not support directory","Warning", MB_OK|MB_ICONWARNING);
return;
}
HWND hWnd = AfxGetMainWnd()->GetSafeHwnd();
if(::SendMessage(hWnd, WM_Create_Progress_Bar, (WPARAM)tmp, NULL))
{
//exist same file
return;
}
AfxBeginThread(ThreadComputeHashInfo, tmp);
}
UINT CHashToolDlg::ThreadComputeHashInfo(LPVOID pParam)
{
CString* filePath = (CString*)pParam;
CHashTool hashTool;
HWND hWndMainDlg = AfxGetMainWnd()->GetSafeHwnd();
if(!hashTool.GetHashInfo(*filePath, hWndMainDlg))
{
::SendMessage(hWndMainDlg, WM_Delete_Progress_Bar, (WPARAM)filePath, NULL);
}
delete filePath;
return 0;
}
BOOL CHashTool::GetHashInfo(CString filePat