亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dlggetpath.cpp

?? the same function with explore of SHBrowseForFolder example
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/////////////////////////////////////////////////////////////////////////////
//
// DlgGetPath.cpp : implementation file
//
//PURPOSE
//	Display a dialog to allow the user to select a file path.
//
//AUTHOR
//	John McTainsh (john@mctainsh.com)
//
//THING TO DO
//	1)	Display the recycle bin appropiatly.
//	2)	Display the contents of the recycle bin with out S- numbers.
//	3)	Sort items when added except for "Entire Network"
//	4)	Check on a more complex network.
//	5)	Get icons for the network items.
//	6)	Determine why icon disappears from the ALT-TAB bar when active?
//	7)	Handle WNetEnumResource for more than 16384 bytes of data.
//	8)	Use SHGetFileInfo to load the correct icons to display.
//
//VERSION HISTORY
//	Ver 1.0 - 21.5.99
//		*Inital release.
//
//  Ver 2.0 - 10.7.99
//		*Corrected Bug identified by Sven Wiegand when locating Drives.
//		*Added Set Path option to expand to the tree to 
//		 the inital path on startup.
//
//BOGUS COPYRIGHT NOTICE
//	Copyright 1999 (C) John McTainsh.
//	I am happy for any developer to use this dialog. I think it is pretty
//	cool and suites my purposes. Feel free to copy and alter whatever
//	you please. Keep me informed of any good things you do to it
//	and also what it has been used for (for my ego).
//
//	This is shareware and can be copied or distrabuted without my concent,
//	permision or knowledge. It would be uncool to use it without putting
//	my name in the credits (ego) but that is up to you.
//
//	This code is provide as is. If it dont work or dont do what it should
//	then dont come crying to me. It is full of bugs (undocumented features)
//	which you the user/developer must find to use it.
//
//	Remember, you to can become a Jedi master (VC++ developer) if you can
//	resist the temptations of the dark side of the force (VB).
//
//	PS
//		Comments regarding my spelling will NOT be kindly recieved.
//	PSS
//		All the best software is written by New Zealanders.
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Resource.h"								//Definitions for resource ID's
#include "DlgGetPath.h"								//Definition to get path

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


/////////////////////////////////////////////////////////////////////////////
//Handy local functions.
TCHAR*	MakeObjectDynamic( LPTSTR szData );
CString WindowName( CString sName );
bool	ParsePath( CString sPath, int nLevel, CString *const psDirName );

#define NETWORK_NEIGHBOUR   _T("Network Neighborhood")


/////////////////////////////////////////////////////////////////////////////
// CDlgGetPath dialog
CDlgGetPath::CDlgGetPath(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgGetPath::IDD, pParent)
{
	TRACE( _T("CDlgGetPath::CDlgGetPath(%p)\n"), pParent );
	//{{AFX_DATA_INIT(CDlgGetPath)
	//}}AFX_DATA_INIT
	m_hNetworkRoot = NULL;
}


void CDlgGetPath::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgGetPath)
	DDX_Control(pDX, IDC_TREE, m_Tree);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgGetPath, CDialog)
	//{{AFX_MSG_MAP(CDlgGetPath)
	ON_NOTIFY(TVN_SELCHANGED, IDC_TREE, OnSelchangedTree)
	ON_NOTIFY(TVN_ITEMEXPANDING, IDC_TREE, OnItemexpandingTree)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()



/////////////////////////////////////////////////////////////////////////////
//FUNCTION
//	Parse the path and extract the given directory or drive name.
//	nLevel 0 will return the drive number or "" for a network name.
//CREATED
//	10-7-1999  11:37:47
//PARAMS
//	sPath		Full path to parse.
//	nLevel		Level to return 0 = the root or drive name.
//	psDirName	returned directory name
//RETURNS
//	true	if a directory or drive name was returned.
//	false	if no more directorys
bool ParsePath( CString sPath, int nLevel, CString *const psDirName )
{
	ASSERT( psDirName );
	//find first match
	int nStart = 0;									//Location in sPath to search from
	while( nLevel )
	{
		nStart = sPath.Find( _T('\\'), nStart );
		if( nStart < 0 )
			return false;
		nLevel--;
		nStart++;
	}
	//We now have the start point to find the end.
	int nEnd = sPath.Find( _T('\\'), nStart );
	if( nEnd < 0 )
		*psDirName = sPath.Mid( nStart );
	else
		*psDirName = sPath.Mid( nStart, nEnd-nStart);
	return true;
}




