5

I'm building a WPF application that is designed to act as a notification toolbar for sending messages to users of an enterprise software platform. It's a bar that is a specific height, stretching all the way across the bottom of the user's desktop, sitting directly above the Windows taskbar.

What I'd like to do is to have my application "claim" or "reserve" the space it takes up and not allow any applications to load behind it. For example, if you were to resize your windows taskbar and make it larger, it will move icons and shortcuts, and maximizing windows will only use the desktop area that is not already being used by the taskbar.

Any idea how this could be pulled off? It's already set to be the topmost item on the desktop, so that's not my question. Right now if you opened another app and maximized it, then the bottom X pixels will be hidden behind my toolbar application.

(Note that I've added Windows 7 and Windows XP tags - I'd love to be able to implement this functionality on WinXP and up, but if I'm not able to do so on a particular version or versions, I can come up with a workaround)

Gunny
  • 1,146
  • 7
  • 11

1 Answers1

5

These are called AppBars in Windows and you can use the SHAppBarMessage function to "dock" your window to a side of a monitor. Then other windows, when maximized, will not obscure the docked window.

Here's a link to a similar question that has more information, including a link to a CodeProject page that walks you through creating one.

Community
  • 1
  • 1
Josh
  • 68,005
  • 14
  • 144
  • 156
  • Thanks - that pointed me in the right direction. I'm thinking about using the Shell Megapack from LogicNP (http://www.ssware.com/megapack.htm) to just bolt this functionality in, especially since I want make sure I target other versions of Windows with as little trouble as possible. Don't suppose you have any experience with this or comparable tools do you? – Gunny Jul 25 '11 at 15:05
  • I'm sorry I don't know anything about that product. But I do know that appbars have remained the same since as far back as I can remember so I don't think you'll have a problem with version differences in Windows. – Josh Jul 25 '11 at 21:20