ldren (hItem);
if (IsDriveNode (hItem))
AddDummyNode (hItem);
else
SetButtonState (hItem, strPathName);
}
}
m_LocalPath = strPathName;
*pResult = 0;
}
void CLeftView::OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
HTREEITEM hItem = pNMTreeView->itemNew.hItem;
CString strPathName = GetPathFromItem (hItem);
*pResult = FALSE;
if(strPathName == MYCOMPUTER)
return;
CWaitCursor wait;
if (!AddDirectoryNodes (hItem, strPathName))
*pResult = TRUE;
m_LocalPath = strPathName;
*pResult = 0;
}
////////////////////////////////////// DriveExplorerView.h : interface of the CDriveExplorerView class
#if !defined(AFX_DRIVEEXPLORERVIEW_H__29F66873_4E46_11D6_9693_B383368EF622__INCLUDED_)
#define AFX_DRIVEEXPLORERVIEW_H__29F66873_4E46_11D6_9693_B383368EF622__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CDriveExplorerView : public CListView
{
protected: // create from serialization only
CDriveExplorerView();
DECLARE_DYNCREATE(CDriveExplorerView)
// Attributes
public:
CDriveExplorerDoc* GetDocument();
CImageList* m_pImageList;
CImageList* m_pImageListL;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDriveExplorerView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void OnInitialUpdate(); // called first time after construct
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
void SetupImages(CImageList* mImageList, int iSize);
UINT GetListViewIcon(CString s);
CString GetFileType(CString s);
LPTSTR GetNTS(CString cString);
void AddToListView(WIN32_FIND_DATA* fd);
void DeleteAllItems();
virtual ~CDriveExplorerView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CDriveExplorerView)
afx_msg void OnDestroy();
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
afx_msg void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct);
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in DriveExplorerView.cpp
inline CDriveExplorerDoc* CDriveExplorerView::GetDocument()
{ return (CDriveExplorerDoc*)m_pDocument; }
#endif
#endif
//////////////////////////////// DriveExplorerView.cpp : implementation of the CDriveExplorerView class
#include "stdafx.h"
#include "DriveExplorer.h"
#include "DriveExplorerDoc.h"
#include "DriveExplorerView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THI