Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. more info about "browserinfo" ?

more info about "browserinfo" ?

Scheduled Pinned Locked Moved C / C++ / MFC
question
13 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R rolfhorror

    i'm doing a dialog with this browse for folder box and i'm thinking to add more parameters/flags to the BROWSEINFO. So anyone have a list of things to put in the browsinfo, like default dir, toolbars and more? this is what i got now, makes a box with title "hello" and OK, Cancel and New folder buttons BROWSEINFO bi; memset(&bi, 0, sizeof(bi)); bi.hwndOwner = hOwner; bi.lpszTitle = "Hello"; bi.ulFlags = 0x0060 | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS; //more flags? //more bi. things? thanx

    D Offline
    D Offline
    Dominik Reichl
    wrote on last edited by
    #2

    Have a look here: BROWSEINFO Structure[^]


    Too many passwords to remember? Try KeePass Password Safe!

    R 1 Reply Last reply
    0
    • D Dominik Reichl

      Have a look here: BROWSEINFO Structure[^]


      Too many passwords to remember? Try KeePass Password Safe!

      R Offline
      R Offline
      rolfhorror
      wrote on last edited by
      #3

      thanks, that was really helpful.

      R 1 Reply Last reply
      0
      • R rolfhorror

        thanks, that was really helpful.

        R Offline
        R Offline
        rolfhorror
        wrote on last edited by
        #4

        ..i'm getting an error when using bi.ulFlags = BIF_USENEWGUI; error C2065: 'BIF_USENEWUI' : undeclared identifier heres the code i'm using, i must be doing something wrong: #include "shlobj.h" //dont know if it matters BOOL BrowseForFolder(HWND hOwner, CString& folderpath) { ::OleInitialize(NULL); // Create a pointer to a MALLOC (memory allocation object) // then get the Shell Malloc. IMalloc* pMalloc = 0; if(::SHGetMalloc(&pMalloc) != NOERROR) return false; // Now create BROWSEINFO structure, to tell the shell how // to display the dialog. BROWSEINFO bi; memset(&bi, 0, sizeof(bi)); bi.hwndOwner = hOwner; bi.lpszTitle = "hello"; bi.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS; // Now show the dialog and get the itemIDList for the selected folder. LPITEMIDLIST pIDL = ::SHBrowseForFolder(&bi); if(pIDL == NULL) return false; // Now create a buffer to store the path, thne get it. char buffer[_MAX_PATH]; if(::SHGetPathFromIDList(pIDL, buffer) == 0) return false; ::OleUninitialize(); // Finally, set the string to the path, and return true. folderpath = buffer; return true; }

        N D 2 Replies Last reply
        0
        • R rolfhorror

          ..i'm getting an error when using bi.ulFlags = BIF_USENEWGUI; error C2065: 'BIF_USENEWUI' : undeclared identifier heres the code i'm using, i must be doing something wrong: #include "shlobj.h" //dont know if it matters BOOL BrowseForFolder(HWND hOwner, CString& folderpath) { ::OleInitialize(NULL); // Create a pointer to a MALLOC (memory allocation object) // then get the Shell Malloc. IMalloc* pMalloc = 0; if(::SHGetMalloc(&pMalloc) != NOERROR) return false; // Now create BROWSEINFO structure, to tell the shell how // to display the dialog. BROWSEINFO bi; memset(&bi, 0, sizeof(bi)); bi.hwndOwner = hOwner; bi.lpszTitle = "hello"; bi.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS; // Now show the dialog and get the itemIDList for the selected folder. LPITEMIDLIST pIDL = ::SHBrowseForFolder(&bi); if(pIDL == NULL) return false; // Now create a buffer to store the path, thne get it. char buffer[_MAX_PATH]; if(::SHGetPathFromIDList(pIDL, buffer) == 0) return false; ::OleUninitialize(); // Finally, set the string to the path, and return true. folderpath = buffer; return true; }

          N Offline
          N Offline
          Newbie00
          wrote on last edited by
          #5

          rolfhorror wrote:

          error C2065: 'BIF_USENEWUI' : undeclared identifier

          the error message relevant to the:

          rolfhorror wrote:

          bi.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS;

          You've missed the letter 'G' int the BIF_USENEWGUI Fresh eye seems to be helpful sometimes :]

          D 1 Reply Last reply
          0
          • R rolfhorror

            ..i'm getting an error when using bi.ulFlags = BIF_USENEWGUI; error C2065: 'BIF_USENEWUI' : undeclared identifier heres the code i'm using, i must be doing something wrong: #include "shlobj.h" //dont know if it matters BOOL BrowseForFolder(HWND hOwner, CString& folderpath) { ::OleInitialize(NULL); // Create a pointer to a MALLOC (memory allocation object) // then get the Shell Malloc. IMalloc* pMalloc = 0; if(::SHGetMalloc(&pMalloc) != NOERROR) return false; // Now create BROWSEINFO structure, to tell the shell how // to display the dialog. BROWSEINFO bi; memset(&bi, 0, sizeof(bi)); bi.hwndOwner = hOwner; bi.lpszTitle = "hello"; bi.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS; // Now show the dialog and get the itemIDList for the selected folder. LPITEMIDLIST pIDL = ::SHBrowseForFolder(&bi); if(pIDL == NULL) return false; // Now create a buffer to store the path, thne get it. char buffer[_MAX_PATH]; if(::SHGetPathFromIDList(pIDL, buffer) == 0) return false; ::OleUninitialize(); // Finally, set the string to the path, and return true. folderpath = buffer; return true; }

            D Offline
            D Offline
            Dominik Reichl
            wrote on last edited by
            #6

            As written in the documentation, the BIF_USENEWUI flag is supported only by version 5.0 and higher. Therefore, define _WIN32_IE to 0x0500 or higher before including the shlobj.h file. Normally you define this in the StdAfx.h file, which gets included before all other header files.


            Too many passwords to remember? Try KeePass Password Safe!

            R 1 Reply Last reply
            0
            • N Newbie00

              rolfhorror wrote:

              error C2065: 'BIF_USENEWUI' : undeclared identifier

              the error message relevant to the:

              rolfhorror wrote:

              bi.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS;

              You've missed the letter 'G' int the BIF_USENEWGUI Fresh eye seems to be helpful sometimes :]

              D Offline
              D Offline
              Dominik Reichl
              wrote on last edited by
              #7

              Newbie00 wrote:

              Fresh eye seems to be helpful sometimes :]

              Sometimes yes, but probably not now ;) It's really BIF_USENEWUI, not BIF_USENEWGUI.


              Too many passwords to remember? Try KeePass Password Safe!

              N 1 Reply Last reply
              0
              • D Dominik Reichl

                Newbie00 wrote:

                Fresh eye seems to be helpful sometimes :]

                Sometimes yes, but probably not now ;) It's really BIF_USENEWUI, not BIF_USENEWGUI.


                Too many passwords to remember? Try KeePass Password Safe!

                N Offline
                N Offline
                Newbie00
                wrote on last edited by
                #8

                ahaa so why did You use the sentence: "..i'm getting an error when using bi.ulFlags = BIF_USENEWGUI;" at the top of your question? There is definitely BIF_USENEWGUI

                D 1 Reply Last reply
                0
                • N Newbie00

                  ahaa so why did You use the sentence: "..i'm getting an error when using bi.ulFlags = BIF_USENEWGUI;" at the top of your question? There is definitely BIF_USENEWGUI

                  D Offline
                  D Offline
                  Dominik Reichl
                  wrote on last edited by
                  #9

                  But in the code he used the correct one :)


                  Too many passwords to remember? Try KeePass Password Safe!

                  1 Reply Last reply
                  0
                  • D Dominik Reichl

                    As written in the documentation, the BIF_USENEWUI flag is supported only by version 5.0 and higher. Therefore, define _WIN32_IE to 0x0500 or higher before including the shlobj.h file. Normally you define this in the StdAfx.h file, which gets included before all other header files.


                    Too many passwords to remember? Try KeePass Password Safe!

                    R Offline
                    R Offline
                    rolfhorror
                    wrote on last edited by
                    #10

                    thanks, i'll try that :) (..regarding the error posted i meant to write "BIF_USENEWUI" not ..GUI)

                    H 1 Reply Last reply
                    0
                    • R rolfhorror

                      thanks, i'll try that :) (..regarding the error posted i meant to write "BIF_USENEWUI" not ..GUI)

                      H Offline
                      H Offline
                      Hamid Taebi
                      wrote on last edited by
                      #11

                      If you like and need you can insert controls to BROWSEINFO


                      WhiteSky


                      R 1 Reply Last reply
                      0
                      • H Hamid Taebi

                        If you like and need you can insert controls to BROWSEINFO


                        WhiteSky


                        R Offline
                        R Offline
                        rolfhorror
                        wrote on last edited by
                        #12

                        ok.. so how to do that?

                        H 1 Reply Last reply
                        0
                        • R rolfhorror

                          ok.. so how to do that?

                          H Offline
                          H Offline
                          Hamid Taebi
                          wrote on last edited by
                          #13

                          See two exmaples Customizing the "Browse for folder" dialog[^] and Customizing "Browse for folder" dialog Part - II[^]


                          WhiteSky


                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups