CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2005
    Posts
    12

    Problems with drawing.

    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.

  2. #2
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Problems with drawing.

    Quote Originally Posted by HolyNick
    how can i fix this problem?
    Without seeing your code - who knows?
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  3. #3
    Join Date
    Feb 2005
    Posts
    12

    Re: Problems with drawing.

    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();

  4. #4
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Problems with drawing.

    Do you send WM_PAINT message? If yes, do not. use: InvalidateRect, InvalidateRgn or RedrawWindow. See MSDN for details.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  5. #5
    Join Date
    Feb 2005
    Posts
    12

    Re: Problems with drawing.

    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.

  6. #6
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Problems with drawing.

    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.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  7. #7
    Join Date
    Feb 2005
    Posts
    12

    Re: Problems with drawing.

    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

  8. #8
    Join Date
    Oct 2004
    Posts
    38

    Re: Problems with drawing.

    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);
    ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured