Sample code for a wallpaper application?

I would like to write a C # application that works like an overlay on desktop wallpapers. Similar to how desktop widgets or Rainmeter (rainmeter.net) are launched; for other applications, but on top of the desktop wallpaper.

I can't find C # examples of this behavior. Can someone point me to some kind of code?

Here is an example of what interests me: http://jabz.us/uploaded_images/screenCaptureRainmeter.png

+4
source share
1 answer

Why not just use WPF windows that are borderless (and therefore static, but you can move them again using this code ) transparent and below all other windows ? You may need to poll each window under the rest every 100 ms or so that the user accidentally clicks it. I did a little test with just some labels, and everything looks great.

For example, use this code and try the โ€œbelow all other windowsโ€ method so often.

<Window x:Class="WpfTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="LearnWPF.BorderlessWindow" Height="200" Width="200" WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True" Background="Transparent" > <Border Padding="5" BorderBrush="#feca00" BorderThickness="3" Width="150" Height="150"> <TextBlock>Learn WPF!</TextBlock> </Border> </Window> 
+2
source

Source: https://habr.com/ru/post/1307393/


All Articles