http://stackoverflow.com/q/31566689/49925

http://stackoverflow.com/q/31566689/49925
http://stackoverflow.com/q/31566689/49925

Comments

  1. I see TOndrej already replied with EM_GETRECT, but also there are messages you can send to examine the margin sizes inside the editor. From memory you can also use DrawText with a flag to emulate edit control text layout to judge exact positioning of text within that rectangle.

    Sorry - in a big hurry, can't look it up to be more precise than the vague answer above, sorry, which is dashed off from memory.  If you need I will have more time for a better reply later.

    ReplyDelete
  2. It's not particularly urgent. I was playing with an edit control + a panel to emulate the cue message without having to enable theming and couldn't figure out how to place the panel inside the edit.

    ReplyDelete
  3. Any success?

    The message I was thinking of is EM_GETMARGINS, plus a set version too.  That lets you adjust the text space inside an edit control in order to place another control over it - buttoned edits work that way. To emulate the cue message, if you want to get text placed exactly where it would be in the edit control's normal drawing, EM_POSFROMCHAR and EM_CHARFROMPOS might be useful too, and the DrawText flag I was thinking of is DT_EDITCONTROL, which is mostly used for multiline edits but I think it can affect the horizontal layout of text too even in a singleline control.  On the other hand I imagine just placing a panel inside the margins and drawing text without worrying about that would work absolutely fine.

    ReplyDelete
  4. No, didn't have the time to play with it today. I'll try it again for sure. Thanks for the pointers.

    ReplyDelete

Post a Comment