12

I have the following setup for the game:

  1. launcher.exe - starts under Steam on Windows and provides some settings UI for the user.
  2. Then launcher.exe starts actual game.exe.

Problem is that the launcher.exe is using H/W accelerated UI - uses Direct2D/DirectX.

This page https://partner.steamgames.com/doc/features/overlay states:

Your game does not need to do anything special for the overlay to work, it automatically hooks into any game launched from Steam!

But in my case that creates problems - the overlay is created on wrong window. So launcher.exe (uses DirectX) has the overlay but window that is created by game.exe (real game, uses DirectX and/or OpenGL) is not.

And the question is: how can I modify code of my launcher.exe window to prevent Steam overlay to be created on it "automatically"?

Update, response from Valve's TS:

Sorry, there's no code in place to selectively enable or disable the overlay between launchers and games!

The only "option" is to disable DirectX drawing in the launcher.exe. In this case their injected DLL will not create that thing. But that effectively means no GPU accelerated UI drawing under the Steam... Kind of "640kb is enough for everybody" type of design.

Ideally Steam should send some custom message to the window to ask how and where the window wants that overlay to be rendered. But apparently there is no such thing, or is it?

Just for the context, the launcher looks as this:

As you see there is no room for overlay

c-smile
  • 26,734
  • 7
  • 59
  • 86
  • Your best bet would likely be to ask in the SteamWorks dev forums/Community. – l3l_aze Sep 17 '18 at 20:48
  • I do not have an account there - it costs some subscription fee I think. – c-smile Sep 17 '18 at 23:35
  • You just have to be linked as a developer of the game, AFAIK. Do you have the SteamWorks badge on Steam? If not and you have other members on your team who do then I think they need to add you, but I'm not a dev so IDK for sure -- just going by what I've read here. If you're developing alone and Valve still has reps help people sign up & setup they should be able to help you with this. If there is no rep you'll likely need to contact customer support to start getting things sorted if they can't just flip the switch personally. – l3l_aze Sep 18 '18 at 01:52
  • Here is what we've got from the Valve TS: "Sorry, there's no code in place to selectively enable or disable the overlay between launchers and games!" But that's not the option at all so is not the answer. What kind of architecture is that? "Road to hell is paved with good intentions", indeed. Sigh. – c-smile Sep 18 '18 at 02:10
  • Yeah, I'm not sure how it's done either but obviously it is done -- Fallout New Vegas, Borderlands 2 & almost anything else "ported" to Mac by Aspyr. Seems like they should have an idea of how it works. Again, no idea myself, but [some of the public docs](https://partner.steamgames.com/doc/features/overlay) you linked to mention "SteamAPI_RestartAppIfNecessary" which may somehow help you. If not [OSOL](https://github.com/WombatFromHell/OriginSteamOverlayLauncher) may have some useful code if you understand C#. – l3l_aze Sep 18 '18 at 02:31
  • I may be reaching here, but if you run the game under the same process as the launcher as opposed to a new process (which I'm assuming you're doing), the Steam overlay may work on both the launcher and the game, not great, but better in some regard. Or perhaps, having steam launch the game process and have the 'launcher' run under that (having it delay the initialization of the actual game) which could make the overlay work solely on the game. Good luck – Mark Diedericks Sep 18 '18 at 23:28
  • 1
    @MarkDiedericks In reality it works on both - we just don't want it to be present on launcher window - it simply makes no sense there - wrong context, etc. – c-smile Sep 18 '18 at 23:33
  • @c-smile, could you share what is the UI framework/library being used by _launcher.exe_? Are you using C++/Win32, Unity or Qt? You may have a UI framework specific way to disable DirectX/OpenGL and use a software rendering approach provided by that same UI framework… _after looking 10 seconds to the screen I decided to post this comment even noticing the epic workaround this would lead to…_ – diogoslima Sep 19 '18 at 00:20
  • @diogoslima The launcher uses sciter engine ( https://sciter.com ) for the UI. And I am the author of the sciter so can do there whatever is needed. It is plain win32 thing that uses either Direct2D, Skia/OpenGL or CPU rendering. – c-smile Sep 19 '18 at 01:17
  • Maybe I don't fully understand your issue (or the steam setup actually), but why don't you just make the launcher.exe an intermediate process ? hide any window or whatever, and then have a (managed) child process from the launcher.exe ? wouldn't that solve any issue you have with steam trying to hijack draw on the launcher.exe ? – darune Sep 19 '18 at 09:43
  • 5
    Thanks for replying @c-smile (and congrats on your work). It seems Steam is making the overlay using _GameOverlayUI.exe_, which receives a pid as argument and [uses Hooks](https://learn.microsoft.com/en-us/windows/desktop/winmsg/using-hooks) to inject itself. You can deep-dive using [Spy++](https://learn.microsoft.com/en-us/visualstudio/debugger/introducing-spy-increment?view=vs-2017) and [WinDbg](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/). After noticing it, and googling again, I was able to find [this post](https://aixxe.net/2017/09/steam-overlay-rendering)! – diogoslima Sep 19 '18 at 20:38
  • @c-smile I didn't understand if you are working at the game or not, but as far as I can tell you, from a war thunder gamer, nobody cares about steam overlay inside the launcher – Simo Sep 25 '18 at 15:41
  • @diogoslima , I am not sure how Spy++ can be useful in this case. Anyway... in general I would try to avoid any doubtful hacks. As today Steam uses hooks, tomorrow - just a popup window for the overlay... But apparently Steam don't care about its users that much. – c-smile Sep 25 '18 at 17:50

0 Answers0