4

I would like to write a C# app that runs like an overlay on the desktop wallpaper. Similar to the way that desktop widgets or Rainmeter(rainmeter.net) runs; behind other apps but on top of the desktop wallpaper.

I cannot find any C# examples of this kind of behavior. Can someone point to me to some code?

Here is an example of what I am interested in creating: http://jabz.us/uploaded_images/screenCaptureRainmeter.png

TERACytE
  • 7,553
  • 13
  • 75
  • 111

1 Answers1

2

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

For example, use this code and poll the "below all other windows" method every 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>
Community
  • 1
  • 1
Callum Rogers
  • 15,630
  • 17
  • 67
  • 90