Click here to Skip to main content
15,911,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRegisterHotKey function Pin
zephyr1232-Feb-04 15:05
susszephyr1232-Feb-04 15:05 
GeneralRe: RegisterHotKey function Pin
valikac2-Feb-04 17:37
valikac2-Feb-04 17:37 
GeneralRe: RegisterHotKey function Pin
Zephy1232-Feb-04 20:37
sussZephy1232-Feb-04 20:37 
Generaldavidlee108 Pin
davidlee1082-Feb-04 14:59
sussdavidlee1082-Feb-04 14:59 
GeneralOpenFile > Cancel - Problem Pin
TiberiusvP2-Feb-04 14:32
TiberiusvP2-Feb-04 14:32 
GeneralRe: OpenFile > Cancel - Problem Pin
Roger Allen3-Feb-04 2:59
Roger Allen3-Feb-04 2:59 
GeneralRe: OpenFile > Cancel - Problem Pin
TiberiusvP3-Feb-04 3:44
TiberiusvP3-Feb-04 3:44 
GeneralGoing Crazy (How to Install a Font) Pin
netx20032-Feb-04 13:18
netx20032-Feb-04 13:18 
Hello,

I am writing an small setup program and I need to install some fonts. I had look in MSDN and in many other places, but I can’t find the solution. AddFontResource works but only on the current session after a reboot the font is gone. I also tried CreateScalableFontResource with AddFontResource but I can’t get it to work. I copy the ttf font file to the windows fonts folder and it does not work. Here is a sample function:

//sFontFileName = Is the name of the font file Ex: arial.ttf will be arial<br />
//sFontLocation  =  Is the current location of the ttf file Ex: D:\setup\fonts\<br />
//GetWindowsFolder() = return the windows folder Ex:  c:\windows\<br />
void InstallFont(CString sFontFileName, CString sFontLocation){<br />
<br />
	CString sFontResource(GetWindowsFolder() + sFontFileName + ".fot");<br />
	CString sWinFonts(GetWindowsFolder() + "Fonts\\" + sFontFileName + ".ttf");<br />
<br />
	::CopyFile(sFontLocation + sFontFileName + ".ttf", sWinFonts, TRUE);<br />
<br />
	CreateScalableFontResource(0, sFontResource, sWinFonts, NULL);<br />
	AddFontResource( sFontFileName + ".fot" );<br />
}


If you have any ideas please help. An example will be perfect. Thanks.
GeneralRe: Going Crazy (How to Install a Font) Pin
Anonymous2-Feb-04 15:20
Anonymous2-Feb-04 15:20 
GeneralRe: Going Crazy (How to Install a Font) Pin
Roger Allen3-Feb-04 3:02
Roger Allen3-Feb-04 3:02 
GeneralISDN USB modem detection Pin
Tadej Zgur2-Feb-04 11:52
Tadej Zgur2-Feb-04 11:52 
QuestionWhat is a good PDF Viewer control? Pin
Alex Korchemniy2-Feb-04 11:04
Alex Korchemniy2-Feb-04 11:04 
Generalcustomize CFileDialog for dynamic Files of Type Pin
sysop@HAL9K.com2-Feb-04 11:00
sysop@HAL9K.com2-Feb-04 11:00 
QuestionCImage and atlimage.h? Pin
__Cerb2-Feb-04 10:52
__Cerb2-Feb-04 10:52 
AnswerRe: CImage and atlimage.h? Pin
Michael Dunn2-Feb-04 11:42
sitebuilderMichael Dunn2-Feb-04 11:42 
GeneralService stops when LOG OFF from the system Pin
cchauhan2-Feb-04 10:38
cchauhan2-Feb-04 10:38 
GeneralRe: Service stops when LOG OFF from the system Pin
Prakash Nadar2-Feb-04 17:17
Prakash Nadar2-Feb-04 17:17 
GeneralRe: Service stops when LOG OFF from the system Pin
Anonymous3-Feb-04 6:11
Anonymous3-Feb-04 6:11 
GeneralRe: Service stops when LOG OFF from the system Pin
Prakash Nadar3-Feb-04 15:57
Prakash Nadar3-Feb-04 15:57 
GeneralAbout TrackMouseEvent function Pin
Cael2-Feb-04 10:22
Cael2-Feb-04 10:22 
GeneralRe: About TrackMouseEvent function Pin
sps-itsec462-Feb-04 10:58
sps-itsec462-Feb-04 10:58 
Generalboost makes min/max ambiguous Pin
peterchen2-Feb-04 9:29
peterchen2-Feb-04 9:29 
GeneralRe: boost makes min/max ambiguous Pin
Joaquín M López Muñoz2-Feb-04 9:45
Joaquín M López Muñoz2-Feb-04 9:45 
GeneralExtracting stuff from a Word doc... Pin
Nitron2-Feb-04 8:24
Nitron2-Feb-04 8:24 
GeneralRe: Extracting stuff from a Word doc... Pin
Steve S3-Feb-04 2:13
Steve S3-Feb-04 2:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.