This has been a problem on my system, where sometimes, but not always, random application windows would leave their shadows on my desktop background which were very persistent, requiring a re-boot to get them to go away. It has been bugging me for years,
and I tried many different things to prevent it, from updating the graphics drivers, to changing screen resolution, color, etc., On my system these only affect the background, never appearing over application windows, so they were a minor annoyance that I
simply ignored until a re-start was required.
Finally, another forum (I apologize for not recording which one; I have looked at so many) offered a suggestion that worked for my system, equipped with Windows 7 64-bit Ultimate, running dual nVidia K5000 graphics cards.
This trick only clears the shadows that occasionally accumulate during normal use, and does not prevent them from re-occurring:
Right-click the desktop, select "Personalize", change the Windows theme to "High Contrast White", and then change the theme back to your favorite.
This worked for me, but your results may be different since a lot of tricks that worked for others didn't work for me; I suppose it has to do with the way Windows, the computer's chipset, and the graphics processors interact.