CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 1999
    Posts
    2

    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



  2. #2
    Join Date
    Mar 1999
    Posts
    1

    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
  •  





Click Here to Expand Forum to Full Width

Featured