Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function returns the currently selected object of the specified type.

Syntax

HGDIOBJ GetCurrentObject(
  HDC 
hdc, 
  UINT 
uObjectType
); 

Parameters

hdc

[in] Handle to the device context.

uObjectType

[in] Specifies the object type to be queried.

It is one of the following values.

Value Description

OBJ_PEN

Returns the current selected pen.

OBJ_BRUSH

Returns the current selected brush.

OBJ_PAL

Returns the current selected palette. Windows CE 1.0 and 1.01 do not support this value.

OBJ_FONT

Returns the current selected font.

OBJ_BITMAP

Returns the current selected bitmap.

Return Value

The handle of the specified object indicates success.

NULL indicates failure.

To get extended error information, call GetLastError.

Remarks

An application can use the GetCurrentObjectand GetObjectfunctions to retrieve descriptions of the graphic objects currently selected into the given device context.

Requirements

Header windows.h
Library coredll.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also