Microsoft Windows CE 3.0  

SelectObject

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.

This function selects an object into a specified device context. The new object replaces the previous object of the same type.

HGDIOBJ
SelectObject( HDC
hdc
, HGDIOBJ
hgdiobj
);

Parameters

hdc
[in] Handle to the device context.
hgdiobj
[in] Handle to the object to be selected. The specified object must have been created by using one of the following functions.
Object Functions
Bitmap CreateBitmap, CreateCompatibleBitmap, CreateDIBSection

(Bitmaps can be selected for memory device contexts only, and for only one device context at a time.)

Brush CreateDIBPatternBrushPt, CreatePatternBrush, CreateSolidBrush
Font CreateFontIndirect
Pen CreatePen, CreatePenIndirect
Region CombineRgn, CreateRectRgn, CreateRectRgnIndirect

Return Values

If the selected object is not a region, the handle of the object being replaced indicates success. If the selected object is a region, one of the following values indicates success.

Value Description
SIMPLEREGION Region consists of a single rectangle.
COMPLEXREGION Region consists of more than one rectangle.
NULLREGION Region is empty.

NULL indicates that an error occurred and the selected object is not a region. Otherwise, a GDI_ERROR value is returned.

Remarks

This function returns the previously selected object of the specified type. An application should always replace a new object with the original, default object after it has finished drawing with the new object.

An application cannot select a bitmap into more than one device context at a time.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Wingdi.h   Mgbase.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CombineRgn, CreateBitmap, CreateCompatibleBitmap, CreateDIBPatternBrushPt, CreateDIBSection, CreateFontIndirect, CreatePatternBrush, CreatePen, CreatePenIndirect, CreateRectRgn, CreateRectRgnIndirect, CreateSolidBrush, SelectClipRgn