RemoveFontResource

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

BOOL RemoveFontResource(
  LPCTSTR lpFileName   // pointer to font-resource filename
);
 

Parameters

lpFileName
Pointer to a null-terminated string that names a font resource file.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Windows NT: To get extended error information, call GetLastError.

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.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in wingdi.h.
  Import Library: Use gdi32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Fonts and Text Overview, Font and Text Functions, AddFontResource, SendMessage