Article View: borland.public.cppbuilder.nativeapi
Article #2491Re: SHBrowseForFolder and filtering
From: Mike Collins
Date: Thu, 08 Feb 2007 01:11
Date: Thu, 08 Feb 2007 01:11
68 lines
3416 bytes
3416 bytes
Cheers bob, i had looked at the MSDN references that you so kindly posted below and they scare the s&%t out of me - was naively hoping that someone would tell me that it was all that complicated - but alas. I actual ended up doing it as remy suggested by processing the users selection on the fly and then disallowing the OK button and setting the status text Thanks again - might brave it when i'm not so busy. Mike "Bob Gonder" <notbg@notmindspring.invalid> wrote in message news:6f0ks2166gv2qvl1v7oq0kofrmitcu4mio@4ax.com... > Mike Collins wrote: > >>Hi all, can anyone point me in the right direction with this -not sure if >>it >>is possible though. > > Sounds COMplicated but doable. > (I haven't done it, just reading the docs...) > >>I 'm using the SHBrowseForFolder api to display a browser dialog. >>However, >>i want to control what is displayed, and thus selected within this dialog. >>I want to limit the users display to only removale drives, CD / DVD drives >>and folders within these drives. I've coded a custome callback for the >>browser but i'm not sure what messages to look for and how to process >>then. > > The remarks section here > http://msdn2.microsoft.com/en-us/library/ms647664.aspx > mentions Custom Filtering (with 6 steps) > > Step3 > You will be catching BFFM_IUNKNOWN message in your callback > http://msdn2.microsoft.com/en-us/library/ms649522.aspx > > case BFFM_IUNKNOWN: > IFolderFilterSite* FFS; > ((IUnknown*)lParam)->QueryInterface( Unsure, &FFS ); > > Step 5 > Then making your COM filter interface available to the dialog. > http://msdn2.microsoft.com/en-us/library/ms645491.aspx > > FFS->SetFilter( MyIUnknownCOMInterfaceThatHasAnIFolderFilter); > Step 6 > FFS->Release(); > > Step 4 > You would then need a COM Interface > (MyIUnknownCOMInterfaceThatHasAnIFolderFilter) that returns a pointer > to an IFolderFilter which implements your 2 filtering procs. > http://msdn2.microsoft.com/en-us/library/ms645494.aspx > > In particular your IFolderFilter::ShouldShow() method returns S_OK to > show and S_FALSE to hide. > http://msdn2.microsoft.com/en-us/library/ms645496.aspx > > Apparently after all that, the dialog automatically calls your COM > filters for each item. > > COM interfaces are currently beyond my knowledge base. > Perhaps you have ventured there? > >
Technical Details
Message-ID:
<45ca78d6$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<45c9eb0a@newsgroups.borland.com> <6f0ks2166gv2qvl1v7oq0kofrmitcu4mio@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,44855005298c82e X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Mike Collins" <its@TheBottomOfThePost.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <45c9eb0a@newsgroups.borland.com> <6f0ks2166gv2qvl1v7oq0kofrmitcu4mio@4ax.com> Subject: Re: SHBrowseForFolder and filtering Date: Thu, 8 Feb 2007 01:11:52 -0000 Lines: 70 Organization: SDA Ltd X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.2826 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2826 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 89.240.223.4 Message-ID: <45ca78d6$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1170897110 89.240.223.4 (7 Feb 2007 17:11:50 -0800) Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail