Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>getstockobject()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
GetStockObject()
Get a pre-defined GDI brush, pen, font, or palette
------------------------------------------------------------------------------

Syntax
GetStockObject( <nStockObject> )   -->   hObject

Arguments
<nStockObject> is an integer indicating the pre-defined
object.

Returns
If successful, a handle to the object is returned (a non-zero
integer).  Otherwise, zero (0) is returned.

Description
This function retrieves a handle to one of the pre-defined GDI
(graphics device interface) objects.  These are defined in
WINDOWS.CH using names of the form *_BRUSH, *_PEN, *_FONT and
*_PALETTE.

The handle returned is suitable for use with the drawing
functions supported by GDI, such as Ellipse(), Rectangle(),
and Polygon().

Example
hBlackPen = GetStockObject( BLACK_PEN )
hOldPen = SelectObject( hDC, hBlackPen )
MoveTo( hDC, 100, 100 )
LineTo( hDC, 200, 100 )       // a horizontal black line
SelectObject( hDC, hOldPen )       // restore previous pen


See Also: Ellipse() FrameRect() GetDC() GetObject() Rectangle() SelectObject()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson