How can I check if the user entered into a folder?

Hey.
How can I check if the user entered into a folder (C:\Program Files for example)?

Thanks for the answers!
Last edited on
I think that if you have a string like

char filename[200];

in which you keep the path of the folder the user is currently into.
Then you can just compare the strings using a code like:

int result = strcmp(filename,"C:\Program Files");

If this function returns 0(result becomes 0), means you successfully compared the strings and user has entered "C:\Program Files". If function returns a positive or negative value, then the user is not in this directory.
Yeah, but my question is how do I get the path of the folder the user is currently into...
You've not given us enough information.

Do you just want to monitor the file system and have the Operating System notify your application when the user enters a specific folder? Or do you wanna test which folder your application was run from?

http://www.cplusplus.com/forum/articles/1295/
Yes , I want the Operating System notify my application when the user enters a specific folder.
Then your best bet is to try a Win32 or Windows forum on how to hook into Explorer callbacks.
Topic archived. No new replies allowed.