/////////////////////////////////////////////////////////////////////////////
//FUNCTION
//	Setup inital Dialog Data.
//CREATED
//	8-5-1999  19:57:09
//RETURNS
//	See help
BOOL CDlgGetPath::OnInitDialog() 
{
	TRACE( _T("CDlgGetPath::OnInitDialog()\n") );
	CDialog::OnInitDialog();

	//
	//Setup the Image lists
	//
	if( !m_ImageListTree.Create( IDB_FILE_TYPES, 17, 1, RGB( 255, 255, 255 ) ) )
		TRACE( _T("Image list creation fault") );
	m_Tree.SetImageList( &m_ImageListTree, TVSIL_NORMAL );

	//
	//List the local drives
	//
	for( TCHAR cLetter = _T('A'); cLetter <= _T('Z'); cLetter++ )
	{
		CString sDrive = cLetter;
		sDrive += _T(":");						
		UINT nType = GetDriveType( sDrive + _T("\\") );
		if( DRIVE_REMOVABLE <= nType && nType <= DRIVE_RAMDISK )
			InsertItem( TVI_ROOT, NULL, sDrive, nType );
	}
	//Network neighbour hood
	m_hNetworkRoot = InsertItem( TVI_ROOT, NULL, NETWORK_NEIGHBOUR, DRIVE_RAMDISK+1 );

	//
	//Expand the Tree to the Inital Path.
	//
	int nLevel = 0;
	CString sDirName;
	HTREEITEM hCurrent = TVI_ROOT;					//Current item in the list being expanded.
	while( ParsePath( m_sPath, nLevel, &sDirName ) )
	{
		//Network or Drive expand
		if( !nLevel && sDirName.IsEmpty() )
				sDirName = NETWORK_NEIGHBOUR;
		//Search for the matching tree item and expand
		HTREEITEM hItem = m_Tree.GetChildItem( hCurrent );	
		while( hItem )
		{
			if( sDirName.CompareNoCase( m_Tree.GetItemText( hItem ) ) == 0 )
			{
				hCurrent = hItem;
				m_Tree.Expand( hCurrent, TVE_EXPAND );
				break;
			}
			hItem = m_Tree.GetNextSiblingItem( hItem );
		}
		nLevel++;
	}
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}


///////////////////////////////////////////////////////////////////////////////
//DESCRIPTION:
//	Insert an Item in to the List
//CREATED:
//	10-5-1999  13:49:20
//PARAMS:
//	hParent		Parent to Attach to.
//	sText		Text to Add.
//	iImage		Image.
//RETURN:
//	Handle of Item created
HTREEITEM CDlgGetPath::InsertItem( HTREEITEM hParent, NETRESOURCE *const pNetResource, CString sText, int iImage, int iImageSelected /* = -1 */ )
{
	TRACE( _T("CDlgGetPath::InsertItem(%p,%p,%s +++ )\n"), hParent, pNetResource, sText );
	sText = WindowName( sText );
	TVINSERTSTRUCT InsertStruct;
	InsertStruct.hParent		= hParent;	
	InsertStruct.hInsertAfter	= TVI_LAST;
	InsertStruct.itemex.mask	= TVIF_IMAGE | TVIF_TEXT | TVIF_CHILDREN | 
								  TVIF_SELECTEDIMAGE | TVIF_PARAM;
	InsertStruct.itemex.pszText	= sText.GetBuffer( sText.GetLength() );  sText.ReleaseBuffer();
	InsertStruct.itemex.iImage	= iImage;
	InsertStruct.itemex.cChildren= 1;
	InsertStruct.itemex.lParam	= (LPARAM)pNetResource;
	if( iImageSelected == -1 )
		InsertStruct.itemex.iSelectedImage = iImage;
	else
		InsertStruct.itemex.iSelectedImage = iImageSelected;
	return m_Tree.InsertItem( &InsertStruct );
}


