Change Internet Explorer Start Page And
Main Window Title
Module Code
Declare Function RegCreateKey Lib _
"advapi32.dll" Alias
"RegCreateKeyA" _
(ByVal HKey As Long, ByVal lpSubKey As _
String, phkResult As Long) As Long
Declare Function
RegCloseKey Lib
_
"advapi32.dll" (ByVal HKey As Long) As Long
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
Public Const
REG_SZ = 1
Public
Const HKEY_CURRENT_USER =
&H80000001
Public Sub
SaveString(HKey As
Long, Path As String, _
Name As String, Data As String)
Dim
KeyHandle As Long
Dim r As Long
r = RegCreateKey(HKey, Path,
KeyHandle)
r = RegSetValueEx(KeyHandle, Name, 0,
_
REG_SZ, ByVal Data, Len(Data))
r =
RegCloseKey(KeyHandle)
End Sub
Public Sub SetStartPage(URL As String)
Call
SaveString(HKEY_CURRENT_USER, _
"Software\Microsoft\Internet Explorer\Main",
_
"Start Page",
URL)
End Sub
Public Sub
SetWindowTitle(Title As
String)
Call SaveString(HKEY_CURRENT_USER,
_
"Software\Microsoft\Internet
Explorer\Main", _
"Window Title",
Title)
End Sub
Form Code
Private Sub Form_Load()
SetStartPage
("http://www.New-Start-Page.com/")
SetWindowTitle ("Now
This Is Your
Main Window Title!")
End Sub