My program creates a folder in the executable's directory and saves some output files. When the application finishes, I have it automatically open the folder in an explorer window using ShellExecute(NULL, _T("Open"), _T("Explorer"), _T(m_strOutputPath), NULL, SW_SHOWDEFAULT);
Now, if I keep re-running the program, it will just keep opening the same folder even if it is already opened. For the absent-minded user (with me being one of them), this results in multiple windows of the same folder.
Is there a way to detect if the folder is already opened in an explorer window and not make it open a new window if it is already opened?
I'm developing in MSVS 2008 SP1 on Windows Vista, but the program will run on XP, Vista, and 7.