Click to See Complete Forum and Search --> : Problems with drawing.


HolyNick
February 4th, 2005, 06:28 AM
Hi,all.
I made tab control and status window in my window.WM_PAINT execute one
function- Plot(),that draw graphic.But,when i click on my status window and
tab my window is redrawing and the background is painting upon my status window and tab control for a second. how can i fix this problem?
Thanks.

JohnCz
February 4th, 2005, 07:20 AM
how can i fix this problem? Without seeing your code - who knows?

HolyNick
February 4th, 2005, 07:33 AM
2JohnCz: The feature is that,"he"(windows) treat tab control&status window
as part of client area,and refresh it,when i call WM_PAINT -->draw backgroun upon controls for a second). I think so.If i comment WM_PAINT all is ok.
So,want to know,how to refresh not all client area,for example.
(code is large)

Message is standart WM_PAINT: hdc=BeginPaint(..)
Plot();
EndPaint();

JohnCz
February 4th, 2005, 07:59 AM
Do you send WM_PAINT message? If yes, do not. use: InvalidateRect, InvalidateRgn or RedrawWindow. See MSDN for details.

HolyNick
February 4th, 2005, 09:03 AM
No,i dont send.( i dont use SendMessage() function,if you mean that).
I have function that handling different messages for window (you know of course)
.....
switch(message)
{
.....//different messages (WM_COMMAND etc)

case WM_PAINT:
hdc=BeginPaint(...);
Plot();
EndPaint(...);
break;
}

And (,as i think,) when i click ,windows redraw all client area with my controls,unfortunatly:)

Yes,i thout about this function(InvalidateRect) ,i use it in my program,but i still
did'n find how it can concerned with my problem.i'll try to find.

JohnCz
February 4th, 2005, 09:54 AM
As I have stated, without a code I am not able to help you since there may be gazillion combination of reasons for redrawing. Description you gave is not enough to identify a problem.

Code is the only way to identify a problem because problem is exclusively generated by your code. Zip and post entire project. Do not include debug, release, *.ncb, *.opt, *.plg, *.aps.

HolyNick
February 4th, 2005, 12:27 PM
2JohnCz:
I have no it(porjct) now here,unfortunatly. I'll try to fix it by myself soon.
And if i will not be able to do that,i'll post.
Thank you

rafraf
February 16th, 2005, 05:24 AM
try to use it like this...and tell me if it works (I am also curious), I had a problem like this some time ago and I could solve in this way...I dont know why...if anyone knows please write us.

...
hdc = GetWindowDC(hframe);
BeginPaint(hframe, lp);

...

EndPaint(hframe, lp);
ReleaseDC(hframe, hdc);
...