?
Solved

How to get cursor position in a CRichEditCtrl

Posted on 2003-11-14
2
Medium Priority
?
918 Views
Last Modified: 2013-11-20
I have a simple editor and I will show the current state of the text at the cursor position (e.g. show the right font and fontsize, set thet state of a bold/us/italic button). When I position the cursor somewhere in the text, I use GetSel to get the position of the cursor. However, this will return the previous position, not the current one? What have I done wrong?
0
Comment
Question by:ble
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
KurtVon earned 500 total points
ID: 9747919
Are you checking teh position in OnLButtonDown, or OnLButtonUp?  It sounds liek you are getting teh position before the cursor has been moved.

Either way, you may want to try the EN_SELCHANGE notification instead.  It passes the new selection information to you.  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/richedit/richeditcontrols/richeditcontrolreference/richeditnotificationmessages/en_selchange.asp

Hope this helps.
0
 

Author Comment

by:ble
ID: 9748281
Yes, that did the trick. Thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question