|
-
Apr 17th, 2008, 08:36 PM
#1
Thread Starter
Member
Viewing IE Favorites on a WebBrowser - VB6
Hello, I'm making an updated version of the WebBrowser Program with new material, but I need the code of how to view the IE favorites that you've bookmarked on Visual Basic 6.
Help...?
-
Apr 18th, 2008, 08:45 AM
#2
Re: Viewing IE Favorites on a WebBrowser - VB6
-
Apr 18th, 2008, 12:39 PM
#3
Re: Viewing IE Favorites on a WebBrowser - VB6
I think the favorites are kept in a directory under Documents and Settings\Your Name\Favorites
I think if you just do set a DirList path to that path you will get your favorites in a DirList box
-
Apr 18th, 2008, 01:17 PM
#4
Re: Viewing IE Favorites on a WebBrowser - VB6
Try this
Code:
Option Explicit
Private Const CSIDL_FAVORITES = 6 '// Favorites
Private Const MAX_PATH As Integer = 260
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End Type
Private Type SHIEMID
cb As Long
abID As Byte
End Type
Private Type ITEMIDLIST
mkid As SHIEMID
End Type
Private Declare Function SHGetSpecialFolderLocation Lib "Shell32.dll" _
(ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
Private Declare Function SHGetSpecialFolderLocationD Lib "Shell32.dll" _
Alias "SHGetSpecialFolderLocation" (ByVal hwndOwner As Long, ByVal nFolder As Long, _
ByRef ppidl As Long) As Long
Private Declare Function SHGetPathFromIDList Lib "Shell32.dll" Alias _
"SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Function GetSpecialFolder(CSIDL As Long) As String
Dim sPath As String
Dim IDL As ITEMIDLIST
GetSpecialFolder = vbNullString
If SHGetSpecialFolderLocation(Form1.hwnd, CSIDL, IDL) = 0 Then
sPath = Space$(MAX_PATH)
If SHGetPathFromIDList(ByVal IDL.mkid.cb, ByVal sPath) Then
GetSpecialFolder = Left$(sPath, InStr(sPath, vbNullChar) - 1) & "\"
End If
End If
End Function
Private Sub Command1Click()
Dim MyFavorites As String
MyFavorites = GetSpecialFolder(CSIDL_FAVORITES)
MsgBox MyFavorites
End Sub
-
Apr 18th, 2008, 04:45 PM
#5
Thread Starter
Member
Re: Viewing IE Favorites on a WebBrowser - VB6
 Originally Posted by Hack
Try this
Code:
Option Explicit
Private Const CSIDL_FAVORITES = 6 '// Favorites
Private Const MAX_PATH As Integer = 260
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End Type
Private Type SHIEMID
cb As Long
abID As Byte
End Type
Private Type ITEMIDLIST
mkid As SHIEMID
End Type
Private Declare Function SHGetSpecialFolderLocation Lib "Shell32.dll" _
(ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
Private Declare Function SHGetSpecialFolderLocationD Lib "Shell32.dll" _
Alias "SHGetSpecialFolderLocation" (ByVal hwndOwner As Long, ByVal nFolder As Long, _
ByRef ppidl As Long) As Long
Private Declare Function SHGetPathFromIDList Lib "Shell32.dll" Alias _
"SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Function GetSpecialFolder(CSIDL As Long) As String
Dim sPath As String
Dim IDL As ITEMIDLIST
GetSpecialFolder = vbNullString
If SHGetSpecialFolderLocation(Form1.hwnd, CSIDL, IDL) = 0 Then
sPath = Space$(MAX_PATH)
If SHGetPathFromIDList(ByVal IDL.mkid.cb, ByVal sPath) Then
GetSpecialFolder = Left$(sPath, InStr(sPath, vbNullChar) - 1) & "\"
End If
End If
End Function
Private Sub Command1Click()
Dim MyFavorites As String
MyFavorites = GetSpecialFolder(CSIDL_FAVORITES)
MsgBox MyFavorites
End Sub
OK. How can I open the file on the menu 'Favorites' like Internet Explorer?
A whole thing of the favorites that is...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|