The WritePrivateProfileSection function replaces the keys and values for the specified section in an initialization file.
Note This function is provided only for compatibility with 16-bit versions of Windows. Applications should store initialization information in the registry.
Declare Function WritePrivateProfileSection Lib "kernel32" Alias "WritePrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpString As String, ByVal lpFileName As String) As Long
|Operating Systems Supported|
|Requires Windows NT 3.1 or later; Requires Windows 95 or later|
|· lpAppName |
[in] Pointer to a null-terminated string specifying the name of the section in which data is written. This section name is typically the name of the calling application.
[in] Pointer to a buffer containing the new key names and associated values that are to be written to the named section.
[in] Pointer to a null-terminated string containing the name of the initialization file. If this parameter does not contain a full path for the file, the function searches the Windows directory for the file. If the file does not exist and lpFileName does not contain a full path, the function creates the file in the Windows directory. The function does not create a file if lpFileName contains the full path and file name of a file that does not exist.
|If the function succeeds, the return value is nonzero.|
If the function fails, the return value is zero. To get extended error information, call GetLastError.