Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2009-04-20
10
Medium Priority
?
476 Views
Last Modified: 2013-12-26
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.


0
Comment
Question by:xsysys
  • 5
  • 4
10 Comments
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 24195841
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
 

Author Comment

by:xsysys
ID: 24201046
hi sandeep,
thanks for the feed back.
So as you said there is no other way around .
0
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 24201114
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 18

Expert Comment

by:diasroshan
ID: 24201802
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
 

Author Comment

by:xsysys
ID: 24202895
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
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 24210243
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
 

Author Comment

by:xsysys
ID: 24221448
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
 

Author Comment

by:xsysys
ID: 24221488
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
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 24227880
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
 

Accepted Solution

by:
xsysys earned 0 total points
ID: 24302666
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month13 days, 14 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question