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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

Import IE favorites into Visual Basic 6 Program

Hi all,
I would like to know how I can open and recursively read the Internet Explorer favorites menu.  I would also like to know how to read the URL linked to each bookmark.  The last thing I would like to do is be able to open up the "Add To Favorites..." dialog from within my VB program.  After opening the Add to Favorites dialog, I need to be able to retrieve the information that the user added.

I realize I will need to use some API, but which ones, and how to implement.  

Thanks!!!!!
0
donkey_kong_jr2003
Asked:
donkey_kong_jr2003
  • 8
  • 5
1 Solution
 
AzraSoundCommented:
0
 
AzraSoundCommented:
0
 
donkey_kong_jr2003Author Commented:
Hi,
I am having trouble getting this code to work.  Stepping through the code, I found that the calls to:

hFile = FindFirstFile(sPath, WFD) and  Loop While FindNextFile(hFile, WFD)

Seem to be returning random values, especially the call to FindNextFile(hFile, WFD).  The big problem is that the loop only runs about 2 or 3 times and each time through WFD.cFileName contains about 15 files names, not just 1.  This causes the loop to end early.  Like I said before, each time I run the code, it will begin with a random file name.

Thanks
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
AzraSoundCommented:
What does the code do when you run it?  Does it not list your favorites in the listview?  What do you mean by random values?
0
 
donkey_kong_jr2003Author Commented:
I did manage to get this to work.  (I was not using a listview, I created my own menu).  I was wondering if there was an simpler way to display the "Add To Favorites..." dialog.  I have seen this done in C++ with a few lines of code.  I seen some sample in VB that looked simple but never could compile them.
thanks
0
 
AzraSoundCommented:
Never seen it done any other way than this in VB.
0
 
donkey_kong_jr2003Author Commented:
I found a much simpler way to open the Add Favorites dialog.  All you need to do is use:

Dim Shell
Set Shell = CreateObject("Shell.UIHelper")

This then gives you access to the AddFavorite method.  All this in a couple lines of code!
0
 
AzraSoundCommented:
Yes but I don't believe that method gives you the ability to get any info back about the operation, which was part of your initial request:

"After opening the Add to Favorites dialog, I need to be able to retrieve the information that the user added"
0
 
AzraSoundCommented:
BTW, though a few lines of code may look more appealing and be easier to work with, that is the only advantage.  This is not a speedier operation because, #1, there is the over head of creating the ShellUIHelper object, and #2, the object is more than likely doing the exact operation as outlined in my links (via Windows API) under the covers.
0
 
donkey_kong_jr2003Author Commented:
You are right, but I think this way works better in my situation.  Every time the user open the Favorites popup menu I am dynamically generating the contents before it is displayed.  So after the user adds the link, they will see in in the list the next time that they display the menu.
0
 
AzraSoundCommented:
You dynamically add them using the code I posted before as well.  Like I said, its really just a wrapper around the code at the above link.  But, whichever method works for you...
0
 
donkey_kong_jr2003Author Commented:
Thanks for the help:)
0
 
AzraSoundCommented:
No problem...glad you found what you were looking for.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 8
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now