Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to get session of a process ? Pin
n4_t15-Sep-04 17:37
n4_t15-Sep-04 17:37 
AnswerRe: How to get session of a process ? Pin
Blake Miller7-Sep-04 13:51
Blake Miller7-Sep-04 13:51 
GeneralRe: How to get session of a process ? Pin
n4_t114-Sep-04 19:44
n4_t114-Sep-04 19:44 
QuestionMouse Hover? Pin
Timothy Grabrian5-Sep-04 17:33
professionalTimothy Grabrian5-Sep-04 17:33 
AnswerRe: Mouse Hover? Pin
Ryan Binns5-Sep-04 18:16
Ryan Binns5-Sep-04 18:16 
AnswerRe: Mouse Hover? Pin
Michael Dunn5-Sep-04 20:21
sitebuilderMichael Dunn5-Sep-04 20:21 
GeneralFont Embedding Pin
dArK cHAriSmA5-Sep-04 16:40
dArK cHAriSmA5-Sep-04 16:40 
GeneralRe: Font Embedding Pin
Chris Hills11-Sep-04 13:50
Chris Hills11-Sep-04 13:50 
I did this for an MFC application recently. I guess it’ll be similar with Borland.

I created a custom resource, gave it a name, and associated it with the .TTF file. Then when I built the .exe file, I found the byte sequence for the .TTF file inside. So that’s the first step – getting the .TTF file into the .exe file.

The second step is to get the byte sequence at run time. Call ::FindResource(), then ::LoadResource(), then ::LockResource(), then ::SizeofResource().

The third step is to tell Windows to use the byte sequence as a TrueType font. I haven’t found a good way of doing this. I don’t know if there is a good way. The method I use uses two indirections. Having found the byte sequence, write it out to a temporary file, then read in the file using ::AddFontResource(). Then call ::CreateFontIndirect(&lf), having set lf.lfFaceName to the name of your font, and hope that Windows chooses to use your font.

Then call ::FreeResource() (I’m not sure if this is necessary, but some of the MSDN samples do it). And before your program ends, call ::RemoveFontResource(), otherwise your font will probably be in the system for ever more.

HTH,
Chris.
QuestionHow do you Get/Set comments from files? Pin
kusanagi20005-Sep-04 16:31
kusanagi20005-Sep-04 16:31 
AnswerRe: How do you Get/Set comments from files? Pin
Timothy Grabrian5-Sep-04 17:40
professionalTimothy Grabrian5-Sep-04 17:40 
AnswerRe: How do you Get/Set comments from files? Pin
Ryan Binns5-Sep-04 18:19
Ryan Binns5-Sep-04 18:19 
GeneralManipulation of Bitmap Pixels using Win32 APIs Pin
essra5-Sep-04 13:49
essra5-Sep-04 13:49 
GeneralRe: Manipulation of Bitmap Pixels using Win32 APIs Pin
Christian Graus5-Sep-04 15:36
protectorChristian Graus5-Sep-04 15:36 
GeneralRe: Manipulation of Bitmap Pixels using Win32 APIs Pin
essra6-Sep-04 0:49
essra6-Sep-04 0:49 
GeneralRe: Manipulation of Bitmap Pixels using Win32 APIs Pin
Christian Graus6-Sep-04 10:39
protectorChristian Graus6-Sep-04 10:39 
Generalincoming connection with ras api Pin
mark1825-Sep-04 13:27
mark1825-Sep-04 13:27 
GeneralRe: incoming connection with ras api Pin
harish n v21-Jul-10 20:39
harish n v21-Jul-10 20:39 
GeneralWriting Plug In For MS Outlook Pin
Robert Palma Jr.5-Sep-04 10:39
Robert Palma Jr.5-Sep-04 10:39 
Generalslider bar Pin
Anonymous5-Sep-04 9:31
Anonymous5-Sep-04 9:31 
GeneralRe: slider bar Pin
PJ Arends5-Sep-04 9:48
professionalPJ Arends5-Sep-04 9:48 
GeneralRe: slider bar Pin
Gary R. Wheeler5-Sep-04 9:57
Gary R. Wheeler5-Sep-04 9:57 
QuestionHow to freeze a process Pin
gamitech5-Sep-04 9:22
gamitech5-Sep-04 9:22 
AnswerRe: How to freeze a process Pin
Gary R. Wheeler5-Sep-04 10:04
Gary R. Wheeler5-Sep-04 10:04 
GeneralRe: How to freeze a process Pin
Neville Franks5-Sep-04 10:46
Neville Franks5-Sep-04 10:46 
GeneralRe: How to freeze a process Pin
Gary R. Wheeler5-Sep-04 14:42
Gary R. Wheeler5-Sep-04 14:42 

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.