Various File Dialog Header definitions (from shobjidl.idl in the SDK)
---------------------------------------------------------------------
typedef
[
helpstring("Constants for the type of usage of an open file")
]
enum tagFILE_USAGE_TYPE
{
FUT_PLAYING,
FUT_EDITING,
FUT_GENERIC
} FILE_USAGE_TYPE;
cpp_quote("#define OF_CAP_CANSWITCHTO 0x0001")
cpp_quote("#define OF_CAP_CANCLOSE 0x0002")
[
uuid(64a1cbf0-3a1a-4461-9158-376969693950),
pointer_default(unique)
]
interface IFileIsInUse : IUnknown
{
HRESULT GetAppName([out, string] LPWSTR *ppszName);
HRESULT GetUsage([out] FILE_USAGE_TYPE *pfut);
HRESULT GetCapabilities([out] DWORD *pdwCapFlags);
HRESULT GetSwitchToHWND([out] HWND *phwnd);
HRESULT CloseFile();
}
interface IFileDialog;
typedef [v1_enum] enum tagFDE_OVERWRITE_RESPONSE
{
FDEOR_DEFAULT = 0x00000000, // The application has not handled the event, and the dialog should put up UI asking the user
// whether or not the file should be overwritten and be returned from the dialog
FDEOR_ACCEPT = 0x00000001, // The application has decided that the file should be returned from the dialog
FDEOR_REFUSE = 0x00000002, // The application has decided that the file should not be returned from the dialog
} FDE_OVERWRITE_RESPONSE;
typedef [v1_enum] enum tagFDE_SHAREVIOLATION_RESPONSE
{
FDESVR_DEFAULT = 0x00000000, // The application has not handled the event. The dialog will put up UI indicating the file
// is in use, and a different file must be chosen.
FDESVR_ACCEPT = 0x00000001, // The application has decided that the file should be returned from the dialog
FDESVR_REFUSE = 0x00000002, // The application has decided that the file should not be returned from the dialog
} FDE_SHAREVIOLATION_RESPONSE;
typedef [v1_enum] enum tagFDAP
{
FDAP_BOTTOM = 0x00000000, // The place is added to the bottom of the default list.
FDAP_TOP = 0x00000001, // The place is added to the top of the default list.
} FDAP;
//
// Implemented by a client of the common file dialog browser,
// for notification of events within the dialog.
//
[
uuid(973510db-7d7f-452b-8975-74a85828d354),
object,
pointer_default(unique)
]
interface IFileDialogEvents : IUnknown
{
HRESULT OnFileOk([in] IFileDialog *pfd);
HRESULT OnFolderChanging([in] IFileDialog *pfd, [in] IShellItem *psiFolder);
HRESULT OnFolderChange([in] IFileDialog *pfd);
HRESULT OnSelectionChange([in] IFileDialog *pfd);
// Note: FOS_SHAREAWARE must be set in IFileDialog::SetOptions in order for this method to be called.
HRESULT OnShareViolation([in] IFileDialog *pfd, [in] IShellItem *psi, [out] FDE_SHAREVIOLATION_RESPONSE *pResponse);
HRESULT OnTypeChange([in] IFileDialog *pfd);
// Note: FOS_OVERWRITEPROMPT must be set in IFileDialog::SetOptions in order for this method to be called.
HRESULT OnOverwrite([in] IFileDialog *pfd, [in] IShellItem *psi, [out] FDE_OVERWRITE_RESPONSE *pResponse);
}
// Event notifications from the controls, handled by an interface
// optionally implemented by the same IFileDialogEvents object supplied by the app.
[
uuid(36116642-D713-4b97-9B83-7484A9D00433),
object,
pointer_default(unique)
]
interface IFileDialogControlEvents : IUnknown
{
// An item in a combobox, toolsmenu, or radiobutton group was selected.
// (this notification is *not* sent when an item is chosen from the open dropdown,
// as the action here is always the same: close the dialog as if the user clicked open.
// At that point, the app will then be able to call GetSelectedItem() for the open dropdown, to
// obtain the item that was chosen).
HRESULT OnItemSelected([in] IFileDialogCustomize *pfdc, [in] DWORD dwIDCtl, [in] DWORD dwIDItem);
// A pushbutton was clicked.
HRESULT OnButtonClicked([in] IFileDialogCustomize *pfdc, [in] DWORD dwIDCtl);
// A checkbutton was toggled.
HRESULT OnCheckButtonToggled([in] IFileDialogCustomize *pfdc, [in] DWORD dwIDCtl, [in] BOOL bChecked);
// A combobox, toolsmenu or open dropdown is about to be "dropped down". At this point,
// the application may want to update the contents based on the current state of the dialog.
HRESULT OnControlActivating([in] IFileDialogCustomize *pfdc, [in] DWORD dwIDCtl);
}
interface IShellItemFilter;
//
// Implemented by the common file dialog browser, used by clients to
// initialize, show, and get results from the dialog.
//
//
// Implemented by the common file dialog browser, used by clients to
// initialize, show, and get results from the dialog.
//
[
uuid(42f85136-db7e-439c-85f1-e4075d135fc8),
object,
pointer_default(unique)
]
interface IFileDialog : IModalWindow
{
enum tagFILEOPENDIALOGOPTIONS
{
FOS_OVERWRITEPROMPT = 0x00000002,
FOS_STRICTFILETYPES = 0x00000004,
FOS_NOCHANGEDIR = 0x00000008,
FOS_PICKFOLDERS = 0x00000020,
FOS_FORCEFILESYSTEM = 0x00000040, // Ensure that items returned are filesystem items.
FOS_ALLNONSTORAGEITEMS = 0x00000080, // Allow choosing items that have no storage.
FOS_NOVALIDATE = 0x00000100,
FOS_ALLOWMULTISELECT = 0x00000200,
FOS_PATHMUSTEXIST = 0x00000800,
FOS_FILEMUSTEXIST = 0x00001000,
FOS_CREATEPROMPT = 0x00002000,
FOS_SHAREAWARE = 0x00004000,
FOS_NOREADONLYRETURN = 0x00008000,
FOS_NOTESTFILECREATE = 0x00010000,
FOS_HIDEMRUPLACES = 0x00020000,
FOS_HIDEPINNEDPLACES = 0x00040000,
FOS_NODEREFERENCELINKS = 0x00100000,
FOS_DONTADDTORECENT = 0x02000000,
FOS_FORCESHOWHIDDEN = 0x10000000,
FOS_DEFAULTNOMINIMODE = 0x20000000
};
HRESULT SetFileTypes([in] UINT cFileTypes, [in, size_is(cFileTypes)] const COMDLG_FILTERSPEC *rgFilterSpec);
HRESULT SetFileTypeIndex([in] UINT iFileType);
HRESULT GetFileTypeIndex([out] UINT *piFileType);
HRESULT Advise([in] IFileDialogEvents *pfde, [out] DWORD *pdwCookie);
HRESULT Unadvise([in] DWORD dwCookie);
HRESULT SetOptions([in] DWORD fos);
HRESULT GetOptions([out] DWORD *pfos);
HRESULT SetDefaultFolder([in] IShellItem *psi);
HRESULT SetFolder([in] IShellItem *psi);
HRESULT GetFolder([out] IShellItem **ppsi);
HRESULT GetCurrentSelection([out] IShellItem **ppsi);
HRESULT SetFileName([in, string] LPCWSTR pszName);
HRESULT GetFileName([out, string] LPWSTR *pszName);
HRESULT SetTitle([in, string] LPCWSTR pszTitle);
HRESULT SetOkButtonLabel([in, string] LPCWSTR pszText);
HRESULT SetFileNameLabel([in, string] LPCWSTR pszLabel);
HRESULT GetResult([out] IShellItem **ppsi);
HRESULT AddPlace([in] IShellItem *psi, FDAP fdap);
HRESULT SetDefaultExtension([in] LPCWSTR pszDefaultExtension);
HRESULT Close(HRESULT hr);
HRESULT SetClientGuid([in] REFGUID guid);
HRESULT ClearClientData();
HRESULT SetFilter(IShellItemFilter *pFilter);
}
//
// Additional methods specific to the file save dialog
//
[
uuid(84bccd23-5fde-4cdb-aea4-af64b83d78ab),
object,
pointer_default(unique)
]
interface IFileSaveDialog : IFileDialog
{
HRESULT SetSaveAsItem([in] IShellItem *psi);
HRESULT SetProperties([in] IPropertyStore *pStore);
HRESULT SetCollectedProperties([in] IPropertyDescriptionList *pList, [in] BOOL fAppendDefault);
HRESULT GetProperties([out] IPropertyStore **ppStore);
HRESULT ApplyProperties([in
没有合适的资源?快使用搜索试试~ 我知道了~
WPF选择文件夹对话框,支持快捷方式
共22个文件
cs:10个
txt:4个
hgignore:1个
1星 需积分: 42 32 下载量 17 浏览量
2015-12-11
00:02:05
上传
评论
收藏 107KB ZIP 举报
温馨提示
WPF自带选择文件夹对话框较简单,且不支持快捷方式跳转。 本示例运行效果同window系统的资源管理器相似。 本代码初始来源于网络。部分我做了修改。 纯为了赚点资源分,好下载资料用。
资源推荐
资源详情
资源评论
收起资源包目录
选择文件夹对话框.zip (22个子文件)
wpffolderbrowser_8abf856663e3
.hg_archival.txt 147B
interop
comguids.cs 2KB
shellcominterfaces.cs 32KB
nativemethods.cs 24KB
nativetaskdialogshowstate.cs 259B
helpers.cs 647B
shellwrapperdefinitions.cs 2KB
errorhelper.cs 2KB
taskdialog api.txt 7KB
bin
Release
WPFFolderBrowser.dll 74KB
properties
assemblyinfo.cs 2KB
resources.resx 6KB
resources.designer.cs 3KB
library
WPFFolderBrowserDialog.cs 22KB
hbarck.ico 38KB
WPFFolderBrowser.sln 1KB
WPFFolderBrowser.res 748B
WPFFolderBrowser.csproj 7KB
filedialog api.txt 13KB
Visual Studio 2008 and NET Framework 3 5 Samples (FINAL) 2007-9-12.txt 8KB
.hgignore 45B
WPFFolderBrowser.csproj.user 497B
共 22 条
- 1
资源评论
- 1+1!=22023-03-06无语,说是支持快捷方式,结果又不支持
- moiska2016-03-208分就8分吧,不能运行啊!一个星表示抗议。
DuelCode
- 粉丝: 44
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功