|
-
May 26th, 2005, 08:18 AM
#1
Thread Starter
Fanatic Member
Set Homepage
is there any way to set IE6 home page
programatically.
-
May 26th, 2005, 08:28 AM
#2
Re: Set Homepage
Registry
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page
it is a string value.
-
May 26th, 2005, 08:31 AM
#3
Re: Set Homepage
 Originally Posted by vbPoet
is there any way to set IE6 home page
programatically.
VB Code:
Option Explicit
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal HKey As Long) _
As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" _
(ByVal HKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "" ()
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" _
(ByVal HKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, _
ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Const REG_SZ = 1
Private Const HKEY_CURRENT_USER = &H80000001
Private Sub SaveString(HKey As Long, Path As String, Name As String, Data As String)
Dim KeyHandle As Long
Dim RetVal As Long
RetVal = RegCreateKey(HKey, Path, KeyHandle)
RetVal = RegSetValueEx(KeyHandle, Name, 0, REG_SZ, ByVal Data, Len(Data))
RetVal = RegCloseKey(KeyHandle)
End Sub
Private Sub SetStartPage(URL As String)
Call SaveString(HKEY_CURRENT_USER, "Software\Microsoft\Internet Explorer\Main", "Start Page", URL)
End Sub
Private Sub SetWindowTitle(Title As String)
Call SaveString(HKEY_CURRENT_USER, "Software\Microsoft\Internet Explorer\Main", "Window Title", Title)
End Sub
Private Sub cmdSetStartPage_Click()
SetStartPage ("http://www.vbforums.com/")
SetWindowTitle ("Your One Stop For All Technical Questions")
End Sub
-
May 26th, 2005, 08:32 AM
#4
Re: Set Homepage
You can change it by altering the registry....
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\ And the key Start Page 
Be aware that is the user has an anti-browser hijacker installed it will change this back automatically.
Cheers,
RyanJ
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
|