|
|
@@ -22,7 +22,8 @@ import importlib
|
|
|
from service.auto_deal_pics.upload_pic import UploadPic
|
|
|
from service.OnePicTest import OnePicTest
|
|
|
import hashlib
|
|
|
-
|
|
|
+import win32api, win32gui, win32con
|
|
|
+from win32gui import EnumWindows, GetWindowText
|
|
|
|
|
|
# from service.AutoDealPics import AutoDealPics
|
|
|
# for plugin in settings.plugins:
|
|
|
@@ -648,3 +649,18 @@ def delete_logo(params: LogoParamsupdate):
|
|
|
for logoItem in logo_files:
|
|
|
logo_list.append(f"{logo_dir}{logoItem}")
|
|
|
return {"code": 0, "msg": "操作成功", "data": logo_list}
|
|
|
+
|
|
|
+
|
|
|
+@app.post("/close_other_window", description="关闭窗口")
|
|
|
+def close_other_window():
|
|
|
+ hwnd_list = []
|
|
|
+ def callback(hwnd, _):
|
|
|
+ title = GetWindowText(hwnd)
|
|
|
+ if title == "digiCamControl by Duka Istvan":
|
|
|
+ hwnd_list.append(hwnd)
|
|
|
+ EnumWindows(callback, None)
|
|
|
+ if hwnd_list:
|
|
|
+ hwnd = hwnd_list[0]
|
|
|
+ win32gui.PostMessage(hwnd, win32con.WM_CLOSE, 0, 0)
|
|
|
+ return {"code": 0, "msg": "关闭成功", "data": {"status":True}}
|
|
|
+ return {"code": 0, "msg": "关闭失败", "data": {"status": False}}
|