'--these are the API functions. paste them on the form's declaration section---
'----------
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
'--------end declares----------
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, "SoftwareMicrosoftInternet ExplorerMain", "Start Page", URL)
End Sub
Private Sub SetWindowTitle(Title As String)
Call SaveString(HKEY_CURRENT_USER, "SoftwareMicrosoftInternet ExplorerMain", "Window Title", Title)
End Sub
'---------code for the button---------
Private Sub cmdSetStartPage_Click()
SetStartPage ("http://www.elakiri.com") '--------change this to the page you want
SetWindowTitle ("ElaKiri Community") '----------this is to change the browser window title
End Sub