- Programm heisst jetzt Squad Manager, Hauptdatei squad_manager.py
- Einstellungen ziehen nach %APPDATA%\SquadManager um; alte werden beim
ersten Start kopiert, nicht verschoben
- Installer: Verknuepfung liegt in {userprograms}, der Deinstallierer
raeumte bisher im falschen Ordner ab; doppelte Verknuepfung entfernt
- Deinstallierer fragt per SuppressibleMsgBox mit Vorgabe Nein, damit
stille Deinstallationen keine Einstellungen loeschen
- HOCHLADEN.txt liegt jetzt in der Quelle und wird beim Bau kopiert
- Plan fuer das Modul Akte (PLAN-AKTE.md)
- Version 3.3
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
48 lines
1.4 KiB
Python
48 lines
1.4 KiB
Python
"""Nimmt das Fenster inklusive Titelleiste auf."""
|
|
import ctypes
|
|
import ctypes.wintypes as wintypes
|
|
import subprocess
|
|
import sys
|
|
import tkinter as tk
|
|
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
|
import squad_manager as m
|
|
|
|
OUT = str(Path.cwd() / "screenshot.png")
|
|
|
|
|
|
class RECT(ctypes.Structure):
|
|
_fields_ = [("left", wintypes.LONG), ("top", wintypes.LONG),
|
|
("right", wintypes.LONG), ("bottom", wintypes.LONG)]
|
|
|
|
|
|
root = tk.Tk()
|
|
m.apply_tactical_theme(root)
|
|
app = m.VoiceActivationApp(root)
|
|
root.attributes("-topmost", True)
|
|
app.current_level = 0.041
|
|
|
|
|
|
def capture():
|
|
root.update_idletasks()
|
|
root.update()
|
|
hwnd = ctypes.windll.user32.GetParent(root.winfo_id()) or root.winfo_id()
|
|
r = RECT()
|
|
ctypes.windll.user32.GetWindowRect(wintypes.HWND(hwnd), ctypes.byref(r))
|
|
x, y = r.left, r.top
|
|
w, h = r.right - r.left, r.bottom - r.top
|
|
ps = ("Add-Type -AssemblyName System.Drawing;"
|
|
f"$b = New-Object System.Drawing.Bitmap {w},{h};"
|
|
"$g = [System.Drawing.Graphics]::FromImage($b);"
|
|
f"$g.CopyFromScreen({x},{y},0,0,$b.Size);"
|
|
f"$b.Save('{OUT}');$g.Dispose();$b.Dispose()")
|
|
subprocess.run(["powershell", "-NoProfile", "-Command", ps],
|
|
capture_output=True)
|
|
print("gespeichert:", OUT, f"({w}x{h})")
|
|
root.destroy()
|
|
|
|
|
|
root.after(2500, capture)
|
|
root.mainloop()
|