diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-31 09:33:13 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-31 09:33:13 +0000 |
commit | c4e939d79b82b195604e48e8d1b794da4c42347f (patch) | |
tree | 7e733724ae420fab0d8bb485734f605b0f878456 /plugins/Toaster/src/main.cpp | |
parent | 9331a9d035bb1b2f9e08ef9141acad1e180fb70b (diff) |
Toaster: crash fixes, popup icons support
git-svn-id: http://svn.miranda-ng.org/main/trunk@15126 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src/main.cpp')
-rw-r--r-- | plugins/Toaster/src/main.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/Toaster/src/main.cpp b/plugins/Toaster/src/main.cpp index 004cec4734..7307451ba8 100644 --- a/plugins/Toaster/src/main.cpp +++ b/plugins/Toaster/src/main.cpp @@ -42,6 +42,13 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_SYSTEM_PRESHUTDOWN, &OnPreShutdown);
InitServices();
+ GetEnvironmentVariableW(L"TEMP", wszTempDir, MAX_PATH);
+ wcscat_s(wszTempDir, L"\\Miranda.Toaster");
+
+ DWORD dwAttributes = GetFileAttributes(wszTempDir);
+ if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
+ CreateDirectoryTreeT(wszTempDir);
+
if (IsWinVer8Plus() && !IsWinVer10Plus())
{
if (FAILED(TryCreateShortcut()))
@@ -55,6 +62,16 @@ extern "C" int __declspec(dllexport) Load(void) extern "C" int __declspec(dllexport) Unload(void)
{
+ SHFILEOPSTRUCT file_op = {
+ NULL,
+ FO_DELETE,
+ wszTempDir,
+ _T(""),
+ FOF_NOERRORUI | FOF_SILENT | FOF_NOCONFIRMATION,
+ false,
+ 0,
+ _T("") };
+ SHFileOperation(&file_op);
return 0;
}
|