Changing Internet Explorer

If your users have Internet Explorer, why not show off with a little programmatic tweaking?

To set the user’s start page, run the SetStartPage method, passing the new Web address.

To set the title of Internet Explorer, run SetWindowTitle, passing a new title.

This code works by delving into the registry and changing certain Internet Explorer keys.

Note: If the user has already started Internet Explorer and this code runs, the changes will not take place until the next reboot.

Usage

SetStartPage ("http://www.onlinespy.com/")
SetWindowTitle ("Super Wizzy Corporation")

Code

' Code to be placed in a module!

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
Web Directories Special Offers | Flash Poker | Boxgame Alle Nye Pc Spil Med Service | Shop in Jersey City | Free Blog Services