From 730492046165bbc360caf4fedf6475a4af42d454 Mon Sep 17 00:00:00 2001 From: ThaaoBlues <40574784+ThaaoBlues@users.noreply.github.com> Date: Fri, 12 Mar 2021 20:12:46 +0100 Subject: [PATCH] Delete launcher.py --- launcher.py | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 launcher.py diff --git a/launcher.py b/launcher.py deleted file mode 100644 index 40f0cc1..0000000 --- a/launcher.py +++ /dev/null @@ -1,29 +0,0 @@ -from subprocess import run -from os import chdir,kill -from getpass import getuser -import psutil - -chdir("copypasta") -run(["start","copypasta.exe"],shell=True) - - -import win32gui -def get_window_titles(): - ret = [] - def winEnumHandler(hwnd, ctx): - if win32gui.IsWindowVisible(hwnd): - txt = win32gui.GetWindowText(hwnd) - if txt: - ret.append((hwnd,txt)) - - win32gui.EnumWindows(winEnumHandler, None) - return ret - -#check if a window have the name copypasta, if not, close the program -while True: - all_titles = get_window_titles() - window_starts = lambda title: [(hwnd,full_title) for (hwnd,full_title) in all_titles if full_title.startswith(title)] - all_matching_windows = window_starts('CopyPasta') - if len(all_matching_windows) < 1: - for _ in range(len(all_matching_windows)): - run(["taskkill","copypasta.exe"]) \ No newline at end of file