Not so brilliant me
-
One of my early coding activities was to customize the CFileDialog. One of the requirements was that the user should not be able to navigate to any other folder...so this is what I came up with:
if(pNmhdr->code == CDN_FOLDERCHANGE ) { char szChFol[_MAX_PATH]; CommDlg_OpenSave_GetFolderPath(GetParent(m_hDlg),szChFol,FILEPATH_LENGTH); CString theDir = lpstrInitialDir; //if the user somehow navigated to some other folder, navigate back to the initial folder if(StrCmpI(initDir, szChFol)) { //0x47C is the control id of the File Name edit field ::SetFocus( GetDlgItem(GetParent(m_hDlg),0x47c)); ::SetWindowText( GetDlgItem(GetParent(m_hDlg),0x47C), theDir ); ::keybd_event( VK_RETURN, 0x45, KEYEVENTF_EXTENDEDKEY, 0 ); } }
as if it wasn't a bad enough workaround already, I'm achieving it by setting text in the edit field and sending a keyboard event to it...;P:rolleyes: -
One of my early coding activities was to customize the CFileDialog. One of the requirements was that the user should not be able to navigate to any other folder...so this is what I came up with:
if(pNmhdr->code == CDN_FOLDERCHANGE ) { char szChFol[_MAX_PATH]; CommDlg_OpenSave_GetFolderPath(GetParent(m_hDlg),szChFol,FILEPATH_LENGTH); CString theDir = lpstrInitialDir; //if the user somehow navigated to some other folder, navigate back to the initial folder if(StrCmpI(initDir, szChFol)) { //0x47C is the control id of the File Name edit field ::SetFocus( GetDlgItem(GetParent(m_hDlg),0x47c)); ::SetWindowText( GetDlgItem(GetParent(m_hDlg),0x47C), theDir ); ::keybd_event( VK_RETURN, 0x45, KEYEVENTF_EXTENDEDKEY, 0 ); } }
as if it wasn't a bad enough workaround already, I'm achieving it by setting text in the edit field and sending a keyboard event to it...;P:rolleyes::rolleyes:;P
Regards, Sylvester G sylvester_g_m@yahoo.com
-
One of my early coding activities was to customize the CFileDialog. One of the requirements was that the user should not be able to navigate to any other folder...so this is what I came up with:
if(pNmhdr->code == CDN_FOLDERCHANGE ) { char szChFol[_MAX_PATH]; CommDlg_OpenSave_GetFolderPath(GetParent(m_hDlg),szChFol,FILEPATH_LENGTH); CString theDir = lpstrInitialDir; //if the user somehow navigated to some other folder, navigate back to the initial folder if(StrCmpI(initDir, szChFol)) { //0x47C is the control id of the File Name edit field ::SetFocus( GetDlgItem(GetParent(m_hDlg),0x47c)); ::SetWindowText( GetDlgItem(GetParent(m_hDlg),0x47C), theDir ); ::keybd_event( VK_RETURN, 0x45, KEYEVENTF_EXTENDEDKEY, 0 ); } }
as if it wasn't a bad enough workaround already, I'm achieving it by setting text in the edit field and sending a keyboard event to it...;P:rolleyes::)
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
One of my early coding activities was to customize the CFileDialog. One of the requirements was that the user should not be able to navigate to any other folder...so this is what I came up with:
if(pNmhdr->code == CDN_FOLDERCHANGE ) { char szChFol[_MAX_PATH]; CommDlg_OpenSave_GetFolderPath(GetParent(m_hDlg),szChFol,FILEPATH_LENGTH); CString theDir = lpstrInitialDir; //if the user somehow navigated to some other folder, navigate back to the initial folder if(StrCmpI(initDir, szChFol)) { //0x47C is the control id of the File Name edit field ::SetFocus( GetDlgItem(GetParent(m_hDlg),0x47c)); ::SetWindowText( GetDlgItem(GetParent(m_hDlg),0x47C), theDir ); ::keybd_event( VK_RETURN, 0x45, KEYEVENTF_EXTENDEDKEY, 0 ); } }
as if it wasn't a bad enough workaround already, I'm achieving it by setting text in the edit field and sending a keyboard event to it...;P:rolleyes::)
Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus