8

I want to set my application to be on desktop level, like Windows Gadgets. Is this possible to achieve?

Thing is, i have borderless application I want to run on desktop.

I tried to find the option, but I found only "always on top" which is opposite of what I want to achieve.

Ray Burns
  • 62,163
  • 12
  • 140
  • 141
Danijel
  • 488
  • 5
  • 14
  • 4
    Is there a reason that you can't write it as a windows gadget – Rich Mar 03 '10 at 14:24
  • 2
    When you devise of a new UI pattern for your application, you're most likely going to end up hated by your users. "Why did that dick make this app borderless?? I can't resize it, its so tiny on my monster screen. What a moron!" Best thing to do is to find a common UI pattern (such as a gadget, tray-icon based app, a windows service, a scheduled task, an app that minimizes to the tray and displays notification popups, etc etc) that people LIKE and use it. –  Mar 03 '10 at 14:33
  • 1
    @rick: It's too complicated for a Windows Gadget. :) @Adam: It's he, not she ;) – Danijel Mar 03 '10 at 14:34
  • @Will: app is intended to look like a gadget, to run on desktop level and to give impact on user to think it's naturally integrated with Windows Desktop. – Danijel Mar 03 '10 at 14:37
  • @danijel except it isn't integrated with the desktop, isn't a gadget and will not behave exactly like either of them. And so, when users expect your app to show up in the gadget gallery (it won't) or if they assume it is controlled in the same way that other desktop features are controlled (good luck with that) they will end up hating you. How about not trying to fool your users and just present them with an application that does useful stuff? This kind of thinking... it boggles me. –  Mar 03 '10 at 20:14

4 Answers4

6

The good old SetWindowPos supports a HWND_BOTTOM to place your application as the last one in the order. To use it in C# take a look at PInvoke.Net.

Oliver
  • 43,366
  • 8
  • 94
  • 151
3

Write the app so that it runs as a service in the background, then implement an actual Windows Gadget as a front-end?

GWLlosa
  • 23,995
  • 17
  • 79
  • 116
0

i think there is no way to do it same way as always on top. do you want to run your application under icons? the only way to do a really background application is to replace explorer.exe, but then you will not see icons and task bar.

Andrey
  • 59,039
  • 12
  • 119
  • 163
0

You can implement an actual Windows Gadget using WPF by creating an XBAP. Just add a gadget.xml file and an .html file that contains only an IFRAME that loads the XBAP. That way your WPF application will actually be a gadget and will automatically follow all the rules.

Another option is to use Windows Sidebar Styler. This requires additional software to be installed alongside yours but also allows you to do things you can't do inside the XBAP sandbox without code signing certificates, user authorizaiton, etc.

A third option is to create a gadget that uses something recognizable in the HTML (such as a particular background color), then when your .exe starts up, scan for a hWnd under Explorer that has the attributes you are looking for, inject yourself into the Explorer.exe process, and set your window as a child of it.

A variation of the third option is to not inject into Explorer.exe but rather maintain your Z Index and location (using SetWindowPos) to track the Z Index and location of the hWnd you found.

So many choices...

Ray Burns
  • 62,163
  • 12
  • 140
  • 141