bluefive
asked on
How to show the Add Fonts window
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!
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
Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You will need to copy the font into the font dir, but you don't need CreateScallableFontResourc e. 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.
>>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.
ASKER
Thanks very much!
ASKER
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 CreateSccalableFontResourc
e. Call SendMessage(HWND_BROADCAST
Or am I making things too complicated? Please tell me I do! ;-)