[Win 32 API] GetStockObject Function

The GetStockObject function retrieves a handle to one of the stock pens,brush,fonts, or palettes.

Syntax


HGDIOBJ GetStockObject(
  __in  int fnObject
);

Parameters

The type of stock object. This parameter can be one of the following values.

ValueMeaning

BLACK_BRUSH
Black brush.

DKGRAY_BRUSH
Dark gray brush.

DC_BRUSH
Solid color brush. The default color is white. The color can be changed by using the SetDCBrushColor function. For more information, see the Remarks section.

GRAY_BRUSH
Gray brush.

HOLLOW_BRUSH
Hollow brush (equivalent to NULL_BRUSH).

LTGRAY_BRUSH
Light gray brush.

NULL_BRUSH
Null brush (equivalent to HOLLOW_BRUSH).

WHITE_BRUSH
White brush.

BLACK_PEN
Black pen.

DC_PEN
Solid pen color. The default color is white. The color can be changed by using the SetDCPenColor function. For more information, see the Remarks section.

NULL_PEN
NULL pen. The null pen draws nothing.

WHITE_PEN
White pen.

ANSI_FIXED_FONT
Windows fixed-pitch (monospace) system font.

ANSI_VAR_FONT
Windows variable-pitch (proportional space) system font.

DEVICE_DEFAULT_FONT
Device-dependent font.

DEFAULT_GUI_FONT
Default font for user interface objects such as menus and dialog boxes. It is not recommended that you use DEFAULT_GUI_FONT or SYSTEM_FONT to obtain the font used by dialogs and windows; for more information, see the remarks section.
The default font is Tahoma.

OEM_FIXED_FONT
Original equipment manufacturer (OEM) dependent fixed-pitch (monospace) font.

SYSTEM_FONT
System font. By default, the system uses the system font to draw menus, dialog box controls, and text. It is not recommended that you use DEFAULT_GUI_FONT or SYSTEM_FONT to obtain the font used by dialogs and windows; for more information, see the remarks section.
The default system font is Tahoma.

SYSTEM_FIXED_FONT
Fixed-pitch (monospace) system font. This stock object is provided only for compatibility with 16-bit Windows versions earlier than 3.0.

DEFAULT_PALETTE
Default palette. This palette consists of the static colors in the system palette.

Return Value

If the function succeeds,return a handle to the requested logical obejct.
otherwise, return NULL.




댓글

이 블로그의 인기 게시물

[Win32 API] WINAPI - 함수호출규약

JAVA Frame Icon setting

JAVA Spinner