Skip to content

Commit

Permalink
Improved launch
Browse files Browse the repository at this point in the history
  • Loading branch information
FozerG committed May 18, 2024
1 parent a254ff7 commit cb63922
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ def Is_already_running():

def Check_conhost():
if '--run-through-conhost' not in sys.argv: # Запущен ли скрипт уже через conhost
print("Wait a few seconds for the script to load.")
script_path = os.path.abspath(sys.argv[0])
subprocess.Popen(['cmd', '/c', 'start', 'conhost.exe', script_path, '--run-through-conhost'] + sys.argv[1:])
subprocess.Popen(['cmd', '/c', 'start','/min', 'conhost.exe', script_path, '--run-through-conhost'] + sys.argv[1:])
time.sleep(2)
sys.exit()

def Disable_close_button():
Expand Down Expand Up @@ -400,7 +402,7 @@ def Is_run_by_exe():

# Отключение кнопки закрытия консоли
Disable_close_button()

win32gui.ShowWindow(window, win32con.SW_SHOW) # Показываем окно т.к оно свернуто с помощью "/min"
if window:
log("Minimize to system tray in 3 seconds...")
time.sleep(3)
Expand Down

0 comments on commit cb63922

Please sign in to comment.