Search code examples
c#wpfvisual-studiooverlayfullscreen

C# WPF Overlay for fullscreen applications?


I'm making an app that displays what keys you are pressing, and I was wondering if there was a way to overlay some image widgets on top of the screen so that they stay on top even when you are in full screen mode. I'm using WPF with Visual Studio. A link to a tutorial or a download to an example would help a ton!


Solution

  • You haven't clarified whether you want the widgets to appear over top of all windows, or just your WPF one.

    If you want it to appear over just your window then look into use an adorner.

    If you want it to appear over all windows then use this WindowSinker class which intercepts the WM_SETFOCUS message for your window and calls SetWindowPos to set the HWND_TOPMOST flag.