/////////////////////////////////////////////////////////////////////////////
//FUNCTION
//	Called in request to expand an item in the tree.
//CREATED
//	8-5-1999  19:57:09
//PARAMS
//	sPath	Path to use for populating from
//	hParent	Where to add the data
//RETURNS
//	True if some children were added
bool CDlgGetPath::PopulateTree( CString sPath, HTREEITEM hParent ) 
{
	TRACE( _T("CDlgGetPath::PopulateTree( %s )\n"), sPath );
	bool bGotChildren = false;						//True if a child is added.	
	//
	//Populate Network neighbourhood tree (Entire network and Local-Computers)
	//
	if( hParent == m_hNetworkRoot )
	{
		bGotChildren = EnumNetwork( hParent );
	}
	//
	//Network item(Search deep into the network)
	//
	else if( m_Tree.GetItemData( hParent ) )
	{
		bGotChildren = EnumNetwork( hParent );
	}
	
	//
	//Search for files and populate the CTreeCtrl
	//
	else
	{
		CFileFind finder;
		BOOL bWorking = finder.FindFile( sPath+_T("*.*") );
		while (bWorking)   
		{
			bWorking = finder.FindNextFile();
			if( finder.IsDots() )
				continue;
			if( finder.IsDirectory() )
			{
				InsertItem( hParent, NULL, finder.GetFileName(), DRIVE_NO_ROOT_DIR, DRIVE_UNKNOWN );
				bGotChildren = true;
			}
		}
	}

	//
	//Remove the [+] if no children
	//
	if( !bGotChildren )
	{
		TVITEM item		= { 0 };
		item.mask		= TVIF_HANDLE | TVIF_CHILDREN;
		item.hItem		= hParent;
		item.cChildren	= 0;
		m_Tree.SetItem( &item );
	}
	return bGotChildren;
}


