Article View: borland.public.cppbuilder.nativeapi
Article #2347Re: Shbrowseforfolder edit box problems
From: Bob Gonder
Date: Mon, 05 Mar 2007 15:58
Date: Mon, 05 Mar 2007 15:58
51 lines
2421 bytes
2421 bytes
"Mark Jacobs" <http://www.jacobsm.com/mjmsg.htm?BorlandNG> wrote:
>This is to present a directory selector with an edit box to manually enter a
>directory name. The directory chosen or entered, does not have to exist. When
>the dialog appears, it changes itself to the current directory. When I enter
>text into the edit box on this dialog, and hit OK, the dialog returns the
>directory in the window above the text box, but not that entered into the text
>box itself. How do I get to the text in the edit box in this dialog?
It looks like you are almost there.
>int CALLBACK mjBrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lParam,LPARAM
>lpData)
>{
> if (uMsg==BFFM_INITIALIZED) SendMessage(hwnd,BFFM_SETSELECTION,TRUE,lpData);
if( uMsg == BFFM_INITIALIZED )
{
if( lpData )
{
if( *lpData)
SendMessage(hwnd,BFFM_SETSELECTION,TRUE,lpData);
* lpData = 0;
};
return 0;
};
if (uMsg==BFFM_VALIDATEFAILED )
{
lstrcpy( lpData, lParam );
return 0; /*end dialog*/
};
- - - - -
mjbi.ulFlags=BIF_USENEWUI |
BIF_VALIDATE;
> mjbi.lpfn=mjBrowseCallbackProc;
> mjbi.lParam=(long)rcvdir;
> ITEMIDLIST *mjites=SHBrowseForFolder(&mjbi);
if( rcvdir[0] == 0 )
{ get rcvdir from pidl
}else{
use rcvdir directly
}
> rcvdir[0]='\0'; if (mjites) SHGetPathFromIDList(mjites,rcvdir);
> CoTaskMemFree(mjites);
> if (rcvdir[0]) Edit1->Text=AnsiString(rcvdir);
>}
>
Technical Details
Message-ID:
<99dou21t2sbmue94iobfekf2en3dfgegek@4ax.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!newshub.sdsu.edu!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<45ec10db$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,149a673c2d92f69f X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Shbrowseforfolder edit box problems Date: Mon, 05 Mar 2007 07:58:49 -0800 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <99dou21t2sbmue94iobfekf2en3dfgegek@4ax.com> References: <45ec10db$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.77.145.101 X-Trace: newsgroups.borland.com 1173110307 67.77.145.101 (5 Mar 2007 07:58:27 -0800) Lines: 52 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!newshub.sdsu.edu!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail