diff --git a/src/res/toolbars/Back.svg b/src/res/toolbars/Back.svg
index 44c95d3d..5fea2c49 100644
--- a/src/res/toolbars/Back.svg
+++ b/src/res/toolbars/Back.svg
@@ -1,8 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/CalculateDirectorySizes.svg b/src/res/toolbars/CalculateDirectorySizes.svg
index bedb161d..d300950c 100644
--- a/src/res/toolbars/CalculateDirectorySizes.svg
+++ b/src/res/toolbars/CalculateDirectorySizes.svg
@@ -1,21 +1,8 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/CalculateOccupiedSpace.svg b/src/res/toolbars/CalculateOccupiedSpace.svg
index 6bbfc0b5..a9f4e9b3 100644
--- a/src/res/toolbars/CalculateOccupiedSpace.svg
+++ b/src/res/toolbars/CalculateOccupiedSpace.svg
@@ -1,24 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/ChangeAttributes.svg b/src/res/toolbars/ChangeAttributes.svg
index c87a0d20..1ddcf41b 100644
--- a/src/res/toolbars/ChangeAttributes.svg
+++ b/src/res/toolbars/ChangeAttributes.svg
@@ -1,6 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/ChangeCase.svg b/src/res/toolbars/ChangeCase.svg
index f83bd635..1e967ff8 100644
--- a/src/res/toolbars/ChangeCase.svg
+++ b/src/res/toolbars/ChangeCase.svg
@@ -1,20 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/ChangeDirectory.svg b/src/res/toolbars/ChangeDirectory.svg
index f3a6c620..321ff130 100644
--- a/src/res/toolbars/ChangeDirectory.svg
+++ b/src/res/toolbars/ChangeDirectory.svg
@@ -1,15 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/CilpboardCut.svg b/src/res/toolbars/CilpboardCut.svg
deleted file mode 100644
index 47a3f7f7..00000000
--- a/src/res/toolbars/CilpboardCut.svg
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
diff --git a/src/res/toolbars/ClipboardCopy.svg b/src/res/toolbars/ClipboardCopy.svg
index ef431a44..27f14ed2 100644
--- a/src/res/toolbars/ClipboardCopy.svg
+++ b/src/res/toolbars/ClipboardCopy.svg
@@ -1,14 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/ClipboardCut.svg b/src/res/toolbars/ClipboardCut.svg
new file mode 100644
index 00000000..e6a7c629
--- /dev/null
+++ b/src/res/toolbars/ClipboardCut.svg
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/src/res/toolbars/ClipboardPaste.svg b/src/res/toolbars/ClipboardPaste.svg
index c350f208..1cdc9fab 100644
--- a/src/res/toolbars/ClipboardPaste.svg
+++ b/src/res/toolbars/ClipboardPaste.svg
@@ -1,16 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/CommandShell.svg b/src/res/toolbars/CommandShell.svg
index be5b8622..47112906 100644
--- a/src/res/toolbars/CommandShell.svg
+++ b/src/res/toolbars/CommandShell.svg
@@ -1,14 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/CompareDirectories.svg b/src/res/toolbars/CompareDirectories.svg
index 2d83b854..acbef107 100644
--- a/src/res/toolbars/CompareDirectories.svg
+++ b/src/res/toolbars/CompareDirectories.svg
@@ -1,19 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Configuration.svg b/src/res/toolbars/Configuration.svg
index c7d3ef7c..694d8281 100644
--- a/src/res/toolbars/Configuration.svg
+++ b/src/res/toolbars/Configuration.svg
@@ -1,16 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/ConnectNetworkDrive.svg b/src/res/toolbars/ConnectNetworkDrive.svg
index caf34893..6d6d7313 100644
--- a/src/res/toolbars/ConnectNetworkDrive.svg
+++ b/src/res/toolbars/ConnectNetworkDrive.svg
@@ -1,20 +1,7 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Convert.svg b/src/res/toolbars/Convert.svg
index dc941dc8..93de6456 100644
--- a/src/res/toolbars/Convert.svg
+++ b/src/res/toolbars/Convert.svg
@@ -1,20 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Copy.svg b/src/res/toolbars/Copy.svg
index 08e638fb..27f14ed2 100644
--- a/src/res/toolbars/Copy.svg
+++ b/src/res/toolbars/Copy.svg
@@ -1,25 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/CreateDirectory.svg b/src/res/toolbars/CreateDirectory.svg
index a61e9358..65720049 100644
--- a/src/res/toolbars/CreateDirectory.svg
+++ b/src/res/toolbars/CreateDirectory.svg
@@ -1,13 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Delete.svg b/src/res/toolbars/Delete.svg
index 07cb8d8c..4adaf380 100644
--- a/src/res/toolbars/Delete.svg
+++ b/src/res/toolbars/Delete.svg
@@ -1,9 +1,7 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Disconnect.svg b/src/res/toolbars/Disconnect.svg
index 26cd57f8..f4b290bc 100644
--- a/src/res/toolbars/Disconnect.svg
+++ b/src/res/toolbars/Disconnect.svg
@@ -1,16 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/DriveInformation.svg b/src/res/toolbars/DriveInformation.svg
index b7b752a9..2a3b2c1c 100644
--- a/src/res/toolbars/DriveInformation.svg
+++ b/src/res/toolbars/DriveInformation.svg
@@ -1,12 +1,7 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Edit.svg b/src/res/toolbars/Edit.svg
index cd1df138..cf56f6e6 100644
--- a/src/res/toolbars/Edit.svg
+++ b/src/res/toolbars/Edit.svg
@@ -1,14 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/EditNewFile.svg b/src/res/toolbars/EditNewFile.svg
index b8313df2..58c93d43 100644
--- a/src/res/toolbars/EditNewFile.svg
+++ b/src/res/toolbars/EditNewFile.svg
@@ -1,20 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Email.svg b/src/res/toolbars/Email.svg
index 5d952090..7a715cff 100644
--- a/src/res/toolbars/Email.svg
+++ b/src/res/toolbars/Email.svg
@@ -1,23 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Filter.svg b/src/res/toolbars/Filter.svg
index 0e06daaf..3dd2c87d 100644
--- a/src/res/toolbars/Filter.svg
+++ b/src/res/toolbars/Filter.svg
@@ -1,6 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/FindFilesAndDirectories.svg b/src/res/toolbars/FindFilesAndDirectories.svg
index ef681fdd..ea550aec 100644
--- a/src/res/toolbars/FindFilesAndDirectories.svg
+++ b/src/res/toolbars/FindFilesAndDirectories.svg
@@ -1,21 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/FocusNameInOtherPanel.svg b/src/res/toolbars/FocusNameInOtherPanel.svg
index 74ebfb69..94995bc4 100644
--- a/src/res/toolbars/FocusNameInOtherPanel.svg
+++ b/src/res/toolbars/FocusNameInOtherPanel.svg
@@ -1,15 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Forward.svg b/src/res/toolbars/Forward.svg
index 909634b2..b4189a4f 100644
--- a/src/res/toolbars/Forward.svg
+++ b/src/res/toolbars/Forward.svg
@@ -1,8 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/GoToHotPath.svg b/src/res/toolbars/GoToHotPath.svg
index 2f1eda65..033fd636 100644
--- a/src/res/toolbars/GoToHotPath.svg
+++ b/src/res/toolbars/GoToHotPath.svg
@@ -1,13 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/GoToPathfromOtherPanel.svg b/src/res/toolbars/GoToPathfromOtherPanel.svg
index 088ce442..71ce300c 100644
--- a/src/res/toolbars/GoToPathfromOtherPanel.svg
+++ b/src/res/toolbars/GoToPathfromOtherPanel.svg
@@ -1,11 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/GoToShortcutTarget.svg b/src/res/toolbars/GoToShortcutTarget.svg
index fdef2237..248f4cb2 100644
--- a/src/res/toolbars/GoToShortcutTarget.svg
+++ b/src/res/toolbars/GoToShortcutTarget.svg
@@ -1,16 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/HelpContents.svg b/src/res/toolbars/HelpContents.svg
index ef12a02f..e85393fc 100644
--- a/src/res/toolbars/HelpContents.svg
+++ b/src/res/toolbars/HelpContents.svg
@@ -1,17 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/HideSelectedNames.svg b/src/res/toolbars/HideSelectedNames.svg
index 14e77109..fd178de2 100644
--- a/src/res/toolbars/HideSelectedNames.svg
+++ b/src/res/toolbars/HideSelectedNames.svg
@@ -1,49 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/HideUnselectedNames.svg b/src/res/toolbars/HideUnselectedNames.svg
index 57e7b519..8f58284c 100644
--- a/src/res/toolbars/HideUnselectedNames.svg
+++ b/src/res/toolbars/HideUnselectedNames.svg
@@ -1,49 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Modify.svg b/src/res/toolbars/Modify.svg
index a47a7fc4..9e9e7764 100644
--- a/src/res/toolbars/Modify.svg
+++ b/src/res/toolbars/Modify.svg
@@ -1,43 +1,7 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Move.svg b/src/res/toolbars/Move.svg
index 7f162353..f7800323 100644
--- a/src/res/toolbars/Move.svg
+++ b/src/res/toolbars/Move.svg
@@ -1,36 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/MoveItemDown.svg b/src/res/toolbars/MoveItemDown.svg
index 65fe6787..fc7de1ee 100644
--- a/src/res/toolbars/MoveItemDown.svg
+++ b/src/res/toolbars/MoveItemDown.svg
@@ -1,11 +1,3 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/MoveItemUp.svg b/src/res/toolbars/MoveItemUp.svg
index 3978c8fd..42869f48 100644
--- a/src/res/toolbars/MoveItemUp.svg
+++ b/src/res/toolbars/MoveItemUp.svg
@@ -1,10 +1,3 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/NTFSCompress.svg b/src/res/toolbars/NTFSCompress.svg
index 9bb9677c..412b656b 100644
--- a/src/res/toolbars/NTFSCompress.svg
+++ b/src/res/toolbars/NTFSCompress.svg
@@ -1,18 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/NTFSUncompress.svg b/src/res/toolbars/NTFSUncompress.svg
index 70e4e91f..6be0b197 100644
--- a/src/res/toolbars/NTFSUncompress.svg
+++ b/src/res/toolbars/NTFSUncompress.svg
@@ -1,21 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/New.svg b/src/res/toolbars/New.svg
index 7fda8dd7..c7e288d7 100644
--- a/src/res/toolbars/New.svg
+++ b/src/res/toolbars/New.svg
@@ -1,12 +1,3 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/OpenFolder.svg b/src/res/toolbars/OpenFolder.svg
index ba98708f..10261815 100644
--- a/src/res/toolbars/OpenFolder.svg
+++ b/src/res/toolbars/OpenFolder.svg
@@ -1,19 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/OpenNameinOtherPanel.svg b/src/res/toolbars/OpenNameinOtherPanel.svg
index 93387a88..733056e3 100644
--- a/src/res/toolbars/OpenNameinOtherPanel.svg
+++ b/src/res/toolbars/OpenNameinOtherPanel.svg
@@ -1,16 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Pack.svg b/src/res/toolbars/Pack.svg
index eb2aa57c..1e8dc6ba 100644
--- a/src/res/toolbars/Pack.svg
+++ b/src/res/toolbars/Pack.svg
@@ -1,14 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/ParentDirectory.svg b/src/res/toolbars/ParentDirectory.svg
index fd8fe64b..103a1c47 100644
--- a/src/res/toolbars/ParentDirectory.svg
+++ b/src/res/toolbars/ParentDirectory.svg
@@ -1,12 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/PasteShortcut.svg b/src/res/toolbars/PasteShortcut.svg
index 5299569a..39feedd3 100644
--- a/src/res/toolbars/PasteShortcut.svg
+++ b/src/res/toolbars/PasteShortcut.svg
@@ -1,21 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Properties.svg b/src/res/toolbars/Properties.svg
index 67fa5ac8..a13fd6ed 100644
--- a/src/res/toolbars/Properties.svg
+++ b/src/res/toolbars/Properties.svg
@@ -1,19 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/QuickRename.svg b/src/res/toolbars/QuickRename.svg
index 55a53abb..19c11ce9 100644
--- a/src/res/toolbars/QuickRename.svg
+++ b/src/res/toolbars/QuickRename.svg
@@ -1,16 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Refresh.svg b/src/res/toolbars/Refresh.svg
index 79d911c8..0a497ace 100644
--- a/src/res/toolbars/Refresh.svg
+++ b/src/res/toolbars/Refresh.svg
@@ -1,15 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/RootDirectory.svg b/src/res/toolbars/RootDirectory.svg
index dba226d6..da8d593d 100644
--- a/src/res/toolbars/RootDirectory.svg
+++ b/src/res/toolbars/RootDirectory.svg
@@ -1,14 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Security.svg b/src/res/toolbars/Security.svg
index 7b9ece63..8eddc4f5 100644
--- a/src/res/toolbars/Security.svg
+++ b/src/res/toolbars/Security.svg
@@ -1,8 +1,3 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/SelectAll.svg b/src/res/toolbars/SelectAll.svg
new file mode 100644
index 00000000..d9122096
--- /dev/null
+++ b/src/res/toolbars/SelectAll.svg
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/src/res/toolbars/SharedDirectories.svg b/src/res/toolbars/SharedDirectories.svg
index c64e5aff..7fa78459 100644
--- a/src/res/toolbars/SharedDirectories.svg
+++ b/src/res/toolbars/SharedDirectories.svg
@@ -1,14 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/ShowHiddenNames.svg b/src/res/toolbars/ShowHiddenNames.svg
index f480c6b7..7eb704c5 100644
--- a/src/res/toolbars/ShowHiddenNames.svg
+++ b/src/res/toolbars/ShowHiddenNames.svg
@@ -1,24 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/SmartColumnMode.svg b/src/res/toolbars/SmartColumnMode.svg
index 7c23a586..841b0a35 100644
--- a/src/res/toolbars/SmartColumnMode.svg
+++ b/src/res/toolbars/SmartColumnMode.svg
@@ -1,11 +1,7 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/SortByAttributes.svg b/src/res/toolbars/SortByAttributes.svg
index fd8c4163..d63f7359 100644
--- a/src/res/toolbars/SortByAttributes.svg
+++ b/src/res/toolbars/SortByAttributes.svg
@@ -1,8 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/SortByDate.svg b/src/res/toolbars/SortByDate.svg
index 6f78944b..9a4794e0 100644
--- a/src/res/toolbars/SortByDate.svg
+++ b/src/res/toolbars/SortByDate.svg
@@ -1,14 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/SortByExtension.svg b/src/res/toolbars/SortByExtension.svg
index 60c23528..cf7747e0 100644
--- a/src/res/toolbars/SortByExtension.svg
+++ b/src/res/toolbars/SortByExtension.svg
@@ -1,17 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/SortByName.svg b/src/res/toolbars/SortByName.svg
index 4ab6b941..c9ceef8e 100644
--- a/src/res/toolbars/SortByName.svg
+++ b/src/res/toolbars/SortByName.svg
@@ -1,19 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/SortBySize.svg b/src/res/toolbars/SortBySize.svg
index 58663ee1..44f20836 100644
--- a/src/res/toolbars/SortBySize.svg
+++ b/src/res/toolbars/SortBySize.svg
@@ -1,14 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/SwapPanels.svg b/src/res/toolbars/SwapPanels.svg
index c88d61e7..b1effca5 100644
--- a/src/res/toolbars/SwapPanels.svg
+++ b/src/res/toolbars/SwapPanels.svg
@@ -1,11 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Unpack.svg b/src/res/toolbars/Unpack.svg
index 7311f52e..e06b6ece 100644
--- a/src/res/toolbars/Unpack.svg
+++ b/src/res/toolbars/Unpack.svg
@@ -1,14 +1,12 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/UnselectAll.svg b/src/res/toolbars/UnselectAll.svg
new file mode 100644
index 00000000..903c8630
--- /dev/null
+++ b/src/res/toolbars/UnselectAll.svg
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/src/res/toolbars/UserMenu.svg b/src/res/toolbars/UserMenu.svg
index 4652e5d3..0f531905 100644
--- a/src/res/toolbars/UserMenu.svg
+++ b/src/res/toolbars/UserMenu.svg
@@ -1,13 +1,8 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/View.svg b/src/res/toolbars/View.svg
index b20cb2ba..0a07ccc4 100644
--- a/src/res/toolbars/View.svg
+++ b/src/res/toolbars/View.svg
@@ -1,17 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/Views.svg b/src/res/toolbars/Views.svg
index db92738d..be4c191d 100644
--- a/src/res/toolbars/Views.svg
+++ b/src/res/toolbars/Views.svg
@@ -1,11 +1,6 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/res/toolbars/WhatIsThis.svg b/src/res/toolbars/WhatIsThis.svg
index f2d07c97..715d8f35 100644
--- a/src/res/toolbars/WhatIsThis.svg
+++ b/src/res/toolbars/WhatIsThis.svg
@@ -1,14 +1,5 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/shellsup.cpp b/src/shellsup.cpp
index 27369a28..4983e98d 100644
--- a/src/shellsup.cpp
+++ b/src/shellsup.cpp
@@ -2489,6 +2489,39 @@ void ExecuteAssociation(HWND hWindow, const char* path, const char* name)
// pokud selze salopen.exe, spoustime klasickym zpusobem (nebezpeci otevrenych handlu v adresari)
}
+ // Attempt to use ShellExecuteExW (Unicode) first
+ wchar_t wPath[MAX_PATH];
+ wchar_t wName[MAX_PATH];
+ if (MultiByteToWideChar(CP_UTF8, 0, path, -1, wPath, MAX_PATH) > 0 &&
+ MultiByteToWideChar(CP_UTF8, 0, name, -1, wName, MAX_PATH) > 0)
+ {
+ wchar_t wFullPath[MAX_PATH * 2];
+ wcscpy(wFullPath, wPath);
+ size_t len = wcslen(wFullPath);
+ if (len > 0 && wFullPath[len - 1] != '\\')
+ wcscat(wFullPath, L"\\");
+ wcscat(wFullPath, wName);
+
+ SHELLEXECUTEINFOW sei = {0};
+ sei.cbSize = sizeof(sei);
+ sei.fMask = SEE_MASK_UNICODE | SEE_MASK_FLAG_NO_UI;
+ sei.hwnd = hWindow;
+ sei.lpVerb = NULL;
+ sei.lpFile = wFullPath;
+ sei.lpDirectory = wPath;
+ sei.nShow = SW_SHOWNORMAL;
+
+ CShellExecuteWnd shellExecuteWnd;
+ sei.hwnd = shellExecuteWnd.Create(hWindow, "SEW: ExecuteAssociation(Unicode) %S", wName);
+
+ if (ShellExecuteExW(&sei))
+ {
+ if (ExecuteAssociationTlsIndex != TLS_OUT_OF_INDEXES)
+ TlsSetValue(ExecuteAssociationTlsIndex, (void*)0);
+ return;
+ }
+ }
+
IContextMenu2* menu = CreateIContextMenu2(hWindow, path, 1,
ReturnNameFromParam, (void*)name);
if (menu != NULL)
diff --git a/src/svg.cpp b/src/svg.cpp
index 61ab263f..74f9a486 100644
--- a/src/svg.cpp
+++ b/src/svg.cpp
@@ -92,63 +92,87 @@ void RenderSVGImage(NSVGrasterizer* rast, HDC hDC, int x, int y, const char* svg
GetModuleFileName(NULL, svgFile, _countof(svgFile));
char* s = strrchr(svgFile, '\\');
if (s != NULL)
- sprintf(s + 1, "toolbars\\%s.svg", svgName);
- char* svg = ReadSVGFile(svgFile);
- if (svg != NULL)
{
- HDC hMemDC = HANDLES(CreateCompatibleDC(NULL));
- BITMAPINFOHEADER bmhdr;
- memset(&bmhdr, 0, sizeof(bmhdr));
- bmhdr.biSize = sizeof(bmhdr);
- bmhdr.biWidth = iconSize;
- bmhdr.biHeight = -iconSize;
- if (bmhdr.biHeight == 0)
- bmhdr.biHeight = -1;
- bmhdr.biPlanes = 1;
- bmhdr.biBitCount = 32;
- bmhdr.biCompression = BI_RGB;
- void* lpMemBits = NULL;
- HBITMAP hMemBmp = HANDLES(CreateDIBSection(hMemDC, (CONST BITMAPINFO*)&bmhdr, DIB_RGB_COLORS, &lpMemBits, NULL, 0));
- SelectObject(hMemDC, hMemBmp);
-
- RECT r;
- r.left = x;
- r.top = y;
- r.right = x + iconSize;
- r.bottom = y + iconSize;
- SetBkColor(hDC, bkColor);
- ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &r, "", 0, NULL);
-
- float sysDPIScale = (float)GetScaleForSystemDPI();
- NSVGimage* image = nsvgParse(svg, "px", sysDPIScale);
-
- if (!enabled)
+ *s = 0; // terminate path at directory
+
+ // 1. Try Instalator/toolbars (where executable usually is)
+ char path[2 * MAX_PATH];
+ sprintf(path, "%s\\toolbars\\%s.svg", svgFile, svgName);
+
+ char* svg = ReadSVGFile(path);
+
+ // 2. Try src/res/toolbars (relative to project root if running from Instalator)
+ if (svg == NULL)
{
- DWORD disabledColor = GetSVGSysColor(COLOR_BTNSHADOW); // JRYFIXME - initial draft, where should we get the disabled color from?
- NSVGshape* shape = image->shapes;
- while (shape != NULL)
+ // If we are in "Instalator", go up one level then to src/res/toolbars
+ sprintf(path, "%s\\..\\src\\res\\toolbars\\%s.svg", svgFile, svgName);
+ svg = ReadSVGFile(path);
+ }
+
+ // 3. Try src/res/toolbars (relative to build output e.g. x64/Debug)
+ if (svg == NULL)
+ {
+ // Go up two levels (x64\Debug -> root) then to src/res/toolbars
+ sprintf(path, "%s\\..\\..\\src\\res\\toolbars\\%s.svg", svgFile, svgName);
+ svg = ReadSVGFile(path);
+ }
+
+ if (svg != NULL)
+ {
+ HDC hMemDC = HANDLES(CreateCompatibleDC(NULL));
+ BITMAPINFOHEADER bmhdr;
+ memset(&bmhdr, 0, sizeof(bmhdr));
+ bmhdr.biSize = sizeof(bmhdr);
+ bmhdr.biWidth = iconSize;
+ bmhdr.biHeight = -iconSize;
+ if (bmhdr.biHeight == 0)
+ bmhdr.biHeight = -1;
+ bmhdr.biPlanes = 1;
+ bmhdr.biBitCount = 32;
+ bmhdr.biCompression = BI_RGB;
+ void* lpMemBits = NULL;
+ HBITMAP hMemBmp = HANDLES(CreateDIBSection(hMemDC, (CONST BITMAPINFO*)&bmhdr, DIB_RGB_COLORS, &lpMemBits, NULL, 0));
+ SelectObject(hMemDC, hMemBmp);
+
+ RECT r;
+ r.left = x;
+ r.top = y;
+ r.right = x + iconSize;
+ r.bottom = y + iconSize;
+ SetBkColor(hDC, bkColor);
+ ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &r, "", 0, NULL);
+
+ float sysDPIScale = (float)GetScaleForSystemDPI();
+ NSVGimage* image = nsvgParse(svg, "px", sysDPIScale);
+
+ if (!enabled)
{
- if ((shape->fill.color & 0x00FFFFFF) != 0x00FFFFFF)
- shape->fill.color = disabledColor;
- shape = shape->next;
+ DWORD disabledColor = GetSVGSysColor(COLOR_BTNSHADOW); // JRYFIXME - initial draft, where should we get the disabled color from?
+ NSVGshape* shape = image->shapes;
+ while (shape != NULL)
+ {
+ if ((shape->fill.color & 0x00FFFFFF) != 0x00FFFFFF)
+ shape->fill.color = disabledColor;
+ shape = shape->next;
+ }
}
- }
- float scale = sysDPIScale / 100;
- nsvgRasterize(rast, image, 0, 0, scale, (BYTE*)lpMemBits, iconSize, iconSize, iconSize * 4);
- nsvgDelete(image);
+ float scale = sysDPIScale / 100;
+ nsvgRasterize(rast, image, 0, 0, scale, (BYTE*)lpMemBits, iconSize, iconSize, iconSize * 4);
+ nsvgDelete(image);
- BLENDFUNCTION bf;
- bf.BlendOp = AC_SRC_OVER;
- bf.BlendFlags = 0;
- bf.SourceConstantAlpha = 0xff; // want to use per-pixel alpha values
- bf.AlphaFormat = AC_SRC_ALPHA;
- AlphaBlend(hDC, x, y, iconSize, iconSize, hMemDC, 0, 0, iconSize, iconSize, bf);
+ BLENDFUNCTION bf;
+ bf.BlendOp = AC_SRC_OVER;
+ bf.BlendFlags = 0;
+ bf.SourceConstantAlpha = 0xff; // want to use per-pixel alpha values
+ bf.AlphaFormat = AC_SRC_ALPHA;
+ AlphaBlend(hDC, x, y, iconSize, iconSize, hMemDC, 0, 0, iconSize, iconSize, bf);
- HANDLES(DeleteObject(hMemBmp));
- HANDLES(DeleteDC(hMemDC));
+ HANDLES(DeleteObject(hMemBmp));
+ HANDLES(DeleteDC(hMemDC));
- free(svg);
+ free(svg);
+ }
}
}