GetCurrentObject function

The GetCurrentObject function retrieves a handle to an object of the specified type that has been selected into the specified device context (DC).

Syntax


HGDIOBJ GetCurrentObject(
  _In_  HDC hdc,
  _In_  UINT uObjectType
);

Parameters

hdc [in]

A handle to the DC.

uObjectType [in]

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

ValueMeaning
OBJ_BITMAP

Returns the current selected bitmap.

OBJ_BRUSH

Returns the current selected brush.

OBJ_COLORSPACE

Returns the current color space.

OBJ_FONT

Returns the current selected font.

OBJ_PAL

Returns the current selected palette.

OBJ_PEN

Returns the current selected pen.

 

Return value

If the function succeeds, the return value is a handle to the specified object.

If the function fails, the return value is NULL.

Remarks

An application can use the GetCurrentObject and GetObject functions to retrieve descriptions of the graphic objects currently selected into the specified DC.

Examples

For an example, see Retrieving Graphic-Object Attributes and Selecting New Graphic Objects.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

See also

Device Contexts Overview
Device Context Functions
DeleteObject
GetObject
SelectObject
CreateColorSpace

 

 

Build date: 6/12/2013

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.