0

I would like to display a text at windows 10 that needs to be always top up as windows 10 shows `Activate windows” when windows is not activated.

enter image description here

Is there any guidelines or documentation to get the work done?

David Silwal
  • 581
  • 5
  • 18
  • Why don't you use something like UI Automation to try understand how this watermark is done? – aybe Jul 16 '20 at 06:08
  • could you please share a link where can i get started and see if this can helps me to get the work done? Thank you – David Silwal Jul 16 '20 at 06:13
  • 2
    That's a DirectX Overlay (or, it can be replicated with one). You can search for these terms to find some already working Open Source libraries. – Jimi Jul 16 '20 at 07:15
  • 1
    Does this answer your question? [Window "on desktop"](https://stackoverflow.com/questions/365094/window-on-desktop) – Mark Feldman Jul 16 '20 at 09:18
  • I've used the WindowSinker class in the answer above in a few commercial apps, it's easy to use and works well on all versions of Windows that I've tried it on (Win7 onwards). – Mark Feldman Jul 16 '20 at 09:20
  • 1
    Hey @MarkFeldman, Thanks for you comments I noticed it can be used for the purpose and https://stackoverflow.com/a/62929366/6696609 this answer works in my app. – David Silwal Jul 16 '20 at 10:23

1 Answers1

1

In case you want a borderless window with transparent background, which is always on top:

<Window x:Class="MyProject.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="450" Width="800" WindowStyle="None" AllowsTransparency="True" Background="Transparent"  Topmost="True"
         >
    
    <StackPanel>
        <TextBlock Text="Activate Windows" FontSize="28"/>
        <TextBlock Text="Go to settings to activate Windows."/>
    </StackPanel>
</Window>
Nawed Nabi Zada
  • 2,819
  • 5
  • 29
  • 40
  • Thanks, your solution works flawlessly. I created a windows with your above solution. I added "WindowState="Maximized" ShowInTaskbar="False" and that window show when application started until closed event occurred. – David Silwal Jul 16 '20 at 10:30
  • This works (well) until another Window declares itself TopMost. Then, it's over. – Jimi Jul 16 '20 at 10:44
  • Oh, yes ! I didn't need to declare TopMost yet in another windows. hopefully it will gonna works. I will play with DIrectX overlay soon to see if this will be better approach. – David Silwal Jul 16 '20 at 12:16