How to install a font without logging off or rebooting a PC?
Is there a way or an API to install a font on the PC fo开发者_开发问答r every user, without logging off or restarting the PC?
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.
精彩评论