Look, I'll send you the code now, you have to redo the main menu and not only. 1. Leave…
- User
Look, I'll send you the code now, you have to redo the main menu and not only.
- Leave the "Enter the program name" tab as is. Next, "Disable Internet data usage", "Block Ocean", "Lags in Anydesk" you should move to a new section on the right sidebar. That is, I will click on the Additional settings button, a window will open with a choice of these functions and a start button, make an on/off switch instead of the checkboxes, and make the "start" button rounded. And make it so that when you click on these buttons, everything works like in the old section.
- Next, create another section called "Cleaning", there will be a "Hide program" button, when you click on it, the application will hide under the system process, but continue to perform its tasks, after the RCTRL + RSHIFT key combination it will appear. And completely change the color scheme of the entire application. Here is the code itself: import tkinter as tk from tkinter import scrolledtext, messagebox import os import sqlite3 import shutil import psutil from time import sleep import subprocess import time import threading import ctypes
==============================
Функции для управления AnyDesk
==============================
def suspend_process(pid): PROCESS_SUSPEND_RESUME = 0x0800 handle = ctypes.windll.kernel32.OpenProcess(PROCESS_SUSPEND_RESUME, False, pid) if handle: ctypes.windll.ntdll.NtSuspendProcess(handle) ctypes.windll.kernel32.CloseHandle(handle)
def resume_process(pid): PROCESS_SUSPEND_RESUME = 0x0800 handle = ctypes.windll.kernel32.OpenProcess(PROCESS_SUSPEND_RESUME, False, pid) if handle: ctypes.windll.ntdll.NtResumeProcess(handle) ctypes.windll.kernel32.CloseHandle(handle)
def get_anydesk_pids(): pids = [] for process in psutil.process_iter(['pid', 'name']): try: if 'anydesk' in process.info['name'].lower(): pids.append(process.info['pid']) except Exception: continue return pids
def lag_anydesk(): while lagging: anydesk_pids = get_anydesk_pids() if not anydesk_pids: print("AnyDesk не запущен.") else: print("Фризим AnyDesk...") for pid in anydesk_pids: suspend_process(pid) time.sleep(5) # Пауза — процессы приостановлены 5 сек. print("Анфризим AnyDesk...") for pid in anydesk_pids: resume_process(pid) time.sleep(1) # Пауза после возобновления
==============================
Функции очистки и блокировок
==============================
def clean_dns(): try: subprocess.run(['ipconfig', '/flushdns'], shell=True, check=True) for proc in psutil.process_iter(['pid', 'name', 'cmdline']): try: if proc.info['name'].lower() == 'svchost.exe': cmdline = proc.info.get('cmdline', []) if cmdline and '-k NetworkService' in ' '.join(cmdline): proc.terminate() sleep(1) except (psutil.NoSuchProcess, psutil.AccessDenied): continue messagebox.showinfo("Успех", "DNS успешно очищен!") except Exception as e: messagebox.showerror("Ошибка", f"Ошибка при очистке DNS: {str(e)}")
- Assistant