Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Current cursor position of edit control?

Posted on 2000-02-19
4
Medium Priority
?
280 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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

609 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