#include "stdafx.h"
#include <iostream>
#include <string.h>
#include <windows.h>

#import <Shell32.dll>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    CoInitialize(NULL);
    do
    {
       
        Shell32::IShellDispatchPtr ptrShell;
        if(ptrShell.CreateInstance(__uuidof(Shell32::Shell)) != S_OK)
            break;

        wstring loWstrFolder = L"E:\\TEST";
        //wchar_t npFilePath[] = L"E:\\1.jpg";
        //CString lstrFilePath(npFilePath);
        //lstrFilePath = lstrFilePath.Left(lstrFilePath.Find(PathFindFileName(npFilePath)));
        Shell32::FolderPtr ptrFolder = ptrShell->NameSpace(loWstrFolder.c_str());
        if(NULL == ptrFolder)
            break;

        Shell32::FolderItemPtr ptrItem = ptrFolder->ParseName(L"1.jpg");
        if(NULL == ptrItem)
            break;

        // 3表示获取的信息内容索引序号,3代表获取最后修改日期
        string lstrValue = ptrFolder->GetDetailsOf( _variant_t((IDispatch *)ptrItem), 3);


    } while (false);

    CoUninitialize();


    return 0;
}

相关文章:

  • 2021-12-27
  • 2022-01-23
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2021-12-09
  • 2021-07-14
  • 2021-06-17
猜你喜欢
  • 2021-08-12
  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
相关资源
相似解决方案