Windows Repaint Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • drexlin
    New Member
    • Apr 2007
    • 8

    Windows Repaint Problem

    Hi,
    I hope this is the correct place to post questions about visual c++ 6.0. If not, sorry.

    Anyway, the program I am working on takes messages from another computer and prints them on the screen. So, whenever a new message comes in, all the previous ones move up and the new one gets added to the bottom. Now, if the operator is scrolling up to see some previous messages, and a new one comes in, we need to let the operator know. Therefore, another smaller box pops up at the top with the message. The message still needs to be added to the bottom of the screen, but we don't want it to move while the operator is still looking at the older messages. To resolve this issue, we disabled the repaint when the other (smaller) box is present. Everything up until this point works fine.

    Here is the issue. If another window is open on top of my program, then a repaint message gets sent to it by Windows, because of the other window. Therefore, we end up with a half refreshed screen and the lines of text will not line up.

    This must be a common problem, but I can't seem to find an answer anywhere. Does anybody have any suggestions?

    Any and all help is very much appreciated!

    Thanks!
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    The smaller box should add the message to the bottom of the larger box on exit.

    You should be able to invalidate and repaint at that time.

    Comment

    • drexlin
      New Member
      • Apr 2007
      • 8

      #3
      The problem is that Windows is forcing the refresh when the new window pops up. So if we don't refresh the screen, then when the window is moved, we will see white.

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        In that case is your smaller box coded "always on top" ?

        Comment

        • drexlin
          New Member
          • Apr 2007
          • 8

          #5
          Yes, it is.

          Thanks for helping!

          Comment

          Working...