Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep form on desktop at all times (No Win+D effects)

Tags:

c#

forms

winapi

I'm working on a project in which I need a form to stay on the desktop at all times. This would mean that it should still be showing even if a user clicks Win+D to hide/show desktop.

If anyone uses Rainmeter, they will know how meters stay on the desktop despite clicking on the show desktop key.

I really don't mind how to do it, as long as it works. I've looked through hundreds of examples but half of them don't work..

Maybe someone could help me out.

Thanks in advance.

like image 887
Meh Avatar asked Oct 09 '22 01:10

Meh


2 Answers

I fired up C# and created a Windows Forms application. I set the forms' TopMost property to True, and its MinimizeBox property to False.

When I run the app, the Window is always on top, even if I use Win+D or click Show Desktop.

I got the idea from here: What is the difference between Minimize All and Show Desktop?

like image 200
Ove Avatar answered Oct 13 '22 10:10

Ove


If you want something to stay on the desktop, you should put it on the desktop. Look at using Windows Gadgets which can do what you want.

like image 33
Deanna Avatar answered Oct 13 '22 12:10

Deanna