WinQueryClassInfo: Difference between revisions
Appearance
mNo edit summary |
|||
Line 1: | Line 1: | ||
This function returns window class information. | |||
This function returns window class information. | |||
==Syntax== | ==Syntax== | ||
Line 6: | Line 5: | ||
==Parameters== | ==Parameters== | ||
;hab (HAB) - input | ;hab (HAB) - input:Anchor-block handle. | ||
:Anchor-block handle. | ;PSZClassName (PSZ) - input:Class name. | ||
;PclsiClassInfo (PCLASSINFO) - output:Class information structure. | |||
;PSZClassName (PSZ) - input | |||
:Class name. | |||
;PclsiClassInfo (PCLASSINFO) - output | |||
:Class information structure. | |||
==Returns== | ==Returns== | ||
;rc (BOOL) - returns | ;rc (BOOL) - returns | ||
:Class-exists indicator. | :Class-exists indicator. | ||
:;TRUE | :;TRUE:Class does exist | ||
:;FALSE:Class does not exist. | |||
:;FALSE | |||
==Errors== | ==Errors== | ||
Possible returns from WinGetLastError | Possible returns from WinGetLastError | ||
;PMERR_INVALID_INTEGER_ATOM (0x1016):The specified atom is not a valid integer atom. | |||
;PMERR_INVALID_ATOM_NAME (0x1015):An invalid atom name string was passed. | |||
;PMERR_ATOM_NAME_NOT_FOUND (0x1017):The specified atom name is not in the atom table. | |||
==Remarks== | ==Remarks== | ||
PSZClassName is either an application-specified name (as defined by the WinRegisterClass call) or the name of a preregistered WC_* class; Preregistered class names are of the form #nnnnn, where nnnnn is up to five digits corresponding to the value of the WC_* class name constant. | PSZClassName is either an application-specified name (as defined by the [[WinRegisterClass]] call) or the name of a preregistered WC_* class; Preregistered class names are of the form #nnnnn, where nnnnn is up to five digits corresponding to the value of the WC_* class name constant. | ||
This function provides information that is needed to create a subclass of a given class (see [[WinSubclassWindow]]). | |||
==Example Code== | ==Example Code== | ||
This example obtains a pointer to the window procedure of the window class WC_COMBOBOX. | This example obtains a pointer to the window procedure of the window class WC_COMBOBOX. | ||
Line 53: | Line 43: | ||
pWindowProc = classinfo.pfnWindowProc; | pWindowProc = classinfo.pfnWindowProc; | ||
</pre> | </pre> | ||
Line 78: | Line 66: | ||
* [[WinDestroyWindow]] | * [[WinDestroyWindow]] | ||
* [[WinQueryClassName]] | * [[WinQueryClassName]] | ||
[[Category:Win]] | [[Category:Win]] |
Latest revision as of 14:20, 4 October 2023
This function returns window class information.
Syntax
WinQueryClassInfo(hab, PSZClassName, PclsiClassInfo)
Parameters
- hab (HAB) - input
- Anchor-block handle.
- PSZClassName (PSZ) - input
- Class name.
- PclsiClassInfo (PCLASSINFO) - output
- Class information structure.
Returns
- rc (BOOL) - returns
- Class-exists indicator.
- TRUE
- Class does exist
- FALSE
- Class does not exist.
Errors
Possible returns from WinGetLastError
- PMERR_INVALID_INTEGER_ATOM (0x1016)
- The specified atom is not a valid integer atom.
- PMERR_INVALID_ATOM_NAME (0x1015)
- An invalid atom name string was passed.
- PMERR_ATOM_NAME_NOT_FOUND (0x1017)
- The specified atom name is not in the atom table.
Remarks
PSZClassName is either an application-specified name (as defined by the WinRegisterClass call) or the name of a preregistered WC_* class; Preregistered class names are of the form #nnnnn, where nnnnn is up to five digits corresponding to the value of the WC_* class name constant.
This function provides information that is needed to create a subclass of a given class (see WinSubclassWindow).
Example Code
This example obtains a pointer to the window procedure of the window class WC_COMBOBOX.
#define INCL_WINWINDOWMGR #define INCL_WINENTRYFIELDS #include <OS2.H> HAB hab; CLASSINFO classinfo; PFNWP pWindowProc; WinQueryClassInfo(hab, WC_COMBOBOX, &classinfo); pWindowProc = classinfo.pfnWindowProc;
Definition
#define INCL_WINWINDOWMGR /* Or use INCL_WIN, INCL_PM, */ #include <os2.h> HAB hab; /* Anchor-block handle. */ PSZ PSZClassName; /* Class name. */ PCLASSINFO PclsiClassInfo; /* Class information structure. */ BOOL rc; /* Class-exists indicator. */ rc = WinQueryClassInfo(hab, PSZClassName, PclsiClassInfo);