Advertisement
Guest User

Untitled

a guest
Jul 5th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #include <QDebug>
  4. #include <commoncontrols.h>
  5. #include <CommCtrl.h>
  6. #include <shellapi.h>
  7.  
  8.  
  9. HICON JumboIcon(LPTSTR pszPath)
  10. {
  11. //const int ILD_TRANSPARENT=1;
  12. SHFILEINFO sfi;
  13. if (!SHGetFileInfo(pszPath, 0, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX)) return NULL;
  14. IImageList *piml;
  15. if (FAILED(SHGetImageList(SHIL_JUMBO, IID_PPV_ARGS(&piml)))) return NULL;
  16. HICON hico;
  17. piml->GetIcon(sfi.iIcon, ILD_TRANSPARENT, &hico);
  18. piml->Release();
  19. return hico;
  20. }
  21.  
  22. MainWindow::MainWindow(QWidget *parent) :
  23. QMainWindow(parent),
  24. ui(new Ui::MainWindow)
  25. {
  26.  
  27. ui->setupUi(this);
  28. ui->tabWidget->setTabText(0,QString("Hi"));
  29. LPTSTR pszPath = L"C:\\Users\\Ethan Smith\\Desktop\\foo.sb2";;
  30. qDebug() << JumboIcon(pszPath);
  31.  
  32.  
  33. }
  34.  
  35. MainWindow::~MainWindow()
  36. {
  37. delete ui;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement