CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 1999
    Posts
    2

    Font instalation !!!

    I want so that my programm can install(uninstall) new font in Windows. How I can do it?





  2. #2
    Join Date
    Jun 1999
    Posts
    315

    Re: Font instalation !!!

    i'm under the impression that you can just copy it to the fonts directory (which is listed in the shell as a special folder) and all should be well...correct me if i'm wrong.

    miked

  3. #3
    Join Date
    Apr 1999
    Posts
    396

    Re: Font instalation !!!

    Once the copy is complete, make a call to AddFontResource. It doesn't have to be in the fonts folder for that call to work though


  4. #4
    Join Date
    Jun 1999
    Posts
    315

    Re: Font instalation !!!

    slight problem with that function -- quoting the MSDN:

    This function installs the font only for the current session. When the system reboots, the font will not be present. To have the font installed even after rebooting the system, the font must be listed in the registry.

    miked

  5. #5
    Join Date
    Apr 1999
    Posts
    396

    Re: Font instalation !!!

    I have Jan 99 edition of MSDN and I don't see that. While it's true that AddFontResource only lasts for a session, the font must be in the FONTS directory for it to be loaded at startup, not the registry.


  6. #6
    Join Date
    Jun 1999
    Posts
    315

    Re: Font instalation !!!

    the MSDN i got that out of was the April 99 version...don't know if things have changed or not.

    miked

  7. #7
    Join Date
    Jun 1999
    Location
    Pune, Maharastra, India
    Posts
    59

    Re: Font instalation !!!

    Well the font file has to be in windows\fonts directory if the font has to be permanently installed on the system .I just tried it out and it does not stay if the font was outside this directory. But how do i tell the applications running about the change in the font



  8. #8
    Join Date
    Apr 1999
    Posts
    396

    Re: Font instalation !!!

    From MSDN -
    Any application that adds or removes fonts from the system font table should notify other windows of the change by sending a WM_FONTCHANGE message to all top-level windows in the operating system. The application should send this message by calling the SendMessage function and setting the hwnd parameter to HWND_BROADCAST.

    When an application no longer needs a font resource that it loaded by calling the AddFontResource function, it must remove that resource by calling the RemoveFontResource function.




  9. #9
    Join Date
    Jun 1999
    Location
    Pune, Maharastra, India
    Posts
    59

    Re: Font instalation !!!

    WELL the font has to be in the windows\fonts directory if it has to work ie stay permanent or the font gets uninstalled once windows is shut down ,i just tried it out .How to inform the other progs running of the font change .
    The prev reply was to the wrong message sorry for the double replies


  10. #10
    Join Date
    Jun 1999
    Posts
    315

    Re: Font instalation !!!

    according to the msdn this is how you notify the other windows:

    Any application that adds or removes fonts from the system font table should notify other windows of the change by sending a WM_FONTCHANGE message to all top-level windows in the operating system. The application should send this message by calling the SendMessage function and setting the hwnd parameter to HWND_BROADCAST.

    miked

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured