Get a string data from WIN.INI using GetProfileString API
Get a string data from WIN.INI using GetProfileString API
Rate Get a string data from WIN.INI using GetProfileString API
(1(1 Vote))
' Read the value "Wallpaper" from under the [Desktop] section of WIN.INI. If an error occurs, the function will return "Error"
Dim wallpaper As String ' receives string read from WIN.INI
Dim slength As Long ' receives length of string read from WIN.INI
Dim buffer As String * 255
' Read the string from WIN.INI
slength = GetProfileString("Desktop", "Wallpaper", "Error", buffer, 255)
wallpaper = Mid(buffer, 1, InStr(buffer, Chr(0)) - 1) ' extract the returned string from the buffer
If wallpaper = "Error" Then
MsgBox "Could not read information from WIN.INI."
Else
MsgBox "Current Wallpaper is " & wallpaper
End If
End
End Sub
Get a string data from WIN.INI using GetProfileString API Comments
No comments yet — be the first to post one!
Post a Comment