Solved

RichEdit: EM_POSFROMCHAR for bottom right corner

Posted on 1998-03-17
2
360 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
[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
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

695 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