|
-
March 29th, 1999, 02:31 PM
#1
Re: CFileDialog - beginning in non-filesystem location
Michael,
To start in the Desktop directory, call ::SHGetSpecialFolderPath to get the desktop folder and set it as the initial
folder in the file dialog. Like this:
TCHAR szPath[MAX_PATH];
HRESULT hRes = ::SHGetSpecialFolderPath(NULL, szPath, CSIDL_DESKTOPDIRECTORY, FALSE);
if (SUCCEEDED(hRes))
{
CFileDialog dlg(TRUE);
dlg.m_ofn.lpstrInitialDir = szPath;
dlg.DoModal();
}
This should work. I haven't tryed it yet. It's probably possible to use SHGetSpecialFolderPath to get the Network
Neighborhood directory too.
Joseph
-
March 29th, 1999, 02:37 PM
#2
Re: CFileDialog - beginning in non-filesystem location
That suggestion works perfectly for items like the Desktop that actually have a physical representation in the file system (i.e. C:\windows\profiles\mine\desktop)
But Network Neighborhood (Not NetHood) does not have such a representation. (it is like the Control Panel).
This is where my difficulty lies.
Any further suggestions would be appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|