equal
deleted
inserted
replaced
14 """ |
14 """ |
15 |
15 |
16 import win32api |
16 import win32api |
17 |
17 |
18 import errno, os, sys, pywintypes, win32con, win32file, win32process |
18 import errno, os, sys, pywintypes, win32con, win32file, win32process |
19 import winerror |
19 import winerror, win32gui |
20 import osutil, encoding |
20 import osutil, encoding |
21 from win32com.shell import shell, shellcon |
21 from win32com.shell import shell, shellcon |
22 |
22 |
23 def os_link(src, dst): |
23 def os_link(src, dst): |
24 try: |
24 try: |
170 """ |
170 """ |
171 def handler(event): |
171 def handler(event): |
172 win32process.ExitProcess(1) |
172 win32process.ExitProcess(1) |
173 win32api.SetConsoleCtrlHandler(handler) |
173 win32api.SetConsoleCtrlHandler(handler) |
174 |
174 |
|
175 def hidewindow(): |
|
176 def callback(*args, **kwargs): |
|
177 hwnd, pid = args |
|
178 wpid = win32process.GetWindowThreadProcessId(hwnd)[1] |
|
179 if pid == wpid: |
|
180 win32gui.ShowWindow(hwnd, win32con.SW_HIDE) |
|
181 |
|
182 pid = win32process.GetCurrentProcessId() |
|
183 win32gui.EnumWindows(callback, pid) |