Is there a way to make an existing window looks like the Fences "window"?

All replies

  • You can create multiple regions using CreateRectRgn for each individual post in your 'fence'.  Combine them into a single region using CombineRgn, then call SetWindowRgn to restrict your window's display to this region.

    • Edited by glotter Tuesday, September 10, 2013 1:38 PM
    Tuesday, September 10, 2013 1:38 PM
  • That will remove all the background, the window no longer a whole piece.

    I just want the window semi-transparent, not cut into pieces.

    Thanks for reply.


    Tuesday, September 10, 2013 2:59 PM
  • You can do per-pixel alpha transparency with Layered Windows


    Sunday, September 22, 2013 3:31 PM
  • Thanks, Rob.

    When I use SetLayeredWindowAttributes with

    LWA_ALPHA, the whole window is semi-transparent;

    LWA_COLORKEY, the background becomes complete transparent;

    both LWA_ALPHA and LWA_COLORKEY, background transparent, objects semi-transparent.

    While I want background semi-transparent, and objects opaque.



    Monday, September 23, 2013 11:53 PM
  • You don't want SetLayeredWindowAttributes. You want UpdateLayeredWindow for per-pixel alpha transparency. In the docs I linked skim down to the paragraph starting "For faster and more efficient animation or if per-pixel alpha is needed, call UpdateLayeredWindow. "

    This will let you control the transparency level for each pixel individually: you can set the background pixels partially transparent and leave your main objects fully opaque.


    Monday, September 23, 2013 11:58 PM