Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh the screen

Status
Not open for further replies.

ceodav

Programmer
Feb 21, 2003
106
0
0
IT
Hi,

In my application i have several CEdit to display data. By clicking a button the program updates
all the data inside the CEdit but the values doesn't refresh at all!

The interesting thing is that if switch to another apllication with alt+tab and then i go back to my program all
the data displaying the right value...beside they were refreshed.

Looking with Spy i observed that the message WM_ACTIVATE and WM_CTLCOLORSTATIC were send by the system...
So, how can i send a message to completely redraw the screen at my will?


i hope to be clear...

thanks in advance
Davide
 
You can use InvalidateRect()

the syntax is:

InvalidateRect(hwnd, NULL, TRUE);

That code will refresh the entire area of hwnd. Or you can specify a certain part of the screen to refresh by sending a RECT structure as the second parameter.

Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"
 
Have you tried using
UpdateData(FALSE);
it might help.

Berras
 
ok i will try with invalidateRect...now a stupid question...

how to get the hwnd of a dialog in MFC?
 
I think Berras is more on the right track; it has to be something like that. You're probably doing things not the MFC way.

Greetings,
Rick
 
I didn't reply to Berras because UpdateData(FALSE) is the first thing i tried...

It doesn't work because i'm handling graphic element...i guess
 
You may want to explain a bit more detailed what you're doing, or trying to do. Preferably with some code, because it sounds to me you're doing some strange things. Like for instance: what data exactly gets updated when you click that button, a bound variable, the CEdit itself? Things like that are rather important to know.

And what do you mean by "I'm handling a graphic element"? How are you handling a grapic element with a CEdit?

The problem is very unclear and what you're doing is even more unclear.

Greetings,
Rick
 
sorry for my english...

bit with InvalidateRect the problem is solved!!

thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top