win12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
PrfQueryProfileString (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINSHELLDATA
 
ULONG PrfQueryProfileString(hini, pszAppName, pszKeyName, pszError,
    pszBuf, cchBuf)
HINI hini;         /* initialization-file handle   */
PSZ pszAppName;    /* pointer to application name  */
PSZ pszKeyName;    /* pointer to keyname           */
PSZ pszError;      /* pointer to default string    */
PSZ pszBuf;        /* pointer to buffer for string */
ULONG cchBuf;      /* buffer size                  */
 
The PrfQueryProfileString function retrieves a string from the profile file.
The location of the string is determined by the application name and keyname
passed to this function.
 
Parameter   Description
────────────────────────────────────────────────────────────────────────────
 
hini        Identifies the file to query. This parameter can be a file
            handle or one of the following values:
 
            Value               Meaning
            ────────────────────────────────────────────────────────────────
            HINI_PROFILE        Search the user profile, and if no matching
                                entries are found, search the system
                                profile.
 
            HINI_USERPROFILE    Search only the user profile.
 
            HINI_SYSTEMPROFILE  Search only the system profile.
 
pszAppName  Points to the null-terminated string that contains the
            application name. The string must be less than 1024 bytes long,
            including the terminating null character. The application name
            is case-sensitive. If pszAppName is NULL, a list of all
            application names in the profile specified by the hini parameter
            is returned.
 
pszKeyName  Points to the null-terminated string that contains the keyname.
            The string must be less than 1024 bytes long, including the
            terminating null character. The keyname is case-sensitive. If
            pszKeyName is NULL, all keynames in the profile specified by the
            hini parameter are enumerated.
 
pszError    Points to the null-terminated string placed in the buffer
            pointed to by pszBuf if the keyname is not found.
 
pszBuf      Points to the buffer that receives the null-terminated string.
 
cchBuf      Specifies the length of the buffer pointed to by the pszBuf
            parameter. If the string retrieved is longer than this value, it
            is truncated.
 
Return Value
 
The return value is the number of characters in the buffer pointed to by
pszBuf, or zero if an error occurs.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_INVALID_PARM
     PMERR_MEMORY_ALLOC
     PMERR_MEMORY_ALLOCATION_ERR
     PMERR_MEMORY_DEALLOCATION_ERR
 
Comments
 
When NULL is used in pszKeyName and the application name specified by
pszAppName is not found, PrfQueryProfileString returns FALSE.
 
Application data should be stored in the user profile or an
application-specific profile. The system profile should be used only for
system data.
 
See Also
 
PrfWriteProfileString, WinQueryProfileString