void getPhoto() { CFileDialog fOpenDlg(TRUE, NULL, NULL, OFN_HIDEREADONLY|OFN_FILEMUSTEXIST, "Bitmap pic(*.bmp)|*.bmp||",this); fOpenDlg.m_pOFN->lpstrInitialDir = "c:"; m_picture = (CStatic*)GetDlgItem(IDC_STATIC); BOOL bWorking = finder.FindFile("*."); if (bWorking) { if (fOpenDlg.DoModal() == IDOK) { finder.FindNextFile(); CString path = (LPCTSTR)fOpenDlg.GetPathName(); HBITMAP hb = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), path, IMAGE_BITMAP, 100, 100, LR_LOADFROMFILE); m_picture->ModifyStyle(0xF, SS_BITMAP, SWP_NOSIZE); m_picture->SetBitmap(hb); iFileAccount = 0; bLastFile = FALSE; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)