By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,899 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,899 IT Pros & Developers. It's quick & easy.

uninstalling a font

P: n/a
2G
Hello everybody,

I'm triyng to uninstall a font but I have some problems doing it. If anyone
would take a look at it, thx in advance.

private void cmdUninstall_Click(object sender, System.EventArgs e){
clsFontFamily f = (clsFontFamily)cboFonts.SelectedItem;
string n = f.Path.Substring(f.Path.LastIndexOf("\\")+1);
int i = RemoveFontResource(iPath + "\\" + n);
SendMessage((System.IntPtr)HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
File.Delete(iPath + "\\" + n);
}

so my problems are .. :) .. after executing :

** my application still says that font is installed, I check this with the
following function

private bool IsInstalled(string name){
InstalledFontCollection iFont = new InstalledFontCollection();
foreach(FontFamily f in iFont.Families){
if(f.Name.Equals(name))
return true;
}
return false;
}

** the font file still exists in the fonts dir but cannot be opened anymore.
My guess is that the font is still in the resource but the file is
deteled because windows can't find the file when I asked for the properties.
Thx again.
Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.