• 0

[C#/WPF] Prevent window from being minimized: SHOW DESKTOP


Question

Hi,

I'm currently working on a WPF sidebar alternative for Windows Vista/7.

My problem here is that I need the "gadgets" (the WPF window) to stay visible when the user hits WIN+D / WIN+M or SHOW DESKTOP directly.

I can't really find any suitable solution on the net (been searching for 2.5 hours no w/o any success).

Ideas don't have to be WPF or C#, C++ is good enough :D

Thanks in advance =)

-Simon

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

No. You don't disable a users hotkeys. Plus they could still directly click Show Desktop.

Why not check what window style attributes Microsoft's sidebar window uses with Spy++?

Link to comment
Share on other sites

  • 0

I already did Spy++ check it, I didn't find any special attributes neither am I able to intercept a Window message that I could react to.

My app is now able to stay visible when the user uses Aero Peek (thanks to TaskSe7en https://www.neowin.net/forum/index.php?showtopic=794078) but still lacks the power of staying visible when I press SHOW DESKTOP (or press WIN+D)

Since apparently showing the desktop does not actually minimize the window but rather put the desktop in front of them I have no idea what to try...

Link to comment
Share on other sites

  • 0

Does Windows send a WM_DESKTOPSHOWN message or similar when this occurs? If so you could use SetActiveWindow or whatever its called from the WinAPI.

Link to comment
Share on other sites

  • 0

Yap, I have checked every window message. The only "relevant" ones I'm getting are when the window is being activated.

The only problem here is that this event fires once I set focus on another window. If i Activate() the window then, it's essentially always visible, which is not what I need...

I've figured out that I can intercept WindowStateChanged (windows actually DOES minimize the window) - I thought it was the solution - Unfortunately once I set ShowInTaskbar="False" windows no longer sends that command. So I'm back at the beginning again...

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.