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
Solved

Current cursor position of edit control?

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
unable to delete all specified values regedit 38 551
string initialization in java 11 115
ffmpeg - "rtsp://...... Operation not permitted" 4 86
sumHeights  challenge 17 74
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…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

860 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