Solved

RichEdit: EM_POSFROMCHAR for bottom right corner

Posted on 1998-03-17
2
355 Views
Last Modified: 2013-11-19
I need to know the bottom-right coordinates of a character
in a RichEdit control. Actually I calculate it by performing
the following steps:

    1. get the top-left coordinate by an EM_POSFROMCHAR
    2. calculate the character extent by a
       CDC::GetTextExtent() (called using a temporary
       Device Context)
    3. add the values obtained in steps 1 & 2

the main problem of this solution is in step 2: I need to
select the character for get the relative CHARFORMAT struct,
this cause a flickering problem with the selection.

There's someone that have a better idea?

Thank's in advance.
0
Comment
Question by:ciutur
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 400 total points
ID: 1317045
Have you tried turning off the redraw flag for the richedit control while you are calculating the text extent?

  SetRedraw(FALSE);
  // do your stuff
  SetRedraw(TRUE);

Then you won't see a flicker for the selection.


0
 

Author Comment

by:ciutur
ID: 1317046
I gift you my points!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

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 …
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 use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

830 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