-
大小: 55KB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-05-11
- 語(yǔ)言: C/C++
- 標(biāo)簽:
資源簡(jiǎn)介
一個(gè)關(guān)于vc++自動(dòng)更新源碼有需用的朋友們下載自已看

代碼片段和文件信息
///////////////////////////////////////////////////////////////////////////
//?DirDialog.cpp:?implementation?of?the?CDirDialog?class.
//////////////////////////////////////////////////////////////////////
#include?“stdafx.h“
#include?“DirDialog.h“
#include?“resource.h“
//?local?includes?for?implementation
#include?
#ifdef?_DEBUG
#undef?THIS_FILE
static?char?THIS_FILE[]=__FILE__;
#define?new?DEBUG_NEW
#endif
//?Callback?function?called?by?SHBrowseForFolder‘s?browse?control
//?after?initialization?and?when?selection?changes
static?int?__stdcall?BrowseCtrlCallback(HWND?hwnd?UINT?uMsg?LPARAM?lParam?LPARAM?lpData)
{
????CDirDialog*?pDirDialogObj?=?(CDirDialog*)lpData;
????if?(uMsg?==?BFFM_INITIALIZED?)
????{
????????if(?!?pDirDialogObj->m_strSelDir.IsEmpty()?)
????????????::SendMessage(hwnd?BFFM_SETSELECTION?TRUE?(LPARAM)(LPCTSTR)(pDirDialogObj->m_strSelDir));
????}
????::SendMessage(hwnd?BFFM_ENABLEOK?0?TRUE);
??return?0;
}
//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////
CDirDialog::CDirDialog()
{
m_strWindowtitle?=?_T(“選擇目標(biāo)文件夾“);
}
CDirDialog::~CDirDialog()
{
}
BOOL?CDirDialog::DoBrowse(CWnd?*pwndParent/*=NULL*/)
{
????if(?!?m_strSelDir.IsEmpty()?)
????{
????????m_strSelDir.TrimRight();
????????if(?m_strSelDir.Right(1)?==?“\\“?||?m_strSelDir.Right(1)?==?“//“?)
????????????m_strSelDir?=?m_strSelDir.Left(m_strSelDir.GetLength()?-?1);
????}
????LPMALLOC?pMalloc;
????if?(SHGetMalloc?(&pMalloc)!=?NOERROR)
????????return?FALSE;
????BROWSEINFO?bInfo;
????LPITEMIDLIST?pidl;
????ZeroMemory?(?(PVOID)?&bInfosizeof?(BROWSEINFO));
????if?(!m_strInitDir.IsEmpty?())
????{
????????OLECHAR???????olePath[MAX_PATH];
????????ULONG?????????chEaten;
????????ULONG?????????dwAttributes;
????????HRESULT???????hr;
????????LPSHELLFOLDER?pDesktopFolder;
????????//
????????//?Get?a?pointer?to?the?Desktop‘s?IShellFolder?interface.
????????//
????????if?(SUCCEEDED(SHGetDesktopFolder(&pDesktopFolder)))
????????{
????????????//
????????????//?IShellFolder::ParseDisplayName?requires?the?file?name?be?in?Unicode.
????????????//
????????????MultiByteToWideChar(CP_ACP?MB_PRECOMPOSED?m_strInitDir.GetBuffer(MAX_PATH)?-1
????????????????????????????????olePath?MAX_PATH);
????????????m_strInitDir.ReleaseBuffer?(-1);
????????????//
????????????//?Convert?the?path?to?an?ITEMIDLIST.
????????????//
????????????hr?=?pDesktopFolder->ParseDisplayName(NULL
????????????????????????????????????????????????NULL
????????????????????????????????????????????????olePath
????????????????????????????????????????????????&chEaten
????????????????????????????????????????????????&pidl
????????????????????????????????????????????????&dwAttributes);
????????????if?(FAILED(hr))
????????????{
????????????????pMalloc?->Free?(pidl);
????????????????pMalloc?->Rele
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄??????????0??2004-10-04?14:04??自動(dòng)升級(jí)程序\Debug
?????文件???????4058??2001-02-09?21:06??自動(dòng)升級(jí)程序\DirDialog.cpp
?????文件????????774??2000-03-08?11:44??自動(dòng)升級(jí)程序\DirDialog.h
?????文件??????10784??2001-02-14?00:15??自動(dòng)升級(jí)程序\GradientProgressCtrl.cpp
?????文件???????2363??2001-02-08?22:07??自動(dòng)升級(jí)程序\GradientProgressCtrl.h
?????文件??????21640??2004-10-04?14:00??自動(dòng)升級(jí)程序\LiveUpdate.aps
?????文件???????1845??2004-10-04?14:03??自動(dòng)升級(jí)程序\LiveUpdate.clw
?????文件???????2654??2003-05-13?10:19??自動(dòng)升級(jí)程序\LiveUpdate.cpp
?????文件???????4662??2003-05-27?09:09??自動(dòng)升級(jí)程序\LiveUpdate.dsp
?????文件????????543??2003-05-12?16:21??自動(dòng)升級(jí)程序\LiveUpdate.dsw
?????文件??????40960??2003-05-27?09:11??自動(dòng)升級(jí)程序\LiveUpdate.exe
?????文件???????1368??2003-05-12?10:20??自動(dòng)升級(jí)程序\LiveUpdate.h
?????文件??????58368??2004-10-04?14:04??自動(dòng)升級(jí)程序\LiveUpdate.ncb
?????文件??????53760??2004-10-04?14:04??自動(dòng)升級(jí)程序\LiveUpdate.opt
?????文件???????2233??2004-10-04?13:59??自動(dòng)升級(jí)程序\LiveUpdate.plg
?????文件???????5947??2003-05-27?09:11??自動(dòng)升級(jí)程序\LiveUpdate.rc
?????文件??????14599??2003-05-27?09:09??自動(dòng)升級(jí)程序\LiveUpdateDlg.cpp
?????文件???????2444??2003-05-27?09:07??自動(dòng)升級(jí)程序\LiveUpdateDlg.h
?????文件???????2866??2001-02-14?00:16??自動(dòng)升級(jí)程序\MemDC.h
?????文件????????166??2003-05-27?08:53??自動(dòng)升級(jí)程序\ReadMe.txt
?????文件???????1078??2003-05-12?13:42??自動(dòng)升級(jí)程序\res\LiveUpdate.ico
?????文件????????402??2003-05-12?10:20??自動(dòng)升級(jí)程序\res\LiveUpdate.rc2
????..AD...?????????0??2004-10-04?14:04??自動(dòng)升級(jí)程序\res
?????文件????????866??2003-05-12?15:16??自動(dòng)升級(jí)程序\Resource.h
?????文件???????5680??2003-05-26?16:17??自動(dòng)升級(jí)程序\ShadowButton.cpp
?????文件???????2799??2003-05-26?16:17??自動(dòng)升級(jí)程序\ShadowButton.h
?????文件????????212??2003-05-12?10:20??自動(dòng)升級(jí)程序\StdAfx.cpp
?????文件???????1196??2003-05-27?09:03??自動(dòng)升級(jí)程序\StdAfx.h
?????目錄??????????0??2004-10-04?14:04??自動(dòng)升級(jí)程序
-----------?---------??----------?-----??----
............此處省略3個(gè)文件信息
評(píng)論
共有 條評(píng)論