2
2G
Hi everybody
I think i'm doing something wrong .
When I install a new font, all my programs (like photoshop) that are running
don't respond anymore for like 2 min, after that I can use the font whitout
restarting the applications but I can not delete the font untill i reboot my
pc (i tried killing all processes but that didn't work).
If anyone would take a look , I do the following :
[DllImport("user32.dll", CharSet=CharSet.Auto)] static extern IntPtr
SendMessage(IntPtr hwnd, int msg, int wParam, int lParam);
private const int HWND_BROADCAST = 0xffff;
private const int WM_FONTCHANGE = 0x001D;
private void cmdInstall_Click(object sender, System.EventArgs e){
clsFontFamily f = (clsFontFamily)cboFonts.SelectedItem;
string n = f.Path.Substring(f.Path.LastIndexOf("\\")+1);
File.Copy(f.Path, iPath + "\\" + n, false);
SendMessage((System.IntPtr)HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
int i = AddFontResource(iPath + "\\" + n);
}
Thx in advance.
I think i'm doing something wrong .

When I install a new font, all my programs (like photoshop) that are running
don't respond anymore for like 2 min, after that I can use the font whitout
restarting the applications but I can not delete the font untill i reboot my
pc (i tried killing all processes but that didn't work).
If anyone would take a look , I do the following :
[DllImport("user32.dll", CharSet=CharSet.Auto)] static extern IntPtr
SendMessage(IntPtr hwnd, int msg, int wParam, int lParam);
private const int HWND_BROADCAST = 0xffff;
private const int WM_FONTCHANGE = 0x001D;
private void cmdInstall_Click(object sender, System.EventArgs e){
clsFontFamily f = (clsFontFamily)cboFonts.SelectedItem;
string n = f.Path.Substring(f.Path.LastIndexOf("\\")+1);
File.Copy(f.Path, iPath + "\\" + n, false);
SendMessage((System.IntPtr)HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
int i = AddFontResource(iPath + "\\" + n);
}
Thx in advance.