Solved

Current cursor position of edit control?

Posted on 2000-02-19
4
261 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 20 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
configuration management 2 100
matchUp  challenge 6 48
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 50
Making an alias 7 54
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
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.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now