   how to get the pixel length of a leter (GetGlyphData)
  I've tried using GetGlyphData() but the X value of the returned rectangle is trash.I've searched more, the glyph parameter is not the ascii leter code as I thought[Edited by - Calin on February 4, 2008 11:00:35 AM]
Quote:Original post by CalinI've tried using GetGlyphData() but the X value of the returned rectangle is trash.I've searched more, the glyph parameter is not the ascii leter code as I thoughtCorrect, it's the Glyph ID, not the ASCII code.Why do you want the blackbox size for one letter? Why not use DrawText with the DT_CALCRECT flag?   ;Quote:Original post by Evil SteveQuote:Original post by CalinI've tried using GetGlyphData() but the X value of the returned rectangle is trash.I've searched more, the glyph parameter is not the ascii leter code as I thoughtWhy do you want the blackbox size for one letter? Why not use DrawText with the DT_CALCRECT flag?I didn't knew you can format the text using flags in DrawText. It will work for placing the text at the middle of the button however I am also trying to place the blinking cursor inside a textbox at the right location.   