Skip to content

Commit 53c99d1

Browse files
committed
bug fix: 恢复窗口py运行崩溃问题
1 parent 25ddcc3 commit 53c99d1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

restore_windows.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@
77
# from subprocess import PIPE, Popen
88
# python调用命令行:https://zhuanlan.zhihu.com/p/329957363
99
import winreg
10-
from window_monitor import update_hwnd_arr, Desktop
10+
from window_monitor import update_hwnd_arr, get_json, add_dll_symbol
1111

1212
exe_dir = os.path.dirname(os.path.realpath(sys.argv[0]))
1313
os.chdir(exe_dir) # 切换到文件所在目录
1414

15+
config_json = "_config.json"
16+
cfg = get_json(config_json)
17+
virtualdesktop_dll_name = cfg["VirtualDesktop_DLL_name"]
18+
VirtualDesktop, Desktop = add_dll_symbol(virtualdesktop_dll_name)
19+
1520
userhomepath = os.environ['USERPROFILE']
1621
userdir = os.path.split(userhomepath)[-1]
1722
special_dir_dict = {

window_monitor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def add_dll_symbol(dll_filename):
2222
import VirtualDesktop
2323
from VirtualDesktop import Desktop
2424
dbg=1
25+
return VirtualDesktop, Desktop
2526

2627
now_hwnd_all = []
2728
# except_list = ['Progman',"Windows.UI.Core.CoreWindow", "ApplicationFrameWindow"]

0 commit comments

Comments
 (0)