Solved

Current cursor position of edit control?

Posted on 2000-02-19
4
272 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
[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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

691 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