locked
Transparent window on desktop RRS feed

  • Question

  • I'm working on a program to organize desktopicons in groups with particular names. To do that I want a WPF window with AllowTransparancy = true behind al the other windows.

    I tried this in some ways but none really worked. Using SetWindowPos() putted the window in the back, but it was still selectable through Alt + Tab and then it wasn't at the back. So I added SetParent() and that worked, but only when the window has AllowTransparancy = false. Otherwise, I get a kindof lightgray border and nothing else.

    So is it possible to take a transparent window and make the program manager the parent, while the window functionallity remains (resizing, dragging)?

    Tuesday, November 15, 2011 7:45 PM

Answers

  • > I want a WPF window with AllowTransparancy = true behind al the other windows.


    take a look here
    • Marked as answer by Annabella Luo Friday, November 25, 2011 3:56 AM
    Tuesday, November 15, 2011 7:59 PM
  • > you mean every time the window is activated, set the z-index back to the lowest value?


    i think it'll be enough if set z-index just once. but for reliability, you can use Global Windows Hook to monitor windows creation, thereafter change z-index of your window.
    • Marked as answer by Annabella Luo Friday, November 25, 2011 3:56 AM
    Wednesday, November 16, 2011 10:08 PM

All replies

  • > I want a WPF window with AllowTransparancy = true behind al the other windows.


    take a look here
    • Marked as answer by Annabella Luo Friday, November 25, 2011 3:56 AM
    Tuesday, November 15, 2011 7:59 PM
  • Thank you for your reply.

    Unfortunately is that not what I'm looking for. That window was always on top, while I want mine to be always at the bottom...

    Tuesday, November 15, 2011 8:13 PM
  • > That window was always on top, while I want mine to be always at the bottom...


     
    you can set Topmost="False" and you can change z-order (see How to sort Windows by z-index?)

     
    Tuesday, November 15, 2011 10:23 PM
  • you mean every time the window is activated, set the z-index back to the lowest value?
    Wednesday, November 16, 2011 8:22 PM
  • > you mean every time the window is activated, set the z-index back to the lowest value?


    i think it'll be enough if set z-index just once. but for reliability, you can use Global Windows Hook to monitor windows creation, thereafter change z-index of your window.
    • Marked as answer by Annabella Luo Friday, November 25, 2011 3:56 AM
    Wednesday, November 16, 2011 10:08 PM
  • We are temporarily marking this as "Answer", if you have any concerns or new findings; please feel free to unmark this.

    Best regards.


    Annabella Luo[MSFT]
    MSDN Community Support | Feedback to us
    Friday, November 25, 2011 3:56 AM