Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Invalidate window...

Invalidate window...

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Neha
    wrote on last edited by
    #1

    Hi, Is there any way to Invalidate the window without using Invalidate() or RedrawWindow(..RDW_INVALIDATE )?

    C P 2 Replies Last reply
    0
    • N Neha

      Hi, Is there any way to Invalidate the window without using Invalidate() or RedrawWindow(..RDW_INVALIDATE )?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Why do you need another way ? Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

      N 1 Reply Last reply
      0
      • C Christian Graus

        Why do you need another way ? Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

        N Offline
        N Offline
        Neha
        wrote on last edited by
        #3

        I want to send WM_ERASEBKGND message to the control.

        R P 2 Replies Last reply
        0
        • N Neha

          I want to send WM_ERASEBKGND message to the control.

          R Offline
          R Offline
          Roman Fadeyev
          wrote on last edited by
          #4

          Neha wrote: I want to send WM_ERASEBKGND message to the control. SendMessage(YourHandle, WM_ERASEBKGND, YourHDC,0)???? But for what? It can't give you anything useful. Use InvalidateRect if you want to repaint certain rectangle of the window.

          1 Reply Last reply
          0
          • N Neha

            I want to send WM_ERASEBKGND message to the control.

            P Offline
            P Offline
            Paul M Watt
            wrote on last edited by
            #5

            Use RedrawWindow with the RDW_ERASENOW flag, and if you want a WM_PAINT message to be sent before the function exits use the RDW_UPDATENOW flag as well.


            Build a man a fire, and he will be warm for a day
            Light a man on fire, and he will be warm for the rest of his life!

            1 Reply Last reply
            0
            • N Neha

              Hi, Is there any way to Invalidate the window without using Invalidate() or RedrawWindow(..RDW_INVALIDATE )?

              P Offline
              P Offline
              Paul M Watt
              wrote on last edited by
              #6

              InvalidateRect, InvalidateRgn, UpdateWindow, ValidateRect adn ValidateRgn are all implemented in terms of RedrawWindow with a different combination of flags. Just look at the documentation for all of hte flags for RedrawWindow in order to do the task that you are looking to do. You can force the window to repaint before the function returns, or you can simply queue it to repaint a certain portion. You can force the child windows to repaint as well as the parent windows of your current window. Here is an article that I wrote that goes into detail about RedrawWindow and the update region of a window: Guide To Win32 Paint for Intermediates[^]


              Build a man a fire, and he will be warm for a day
              Light a man on fire, and he will be warm for the rest of his life!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups