From bedd99a59329a152a3d04ebba70873245998f889 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Mon, 13 May 2024 03:45:12 +0300 Subject: [PATCH] Let the bridge to start without being installed from GUI --- gui.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gui.c b/gui.c index 2b1a54c..64d4977 100644 --- a/gui.c +++ b/gui.c @@ -44,7 +44,18 @@ VOID HandleStartButton(BOOL Silent) SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG | SERVICE_START); if (schService == NULL) { - print("OpenService failed: %s\n", GetErrorMessage()); + // print("OpenService failed: %s\n", GetErrorMessage()); + + /* Service doesn't exist; running without any service */ + + ShowWindow(hwnd, SW_MINIMIZE); + CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CreateBridge, + NULL, 0, NULL); + + HWND item = GetDlgItem(hwnd, /* Start Button */ 1); + EnableWindow(item, FALSE); + item = GetDlgItem(hwnd, 4); + return; } @@ -160,10 +171,7 @@ VOID SetButtonStyles(INT *btnStartStyle, INT *btnRemoveStyle, INT *btnInstallSty *btnStartStyle |= WS_DISABLED; } else - { - *btnStartStyle |= WS_DISABLED; *btnRemoveStyle |= WS_DISABLED; - } CloseServiceHandle(schService); CloseServiceHandle(hSCManager);