summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-19 16:26:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-19 16:28:57 +0300
commit412a979505cdb849e4adb3b5ac6c16aedf7cdcf7 (patch)
tree76af65647c6fcab8e3830bf2c8740b4ab8256678 /src/mir_app
parent579a58bfa8cfa9b043d76e0503f8f595e2da8edd (diff)
tray related code moved to the appropriate module
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/clc.h2
-rw-r--r--src/mir_app/src/clisttray.cpp13
-rw-r--r--src/mir_app/src/miranda.cpp9
-rw-r--r--src/mir_app/src/miranda.h2
-rw-r--r--src/mir_app/src/stdafx.h8
5 files changed, 17 insertions, 17 deletions
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h
index d2d3e4743e..a13485794e 100644
--- a/src/mir_app/src/clc.h
+++ b/src/mir_app/src/clc.h
@@ -150,6 +150,8 @@ INT_PTR fnTrayIconProcessMessage(WPARAM, LPARAM);
int fnTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount);
void InitTray(void);
+void UninitTray(void);
+
void TrayIconSetToBase(char *szPreferredProto);
void TrayIconTaskbarCreated(HWND hwnd);
int TrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPreferredProto, int isBase);
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp
index adaa0dab15..544e192ca5 100644
--- a/src/mir_app/src/clisttray.cpp
+++ b/src/mir_app/src/clisttray.cpp
@@ -27,9 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TOOLTIP_TOLERANCE 5
+static ITaskbarList3* pTaskbarInterface;
+
static UINT WM_TASKBARCREATED;
static UINT WM_TASKBARBUTTONCREATED;
-static UINT_PTR RefreshTimerId = 0; /////by FYR
+static UINT_PTR RefreshTimerId = 0;
static UINT_PTR CycleTimerId;
mir_cs trayLockCS;
@@ -831,4 +833,13 @@ MIR_APP_DLL(int) Clist_TrayNotifyW(const char *szProto, const wchar_t *wszInfoTi
void InitTray(void)
{
fTrayInited = true;
+
+ if (IsWinVer7Plus())
+ CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_ITaskbarList3, (void**)&pTaskbarInterface);
+}
+
+void UninitTray(void)
+{
+ if (pTaskbarInterface)
+ pTaskbarInterface->Release();
}
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp
index 0cd0a4c5b5..4c64666701 100644
--- a/src/mir_app/src/miranda.cpp
+++ b/src/mir_app/src/miranda.cpp
@@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "stdafx.h"
+#include "clc.h"
#if defined(VLD_ENABLED)
#include "msapi\vld.h"
@@ -46,8 +47,6 @@ pfnGetBufferedPaintBits getBufferedPaintBits;
pfnDwmExtendFrameIntoClientArea dwmExtendFrameIntoClientArea;
pfnDwmIsCompositionEnabled dwmIsCompositionEnabled;
-ITaskbarList3 *pTaskbarInterface;
-
HANDLE hOkToExitEvent, hModulesLoadedEvent;
HANDLE hShutdownEvent, hPreShutdownEvent;
DWORD hMainThreadId;
@@ -336,9 +335,6 @@ int WINAPI mir_main(LPTSTR cmdLine)
OleInitialize(nullptr);
- if (IsWinVer7Plus())
- CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_ITaskbarList3, (void**)&pTaskbarInterface);
-
g_pSystemWindow = new MSystemWindow();
g_pSystemWindow->Create();
@@ -421,8 +417,7 @@ int WINAPI mir_main(LPTSTR cmdLine)
if (hThemeAPI)
FreeLibrary(hThemeAPI);
- if (pTaskbarInterface)
- pTaskbarInterface->Release();
+ UninitTray();
delete g_pSystemWindow;
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h
index dc1d7594b4..e7ab2da12b 100644
--- a/src/mir_app/src/miranda.h
+++ b/src/mir_app/src/miranda.h
@@ -42,8 +42,6 @@ extern pfnBeginBufferedPaint beginBufferedPaint;
extern pfnEndBufferedPaint endBufferedPaint;
extern pfnGetBufferedPaintBits getBufferedPaintBits;
-extern ITaskbarList3 * pTaskbarInterface;
-
typedef HRESULT (STDAPICALLTYPE *pfnDwmExtendFrameIntoClientArea)(HWND hwnd, const MARGINS *margins);
typedef HRESULT (STDAPICALLTYPE *pfnDwmIsCompositionEnabled)(BOOL *);
diff --git a/src/mir_app/src/stdafx.h b/src/mir_app/src/stdafx.h
index 221dc96031..003be62162 100644
--- a/src/mir_app/src/stdafx.h
+++ b/src/mir_app/src/stdafx.h
@@ -24,11 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma once
-#define _ALPHA_BASE_ 1 // defined for CVS builds
-#define _ALPHA_FUSE_ 1 // defined for fuse powered core
-
-#define INCL_WINSOCK_API_TYPEDEFS 1
-
#define HSSL_DEFINED 1
typedef struct SslHandle *HSSL;
@@ -36,9 +31,8 @@ typedef struct SslHandle *HSSL;
#include <ws2tcpip.h>
#include <windows.h>
#include <windowsx.h>
-#include <shlobj.h>
+#include <ShlObj.h>
#include <uxtheme.h>
-#include <commctrl.h>
#include <vssym32.h>
#include <Shlwapi.h>
#include <Richedit.h>