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

Source Code for Module shlobj

 1  #shlobj.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  MAX_PATH = 260 
13   
14  CSIDL_APPDATA = 0x001a 
15  CSIDL_COMMON_APPDATA = 0x0023 
16   
17 -def SHGetFolderPath(owner, folder, token=0, flags=0):
18 path = create_unicode_buffer(MAX_PATH) 19 if shell32.SHGetFolderPathW(owner, folder, token, flags, byref(path)) != 0: 20 raise WinError() 21 return path.value
22