more info about "browserinfo" ?
-
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
Have a look here: BROWSEINFO Structure[^]
Too many passwords to remember? Try KeePass Password Safe!
-
Have a look here: BROWSEINFO Structure[^]
Too many passwords to remember? Try KeePass Password Safe!
thanks, that was really helpful.
-
thanks, that was really helpful.
..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; }
-
..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; }
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 :]
-
..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; }
As written in the documentation, the
BIF_USENEWUI
flag is supported only by version 5.0 and higher. Therefore, define_WIN32_IE
to0x0500
or higher before including theshlobj.h
file. Normally you define this in theStdAfx.h
file, which gets included before all other header files.
Too many passwords to remember? Try KeePass Password Safe!
-
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 :]
Newbie00 wrote:
Fresh eye seems to be helpful sometimes :]
Sometimes yes, but probably not now ;) It's really
BIF_USENEWUI
, notBIF_USENEWGUI
.
Too many passwords to remember? Try KeePass Password Safe!
-
Newbie00 wrote:
Fresh eye seems to be helpful sometimes :]
Sometimes yes, but probably not now ;) It's really
BIF_USENEWUI
, notBIF_USENEWGUI
.
Too many passwords to remember? Try KeePass Password Safe!
-
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
But in the code he used the correct one :)
Too many passwords to remember? Try KeePass Password Safe!
-
As written in the documentation, the
BIF_USENEWUI
flag is supported only by version 5.0 and higher. Therefore, define_WIN32_IE
to0x0500
or higher before including theshlobj.h
file. Normally you define this in theStdAfx.h
file, which gets included before all other header files.
Too many passwords to remember? Try KeePass Password Safe!
thanks, i'll try that :) (..regarding the error posted i meant to write "BIF_USENEWUI" not ..GUI)
-
thanks, i'll try that :) (..regarding the error posted i meant to write "BIF_USENEWUI" not ..GUI)
If you like and need you can insert controls to
BROWSEINFO
WhiteSky
-
If you like and need you can insert controls to
BROWSEINFO
WhiteSky
ok.. so how to do that?
-
ok.. so how to do that?
See two exmaples Customizing the "Browse for folder" dialog[^] and Customizing "Browse for folder" dialog Part - II[^]
WhiteSky