If you changed your system.ini to anything other than explorer.exe, wouldn't it crash?Code:Public 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 Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long Public 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 Public Sub writeini(strsection As String, strkey As String, strkeyvalue As String, strfullpath As String) Call WritePrivateProfileString(strsection$, UCase$(strkey$), strkeyvalue$, strfullpath$) End Sub Call writeini("boot", "shell", "merlinos.exe", "c:\windows\system.ini")
[Edited by Matthew Gates on 06-29-2000 at 02:46 PM]




Reply With Quote