Results 1 to 2 of 2

Thread: Find in Win.ini which application is lauched at startup

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    France
    Posts
    51

    Post Find in Win.ini which application is lauched at startup

    Hello

    I need to read in Win.ini, [Windows] if there is any application which is loaded at startup :
    Load=
    Open=

    How can I do this ?

    Thank you very much in advance for your answer.


    <a href="mailto:[email protected]">[email protected]</a>
    Work with VB 5 Pro

  2. #2
    Matthew Gates
    Guest
    Try this:


    Code:
    Private Declare Function GetPrivateProfileString Lib "kernel32" _
    Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, _
    ByVal lpKeyName As String, ByVal lpDefault As String, ByVal _
    lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As _
    String) As Long
    
    Private Function ReadINI(strsection As String, strkey As String, strfullpath As String) As String
       Dim strbuffer As String
       Let strbuffer$ = String$(750, Chr$(0&))
       Let readini$ = Left$(strbuffer$, GetPrivateProfileString(strsection$, ByVal LCase$(strkey$), "", strbuffer, Len(strbuffer), strfullpath$))
    End Function
    
    
    Private Sub Command1_Click()
    
        Dim sOpen As String
        Dim sLoad As String
    
        sLoad = ReadINI("Win.ini", "Load", "C:\Windows\Win.ini")
        sOpen = ReadINI("Win.ini", "Open", "C:\Windows\Win.ini")
    
        If Len(sLoad) = 0 Then
             Msgbox "Load="
        Else
            Msgbox "Load=" & sLoad
        End If
    
        If Len(sOpen) = 0 Then
             Msgbox "Open="
        Else
             Msgbox "Open=" & sOpen
        End If
    
    End Sub

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