Module shellapi
[hide private]
[frames] | no frames]

Source Code for Module shellapi

 1  #shellapi.py 
 2  #A part of NonVisual Desktop Access (NVDA) 
 3  #Copyright (C) 2006-2009 NVDA Contributors <http://www.nvda-project.org/> 
 4  #This file is covered by the GNU General Public License. 
 5  #See the file COPYING for more details. 
 6   
 7  from ctypes import * 
 8  from ctypes.wintypes import * 
 9   
10  shell32 = windll.shell32 
11   
12 -class SHELLEXECUTEINFOW(Structure):
13 _fields_ = ( 14 ("cbSize", DWORD), 15 ("fMask", ULONG), 16 ("hwnd", HWND), 17 ("lpVerb", LPCWSTR), 18 ("lpFile", LPCWSTR), 19 ("lpParameters", LPCWSTR), 20 ("lpDirectory", LPCWSTR), 21 ("nShow", c_int), 22 ("hInstApp", HINSTANCE), 23 ("lpIDList", LPVOID), 24 ("lpClass", LPCWSTR), 25 ("hkeyClass", HKEY), 26 ("dwHotKey", DWORD), 27 ("hIconOrMonitor", HANDLE), 28 ("hProcess", HANDLE), 29 )
30 - def __init__(self, **kwargs):
31 super(SHELLEXECUTEINFOW, self).__init__(cbSize=sizeof(self), **kwargs)
32 SHELLEXECUTEINFO = SHELLEXECUTEINFOW 33 34 SEE_MASK_NOCLOSEPROCESS = 0x00000040 35
36 -def ShellExecute(hwnd, operation, file, parameters, directory, showCmd):
37 if shell32.ShellExecuteW(hwnd, operation, file, parameters, directory, showCmd) <= 32: 38 raise WinError()
39
40 -def ShellExecuteEx(execInfo):
41 if not shell32.ShellExecuteExW(byref(execInfo)): 42 raise WinError()
43