91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3.37MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-09-28
  • 語言: 其他
  • 標簽: vc??

資源簡介

利用VC中的Treeview和Listview,做一個自己的資源管理器,左側的樹狀目錄可以關閉,當點擊一個文件夾時右側的Listview中會顯示文件夾的內容。盡量模仿windows的資源管理器的功能,比如左側文件夾圖標的變化和右側listview中可以顯示“列表”,“詳細資料”。

資源截圖

代碼片段和文件信息

//?DirListCtrl.cpp?:?implementation?file
//

#include?“stdafx.h“
#include?“MyExplorer.h“
#include?“DirListCtrl.h“

#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
//?CDirListCtrl

CDirListCtrl::CDirListCtrl()
{
}

CDirListCtrl::~CDirListCtrl()
{
}


BEGIN_MESSAGE_MAP(CDirListCtrl?CListCtrl)
//{{AFX_MSG_MAP(CDirListCtrl)
ON_WM_RBUTTONDOWN()
ON_COMMAND(IDM_EDIT_COPY?OnEditCopy)
ON_COMMAND(IDM_EIDT_CUT?OnEidtCut)
ON_COMMAND(IDM_EDIT_PASTE?OnEditPaste)
ON_COMMAND(IDM_EDIT_DELETE?OnEditDelete)
ON_NOTIFY_REFLECT(LVN_ITEMCHANGED?OnItemchanged)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
//?CDirListCtrl?message?handlers

void?CDirListCtrl::SetFolder(CString?sFile)
{
int?index;

if?(sFile?==?““)?return?; //如果地址為空,則返回

m_strPath?=?sFile;

CImageList?*?imageList?=?m_SysImageList.GetImageList(?FALSE?);
SetImageList(imageList?LVSIL_NORMAL);

CFileFind?finder;
int?bWorking?=?finder.FindFile(sFile+“*.*“);

if(?bWorking?)?{
DeleteAllItems();
}
else?return;

while(?bWorking?)?{
bWorking?=?finder.FindNextFile();
if(!finder.IsDots())?
{
HICON?icon?=?m_SysImageList.GetIcon(sFile+finder.GetFileName()FALSEFALSE);
index?=?imageList->Add(icon);
InsertItem(?1?sFile+finder.GetFileName()?index?);
}
}
}

void?CDirListCtrl::OnRButtonDown(UINT?nFlags?CPoint?point)?
{
CListCtrl::OnRButtonDown(nFlags?point);

CRect?rect;
GetWindowRect(&rect);

if(!GetSelectedCount())?{
return;
}
else?{
CMenu?*?m_PopMenu?=?new?CMenu;
m_PopMenu->LoadMenu(IDR_MENU_MAINframe);

TrackPopupMenu(m_PopMenu->GetSubMenu(1)->m_hMenu?0?
point.x+rect.left?point.y+rect.top?
0?this->GetSafeHwnd()&rect);
}
}

void?CDirListCtrl::OnEditCopy()?
{
strSrcPath?=?strSelItemPath;
strDesPath?=?““;
nOption?=?1;
}

void?CDirListCtrl::OnEidtCut()?
{
strSrcPath?=?strSelItemPath;
strDesPath?=?““;
nOption?=?2;

}

void?CDirListCtrl::OnEditPaste()?
{
strDesPath?=?m_strPath;

CString?msg;
msg?+=?“源文件:“;
msg?+=?strSrcPath;
msg?+=?“\n“;
msg?+=?“目標文件:“;
msg?+=?strDesPath;
msg?+=?“\n“;

if(nOption?==?1)?{
if(CopyFile(strSrcPathstrDesPathFALSE))?{
msg?+=?“文件拷貝成功!“;
MessageBox(msg);
}
else?{
msg?+=?“文件拷貝失??!“;
MessageBox(msg);
}
}
else?if(nOption?==?2)?{
if(MoveFile(strSrcPathstrDesPath))?{
msg?+=?“文件移動成功!“;
MessageBox(msg);
}
else?{
msg?+=?“文件移動失敗!“;
MessageBox(msg);
}
}
}

void?CDirListCtrl::OnEditDelete()?
{
strSrcPath?=?strSelItemPath;

CString?msg;
msg?+=?“源文件:“;
msg?+=?strSrcPath;
msg?+=?“\n“;

if(DeleteFile(strSrcPath))?{
msg?+=?“文件刪除成功!“;
MessageBox(msg);
}
else?{
msg?+=?“文件刪除失敗!“;
MessageBox(msg);
}
}

void?CDirListCtrl::O

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????29302??2010-09-24?20:20??P031M資源管理器\Debug\DirListCtrl.obj

?????文件??????39997??2010-09-24?20:20??P031M資源管理器\Debug\DirTreeCtrl.obj

?????文件????2125927??2010-09-24?20:36??P031M資源管理器\Debug\MyExplorer.exe

?????文件????2504868??2010-09-24?20:36??P031M資源管理器\Debug\MyExplorer.ilk

?????文件??????14447??2010-09-24?20:20??P031M資源管理器\Debug\MyExplorer.obj

?????文件????5466844??2010-09-24?20:20??P031M資源管理器\Debug\MyExplorer.pch

?????文件????4121600??2010-09-24?20:36??P031M資源管理器\Debug\MyExplorer.pdb

?????文件???????8736??2010-09-24?20:36??P031M資源管理器\Debug\MyExplorer.res

?????文件??????34590??2010-09-24?20:20??P031M資源管理器\Debug\MyExplorerDlg.obj

?????文件?????105867??2010-09-24?20:20??P031M資源管理器\Debug\StdAfx.obj

?????文件??????12575??2010-09-24?20:20??P031M資源管理器\Debug\SystemImageList.obj

?????文件?????214016??2010-09-25?02:07??P031M資源管理器\Debug\vc60.idb

?????文件?????364544??2010-09-24?20:20??P031M資源管理器\Debug\vc60.pdb

?????文件???????3265??2010-09-24?20:20??P031M資源管理器\DirListCtrl.cpp

?????文件???????1549??2010-09-24?20:20??P031M資源管理器\DirListCtrl.h

?????文件???????7623??2010-09-24?20:20??P031M資源管理器\DirTreeCtrl.cpp

?????文件???????2004??2010-09-24?20:20??P031M資源管理器\DirTreeCtrl.h

?????文件??????21392??2010-09-25?02:06??P031M資源管理器\MyExplorer.aps

?????文件???????1216??2010-09-24?20:37??P031M資源管理器\MyExplorer.clw

?????文件???????2119??2010-09-24?20:20??P031M資源管理器\MyExplorer.cpp

?????文件???????4534??2010-09-24?20:20??P031M資源管理器\MyExplorer.dsp

?????文件????????543??2010-09-24?20:20??P031M資源管理器\MyExplorer.dsw

?????文件???????1368??2010-09-24?20:20??P031M資源管理器\MyExplorer.h

?????文件?????140288??2010-09-25?02:07??P031M資源管理器\MyExplorer.ncb

?????文件??????83968??2010-09-25?02:07??P031M資源管理器\MyExplorer.opt

?????文件????????254??2010-09-25?02:07??P031M資源管理器\MyExplorer.plg

?????文件???????5557??2010-09-24?20:36??P031M資源管理器\MyExplorer.rc

?????文件???????6089??2010-09-24?20:20??P031M資源管理器\MyExplorerDlg.cpp

?????文件???????1787??2010-09-24?20:20??P031M資源管理器\MyExplorerDlg.h

?????文件???????3651??2010-09-24?20:20??P031M資源管理器\ReadMe.txt

............此處省略14個文件信息

評論

共有 條評論