import sys, ctypes as C
pSavePath = C.c_wchar_p()
lib = C.windll.shell32
class GUID(C.Structure):
_fields_ = [("Data1", C.c_ulong),
("Data2", C.c_ushort),
("Data3", C.c_ushort),
("Data4", C.c_ubyte *8), ]
#folder_local_data
fld = GUID()
fld.Data1 = 0xF1B32785
fld.Data2 = 0x6FBA
fld.Data3 = 0x4FCF
arr_8 = C.c_ubyte *8
fld.Data4 = arr_8(0x9D, 0x55, 0x7B, 0x8E, 0x7F, 0x15, 0x70, 0x91)
ret_val = lib.SHGetKnownFolderPath(C.pointer(fld), 0,0, C.pointer(pSavePath))
print pSavePath.value
|