VB6 Dannvanam Visit Karala Yanna

Mar 12, 2007
2,277
96
0
41
කඳුළු අතර
Mata Podi Help Ekak Ona
VB6 Valain

Button Ekak Click Kalama
Computer Eke Default Web Browser Eke Home Page Eka Wenas Wenna
Apita Ona Home Page Ekak Danna
Coding Eka Ona

Danna Kenek Innavanam Kiyala Denna


Api digatama VB6 Gena Me Thread eken discuss karamu
 

kosandpol

Well-known member
  • Jun 10, 2008
    45,329
    1,492
    113
    this is for IE :
    Code:
    '--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
     
    Mar 12, 2007
    2,277
    96
    0
    41
    කඳුළු අතර
    kosandpol said:
    this is for IE :
    Code:
    '--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

    Machan den mage machine eke Vb nehe
    Mama meka test karala balannam
    Oke elakiri.com thena vitharak wenas kalama ethi wei neda ban?

    Oka defalt web browser ekata nemeida?
    IE valata vitharai nam Firefox valata oka karana heti danne dedda?

    Karadara karanavta Sorry

    Dunna code ekata thanks
    Mama test karla balannam
     

    kosandpol

    Well-known member
  • Jun 10, 2008
    45,329
    1,492
    113
    IE and Firefox stores the home page setting in different ways. IE keeps it in the registry but I've no idea how firefox does it. Probably keeps it in one of the jscript files in the user's app data folder.
    Search the net, theres bound to be sample codes for that as well.
    Even the code I gave is one I had found on the web some time back.
     
    Mar 12, 2007
    2,277
    96
    0
    41
    කඳුළු අතර
    kosandpol said:
    IE and Firefox stores the home page setting in different ways. IE keeps it in the registry but I've no idea how firefox does it. Probably keeps it in one of the jscript files in the user's app data folder.
    Search the net, theres bound to be sample codes for that as well.
    Even the code I gave is one I had found on the web some time back.

    Ok
    Thanks