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

2019-06-21 13:14发布

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.

标签: c# forms winapi
2条回答
来,给爷笑一个
2楼-- · 2019-06-21 13:31

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?

查看更多
叼着烟拽天下
3楼-- · 2019-06-21 13:42

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.

查看更多
登录 后发表回答