GetStockObject
The GetStockObject function retrieves a handle to a specified stock pen, brush, font, or system color bitmap.
Syntax
HGDIOBJ GetStockObject(
int fnObject
);
Parameters
fnObject [in]
The type of stock object to retrieve. This parameter can be one of the following values:
BLACK_BRUSHDKGRAY_BRUSHGRAY_BRUSHHOLLOW_BRUSHLTGRAY_BRUSHNULL_BRUSHWHITE_BRUSHBLACK_PENINVERT_PENNULL_PENWHITE_PENANSI_FIXED_FONTANSI_VAR_FONTDEVICE_DEFAULT_FONTMarlettOEM_FIXED_FONTSYSTEM_FONTSYSTEM_FIXED_FONTDEFAULT_PALETTEGRAY_HALFTONE
Return Value
Return Value
If the function succeeds, the return value is a handle to the specified stock GDI object.
If the function fails, the return value is NULL.
Remarks
Remarks
You do not need to release the handle obtained by calling GetStockObject. The system manages the memory associated with stock objects.
Do not attempt to delete a stock object using DeleteObject. Doing so will cause the system to behave unpredictably.
For a list of possible system colors, see SystemColor constants.
Requirements
Requirements
- Minimum supported client: Windows 2000 Professional
- Minimum supported server: Windows 2000 Server
- Header: wingdi.h
- Library: Gdi32.lib
- DLL: Gdi32.dll