Solved

Painting/Drawing problems

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 determine file rename from EventLog ? 2 43
notReplace  challenge 53 116
dog bark java program 15 88
Dell Alienware Graphics Amplifier Driver for non-Alienware systems 18 195
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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

864 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

22 Experts available now in Live!

Get 1:1 Help Now