?
Solved

Current cursor position of edit control?

Posted on 2000-02-19
4
Medium Priority
?
283 Views
Last Modified: 2013-11-20
Does anyone know how to get the current cursor poisition of a edit control?

thanks all!
0
Comment
Question by:gblxj
  • 3
4 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 60 total points
ID: 2538483
Call CEdit::GetSel(). Here's the prototype:

  void GetSel( int& nStartChar, int& nEndChar ) const;

The call returns the beginning and ending of the selection. If there is no selection (eg, you're just looking at a flashing cursor and nothing is highlighted), then the value returned to nStartChar will equal the value returned in nEndChar.

..B ekiM

0
 
LVL 11

Expert Comment

by:mikeblas
ID: 2538645
Or is it that you want to do this measurement and have the result indicate the position as a column and row number?

If so, see the EDPOS.ZIP sample on my webpage at http://www.nwlink.com/~mikeblas/samples/ .

Note that my webpage will someday move to http://www.mooseboy.com/ .

..B ekiM
0
 

Author Comment

by:gblxj
ID: 2544331
Thank Mike Blaszczak, You home page is very usefull, if I find it a week ago, I would not waste four day's time to find out how to catch a key press in IE tool bar's input control, I'm currently working on a Explore CommBand project, when I put a combobox control on the bar, the band bar eat all RETURN, BACKSPACE and F4 key press. though I have solved all problem by myself, I still greatly appreciate your timely help!
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 2546872
Great; I'm glad you've found it useful.

..B ekiM
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

864 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