I've been playing a lot lately with drag rects. Seems no matter how clean you do them, you always seem to get a few artifacts left here and there on the screen (like on a window that scrolls so the undraw happens at a different place then the draw). A real solution would be to first cover the screen with a transparent window, with a copy of the desktop image on it, do the drag rect on THAT, then delete the window when finished. Poof, no artifacts. But in the meantime, a kinda nice quick fix is to just do:

    invoke InvalidateRect, 0, NULL, TRUE
Sure, it takes a little time, but it's very thorough. ---------------------------------- "Now, son, you donít want to drink beer. Thatís for daddys, and kids with fake I.D.s."
Posted on 2001-03-18 01:21:00 by Ernie
another good choice is the usage of XOR draw mode, which gives the original image after drawing a rect twice. If you keep an eye on painting always the same rect twice, you will get no artefacts. The only problem is drawing a xor rect on a gray area, it will result in a gray rect on gray background :) beaster.
Posted on 2001-03-22 09:42:00 by beaster
So you would think.... that's just what I'm doing. XNOR drawing, same DROP as MS Word uses (someone dissasembled it and published the magic number). The major drawback is it craps out entirely if the one assumption XOR drawing makes isn't met: Nothing else on the desktop changes. Sometimes it does. Bam, artifacts all over the place. ------------------------------- "The only danger in space is if we land on the terrible Planet of the Apes...wait a minute...Statue of Liberty ... that was our planet! You maniacs! You blew it up! Damn you! Damn you all to hell!"
Posted on 2001-03-22 18:15:00 by Ernie