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.
PrfQueryProgramCategory (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINPROGRAMLIST
 
PROGCATEGORY PrfQueryProgramCategory(hini, pszProgramName)
HINI hini;             /* initialization-file handle */
PSZ pszProgramName;    /* pointer to program name    */
 
The PrfQueryProgramCategory function retrieves the type (category) of a
specified program.
 
Parameter       Description
────────────────────────────────────────────────────────────────────────────
 
hini            Identifies the file to search for program information (if
                the program type cannot be determined by searching the
                header of the executable file). This parameter can be an
                initialization-file handle obtained by using the
                PrfOpenProfile function, or it can be the value
                HINI_USERPROFILE, specifying the user-profile file.
 
pszProgramName  Points to the null-terminated string that contains the name
                of the executable file for which the type is to be returned.
                If the string appears to be a fully qualified path [(that
                is, it contains a colon (:) in the second position and/or
                contains a backslash (\)], the file is searched for in the
                indicated directory on the indicated drive. If neither of
                these conditions is true and the file is not in the current
                directory, each drive and directory specified in the path
                defined in the current program's environment is searched.
                The default extension for an executable file is .exe,
                although any extension is acceptable.
 
Return Value
 
The return value is the program category if the function is successful or
zero if an error occurs. The program type can be one of the following
values:
 
Value               Meaning
────────────────────────────────────────────────────────────────────────────
PROG_FULLSCREEN     Program runs only in a full-screen session.
 
PROG_WINDOWABLEVIO  Program runs in a VIO window.
 
PROG_PM             Program is a Presentation Manager application.
 
PROG_REAL           Program is a real-mode (DOS) application.
 
PROG_DLL            Program is a dynamic-link module.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
the following:
 
    PMERR_DOS_ERROR
 
Comments
 
The PrfQueryProgramCategory function first calls the DosQAppType function.
If the program type cannot be determined from this call, the profile
specified by the hini parameter is searched.
 
Because this function calls DosQAppType, the program type returned may not
be the same type the user specified for the program in Desktop Manager.
 
See Also
 
DosQAppType, PrfQueryDefinition