This topic has not yet been rated - Rate this topic

RemoveFontResource function

Applies to: desktop apps only

The RemoveFontResource function removes the fonts in the specified file from the system font table.

If the font was added using the AddFontResourceEx function, you must use the RemoveFontResourceEx function.

Syntax

BOOL RemoveFontResource(
  __in  LPCTSTR lpFileName
);

Parameters

lpFileName [in]

A pointer to a null-terminated string that names a font resource file.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

An application that adds or removes fonts from the system font table should notify other windows of the change by sending a WM_FONTCHANGE message to all top-level windows in the system. The application sends this message by calling the SendMessage function with the hwnd parameter set to HWND_BROADCAST.

If there are outstanding references to a font, the associated resource remains loaded until no device context is using it.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

Unicode and ANSI names

RemoveFontResourceW (Unicode) and RemoveFontResourceA (ANSI)

See also

Fonts and Text Overview
Font and Text Functions
AddFontResource
RemoveFontResourceEx
SendMessage

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