資源簡介
不需要文件實際存在,只要傳遞一個文件后綴名,就可以獲取相應的文件列表。
應用場合:
適合在客戶端獲取服務器文件名來顯示文件圖標

代碼片段和文件信息
//?GetFileIcon.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“GetFileIcon.h“
#include?“GetFileIconDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CGetFileIconApp
BEGIN_MESSAGE_MAP(CGetFileIconApp?CWinApp)
//{{AFX_MSG_MAP(CGetFileIconApp)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG
ON_COMMAND(ID_HELP?CWinApp::onhelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CGetFileIconApp?construction
CGetFileIconApp::CGetFileIconApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CGetFileIconApp?object
CGetFileIconApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CGetFileIconApp?initialization
BOOL?CGetFileIconApp::InitInstance()
{
AfxEnableControlContainer();
//?Standard?initialization
//?If?you?are?not?using?these?features?and?wish?to?reduce?the?size
//??of?your?final?executable?you?should?remove?from?the?following
//??the?specific?initialization?routines?you?do?not?need.
#ifdef?_AFXDLL
Enable3dControls(); //?Call?this?when?using?MFC?in?a?shared?DLL
#else
Enable3dControlsStatic(); //?Call?this?when?linking?to?MFC?statically
#endif
CGetFileIconDlg?dlg;
m_pMainWnd?=?&dlg;
int?nResponse?=?dlg.DoModal();
if?(nResponse?==?IDOK)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?OK
}
else?if?(nResponse?==?IDCANCEL)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?Cancel
}
//?Since?the?dialog?has?been?closed?return?FALSE?so?that?we?exit?the
//??application?rather?than?start?the?application‘s?message?pump.
return?FALSE;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄??????????0??2009-04-17?13:31??GetFileIcon
?????目錄??????????0??2009-04-17?13:31??GetFileIcon\Debug
?????文件?????106553??2009-04-17?13:29??GetFileIcon\Debug\GetFileIcon.exe
?????文件??????35500??2009-04-17?11:55??GetFileIcon\GetFileIcon.aps
?????文件???????1124??2009-04-17?13:30??GetFileIcon\GetFileIcon.clw
?????文件???????2133??2009-04-17?11:47??GetFileIcon\GetFileIcon.cpp
?????文件???????4249??2009-04-17?11:47??GetFileIcon\GetFileIcon.dsp
?????文件????????545??2009-04-17?11:47??GetFileIcon\GetFileIcon.dsw
?????文件???????1379??2009-04-17?11:47??GetFileIcon\GetFileIcon.h
?????文件??????58368??2009-04-17?13:31??GetFileIcon\GetFileIcon.ncb
?????文件??????54784??2009-04-17?13:31??GetFileIcon\GetFileIcon.opt
?????文件???????1608??2009-04-17?13:29??GetFileIcon\GetFileIcon.plg
?????文件???????5285??2009-04-17?11:55??GetFileIcon\GetFileIcon.rc
?????文件???????5924??2009-04-17?13:29??GetFileIcon\GetFileIconDlg.cpp
?????文件???????1433??2009-04-17?13:25??GetFileIcon\GetFileIconDlg.h
?????文件???????3669??2009-04-17?11:47??GetFileIcon\ReadMe.txt
?????目錄??????????0??2009-04-17?11:47??GetFileIcon\res
?????文件???????1078??2009-04-17?11:47??GetFileIcon\res\GetFileIcon.ico
?????文件????????403??2009-04-17?11:47??GetFileIcon\res\GetFileIcon.rc2
?????文件????????689??2009-04-17?11:50??GetFileIcon\resource.h
?????文件????????213??2009-04-17?11:47??GetFileIcon\StdAfx.cpp
?????文件???????1054??2009-04-17?11:47??GetFileIcon\StdAfx.h
-----------?---------??----------?-----??----
???????????????285991????????????????????22
- 上一篇:MsComm32套件
- 下一篇:采用MFC編寫的文件加密解密程序
評論
共有 條評論