Can i change window title of SHBrowseForFolder Function.
-
Hi all, in SHBrowseForFolder Function when window open its title is "Browse for folder". please tell me can i change it. thanks in advance.
To accomplish great things, we must not only act, but also dream; not only plan, but also believe.
The SHBrowseForFolder [^] takes in a pointer to a BROWSERINFO[^] structure. You can assign the lpszTitle of BROWSERINFO and pass the BROWSERINFO to SHBrowseForFolder .
-
The SHBrowseForFolder [^] takes in a pointer to a BROWSERINFO[^] structure. You can assign the lpszTitle of BROWSERINFO and pass the BROWSERINFO to SHBrowseForFolder .
In BROWSERINFO structur the parameter discription like this "lpszTitle Pointer to a null-terminated string that is displayed above the tree view control in the dialog box. This string can be used to specify instructions to the user. " this parameter not change the main window title. please help me.
To accomplish great things, we must not only act, but also dream; not only plan, but also believe.
-
In BROWSERINFO structur the parameter discription like this "lpszTitle Pointer to a null-terminated string that is displayed above the tree view control in the dialog box. This string can be used to specify instructions to the user. " this parameter not change the main window title. please help me.
To accomplish great things, we must not only act, but also dream; not only plan, but also believe.
LPMALLOC pMalloc;
LPITEMIDLIST pidl;
TCHAR szPath [MAX_PATH]; // not used
BROWSEINFO bi = { GetSafeHwnd(), NULL, szPath,
_T("Test title for browse dialog"),
BIF_VALIDATE|BIF_UAHINT|BIF_NEWDIALOGSTYLE|BIF_NONEWFOLDERBUTTON|BIF_RETURNONLYFSDIRS, NULL, NULL };pidl = SHBrowseForFolder ( &bi ); if ( NULL != pidl ) { SHGetMalloc ( &pMalloc ); pMalloc->Free(pidl); pMalloc->Release(); }
here the window title is remain same "Browse for folder",and "Test title for browse dialog" comes above on dir tree.
To accomplish great things, we must not only act, but also dream; not only plan, but also believe.
-
Hi all, in SHBrowseForFolder Function when window open its title is "Browse for folder". please tell me can i change it. thanks in advance.
To accomplish great things, we must not only act, but also dream; not only plan, but also believe.
As you've found out, the lpszTitle member of the BROWSEINFO structure does what it says - changes the text above the tree control, rather than the title. I'd agree that the variabke name is a bit misleading, but the help text tells the truth. Maybe make a browsecallbackproc? The docs say that the first parameter of this callback function is the window of the browese dialog. Could yopu call SetWindowText from there? It passes a BFFM_INITIALIZED message to the proc, so you could change the text very soon. Good luck, Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]
-
LPMALLOC pMalloc;
LPITEMIDLIST pidl;
TCHAR szPath [MAX_PATH]; // not used
BROWSEINFO bi = { GetSafeHwnd(), NULL, szPath,
_T("Test title for browse dialog"),
BIF_VALIDATE|BIF_UAHINT|BIF_NEWDIALOGSTYLE|BIF_NONEWFOLDERBUTTON|BIF_RETURNONLYFSDIRS, NULL, NULL };pidl = SHBrowseForFolder ( &bi ); if ( NULL != pidl ) { SHGetMalloc ( &pMalloc ); pMalloc->Free(pidl); pMalloc->Release(); }
here the window title is remain same "Browse for folder",and "Test title for browse dialog" comes above on dir tree.
To accomplish great things, we must not only act, but also dream; not only plan, but also believe.
You may use the
lpfn
member of the struct, for instanceint CALLBACK MyCallback(
HWND hwnd,
UINT uMsg,
LPARAM lParam,
LPARAM lpData
)
{
if (uMsg == BFFM_INITIALIZED)
SetWindowText(hwnd, _T("Hi folks"));
return 0;
}and then
//...
BROWSEINFO bi = {
GetSafeHwnd(),
NULL,
szPath,
_T("Test title for browse dialog"),
BIF_VALIDATE|BIF_UAHINT|BIF_NEWDIALOGSTYLE|BIF_NONEWFOLDERBUTTON|BIF_RETURNONLYFSDIRS,
MyCallback,
NULL
};pidl = SHBrowseForFolder ( &bi );
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
As you've found out, the lpszTitle member of the BROWSEINFO structure does what it says - changes the text above the tree control, rather than the title. I'd agree that the variabke name is a bit misleading, but the help text tells the truth. Maybe make a browsecallbackproc? The docs say that the first parameter of this callback function is the window of the browese dialog. Could yopu call SetWindowText from there? It passes a BFFM_INITIALIZED message to the proc, so you could change the text very soon. Good luck, Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]
-
Thank u very much its really helps me.
To accomplish great things, we must not only act, but also dream; not only plan, but also believe.
-
one more question for browse for folder the ok button enable on my computer type location i want this type of location the ok button should be disable.
To accomplish great things, we must not only act, but also dream; not only plan, but also believe.
- You can set the ulFlags member of the BROWSEINFO structure you pass to SHBrowseForFolder to specify that (for example) you only want file-system directories. 2) You can implement functionality in the BrowseCallbackProc[^] to enable/disable the OK button.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p