Nice work.

I will definitely make a note of that one.

Thanks rodi.

Adam.

On 29 March 2010 23:02, rodi <c2...@web.de> wrote:

> Hello PytonCE users,
>
> have solved the question. The appropriate function
> is 'SHGetSpecialFolderPath': see
> http://msdn.microsoft.com/en-us/library/aa931257.aspx
>
> May be this info and the follwing code snippet is helpfull to others :)
>
> import ctypes
> from time import sleep
>
> HANDLE = ctypes.c_ulong
> HWND = HANDLE
> INT = ctypes.c_int
> BOOL = ctypes.c_int
>
> SHGetSpecialFolderPath = ctypes.windll.coredll.SHGetSpecialFolderPath
> # BOOL SHGetSpecialFolderPath( HWND hwndOwner, LPTSTR lpszPath, int
> nFolder,
> BOOL fCreate );
> SHGetSpecialFolderPath.argtypes = [HWND, ctypes.c_wchar_p, INT, BOOL]
> MAX_PATH = 260
> path = ctypes.create_unicode_buffer(MAX_PATH)
> for i in range(0, 60): #[CSIDL_STARTMENU, CSIDL_PROGRAMS]:
>    try:
>        SHGetSpecialFolderPath( 0,  path, i, 0)
>        if len(path.value)>0:
>            print i, path.value
>        else:
>            print i, 'not supported'
>    except Exception, e:
>        print i, 'exception', e
> sleep(5)
>
>
> Cheers rodi.
> _______________________________________________
> PythonCE mailing list
> PythonCE@python.org
> http://mail.python.org/mailman/listinfo/pythonce
>
_______________________________________________
PythonCE mailing list
PythonCE@python.org
http://mail.python.org/mailman/listinfo/pythonce

Reply via email to