Click here to Skip to main content
15,905,504 members
Home / Discussions / C#
   

C#

 
GeneralRe: Theoretical Question on object creation Pin
Blake Coverett22-Sep-03 23:32
Blake Coverett22-Sep-03 23:32 
GeneralRe: Theoretical Question on object creation Pin
Blake Coverett22-Sep-03 23:30
Blake Coverett22-Sep-03 23:30 
QuestionHow do i convert an image to cursor? Pin
Gywox22-Sep-03 23:05
Gywox22-Sep-03 23:05 
GeneralChange User Windows Rights Pin
marsiglia22-Sep-03 22:54
marsiglia22-Sep-03 22:54 
GeneralRe: Change User Windows Rights Pin
shaunAustin22-Sep-03 23:22
shaunAustin22-Sep-03 23:22 
GeneralQuick boolean question: DataGrids.DataSource: multi datatables Pin
troels_sorensen22-Sep-03 22:44
troels_sorensen22-Sep-03 22:44 
Generalencode a path to binary and store to database Pin
M_|222-Sep-03 22:03
M_|222-Sep-03 22:03 
GeneralRe: encode a path to binary and store to database Pin
shaunAustin22-Sep-03 23:28
shaunAustin22-Sep-03 23:28 
GeneralDLL CAll Pin
anees8122-Sep-03 20:56
anees8122-Sep-03 20:56 
Questionhow to use c# to sned message to a mobile phone Pin
Jim Chan22-Sep-03 20:20
Jim Chan22-Sep-03 20:20 
GeneralIntegral Number of Lines in RichTextBox Pin
Andrew Shapira22-Sep-03 18:08
Andrew Shapira22-Sep-03 18:08 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Blake Coverett22-Sep-03 22:14
Blake Coverett22-Sep-03 22:14 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Andrew Shapira22-Sep-03 22:26
Andrew Shapira22-Sep-03 22:26 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Blake Coverett22-Sep-03 23:09
Blake Coverett22-Sep-03 23:09 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Blake Coverett22-Sep-03 23:20
Blake Coverett22-Sep-03 23:20 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Andrew Shapira23-Sep-03 0:06
Andrew Shapira23-Sep-03 0:06 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Blake Coverett23-Sep-03 5:58
Blake Coverett23-Sep-03 5:58 
It's just a cached copy of the tmHeight height value from the TEXTMETRIC for the currently selected font. Here's the relevent bit out of the middle of an EnumFontFamilies callback:

HDC hdc = GetDC(NULL)
LOGFONT lf = pelf->elfLogFont;
lf.lfHeight = -MulDiv(pParam->pCon->m_nPointSize,
    GetDeviceCaps(hdc, LOGPIXELSY), 72),
lf.lfWidth = 0;
HFONT hf = CreateFontIndirect(&lf);

TEXTMETRIC tm;
HFONT hfOld = (HFONT)SelectObject(hdc, hf);
GetTextMetrics(hdc, &tm);
SelectObject(hdc, hfOld);
ReleaseDC(NULL, hdc);

SendMessage(pParam->pCon->m_hOutput, WM_SETFONT, WPARAM(hf), 0);
SendMessage(pParam->pCon->m_hInput, WM_SETFONT, WPARAM(hf), 0);
DeleteObject(hf);

pParam->pCon->m_nCharWidth = tm.tmAveCharWidth;
pParam->pCon->m_nCharHeight = tm.tmHeight;


--
-Blake (com/bcdev/blake)
GeneralRe: Integral Number of Lines in RichTextBox Pin
Andrew Shapira23-Sep-03 9:12
Andrew Shapira23-Sep-03 9:12 
GeneralRe: Integral Number of Lines in RichTextBox Pin
Andrew Shapira23-Sep-03 0:01
Andrew Shapira23-Sep-03 0:01 
Generalnewbie trying to Pinvoke Pin
jpervaz22-Sep-03 17:33
jpervaz22-Sep-03 17:33 
GeneralRe: newbie trying to Pinvoke Pin
Blake Coverett22-Sep-03 17:51
Blake Coverett22-Sep-03 17:51 
GeneralRe: newbie trying to Pinvoke Pin
jpervaz23-Sep-03 3:40
jpervaz23-Sep-03 3:40 
GeneralRe: newbie trying to Pinvoke Pin
Blake Coverett23-Sep-03 6:10
Blake Coverett23-Sep-03 6:10 
Generalbuilding a canned email sender Pin
frank2122-Sep-03 14:05
frank2122-Sep-03 14:05 
GeneralRe: building a canned email sender Pin
fadee22-Sep-03 20:43
fadee22-Sep-03 20:43 

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.