사이트에서 SHMultiFileProperties를 사용하여 C#으로 예제를 보았지만 관리되지 않는 C++에서 사용하는 데 문제가 있습니다. 나는 초보자이므로 어떤 도움이나 어쩌면 작은 예를 들어 주셔서 감사하겠습니다.SHMultiFileProperties with C++
1
A
답변
0
주석 처리되었지만 shareaza/CtrlLibraryFileView.cpp을 살펴볼 수 있습니다.
0
내가 게시 할 때 그날 나중에 알아 냈어. 내 코드를 여기에 올리려고 결정했기 때문에 누군가가 그 기능을 사용하는 데 어려움이 있을지도 모른다. 함수에 대한 매개 변수는 nrFiles이며 모든 파일이 '|'로 구분 된 문자열입니다. . 예제 ShowPropertiesByPath ("C : \ Windows | C : \ Program Files", 2) // 정확하게 기억한다면
void ShowPropertiesByPath(CString csFilePath,int nrFiles)
{
LPITEMIDLIST *pidlDrives = (LPITEMIDLIST *)malloc(sizeof(LPITEMIDLIST)*nrFiles);
IShellFolder* psfDesktop;
IDataObject* pdata;
HRESULT hr;
ULONG chEaten=0, dwAttributes=0;
int i=0;
hr = SHGetSpecialFolderLocation(NULL, CSIDL_DRIVES, pidlDrives);
if (SUCCEEDED(hr))
{
hr = SHGetDesktopFolder(&psfDesktop);
do{
CString currentFilePath;
int delimitatorPosition;
delimitatorPosition = csFilePath.Find(L'|');
currentFilePath = csFilePath.Left(delimitatorPosition);
csFilePath.Delete(0,delimitatorPosition+1);
psfDesktop->ParseDisplayName(NULL,
NULL,
currentFilePath.GetBuffer(),
&chEaten,
(LPITEMIDLIST*)&pidlDrives[i],
&dwAttributes);
i++;
}while(!csFilePath.IsEmpty() && i<nrFiles);
if (SUCCEEDED(hr))
{
hr = psfDesktop->GetUIObjectOf(NULL,
nrFiles,
(LPCITEMIDLIST*)pidlDrives,
IID_IDataObject,
NULL,
(void**)&pdata);
if (SUCCEEDED(hr))
{
CoInitialize(NULL);
hr=SHMultiFileProperties(pdata,0);
//hr = psfDesktop->CreateViewObject(NULL, IID_IShellFolder, (void**)&psfDesktop);
pdata->Release();
CoUninitialize();
}
psfDesktop->Release();
}
for(i=0;i<nrFiles;i++)
ILFree(pidlDrives[i]);}
}
관련 문제
- 1. TransactionScope with Files with C#
- 2. P/Invoke for shell32.dll의 SHMultiFileProperties
- 3. C++ send keyboard_event with Guard with Guard
- 4. C#에서 "With ... With With"와 동등 함?
- 5. mirc with C# 코드
- 6. SWIG with C++ 사용
- 7. Spicing C with classes
- 8. C# with DirectX
- 9. C# with Nhibernate
- 10. Cuckoo hashing with C
- 11. gconf-client with C
- 12. Vim [C# with motion #
- 13. C "Play with"디렉토리
- 14. protobuf-net with C++
- 15. C++ help with headers
- 16. new with C++ constructor
- 17. C# struct with struct
- 18. C with assembly tutorials
- 19. C# List with ProgressBar
- 20. MVC with cocoa/objective-c
- 21. C# SOAP with custom URL
- 22. Bullet MarkerStyle with C# WPF
- 23. operator overloading with monitor C++
- 24. 원시 FTP SSL with C#
- 25. C# APM with Callback Tutorial
- 26. Help with C++ Boost :: regex
- 27. Objective-C with Kdevelop 설정
- 28. open word doc with C#
- 29. C# InvokeRequired with property getter
- 30. 구문 강조 with objective-c