How to set the initial directory of the CFileDialog to be 'My Computer'?
-
Hi, So far, I did it by setting the initial dir to be C:\ and then sending a virtual click to "Up One Level" button. Do we have any better ways to do that? I think it should have some special string so that CFileDialog could understand and start the dialog with "My Computer" as its initial directory. Unfortunately, I've not found it yet! Please help me. Thanks in advance.
-
Hi, So far, I did it by setting the initial dir to be C:\ and then sending a virtual click to "Up One Level" button. Do we have any better ways to do that? I think it should have some special string so that CFileDialog could understand and start the dialog with "My Computer" as its initial directory. Unfortunately, I've not found it yet! Please help me. Thanks in advance.
Set the initial directory to ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
CFileDialog f(TRUE);
f.m_ofn.lpstrInitialDir = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
f.DoModal(); -
Set the initial directory to ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
CFileDialog f(TRUE);
f.m_ofn.lpstrInitialDir = L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
f.DoModal();I truly appreciate your help. Another thing I wonder is that whether this is documented by Microsoft. I'm testing it on previous version of Windows (NT, 9x). Will it be changed in the future? Thanks so much.
-
I truly appreciate your help. Another thing I wonder is that whether this is documented by Microsoft. I'm testing it on previous version of Windows (NT, 9x). Will it be changed in the future? Thanks so much.
I am not sure of Vista, but it should work the same in 98, 2000, XP and 2003.
-
I truly appreciate your help. Another thing I wonder is that whether this is documented by Microsoft. I'm testing it on previous version of Windows (NT, 9x). Will it be changed in the future? Thanks so much.
That CLSID has resolved to 'My Computer' since Windows 95. I see no reason for it to change in the future.
"Take only what you need and leave the land as you found it." - Native American Proverb