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

    Forcing windows to repaint.

    Hey,

    I have a few questions about repainting windows (in windows xp/+).
    I would like to FULLY repaint a hidden window / (maybe even partially hidden windows) on command. Does a command exist for this? Windows you minimize for example don't get repainted. And making WM_PAINT trigger will only result in errors. Moving it offscreen will also not make it repaint.

    Does anyone know a workaround this? If its even possible.
    I know it sounds weird but I'm sure its the only way to make it work.


    Thanks already.

    e: Tricking Windows(OS) into thinking the window should be repainted should work too. (This should cause some weird behavior but that doesn't matter to me )
    Last edited by edgebird; February 25th, 2010 at 10:05 AM.

  2. #2
    Join Date
    Dec 2008
    Posts
    144

    Re: Forcing windows to repaint.

    Setting the form's Paint event and using something like:
    Code:
    Graphics g = e.Graphics
    is an option... otherwise you could call Invalidate()- this forces a repaint.

  3. #3
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Forcing windows to repaint.

    Quote Originally Posted by edgebird View Post
    Hey,
    I know it sounds weird but I'm sure its the only way to make it work.
    I wouldn't be so sure. Why don't you tell us what you are actually attempting to accomplish?

  4. #4
    Join Date
    Jun 2001
    Location
    Melbourne/Aus (C# .Net 4.0)
    Posts
    686

    Re: Forcing windows to repaint.

    Moving it offscreen will also not make it repaint
    How on earth did you verify that? Or have I missunderstood?
    Rob
    -
    Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......

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