Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install a font without logging off or rebooting a PC?

Tags:

c

windows

fonts

Is there a way or an API to install a font on the PC for every user, without logging off or restarting the PC?

like image 920
kampi Avatar asked Feb 23 '23 23:02

kampi


1 Answers

See the MSDN document, Font Installation and Deletion, for full details. In summary:

  • Copy the font file to the fonts directory (%windir%\fonts).
  • Call AddFontResource() to ensure the font is immediately available.
  • Broadcast the WM_FONTCHANGE message.

Thanks to @Alex K for cleaning this up and adding the fine detail.

like image 187
David Heffernan Avatar answered Feb 26 '23 11:02

David Heffernan