Jump to content
  • Advertisement
Sign in to follow this  
M-374 LX

[C++/Win32] How to get caret position?

This topic is 3508 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
You need control-specific messages: Use EM_GETSEL to get the selection start and end index, then use EM_LINEFROMCHAR to get which line the start and end are on, then you can use EM_LINEINDEX to get the character at the start of the line to know how far on the line the index is.

I don't know of a way to know whether the caret is at the start or end of the selection, but I believe that for an edit control it is always at the start or end of the selection.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!