Detecting and Disabling change folder in CFileDialog in MFC at certain case

I am trying to overload the CFiledialog class to add to functionality as per my need. Im not getting the solution for restricting user from changing folder in certain situation as mentioned below.

When user is attempting to change folder.

- I need to check if there any folder is selected or not?
- If selected I need to check, if any of the selected folder is containing the desired file or not?
- If the selected folder is having the desired file, then in such case I want to disable the change folder functionality.

I have tried to override
virtual void    OnFolderChange();

function, but call to this function comes after the folder is already changed.

Any suggestion will be greatly appreciated!

Topic archived. No new replies allowed.