Click here to Skip to main content
15,890,932 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: making a path to a file Pin
David Crow12-Jul-05 8:16
David Crow12-Jul-05 8:16 
GeneralRe: making a path to a file Pin
Maximilien12-Jul-05 8:24
Maximilien12-Jul-05 8:24 
QuestionVisual C++ .NET Standard crippled? Pin
Member 30711412-Jul-05 6:56
Member 30711412-Jul-05 6:56 
AnswerRe: Visual C++ .NET Standard crippled? Pin
Kevin McFarlane12-Jul-05 8:16
Kevin McFarlane12-Jul-05 8:16 
GeneralList box question Pin
Tom Wright12-Jul-05 6:49
Tom Wright12-Jul-05 6:49 
GeneralRe: List box question Pin
RChin12-Jul-05 7:02
RChin12-Jul-05 7:02 
GeneralRe: List box question Pin
Tom Wright12-Jul-05 7:14
Tom Wright12-Jul-05 7:14 
GeneralRe: List box question Pin
Jack Puppy12-Jul-05 7:42
Jack Puppy12-Jul-05 7:42 
You need to use the GetTextExtent function to calculate the width of the string...

<br />
CClientDC dc(this);<br />
<br />
// Select list box font into the dc<br />
CFont* pOldFont = dc.SelectObject(GetFont());<br />
<br />
// Get the text metrics for the font<br />
TEXTMETRIC tm;<br />
dc.GetTextMetrics(&tm);<br />
<br />
...<br />
<br />
// Calculate the horizontal extent of the item (add the width of average character in font for spacing)<br />
nHorizontalExtent = dc.GetTextExtent(strText).cx + tm.tmAveCharWidth;<br />
<br />
... <br />
<br />
// Restore the GDI<br />
dc.SelectObject(pOldFont);<br />



Suspicious | :suss: Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!

Painted on the side of a dog trainer's van: SIT HAPPENS

GeneralGet The Status Of A Thread Pin
yccheok12-Jul-05 6:38
yccheok12-Jul-05 6:38 
GeneralRe: Get The Status Of A Thread Pin
David Crow12-Jul-05 8:19
David Crow12-Jul-05 8:19 
GeneralConvert 24bit bmp to dithered 2bit bmp Pin
Pabs(Sco)12-Jul-05 5:06
Pabs(Sco)12-Jul-05 5:06 
GeneralRe: Convert 24bit bmp to dithered 2bit bmp Pin
Andrew Kirillov12-Jul-05 5:37
Andrew Kirillov12-Jul-05 5:37 
GeneralRe: Convert 24bit bmp to dithered 2bit bmp Pin
Pabs(Sco)12-Jul-05 5:54
Pabs(Sco)12-Jul-05 5:54 
GeneralHELP ME!!!!!! Pin
Member 202519312-Jul-05 4:29
Member 202519312-Jul-05 4:29 
GeneralRe: HELP ME!!!!!! Pin
Jose Lamas Rios12-Jul-05 4:47
Jose Lamas Rios12-Jul-05 4:47 
GeneralRe: HELP ME!!!!!! Pin
toxcct12-Jul-05 6:12
toxcct12-Jul-05 6:12 
GeneralRe: HELP ME!!!!!! Pin
Tom Wright12-Jul-05 6:51
Tom Wright12-Jul-05 6:51 
GeneralRe: HELP ME!!!!!! Pin
Bob Stanneveld12-Jul-05 21:09
Bob Stanneveld12-Jul-05 21:09 
GeneralCapturing mouse events and Cursor Pin
Kharfax12-Jul-05 3:53
Kharfax12-Jul-05 3:53 
GeneralRe: Capturing mouse events and Cursor Pin
Blake Miller12-Jul-05 4:56
Blake Miller12-Jul-05 4:56 
GeneralRe: Capturing mouse events and Cursor Pin
Kharfax12-Jul-05 5:03
Kharfax12-Jul-05 5:03 
GeneralRe: Capturing mouse events and Cursor Pin
Trollslayer12-Jul-05 8:34
mentorTrollslayer12-Jul-05 8:34 
GeneralRe: Capturing mouse events and Cursor Pin
Kharfax12-Jul-05 10:44
Kharfax12-Jul-05 10:44 
GeneralRe: Capturing mouse events and Cursor Pin
Trollslayer12-Jul-05 11:33
mentorTrollslayer12-Jul-05 11:33 
GeneralRe: I found a solution Pin
Kharfax13-Jul-05 4:57
Kharfax13-Jul-05 4:57 

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.