1
1

GuiThumbnail.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include "GuiThumbnail.h"
  2. #include <string.h>
  3. #include <wchar.h>
  4. // 执行提取缩略图 主功能
  5. bool GuiThumbnail(const wchar_t* keyWord , const wchar_t* savePath)
  6. {
  7. wchar_t src_filename[MAX_PATH] = {0};
  8. wchar_t thumb_filename[MAX_PATH] = {0};
  9. wchar_t wbuf[MAX_PATH] = {0};
  10. Everything_SetSearch(keyWord);
  11. bool EQRet = Everything_Query(TRUE);
  12. if (EQRet == false) {
  13. return false;
  14. }
  15. // 如果没有目录建立,进入目录
  16. _wmkdir(savePath);
  17. _wchdir(savePath);
  18. // Display results. // 文件导出缩略图
  19. for (int i = 0 ; i < Everything_GetNumResults(); i++) {
  20. Everything_GetResultFullPathNameW(i, src_filename , MAX_PATH);
  21. // AI EPS INDD 文件导出缩略图
  22. wcscpy(thumb_filename, Everything_GetResultFileName(i));
  23. wcscat(thumb_filename, L"_T.jpg");
  24. bool ret = AdobeThumbnail_W(src_filename , thumb_filename);
  25. if (!ret) { // CorelDRAW CDR 文件导出缩略图
  26. wcscpy(thumb_filename, Everything_GetResultFileName(i));
  27. wcscat(thumb_filename, L"_T.png");
  28. ret = CorelThumbnail_W(src_filename, thumb_filename);
  29. }
  30. }
  31. return true;
  32. }
  33. // 临时PNG显示文件
  34. bool Thumbnail_TempPng(const wchar_t* src_filename , const wchar_t* tmppng)
  35. {
  36. bool ret = AdobeThumbnail_W(src_filename , tmppng);
  37. if (!ret) {
  38. ret = CorelThumbnail_W(src_filename, tmppng);
  39. }
  40. return ret;
  41. }