summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-06-08 13:06:50 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-06-08 13:06:50 +0300
commit9d057cf06cdedc6c6323765b34ec2d5d26caa1e9 (patch)
tree200d6c2ee0aff02ff60d1c74cf0cff99dd1470e5 /plugins/Toaster/src
parentdfc78b362d5e37f4cfe45f9be42c63e400a4eae4 (diff)
Toaster: cache Miranda's app icon for the future use
Diffstat (limited to 'plugins/Toaster/src')
-rw-r--r--plugins/Toaster/src/main.cpp4
-rw-r--r--plugins/Toaster/src/services.cpp3
-rw-r--r--plugins/Toaster/src/stdafx.h1
3 files changed, 6 insertions, 2 deletions
diff --git a/plugins/Toaster/src/main.cpp b/plugins/Toaster/src/main.cpp
index 4fd340fb81..06c61e2dc0 100644
--- a/plugins/Toaster/src/main.cpp
+++ b/plugins/Toaster/src/main.cpp
@@ -46,13 +46,13 @@ int CMPlugin::Load()
HookEvent(ME_OPT_INITIALISE, OnOptionsInitialized);
HookEvent(ME_SYSTEM_SHUTDOWN, &OnShutdown);
- InitServices();
-
if (GetEnvironmentVariableW(L"TEMP", wszTempDir, MAX_PATH) != 0) {
wcscat_s(wszTempDir, L"\\Miranda.Toaster");
CreateDirectoryTreeW(wszTempDir);
}
else MessageBox(nullptr, TranslateT("Failed to create temporary directory"), _T(MODULENAME), MB_OK | MB_ICONERROR);
+ InitServices();
+
return 0;
}
diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp
index b70dfe253d..634949eb76 100644
--- a/plugins/Toaster/src/services.cpp
+++ b/plugins/Toaster/src/services.cpp
@@ -2,6 +2,7 @@
std::map<std::string, ClassData*> mp_Classes;
wchar_t wszTempDir[MAX_PATH];
+ptrW g_wszAppIcon;
void __stdcall ShowToastNotification(void *p)
{
@@ -203,4 +204,6 @@ void InitServices()
CreateServiceFunction(MS_POPUP_GETCONTACT, GetPopupContact);
CreateServiceFunction(MS_POPUP_DESTROYPOPUP, HideToast);
+
+ g_wszAppIcon = ToasterImage(IcoLib_GetIconByHandle(Skin_GetIconHandle(SKINICON_OTHER_MIRANDA), true)).Save();
}
diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h
index e594613485..a0ccd5e4a8 100644
--- a/plugins/Toaster/src/stdafx.h
+++ b/plugins/Toaster/src/stdafx.h
@@ -17,6 +17,7 @@
#include <m_system.h>
#include <m_langpack.h>
#include <m_avatars.h>
+#include <m_icolib.h>
#include <m_protocols.h>
#include <m_popup_int.h>
#include <m_message.h>