Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
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 
GeneralObjectStreams in .NET Pin
Anonymous22-Sep-03 13:18
Anonymous22-Sep-03 13:18 
GeneralRe: ObjectStreams in .NET Pin
J. Dunlap22-Sep-03 15:38
J. Dunlap22-Sep-03 15:38 
GeneralRe: From MFC to C# Serialization Pin
J. Dunlap22-Sep-03 10:54
J. Dunlap22-Sep-03 10:54 
GeneralBinding on Tab Controls Pin
Wjousts22-Sep-03 9:35
Wjousts22-Sep-03 9:35 
GeneralRe: Binding on Tab Controls Pin
Wjousts23-Sep-03 4:24
Wjousts23-Sep-03 4:24 
GeneralValidating a windows form Pin
Wjousts22-Sep-03 7:44
Wjousts22-Sep-03 7:44 
Generalcall unmanaged ActiveX method from C# Pin
rishikt22-Sep-03 6:16
rishikt22-Sep-03 6:16 
GeneralAccessing datasets on form Pin
phimix22-Sep-03 6:10
phimix22-Sep-03 6:10 
GeneralRe: Accessing datasets on form Pin
Mike Osbahr22-Sep-03 7:26
Mike Osbahr22-Sep-03 7:26 

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.