IFont::ReleaseHfont method (ocidl.h)

Notifies the font object that the caller that previously locked this font in the cache with IFont::AddRefHfont no longer requires the lock.

Syntax

HRESULT ReleaseHfont(
  [in] HFONT hFont
);

Parameters

[in] hFont

A font handle previously realized through IFont::get_hFont. This value was passed to a previous call to IFont::AddRefHfont to lock the font, and the caller would now like to unlock the font in the cache.

Return value

The method supports the standard return values E_UNEXPECTED and E_INVALIDARG, as well as the following values.

Return code Description
S_OK
The font was unlocked successfully.
S_FALSE
The font was not locked in the cache. This return value is a benign notification to the caller that it may have a font reference counting problem.

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 ocidl.h

See also

IFont

IFont::AddRefHfont