home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Skins
Popular Skins
Graveyard
Maya
New Installer?
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="chemelli" data-source="post: 633746" data-attributes="member: 25221"><p>Dukus, I think you should also do a call to "SendMessage" to notify the OS that a new font is installed.</p><p>Sample code:</p><p></p><p>[CODE]</p><p>Ret = FontInstall.AddFontResource(FontPath); </p><p>Res = FontInstall.SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0); </p><p>Ret = FontInstall.WriteProfileString("fonts", FontName + " (TrueType)", FontFileName); </p><p>[/CODE]</p><p></p><p>function definition:</p><p></p><p>[CODE]</p><p>[DllImport("kernel32.dll", SetLastError=true)]</p><p>static extern int WriteProfileString( string lpszSection, string lpszKeyName, string lpszString) ; </p><p></p><p>[DllImport("user32.dll")] </p><p>public static extern int SendMessage(int hWnd, // handle to destination window </p><p>uint Msg, // message </p><p>int wParam, // first message parameter </p><p>int lParam // second message parameter </p><p>); </p><p></p><p>[DllImport("gdi32")] </p><p>public static extern int AddFontResource(string lpFileName); </p><p></p><p>[/CODE]</p><p></p><p>Simone</p><p></p><p>EDIT: Const definition:</p><p></p><p>[CODE]</p><p>const int WM_FONTCHANGE = 0x001D; </p><p>const int HWND_BROADCAST = 0xffff; </p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="chemelli, post: 633746, member: 25221"] Dukus, I think you should also do a call to "SendMessage" to notify the OS that a new font is installed. Sample code: [CODE] Ret = FontInstall.AddFontResource(FontPath); Res = FontInstall.SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0); Ret = FontInstall.WriteProfileString("fonts", FontName + " (TrueType)", FontFileName); [/CODE] function definition: [CODE] [DllImport("kernel32.dll", SetLastError=true)] static extern int WriteProfileString( string lpszSection, string lpszKeyName, string lpszString) ; [DllImport("user32.dll")] public static extern int SendMessage(int hWnd, // handle to destination window uint Msg, // message int wParam, // first message parameter int lParam // second message parameter ); [DllImport("gdi32")] public static extern int AddFontResource(string lpFileName); [/CODE] Simone EDIT: Const definition: [CODE] const int WM_FONTCHANGE = 0x001D; const int HWND_BROADCAST = 0xffff; [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Skins
Popular Skins
Graveyard
Maya
New Installer?
Contact us
RSS
Top
Bottom