Solved

How to show the Add Fonts window

Posted on 1998-11-07
4
232 Views
Last Modified: 2013-12-02
I would like to know how I can show the 'Add Fonts' window (Control Panel/Fonts/Add Fonts) from my program and if possible at a predifined location (like e:\new fonts)
with the 'Copy fonts to Fonts folder' option ON.

API, Shell, regular or custom code, it doesn't matter.
I'm using VB6-SP1.

Note:
I know I can show the Fonts window from the Control Panel with the Shell command
rundll32.exe shell32.dll,Control_RunDLL main.cpl @3, but I realy need to trigger the 'Add Fonts' window.

Thank you!
0
Comment
Question by:bluefive
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 200 total points
ID: 1443841
You can build one pretty easily by yourself, using DirList and FileList controls, and to actualy install the font, you can use AddFontResource.
If you need more details, just ask.
0
 

Author Comment

by:bluefive
ID: 1443842
Is AddFontResource all I need?
I thought this would make a font available to the system just temporarily...

Don't I have to do something like:
a. Copy the font to the fonts dir
b. Write to the registry
c. Call AddFontResource
d. Call CreateSccalableFontResource
e. Call SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0)

Or am I making things too complicated? Please tell me I do! ;-)


0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1443843
You will need to copy the font into the font dir, but you don't need CreateScallableFontResource. AddFontResource takes every type of fonts:

>>Pointer to a null-terminated character string that contains a valid font file filename. The filename may specify either a .FON font resource file, a .FNT raw bitmap font file, a .TTF raw TrueType file, or a .FOT TrueType resource file.

You will also have to notify with WM_FONTCHANGED, I forgot that part.
0
 

Author Comment

by:bluefive
ID: 1443844
Thanks very much!
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question