Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Updated 4-Oct-16 5:34am
v2

Are you tried this??
Here[^]
 
Share this answer
 
Comments
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.
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.
 
Share this answer
 
Registry keys my ass..

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


Does not exist?
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900