Click here to Skip to main content
13,089,207 members (100,246 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi friends,
Please help me to provide a good solution for this. How to install a font permanently in your system programmatically, using C#. I want the font immediately available in Windows Fonts folder, without system reboot. I googled a lot, but no luck. I found AddFontResource from msdn and tried that, but that also not reflecting properly. Also SendMessage after AddfontResource hangs the system sometimes.
So, currently i opt a COPY function which will copy the font into fonts folder, and later adding the font entry in Regristry executing a batch file.
But, then the font is available from next system logon only.

What i'm missing here.

thanks in advance.
Posted 21-Dec-11 16:50pm
Updated 4-Oct-16 5:34am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Are you tried this??
Lijo Sebastian 22-Dec-11 2:13am
@Rajesh: thanks for your reply. Yes i did an attempt your link. It only works for the current session. If the User reboots the system, the font wont be available. So, what i'm trying to do is get the font in Fonts folder, so that it would persist for ever. I would be glad if you got any further info regarding this. Thanks.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

I achieved same doing this:
XCOPY font file into system fonts folder using cmd prompt.
Adding font entry in registry Fonts folder.

Then my font was immediately available without restarting the machine.
Rate this: bad
Please Sign up or sign in to vote.

Solution 5

Registry keys my ass..

I spend hours searching registry keys fo;
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts", 0, KEY_ALL_ACCESS, &hkey);

Does not exist?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 4 Oct 2016
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100