Joseph
March 29th, 1999, 01:31 PM
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
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