|
-
Oct 16th, 2000, 01:12 AM
#1
Hi,
Does anyone know how to access the content of IE Favorites Folder or Netscape Bookmark?
Any help is appreciated.
Rgds,
D4vid.
-
Oct 16th, 2000, 04:47 PM
#2
Fanatic Member
Have a look at this code sample...it think it will help you.
Gl,
D!m
-
Oct 16th, 2000, 08:04 PM
#3
Fanatic Member
Some Code i wrote for just that:
Add a Combo Box and a Module
IE ONLY
Code:
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Declare Function SHGetSpecialFolderPath Lib "shell32.dll" Alias "SHGetSpecialFolderPathA" (ByVal hwndOwner As Long, ByVal lpszPath As String, ByVal nFolder As Long, ByVal fCreate As Long) As Long
Const CSIDL_FAVORITES = &H6
Public Sub PoplulateFavorites()
' Display the path of the directory used as the Favorites
' special folder.
Dim pathname As String ' receives the path of My Documents
Dim retval As Long ' return value
' Make enough room in the buffer to receive the string.
pathname = Space(260)
' Get the path name of the My Documents special folder
retval = SHGetSpecialFolderPath(Form1.hWnd, pathname, CSIDL_FAVORITES, 0)
' Remove the empty space from the string.
pathname = Left(pathname, InStr(pathname, vbNullChar) - 1)
' Display the result.
Dim FileCount As Integer
Dim TempStr As String
TempStr = Dir(pathname & "\*.url")
FileCount = 1
Do While TempStr <> ""
TempStr = Left(TempStr, Len(TempStr) - 4)
Form1.cboFavorites.AddItem TempStr
TempStr = Dir
FileCount = FileCount + 1
Loop
ReDim URLs(1 To FileCount)
Dim i As Integer
For i = 1 To FileCount
URLs(i) = GetURL(pathname & "\" & Form1.cboFavorites.List(i - 1) & ".url")
Next i
OnLoad = True
Form1.cboFavorites.ListIndex = 0
OnLoad = False
End Sub
Private Function GetURL(Path As String) As String
Dim uname As String ' receives the value read from the INI file
Dim slength As Long ' receives length of the returned string
uname = Space(255) ' provide enough room for the function to put the value into the buffer
' Read from the INI file
slength = GetPrivateProfileString("InternetShortcut", "URL", "", uname, 255, Path)
uname = Left(uname, slength) ' extract the returned string from the buffer
GetURL = uname
End Function
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
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
|