Extract icon from executable files on Windows

This commit is contained in:
enricoturri1966 2020-10-12 10:44:50 +02:00
parent 482a58ccdc
commit 7630be6cf1

View file

@ -114,20 +114,16 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
#if _WIN32
{
#if ENABLE_GCODE_DRAG_AND_DROP_GCODE_FILES
switch (wxGetApp().get_app_mode())
{
wxString src_path;
wxFileName::SplitPath(wxStandardPaths::Get().GetExecutablePath(), &src_path, nullptr, nullptr, wxPATH_NATIVE);
switch (wxGetApp().get_app_mode()) {
default:
case GUI_App::EAppMode::Editor:
{
SetIcon(wxIcon(Slic3r::var("PrusaSlicer.ico"), wxBITMAP_TYPE_ICO));
break;
}
case GUI_App::EAppMode::GCodeViewer:
{
SetIcon(wxIcon(Slic3r::var("PrusaSlicer-gcodeviewer.ico"), wxBITMAP_TYPE_ICO));
break;
}
case GUI_App::EAppMode::Editor: { src_path += "\\prusa-slicer.exe"; break; }
case GUI_App::EAppMode::GCodeViewer: { src_path += "\\prusa-gcodeviewer.exe"; break; }
}
wxIconLocation icon_location;
icon_location.SetFileName(src_path);
SetIcon(icon_location);
#else
TCHAR szExeFileName[MAX_PATH];
GetModuleFileName(nullptr, szExeFileName, MAX_PATH);