1

I'm writing a program and I want it to be displayed even on top of a game running in full-screen mode (like counter-strike).

I'm using Visual Basic as programming language. Every single help is appreciated.

Nikolay Kostov
  • 16,433
  • 23
  • 85
  • 123
  • What research have you done so far? – rory.ap Aug 06 '15 at 15:50
  • 1
    Thanks for answering @roryap ! I have searched Google (of course) and other forums. But..unfortunately I cant find anyting so far. –  Aug 06 '15 at 15:52
  • http://stackoverflow.com/questions/8543765/bring-vb-net-window-on-top-of-all-windows – jhegeman2 Aug 06 '15 at 15:53
  • 1
    Yeah, I had already checked that. But I pretty much didnt understand it! –  Aug 06 '15 at 15:56
  • 1
    @jhegeman2 It won't work. As he said, he want the program **to be displayed even on top of a game running in full-screen mode** ! And these game aren't at topmost. It's "a special state"... – Drarig29 Aug 06 '15 at 16:28
  • 1
    what i do in those "special cases"? –  Aug 06 '15 at 16:46

2 Answers2

0

Display window over full screen application

But this is not the best option. In full screen mode there is exclusive access to the display, and you can only display on top of this if you are allowed to implement it if it's a game in OpenGL, DirectX and BackBuffer to impose your data.

-1

It's not so complicated. You just have to read this question's answer.

The simplest way of making a window top-most is to specify the WS_EX_TOPMOST flag when you create the window. The .NET Framework hides most of the window creation work behind the scenes, but you can customize the parameters when you need to by overriding the CreateParams property of your form class.

Here's the code :

Protected Overrides ReadOnly Property CreateParams() As CreateParams
    Get
        Const WS_EX_TOPMOST As Integer = &H00000008

        Dim cp As CreateParams = MyBase.CreateParams
        cp.ExStyle = cp.ExStyle Or WS_EX_TOPMOST
        Return cp
    End Get
End Property

But anyway, because this won't work. It's not a good solution as I said to jhegeman2.

Community
  • 1
  • 1
Drarig29
  • 1,902
  • 1
  • 19
  • 42
  • 1
    I ll wait for your response! –  Aug 06 '15 at 16:33
  • I think there's no solution... As _Rudedog2_ said [here](https://social.msdn.microsoft.com/Forums/vstudio/en-US/b1560ec2-1503-4ed7-ac9e-ea61b18805cc/show-form-over-full-screen-game-window?forum=vbgeneral) : `"Unless you run your games in a window mode, you're going to have issues. Most games completely take over the display and popping up windows is not really an option without it giving windows back the display. You may have luck drawing your own, but it would compete with the game for display on the screen."` – Drarig29 Aug 06 '15 at 16:42
  • [Here](http://stackoverflow.com/questions/9243748/vb-application-on-top-of-a-game/9244289#9244289)'s another good answer. There's also a possible alternative : creating a DirectX overlay like what Steam does. There's a couple questions around doing this : [stackoverflow.com/questions/3549004/…](http://stackoverflow.com/questions/3549004/fullscreen-directx-overlay-yes-again-c-sharp) [stackoverflow.com/questions/2649702/…](http://stackoverflow.com/questions/2649702/c-sharp-hook-overlay-a-directx-game). – Drarig29 Aug 06 '15 at 16:48
  • The previous links are written in C# but it doesn't matter, it'll give you an idea and it'll aways be possible to convert the code to vb.net... ;) – Drarig29 Aug 06 '15 at 16:51
  • In all the forums I've found, the answer is : "You can't". [There's another good example of thread](http://forums.codeguru.com/showthread.php?457910-Application-on-top-of-a-(fullscreen)-DirectX-program) proving that it's not possible. I think you can give it up :/ Sorry for you. – Drarig29 Aug 06 '15 at 17:00
  • `WS_EX_TOPMOST` won't work for a DirectX _full-screen_ game. You'll just end up _taking_ the game out of full-screen when your window appears –  Aug 07 '15 at 16:10
  • Yes, it's what I said. – Drarig29 Aug 07 '15 at 20:57