文件另存为
<h4>效果图</h4>
<p><img src="http://www.skinui.cn/doc/img/5.0/4/SaveAsDialog.png" alt="文件另存为" /></p>
<h4>示例代码</h4>
<ul>
<li>h文件</li>
</ul>
<pre><code class="language-c">#pragma once
class CDemoSaveAsDialogLayout : public CFlexLayout
{
public:
enum
{
IDC_BUTTON_CLICK_ME = 1001,
};
public:
CDemoSaveAsDialogLayout(CView* pParent);
public:
virtual void OnBuildFinish();
protected:
void OnBtnClickedClickMe(UINT uNotifyCode, int nID, CView* pView);
SKINUI_DECLARE_MESSAGE_MAP()
SKINUI_DECLARE_DYNCREATE(CDemoSaveAsDialogLayout, CFlexLayout)
};</code></pre>
<ul>
<li>cpp文件</li>
</ul>
<pre><code class="language-c">#include <stdafx.h>
#include "DemoSaveAsDialogLayout.h"
SKINUI_BEGIN_MESSAGE_MAP(CDemoSaveAsDialogLayout, CFlexLayout)
ON_SKINUI_COMMAND(IDC_BUTTON_CLICK_ME, OnBtnClickedClickMe)
SKINUI_END_MESSAGE_MAP()
CDemoSaveAsDialogLayout::CDemoSaveAsDialogLayout(CView* pParent)
: CFlexLayout(pParent)
{
}
void CDemoSaveAsDialogLayout::OnBuildFinish()
{
CFlexLayout::OnBuildFinish();
}
void CDemoSaveAsDialogLayout::OnBtnClickedClickMe(UINT uNotifyCode, int nID, CView* pView)
{
CSaveAsDialog dialog(_T("123.txt"), s_lpstrAllFileFilter);
if(dialog.DoModal(GetOwner()->GetHWND()) == IDOK)
{
String strFolder = dialog.GetFile();
}
}</code></pre>