Results 1 to 4 of 4

Thread: Set Homepage

  1. #1

    Thread Starter
    Fanatic Member vbPoet's Avatar
    Join Date
    Feb 2005
    Location
    Searching ..
    Posts
    669

    Set Homepage

    is there any way to set IE6 home page
    programatically.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Set Homepage

    Registry

    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page

    it is a string value.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Set Homepage

    Quote Originally Posted by vbPoet
    is there any way to set IE6 home page
    programatically.
    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal HKey As Long) _
    4. As Long
    5. Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" _
    6. (ByVal HKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
    7. Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "" ()
    8. Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" _
    9. (ByVal HKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, _
    10. ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
    11.  
    12. Private Const REG_SZ = 1
    13. Private Const HKEY_CURRENT_USER = &H80000001
    14.  
    15. Private Sub SaveString(HKey As Long, Path As String, Name As String, Data As String)
    16.    
    17.     Dim KeyHandle As Long
    18.     Dim RetVal As Long
    19.     RetVal = RegCreateKey(HKey, Path, KeyHandle)
    20.     RetVal = RegSetValueEx(KeyHandle, Name, 0, REG_SZ, ByVal Data, Len(Data))
    21.     RetVal = RegCloseKey(KeyHandle)
    22.  
    23. End Sub
    24.  
    25. Private Sub SetStartPage(URL As String)
    26. Call SaveString(HKEY_CURRENT_USER, "Software\Microsoft\Internet Explorer\Main", "Start Page", URL)
    27. End Sub
    28.  
    29. Private Sub SetWindowTitle(Title As String)
    30. Call SaveString(HKEY_CURRENT_USER, "Software\Microsoft\Internet Explorer\Main", "Window Title", Title)
    31. End Sub
    32.  
    33. Private Sub cmdSetStartPage_Click()
    34. SetStartPage ("http://www.vbforums.com/")
    35. SetWindowTitle ("Your One Stop For All Technical Questions")
    36. End Sub

  4. #4
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    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
    My Blog.

    Ryan Jones.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width