Solved

Painting/Drawing problems

Posted on 1998-03-23
3
501 Views
Last Modified: 2013-11-19
I don't really know the difference between what WM_PAINT does and what WM_DRAW does, and this is
causing some trouble. I have an application with a CEditView and I have a string of text that I am trying to
print to it. I would like the screen to be cleared before I print a new string. I tried to do this by using
GetEditCtrl().SetWindowText (NULL), but the text disappears immediately after printing. I  am using GetEditCtrl().SetSel and ReplaceSel to print the text. I think this has something to do with the window painting,
 but i don't know how to stop this.

I think this probably has an easy answer. If it turns out not to, I will offer more points.
0
Comment
Question by:horn
[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
3 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 50 total points
ID: 1317162
It's a very easy answer: the difference between WM_PAINT and WM_DRAW is that WM_PAINT exists while there's no such thing as WM_DRAW.

Calling SetWindowText(NULL) will clear the window of all text.  If you want to erase all of what's in the control, just call SetWindowText() with the text you want to place in the control. The text you place in there will erase what used to be there.

If you use SetSel() and ReplaceSel(), you can have more control over what happens to the text that's already in the control--you can add to the beginning or add to the end, for example.

.B ekiM
0
 

Author Comment

by:horn
ID: 1317163
OK, I didn't know about the non-existence of WM_DRAW. No wonder I couldn't find it
anywhere in the docs. FYI I *have* tried reading the online documentation -- but a lot of
it is non-intuitive, and pretty disorganized. I guess I should go buy Petzold or something.

Thanks.
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1317164
If you use the very fine full-text search commands and turn up nothing, you can be certain it doesn't exist.

.B ekiM

0

Featured Post

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 146
notReplace  challenge 53 153
ffmpeg - "rtsp://...... Operation not permitted" 4 92
firstChar challenge 13 148
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ā€¦
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.

734 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