SHGetSpecialFolderPath and SHGetSpecialFolderLocation



SHGetSpecialFolderPath function

[SHGetSpecialFolderPath is not supported. Instead, use ShGetFolderPath.]

Retrieves the path of a special folder, identified by its CSIDL.

Syntax

C++
BOOL SHGetSpecialFolderPath(
        HWND   hwndOwner,
  _Out_ LPTSTR lpszPath,
  _In_  int    csidl,
  _In_  BOOL   fCreate
);

Parameters

hwndOwner

Type: HWND

Reserved.

lpszPath [out]

Type: LPTSTR

A pointer to a null-terminated string that receives the drive and path of the specified folder. This buffer must be at least MAX_PATH characters in size.

csidl [in]

Type: int

A CSIDL that identifies the folder of interest. If a virtual folder is specified, this function will fail.

fCreate [in]

Type: BOOL

Indicates whether the folder should be created if it does not already exist. If this value is nonzero, the folder is created. If this value is zero, the folder is not created.

Return value

Type: BOOL

TRUE if successful; otherwise, FALSE.

Remarks

The Microsoft Internet Explorer 4.0 Desktop Update must be installed for this function to be available.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

End of client support

Windows 2000 Professional

End of server support

Windows 2000 Server

Header

Shlobj.h

Library

Shell32.lib

DLL

Shell32.dll (version 4.71 or later)

Unicode and ANSI names

SHGetSpecialFolderPathW (Unicode) and SHGetSpecialFolderPathA (ANSI)

 

                    

7/27/2011                        
===========================================

SHGetSpecialFolderLocation function

[SHGetSpecialFolderLocation is not supported and may be altered or unavailable in the future. Instead, use SHGetFolderLocation.]

Retrieves a pointer to the ITEMIDLIST structure of a special folder.

Syntax

C++
HRESULT SHGetSpecialFolderLocation(
  _In_  HWND             hwndOwner,
  _In_  int              nFolder,
  _Out_ PIDLIST_ABSOLUTE *ppidl
);

Parameters

hwndOwner [in]

Type: HWND

Reserved.

nFolder [in]

Type: int

A CSIDL value that identifies the folder of interest.

ppidl [out]

Type: PIDLIST_ABSOLUTE*

A PIDL specifying the folder's location relative to the root of the namespace (the desktop). It is the responsibility of the calling application to free the returned IDList by using CoTaskMemFree.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

End of client support

Windows 2000 Professional

End of server support

Windows 2000 Server

Header

Shlobj.h

Library

Shell32.lib

DLL

Shell32.dll (version 4.0 or later)


    
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值