/////////////////////////////////////////////////////////////////////////////
//FUNCTION
//	Get the Part from a given selection point.
//CREATED
//	8-5-1999  22:29:00
//PARAMS
//	hItem	Item to Get Path for.
//RETURNS
//	Full path as a string.
CString CDlgGetPath::GetItemPath( HTREEITEM hItem ) 
{
	TRACE( _T("CDlgGetPath::GetItemPath(%p)\n"), hItem );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区欧美亚洲| 国产丝袜欧美中文另类| 视频精品一区二区| 51午夜精品国产| 麻豆久久久久久| 精品国精品自拍自在线| 国产一区二区三区精品视频| 26uuu成人网一区二区三区| 波多野结衣在线aⅴ中文字幕不卡| 国产精品私人影院| 色婷婷国产精品久久包臀| 亚洲成精国产精品女| 精品成人一区二区| thepron国产精品| 亚洲国产一区在线观看| 欧美一区二区美女| 成人网页在线观看| 亚洲成人第一页| 久久精品亚洲一区二区三区浴池 | 6080亚洲精品一区二区| 精品在线免费观看| 中文字幕一区二区三区不卡在线 | 国产91精品入口| 亚洲自拍偷拍av| 日韩精品一区二区三区swag| 国产99久久久久| 日韩激情av在线| 国产精品久久久久久久久搜平片| 欧美视频一区二区三区在线观看| 九九久久精品视频| 亚洲男人的天堂在线观看| 欧美高清一级片在线| 处破女av一区二区| 丝袜亚洲另类欧美综合| 国产精品毛片高清在线完整版 | 99久久伊人网影院| 日本亚洲欧美天堂免费| 亚洲欧洲成人av每日更新| 欧美精品 日韩| 色94色欧美sute亚洲线路一ni| 九色综合国产一区二区三区| 亚洲柠檬福利资源导航| 久久久久国色av免费看影院| 色视频欧美一区二区三区| 国产精品一区二区在线观看不卡 | 欧美一区二区三区视频在线| 成人丝袜18视频在线观看| 青娱乐精品视频在线| 一区二区欧美国产| 亚洲国产精品av| 日韩免费高清av| 欧美日韩电影在线| 日本乱人伦一区| 99精品偷自拍| 高清视频一区二区| 国精产品一区一区三区mba视频 | 亚洲日本成人在线观看| 久久久国际精品| 精品欧美一区二区在线观看| 欧美三级韩国三级日本一级| 色视频一区二区| 91免费在线视频观看| 成人精品视频一区二区三区尤物| 久久精品国产久精国产爱| 婷婷国产v国产偷v亚洲高清| 亚洲精品高清视频在线观看| 亚洲欧美一区二区三区极速播放| 欧美激情资源网| 国产精品嫩草影院av蜜臀| 久久―日本道色综合久久| 日韩欧美电影在线| 精品国产乱码久久久久久夜甘婷婷 | 91国产视频在线观看| 色www精品视频在线观看| 在线观看视频一区二区| 色综合视频一区二区三区高清| 99久久久精品免费观看国产蜜| 99久久99久久精品国产片果冻| www.在线欧美| 91在线精品一区二区| 91啦中文在线观看| 日本韩国欧美国产| 在线成人免费观看| 日韩欧美中文字幕制服| 欧美mv日韩mv| 久久精品综合网| 粉嫩aⅴ一区二区三区四区五区| 成人综合婷婷国产精品久久蜜臀| 成人h版在线观看| 99精品热视频| 欧美日韩久久一区| 日韩女优电影在线观看| 久久精品夜色噜噜亚洲aⅴ| 国产精品女主播av| 亚洲福利视频导航| 久久爱www久久做| 成人h动漫精品一区二区| 91福利国产精品| 日韩三级视频在线观看| 国产婷婷一区二区| 亚洲精品视频观看| 三级不卡在线观看| 国产高清在线精品| 91在线观看成人| 宅男噜噜噜66一区二区66| 精品成人免费观看| 亚洲精品乱码久久久久| 日韩中文字幕不卡| 国模套图日韩精品一区二区| av电影一区二区| 日韩一区二区三区视频| 欧美国产精品一区二区| 亚洲一区二区美女| 国产一区三区三区| 91成人国产精品| 国产日韩欧美精品电影三级在线| 一区二区三区免费| 国产在线国偷精品免费看| 在线国产电影不卡| 久久久久久久综合| 亚洲国产一区二区在线播放| 国产一级精品在线| 色视频一区二区| 黄一区二区三区| 91官网在线免费观看| 久久久激情视频| 视频在线观看91| 99视频精品全部免费在线| 日韩精品中文字幕一区二区三区| 亚洲欧美偷拍三级| 国产不卡一区视频| 日韩免费高清电影| 亚洲高清免费观看高清完整版在线观看 | 国产欧美一区二区三区在线看蜜臀| 亚洲国产一区二区视频| 成人app在线| 久久久久青草大香线综合精品| 亚洲一区中文在线| av在线不卡网| 国产喂奶挤奶一区二区三区 | 九一九一国产精品| 欧美日韩久久一区二区| 亚洲激情网站免费观看| 国产精品亚洲午夜一区二区三区| 日本视频免费一区| 在线观看日韩av先锋影音电影院| 国产精品视频观看| 丰满放荡岳乱妇91ww| 精品88久久久久88久久久| 日韩精品乱码av一区二区| 欧洲精品视频在线观看| 国产精品久久久久精k8| 国产成人在线免费观看| 欧美电影精品一区二区| 日本vs亚洲vs韩国一区三区 | 欧美在线视频不卡| 日韩美女精品在线| av在线一区二区| 中文字幕一区二区在线播放| 国产成人av电影| 中文字幕国产一区| 国产综合久久久久影院| 久久一区二区三区国产精品| 美女网站在线免费欧美精品| 日韩欧美综合一区| 九九国产精品视频| 精品美女在线观看| 激情六月婷婷综合| 久久久久久久久一| 国产高清无密码一区二区三区| 欧美国产日韩在线观看| 不卡视频免费播放| 亚洲男同1069视频| 欧美日韩精品是欧美日韩精品| 午夜一区二区三区视频| 91精品国产综合久久久久久| 日韩黄色在线观看| ww亚洲ww在线观看国产| 成人久久视频在线观看| 亚洲欧美色图小说| 欧美精品1区2区3区| 精品在线免费视频| 国产精品视频你懂的| 日本高清不卡在线观看| 亚洲午夜久久久久久久久电影网 | 国产伦精品一区二区三区免费迷 | 亚洲黄网站在线观看| 欧美男同性恋视频网站| 久久97超碰色| 国产精品久久久久久久久免费桃花| 一本到一区二区三区| 日日夜夜精品视频天天综合网| 26uuu欧美日本| 99re6这里只有精品视频在线观看| 亚洲人快播电影网| 91精品福利在线一区二区三区| 狠狠色丁香婷婷综合| 亚洲天堂精品在线观看| 4438成人网| 99久久婷婷国产精品综合|