How can I make another application's window transparent?

Posted by Sil on Stack Overflow See other posts from Stack Overflow or by Sil
Published on 2010-02-19T23:54:08Z Indexed on 2010/03/20 21:31 UTC
Read the original article Hit count: 247

Filed under:
|
|

I know how to make my own application transparent using Layered Windows but I want to make a different application transparent (for example notepad). I wrote code like this but it doesn't work with other windows except my app main window:

SetWindowLongPtr(WindowFromPoint(p), GWL_EXSTYLE, 
                 GetWindowLongPtr(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
SetLayeredWindowAttributes(WindowFromPoint(p), 0, (255 * 50) / 100, LWA_ALPHA);

where p is a point on screen ( for example the window I select with my mouse )

I am also interested if there is a way to do this directly from Windows 7 (not necessarily programmatic). I figure there must be a way to do it since every application is rendered in it's own surface and DWM composites them into the final image.

© Stack Overflow or respective owner

Related posts about winapi

Related posts about windows-7