SelectFont macro (windowsx.h)

The SelectFont macro selects a font object into the specified device context (DC). The new font object replaces the previous font object.

Syntax

void SelectFont(
   hdc,
   hfont
);

Parameters

hdc

A handle to the DC.

hfont

A handle to the font object to be selected. The font object must have been created using either CreateFont or CreateFontIndirect.

Return value

None

Remarks

After an application has finished drawing with the new font object, it should always replace a new font object with the original font object.

The SelectFont macro is equivalent to calling SelectObject as follows:


((HFONT) SelectObject((hdc), (HGDIOBJ)(HFONT)(hfont)))

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header windowsx.h

See also

DeleteFont

SelectObject