Aetopia / NoSteamWebHelper

A program that disables Steam's CEF/Chromium Embedded Framework.
GNU General Public License v3.0
129 stars 6 forks source link

Steam closes itself after some time (v2.0) #3

Closed 3nly closed 1 year ago

3nly commented 1 year ago

First of all, thank you for making this.

I've run into this issue of Steam closing itself after an undetermined amount of time on two occasions now:

Didn't seem to be happening with version 1.1. I think at some point something happens and Steam just crashes silently. Using Windows 10 LTSC 21H2.

Aetopia commented 1 year ago

That's actually something I intentionally added:

void WinEventProc(
    HWINEVENTHOOK hWinEventHook,
    DWORD event,
    HWND hWnd,
    LONG idObject,
    LONG idChild,
    DWORD idEventThread,
    DWORD dwmsEventTime)
{
    if ((event != EVENT_OBJECT_HIDE ||
         event != EVENT_OBJECT_SHOW) &&
        idObject != OBJID_WINDOW &&
        idChild != CHILDID_SELF)
        return;
    UnhookWinEvent(hWinEventHook);
    if (event == EVENT_OBJECT_SHOW)
        TerminateProcess(GetCurrentProcess(), 0);
    SteamWndProc = (WNDPROC)GetWindowLongPtrW(hWnd, GWL_WNDPROC);
    SetWindowLongPtrW(hWnd, GWL_WNDPROC, (LONG_PTR)NoBrowserWndProc);
    PostQuitMessage(0);
}

If Steam shows its window when starting up then the WebHelper will not be disabled by NoSteamWebHelper since the Steam window needs to be hidden to prevent the WebHelper from loading any CEF elements. This closing behavior can be trigger some another window is being shown at startup i.e like the Friends' Window or when Steam Updates. Have you tried to start the Steam Client normally?

3nly commented 1 year ago

I think I get what you're saying, but isn't closing the Steam client while your game is running unwanted behavior?

Have you tried to start the Steam Client normally?

I have and do when I want to check the store.

Aetopia commented 1 year ago

I think I get what you're saying, but isn't closing the Steam client while your game is running unwanted behavior?

Steam will automatically close at startup with NoSteamWebHelper, if it attempts to show its main window instead of starting silently as I have said before.

I have tested and used this executable on Windows 11, Windows IoT Enterprise and Windows Server 2022 but unless I can replicate your issue then I cannot confirm this as a bug.