I'd like to avoid hooking into DirectX, and just run a shader over the entire screen. Is this something I can do in Windows without draining an unreasonable amount of resources?

I can use whatever language or tool is most practical for this, but I'm most comfortable with Java and HLSL.

  • \$\begingroup\$ This would involve drawing over every open window, which isn't the way windows works. Never seen this done. I doubt it'd be possible, but you never know. \$\endgroup\$ – Ben Nov 5 '14 at 1:47
  • \$\begingroup\$ Darn. Would it be more viable to intercept a DirectX game before it gets sent to the monitor? \$\endgroup\$ – Matthew G. Nov 5 '14 at 1:48
  • \$\begingroup\$ You probably wouldn't be able to from outside of the program. I'm fairly sure windows doesn't give access to the final screen buffer at all. \$\endgroup\$ – Ben Nov 5 '14 at 1:53
  • \$\begingroup\$ stackoverflow.com/questions/2232727/… \$\endgroup\$ – Ben Nov 5 '14 at 1:54
  • \$\begingroup\$ You might look into how tools like Fraps capture the screen, which may be a good starting point (although, Fraps does it in a kind of messy manner if I recall correctly). \$\endgroup\$ – XNargaHuntress Nov 5 '14 at 13:00

if you are trying to make a screensaver for example, they most usually go with screen capturing one time, then create a fullscreen borderless window and draw over the picture they took. Some games where you "destroy your desktop" with a hammer and it breaks in glass fashion, or other effects, also works like that. Some virus/jokes, also do that.

If you want to apply a global effect that is always going to be there for all the session whatever the application, you would need to write a new window manager (dwm). Try linux first, probably easier. check xpenguins, or xsnow. (though they probably use lots of small windows).


I don't really understand what is it that you're trying to do, but as far as I know, no, you can't do that.

Oversimplifying, each window draws to a different texture, and the Desktop Window Manager (DWM) composes all of those textures into one big full screen texture, which is what you see.

Generally, the DWM composition pipeline is a core part of Windows, and there are no documented ways that I know of to hook into it to mess with the composition. I am pretty certain this part is extremely optimized to run as fast as possible, and allowing people to hook into it would certainly create performance and stability issues.

It may be possible for a specific graphics driver to allow you to hook into the pipeline after composition has finished, but first: I don't know of any driver that would let you do that; and second: any program you make would only work on computers with that specific driver.

Without understanding what is it that you're trying to do, it's very difficult to give you alternate solutions, but if you want to create effects as screensavers do, you could do as v.oddou says: take a screenshot, and apply any modifications you wish to it, and then drawing it full-screen. Obviously, the displayed windows won't be interactive, since you're just showing a modified screenshot.

What is it that you're trying to do?

  • \$\begingroup\$ Specific tweaks for my severely colorblind nephew. He has trouble playing certain games. \$\endgroup\$ – Matthew G. Nov 5 '14 at 23:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.