|
24 | 24 |
|
25 | 25 | from pywinauto.win32defines import SEE_MASK_NOCLOSEPROCESS, SW_HIDE, SW_SHOWMINNOACTIVE |
26 | 26 |
|
| 27 | + class SHELLEXECUTEINFO(ctypes.Structure): |
| 28 | + _fields_ = [ |
| 29 | + ("cbSize", ctypes.c_ulong), |
| 30 | + ("fMask", ctypes.c_ulong), |
| 31 | + ("hwnd", ctypes.c_void_p), |
| 32 | + ("lpVerb", ctypes.c_wchar_p), |
| 33 | + ("lpFile", ctypes.c_wchar_p), |
| 34 | + ("lpParameters", ctypes.c_wchar_p), |
| 35 | + ("lpDirectory", ctypes.c_wchar_p), |
| 36 | + ("nShow", ctypes.c_int), |
| 37 | + ("hInstApp", ctypes.c_void_p), |
| 38 | + ("lpIDList", ctypes.c_void_p), |
| 39 | + ("lpClass", ctypes.c_wchar_p), |
| 40 | + ("hkeyClass", ctypes.c_void_p), |
| 41 | + ("dwHotKey", ctypes.c_ulong), |
| 42 | + ("hIcon", ctypes.c_void_p), |
| 43 | + ("hProcess", ctypes.c_void_p), |
| 44 | + ] |
| 45 | + |
| 46 | + |
27 | 47 | __all__ = [ |
28 | 48 | "find_process", |
29 | 49 | "find_process_async", |
@@ -313,27 +333,6 @@ def shouldRollover(self, record): |
313 | 333 | return 0 |
314 | 334 |
|
315 | 335 |
|
316 | | -if sys.platform == 'win32': |
317 | | - class SHELLEXECUTEINFO(ctypes.Structure): |
318 | | - _fields_ = [ |
319 | | - ("cbSize", ctypes.c_ulong), |
320 | | - ("fMask", ctypes.c_ulong), |
321 | | - ("hwnd", ctypes.c_void_p), |
322 | | - ("lpVerb", ctypes.c_wchar_p), |
323 | | - ("lpFile", ctypes.c_wchar_p), |
324 | | - ("lpParameters", ctypes.c_wchar_p), |
325 | | - ("lpDirectory", ctypes.c_wchar_p), |
326 | | - ("nShow", ctypes.c_int), |
327 | | - ("hInstApp", ctypes.c_void_p), |
328 | | - ("lpIDList", ctypes.c_void_p), |
329 | | - ("lpClass", ctypes.c_wchar_p), |
330 | | - ("hkeyClass", ctypes.c_void_p), |
331 | | - ("dwHotKey", ctypes.c_ulong), |
332 | | - ("hIcon", ctypes.c_void_p), |
333 | | - ("hProcess", ctypes.c_void_p), |
334 | | - ] |
335 | | - |
336 | | - |
337 | 336 | def run_elevated(exe_path, cwd, *args): |
338 | 337 | """Start *exe_path* as Administrator and return the return code.""" |
339 | 338 | if sys.platform != 'win32': |
|
0 commit comments