mirror of
https://github.com/x64dbg/x64dbg.git
synced 2025-02-21 13:33:29 +00:00
add util function to extract icon from executable
This commit is contained in:
parent
67ef8e3eaf
commit
714430c2ac
@ -1,5 +1,5 @@
|
||||
#include "MiscUtil.h"
|
||||
#include <windows.h>
|
||||
#include <QtWin>
|
||||
#include <QApplication>
|
||||
#include <QMessageBox>
|
||||
#include <QDir>
|
||||
@ -159,6 +159,19 @@ QString getSymbolicNameStr(duint addr)
|
||||
return finalText;
|
||||
}
|
||||
|
||||
QIcon getFileIcon(QString file)
|
||||
{
|
||||
SHFILEINFO info;
|
||||
if(SHGetFileInfoW((const wchar_t*)file.utf16(), 0, &info, sizeof(info), SHGFI_ICON) == 0)
|
||||
{
|
||||
return QIcon(); //API error
|
||||
}
|
||||
QIcon result;
|
||||
result = QIcon(QtWin::fromHICON(info.hIcon));
|
||||
DestroyIcon(info.hIcon);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool ExportCSV(dsint rows, dsint columns, std::vector<QString> headers, std::function<QString(dsint, dsint)> getCellContent)
|
||||
{
|
||||
BrowseDialog browse(nullptr, QApplication::translate("ExportCSV", "Export data in CSV format"), QApplication::translate("ExportCSV", "Enter the CSV file name to export"), QApplication::translate("ExportCSV", "CSV files (*.csv);;All files (*.*)"), QApplication::applicationDirPath() + QDir::separator() + "db", true);
|
||||
|
@ -21,6 +21,7 @@ QString getSymbolicNameStr(duint addr);
|
||||
bool ExportCSV(dsint rows, dsint columns, std::vector<QString> headers, std::function<QString(dsint, dsint)> getCellContent);
|
||||
bool isEaster();
|
||||
QString couldItBeSeasonal(QString icon);
|
||||
QIcon getFileIcon(QString file);
|
||||
|
||||
#define DIcon(file) QIcon(QString(":/icons/images/").append(couldItBeSeasonal(file)))
|
||||
#endif // MISCUTIL_H
|
||||
|
@ -36,7 +36,7 @@ UI_DIR = $${X64_GEN_DIR}
|
||||
##
|
||||
## QT libraries
|
||||
##
|
||||
QT += core gui network
|
||||
QT += core gui network winextras
|
||||
|
||||
# QT5 requires widgets
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
Loading…
x
Reference in New Issue
Block a user