2

How do you put a Windows Form Application on top off everything on your screen?

Just setting the topmost-property isn't enough when you're running fullscreen games.

If anyone has a solution for good old Forms i'll also be happy

I've seen many posts on this forum that say it's impossible but i know it's not couse i've seen alot of apps (fraps, teamspeak overlay, xfire, etc) that does this.

  • 3
    Imagine if two applications tried to do this at the same time http://blogs.msdn.com/b/oldnewthing/archive/2011/03/10/10138969.aspx – Pete Baughman Feb 25 '14 at 21:52
  • 1
    Fraps is doing this via DirectX/OpenGL. If you're willing to use a low level graphics API it is possible, but not really in a regular windows form (excluding Form.TopMost). – Nathan Feb 25 '14 at 21:53
  • Are you using MS-windows? – ctrl-alt-delor Feb 25 '14 at 21:54
  • Comedy option : Take a screenshot of the Windows Form application, print it out, tape it to your screen. Serious comment - Nathan is right, but glosses over the fact that this might be waaaaay easier in an unmanaged language other than C# where you have a lot more control over painting. I doubt that teamspeak uses Winforms to do their thing - they probably had to roll a lot of their own drawing logic. – Pete Baughman Feb 25 '14 at 22:09
  • @PeteBaughman That's definitely true, in other languages this may be much more doable. I'm just speaking in the context of windows forms, since that's what was asked. – Nathan Feb 25 '14 at 22:14
  • yes im using ms windows, for example game is using OpenGL, i heard some stuff like "hooking", i searched alot about hook OpenGL but i didnt really get anything useful. has anyone got some information about it? c#! –  Feb 26 '14 at 09:35

1 Answers1

1

If you want to use a graphics library to display something always on screen, you may want to start here on SO. There are wrapper libraries available like OpenTK for OpenGL. If you want to go the DirectX route you'll need to load in the C++ libraries and access them using P/Invoke. There's a good tutorial to start with on msdn. Wrappers for DirectX also exist in the form of SharpDX.

Community
  • 1
  • 1
Nathan
  • 2,093
  • 3
  • 20
  • 33