CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: UpdateWindow()

  1. #1
    Join Date
    May 1999
    Location
    Sweden
    Posts
    55

    UpdateWindow()

    Hi,

    I´m having a little problem to redraw my created window. So if anyone could give me a hint on how to use UpdateWindow() or RedrawWindow(), I would be very happy.Also I´m trying to draw this window on a round area, should it work the way I figured or? Included is my constructor:

    CMainFrame::CMainFrame()
    {
    CRect r;
    r.SetRect(100,100,200,200);
    CRgn m_wndRgn;
    Create(NULL, "Simple MFC App",
    WS_POPUP,
    r, NULL, NULL, 0, NULL );
    GetWindowRect(r);
    m_wndRgn.CreateEllipticRgn (r.left,r.top,
    r.Width(),r.Height());
    SetWindowRgn(m_wndRgn,TRUE);
    ModifyStyle(0, WS_SYSMENU, 0);
    ModifyStyleEx (WS_EX_CLIENTEDGE, 0, 0);
    m_bMouseDown = FALSE;
    UpdateWindow(); // ?? doesn´t work, why?


    }


  2. #2
    Join Date
    May 1999
    Location
    Toulouse, France
    Posts
    171

    Re: UpdateWindow()

    It doesn't work because no part of your window is invalidated. UpdateWindow launches the process of drawing. RedrawWindow invalidates a zone and launches drawing (with default flags RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE).
    You should define an elliptical CRgn, invalidate it and after call UpdateWindow().

    HTH.

    K.

    Ash to ash and clay to clay, if the enemy doesn't get you, your own folk may.
    We're talking ****, 'cause life is a 'biz
    You know it is
    Everybody tryin' to get rich
    God ****!
    All I wanna do is live !

    KoRn, Children of the Korn

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