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
Solved

Painting/Drawing problems

Posted on 1998-03-23
3
499 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
  • 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

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 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