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

    Question How to detect that file dialog has been created using GetOpenFileName?

    I take a part in developing of namespace shell extension(NSE) containing file list from some folders. I have some problems with Open file dialog (OFD) created with the flag OFN_ALLOWMULTISELECT on Window Vista.
    If application uses OFD created using IFileOpenDialog my NSE works fine and application gets correct result in IShellItemArray.

    If application uses OFD created using GetOpenFileName and user selects some files then he gets an incorrect result because this function returns the string:

    <Folder name>\0<File name 1>\0<File name2>\0\0

    There must be the following result:

    <Folder name>\0<File name 1>\0<Subfolder 1\File name 2>\0<Folder name>\0<Subfolder 2\File name 3>\0\0.

    I must use single select mode in my NSE if application uses OFD created using GetOpenFileName.

    I want to get IFileOpenDialog from IShellBrowser and if this attempt is successfully then OFD has been created using IFileOpenDialog otherwise using GetOpenFileName.

    But I am not sure it is possibly and if GetOpenFileName uses IFileOpenDialog for creating OFD then it will be always successfully...


    Could you advise me how to detect in my NSE that OFD has been created using GetOpenFileName?

  2. #2
    Join Date
    Sep 2011
    Posts
    2

    Re: How to detect that file dialog has been created using GetOpenFileName?

    Quote Originally Posted by goshavt View Post
    There must be the following result:

    <Folder name>\0<File name 1>\0<Subfolder 1\File name 2>\0<Folder name>\0<Subfolder 2\File name 3>\0\0.
    I am sorry, it is a copy-past error.

    There must be the following result:

    <Folder name>\0<File name 1>\0<Subfolder 1\File name 2>\0<Subfolder 2\File name 3>\0\0.

Tags for this Thread

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