Ejemplo n.º 1
0
        public static string GetAllUsersFolderPath(SpecialFolderCSIDL csidl)
        {
            StringBuilder path = new StringBuilder(MAX_PATH);

            SHGetFolderPath(IntPtr.Zero, csidl, IntPtr.Zero, 0, path);
            return(path.ToString());
        }
Ejemplo n.º 2
0
        public static string SHGetFolderPath(IntPtr hwndOwner, SpecialFolderCSIDL nFolder, IntPtr hToken, uint dwFlags)
        {
            var sb = new StringBuilder(300);

            int result = SHGetFolderPath(hwndOwner, (int)nFolder, hToken, dwFlags, sb);

            if (result != 0)
            {
                return(null);
            }

            return(sb.ToString());
        }
Ejemplo n.º 3
0
        public static string SHGetFolderPath(IntPtr hwndOwner, SpecialFolderCSIDL nFolder, IntPtr hToken, uint dwFlags)
        {
            var sb = new StringBuilder(300);

            int result = SHGetFolderPath(hwndOwner, (int)nFolder, hToken, dwFlags, sb);

            if (result != 0)
                return null;

            return sb.ToString();
        }
Ejemplo n.º 4
0
 static extern int SHGetFolderPath(IntPtr hwndOwner, SpecialFolderCSIDL nFolder, IntPtr hToken,
                                   uint dwFlags, [Out] StringBuilder pszPath);