Link to home
Start Free TrialLog in
Avatar of xsysys
xsysys

asked on

to apply filter in windows explorer created by microsoft web browser control

hi
i am using PB 8.0.4. in my application i have a OLE control of type microsoft
Web Browser control, where i am showing the contains of a folder by using
Navigate function.

My question is in here in the control I am getting all the file and folder
names.
But if i want to display only the bitmap files (.bmp, .jpg). then how i
can impliment this.

so how can i apply filter to this control.


plz help me. thanks in advance.


Avatar of sandeep_patel
sandeep_patel
Flag of United States of America image

I believe you can not do this, because it actually displays your explorer and it doesn't have such functionality. Whatever the operations you do via web browser control are on the explorer.

I would suggest workaround to use PB's FileCopy() OR FileMove() functions and copy required files from your actual directory to temp directory and display the temp directory in web browser control.

However copying or moving large no of files will slowdown your application.

Regards,
Sandeep
Avatar of xsysys
xsysys

ASKER

hi sandeep,
thanks for the feed back.
So as you said there is no other way around .
I am still thinking if we can really use webcontrol to work like search output window on mycomputer. where you just give the directory in which to search and search criteria (*.bmp) and fire search, which produces the result you want.

Give a try to google it.

Regards,
Sandeep
Hi,

tried to google and look around, but cudnt get any info on this.
If possible try another workaround in place of the web control.

If there is VB or any other code that u can get hold of, we cud help u convert the same into PB.

Cheers,
Rosh
Avatar of xsysys

ASKER

i tried to find some thread in google.
but all my search go invain.
 but still i m positive that you guys can find A way to solve this problem.
all da best. im eagerly waiting for the reply.
 
 
 
I think this can be done now.. I didn't get enough time to research on this...

see below link and try out those stuffs.. it may help

//http://www.vbcity.com/forums/topic.asp?tid=116425
//http://msdn.microsoft.com/en-us/library/bb787789(VS.85).aspx

I tried below...

oleobject ole_doc,ole_items
long ll_count,ll_items

ole_doc = ole_web.object.document
ole_items = ole_doc.folder.items()
ll_items = ole_items.count()
messagebox('1',ll_items)
ole_items.filter(64,'*.txt')
ll_items = ole_items.count()
messagebox('2',ll_items)

After fileter it shows 0 for count, but no change on web browser control. Looks like i m still missing some settings.

Hope will get this done!!!

Regards,
Sandeep
Avatar of xsysys

ASKER

hi sandeep,
i tried with the code provided by you. but my doubt is after filter always the itemscount is shown as 0. So i m affraid that the filter is working or not.
Avatar of xsysys

ASKER

Hi sandeep,
 
what i got now is filter() method is avaliable under FolderItems3 shell object.
are we using folderitems3 in our script??
now I think you can do the magic..
come-on hurry up!!!!
 
I knew that it is under FolderItem3 but it really doesn't matter. Yes you are right, it always returns 0. Problem looks like this is not supported under webbrowser control. But the same is working for shell.

webbrowser contorl code ( This is not working as desired)
---------------------------------

oleobject ole_folder
oleobject ole_folderitem3

ole_folder = ole_web.object.document.folder
If Not IsNull(ole_folder) Then
      ole_folderitem3 = ole_folder.Items
      If Not IsNull(ole_folderitem3) Then
            Long SHCONTF_NONFOLDERS
            SHCONTF_NONFOLDERS = 64
            Messagebox('1',string(ole_folderitem3.Count))
            ole_folderitem3.Filter(SHCONTF_NONFOLDERS, "*.bmp")
            Messagebox('2',string(ole_folderitem3.Count))            
      End If
End If

Shell code ( This is working perfect)
---------------------------------

oleobject ole_shell
oleobject ole_folder
oleobject ole_folderitem3

ole_shell = create oleobject
ole_shell.connecttonewobject("shell.application")
ole_folder = ole_shell.NameSpace('c:\temp')
If Not IsNull(ole_folder) Then
      ole_folderitem3 = ole_folder.Items
      If Not IsNull(ole_folderitem3) Then
            Long SHCONTF_NONFOLDERS
            SHCONTF_NONFOLDERS = 64
            Messagebox('1',string(ole_folderitem3.Count))
            ole_folderitem3.Filter(SHCONTF_NONFOLDERS, "*.bmp")
            Messagebox('2',string(ole_folderitem3.Count))
      End If
End If

Searched lot on net but no luck so far :(
ASKER CERTIFIED SOLUTION
Avatar of xsysys
xsysys

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial