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.


xsysysAsked:
Who is Participating?
 
xsysysAuthor Commented:
hi Sandeep,
i checked the shell example it is working fine. But i think there is no way to filter the files in web browser window. so i am closing the question.
 
thanks for your help. keep it up!!!!!
0
 
sandeep_patelCommented:
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
0
 
xsysysAuthor Commented:
hi sandeep,
thanks for the feed back.
So as you said there is no other way around .
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
sandeep_patelCommented:
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
0
 
diasroshanCommented:
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
0
 
xsysysAuthor Commented:
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.
 
 
 
0
 
sandeep_patelCommented:
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
0
 
xsysysAuthor Commented:
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.
0
 
xsysysAuthor Commented:
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!!!!
 
0
 
sandeep_patelCommented:
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 :(
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.