Solved

RichEdit: EM_POSFROMCHAR for bottom right corner

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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 demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now