Current version

v1.10.4 (stable)

Navigation

Main page
Archived news
Downloads
Documentation
   Capture
   Compiling
   Processing
   Crashes
Features
Filters
Plugin SDK
Knowledge base
Contact info
 
Other projects
   Altirra

Archives

Blog Archive

Abusing a composited desktop

Here's a stupid Windows trick to abuse the Desktop Window Manager.

Basically, the idea is to try to get a translucent window that doesn't have a hit testing area, i.e. it's invisible to the mouse. This creates an overlay on screen that displays something but doesn't occupy space on screen. Traditionally, support in Windows hasn't been very good for this, because the only way to get translucency was to use a layered window -- which interacted very badly with Direct3D rendering in XP -- and because WS_EX_TRANSPARENT worked poorly or not at all across threads. In Windows 7 with the DWM, however:

translucent video player

...you get a translucent no-hit window that actually works. No more having to fish the VS2005's Find and Replace window out from under the video player.

There isn't an easy way to do this without code, but if you're curious, here's a tiny command line program to toggle this on a running instance Media Player Classic - Home Cinema: transplayer.zip. I haven't tried it with the original MPC but it might work if the window class is the same. Again, you need at least Windows Vista for this, as it's highly likely not to work at all on XP. Also, you may have to turn off VSync tracking on the renderer as I think that reacted badly once the window became layered.

I haven't done any real testing on this, and if you rely on it in production software you'll probably get lampooned on The Old New Thing about five years from now, but it's neat when it works.

Comments

This blog was originally open for comments when this entry was first posted, but was later closed and then removed due to spam and after a migration away from the original blog software. Unfortunately, it would have been a lot of work to reformat the comments to republish them. The author thanks everyone who posted comments and added to the discussion.