4 Star 0 Fork 2

leegoobin/AutoPHS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
browseforfolermodule.cpp 2.24 KB
一键复制 编辑 原始数据 按行查看 历史
uksoft 提交于 2014-11-26 16:31 . VSS代码移植到Git
// BrowseForFolerModule.cpp
//
#include "stdafx.h"
#include "BrowseForFolerModule.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//int BrowseForFolerModule::WM_USER = (int) &H400;
//long BrowseForFolerModule::BFFM_SETSELECTIONA = (long) (WM_USER + 102);
//long BrowseForFolerModule::BFFM_SETSELECTIONW = (long) (WM_USER + 103);
//int BrowseForFolerModule::LPTR = (int) (&H0|&H40);
//void BrowseForFolerModule::CoTaskMemFree(Long ByVal pv)
//{
//}
//Long BrowseForFolerModule::SendMessage(Long ByVal hwnd, Long ByVal wMsg, Long ByVal wParam, Any lParam)
//{
// return (Long)0;
//}
//void BrowseForFolerModule::CopyMemory(Any pDest, Any pSource, Long ByVal dwLength)
//{
//}
//Long BrowseForFolerModule::LocalAlloc(Long ByVal uFlags, Long ByVal uBytes)
//{
// return (Long)0;
//}
//Long BrowseForFolerModule::LocalFree(Long ByVal hMem)
//{
// return (Long)0;
//}
//Long BrowseForFolerModule::BrowseCallbackProcStr(Long ByVal hwnd, Long ByVal uMsg, Long ByVal lParam, Long ByVal lpData)
//{
// return (Long)0;
//}
//Long BrowseForFolerModule::FunctionPointer(Long FunctionAddress)
//{
// return (Long)0;
//}
//String BrowseForFolerModule::BrowseForFolder(Long hwnd, String selectedPath)
//{
//}
int CALLBACK BrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lParam,LPARAM lpData)
{
if (uMsg==1){
SendMessage(hwnd,BFFM_SETSELECTION,true,lpData);
}
return 0;
}
void BrowseForFolerModule::BrowseForFoldersFromPathStart(HWND hwnd, CString PathStart, CString &PathSelected)
{
_TCHAR szTmp[MAX_PATH];//用于转换成PathSelected
BROWSEINFO info;
memset(&info,0,sizeof(BROWSEINFO));
info.lpfn=BrowseCallbackProc;
info.hwndOwner=hwnd;
CString str;
str.LoadString(IDS_SELECT_NEED_FILE);
info.lpszTitle = str;//_T("请选择一个AutoPHS需要的文件夹");
//Remove _T('\') at the end of the path if user added it
while(PathStart.Right(1)==_T("\\"))
PathStart.Delete(PathStart.GetLength()-1,1);
info.lParam=(DWORD)(LPCTSTR)PathStart;
SHGetPathFromIDList(SHBrowseForFolder(&info),szTmp);
if (szTmp==_T("")){CString str;
str.LoadString(IDS_NOSELECT_ANYFILE);
MessageBox(hwnd,str,_T("AutoPHS"),MB_OK|MB_TASKMODAL|MB_TOPMOST);
PathSelected=PathStart;
}
else PathSelected=szTmp;
//PathStart.ReleaseBuffer();
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/uesoft/AutoPHS.git
git@gitee.com:uesoft/AutoPHS.git
uesoft
AutoPHS
AutoPHS
CAE

搜索帮助

D67c1975 1850385 1daf7b77 1850385