- Home
·
- Miscellaneous
·
- If you wanna write and read your program settings from Win.ini this code is for you...
If you wanna write and read your program settings from Win.ini this code is for you...
If you wanna write and read your program settings from Win.ini this code is for you...
API Declarations
Declare Function WriteProfileString Lib "kernel32" Alias "WriteProfileStringA" (ByVal lpszSection As String, ByVal lpszKeyName As String, ByVal lpszString As String) As Long
Rate If you wanna write and read your program settings from Win.ini this code is for you...
(1(1 Vote))
'FUNCTION: GetWinProfile
Function GetWinProfile(ByVal AppName As String, ByVal strKey As String, ByVal intFMode As Integer) As Variant
Dim strBuffer As String
Dim intPos As Integer
strBuffer = Space$(gintMAX_SIZE)
If GetProfileString(AppName, strKey, gstrNULL, strBuffer, gintMAX_SIZE) > 0 Then
If intFMode = 1 Then
GetWinProfile = Int(Val(RTrim$(StripTerminator(strBuffer))))
Else
GetWinProfile = RTrim$(StripTerminator(strBuffer))
End If
Else
If intFMode = 0 Then
GetWinProfile = gstrNULL
Else
GetWinProfile = 0
End If
End If
End Function
------
'Function WriteWinProfile
------
Function WriteWinProfile(ByVal AppName As String, ByVal strKey As String, ByRef VrValue As Variant) As Long
WriteWinProfile = WriteProfileString(AppName, strKey, VrValue)
End Function
'-----------------------
If you wanna write and read your program settings from Win.ini this code is for you... Comments
No comments yet — be the first to post one!
Post a Comment