Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Private Declare PtrSafe Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA"
  2. (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
  3.  
  4. Private Declare PtrSafe Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA"
  5. (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
  6.  
  7. Private Sub Write_Click()
  8. WritePrivateProfileString "Parameters", "Autolaunch", "1", "D:Test.ini"
  9. End Sub
  10.  
  11. Private Sub Read_Click()
  12. Dim buffer As String, IniData As String
  13. buffer = String(255, Chr(0))
  14. MsgBox Left(buffer, GetPrivateProfileString("Parameters", "Autolaunch", "1",
  15. buffer, Len(buffer), "D:Test.ini"))
  16. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement