diff options
author | George Hazan <ghazan@miranda.im> | 2020-01-03 14:51:59 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-01-03 14:51:59 +0300 |
commit | 8eeb83e00b6092a75810a852fb385ddc0ccdc419 (patch) | |
tree | dc80c41e00bf6b9eb0b81b08869fc5899989994a /src | |
parent | d79e8a0ecf46e860c4ae9bae0bd9ea53e6cad382 (diff) |
Miranda_GetSystemWindow - returns a common window for creating global timers
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/miranda.cpp | 38 |
3 files changed, 36 insertions, 4 deletions
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 5a11ad4b0f..a178beb036 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -329,6 +329,7 @@ ProtoGetAvatarFormatByMimeType @400 ProtoGetAvatarMimeType @401
?set_uin@DB_AUTH_BLOB@@QAEXK@Z @402 NONAME
??0CSrmmBaseDialog@@IAE@AAVCMPluginBase@@HPAUSESSION_INFO@@@Z @403 NONAME
+Miranda_GetSystemWindow @404 NONAME
??1CSrmmBaseDialog@@UAE@XZ @405 NONAME
Srmm_FindDialog @406 NONAME
??_7CSrmmBaseDialog@@6B@ @407 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index f32ae8db09..d6f40b51b8 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -329,6 +329,7 @@ ProtoGetAvatarFormatByMimeType @400 ProtoGetAvatarMimeType @401
?set_uin@DB_AUTH_BLOB@@QEAAXK@Z @402 NONAME
??0CSrmmBaseDialog@@IEAA@AEAVCMPluginBase@@HPEAUSESSION_INFO@@@Z @403 NONAME
+Miranda_GetSystemWindow @404 NONAME
??1CSrmmBaseDialog@@UEAA@XZ @405 NONAME
Srmm_FindDialog @406 NONAME
??_7CSrmmBaseDialog@@6B@ @407 NONAME
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index b67b93b2a2..758fe9f89f 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -202,6 +202,8 @@ static int SystemShutdownProc(WPARAM, LPARAM) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
#define MIRANDA_PROCESS_WAIT_TIMEOUT 60000
#define MIRANDA_PROCESS_WAIT_RESOLUTION 1000
#define MIRANDA_PROCESS_WAIT_STEPS (MIRANDA_PROCESS_WAIT_TIMEOUT/MIRANDA_PROCESS_WAIT_RESOLUTION)
@@ -264,6 +266,23 @@ INT_PTR CheckRestart() return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+class MSystemWindow : public CDlgBase
+{
+
+public:
+ MSystemWindow() :
+ CDlgBase(g_plugin, -1)
+ {
+ m_hwnd = CreateWindowEx(0, L"STATIC", nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, g_plugin.getInst(), nullptr);
+ }
+};
+
+static MSystemWindow *g_pSystemWindow;
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
static void crtErrorHandler(const wchar_t*, const wchar_t*, const wchar_t*, unsigned, uintptr_t)
{}
@@ -322,7 +341,9 @@ int WINAPI mir_main(LPTSTR cmdLine) CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_ALL, IID_ITaskbarList3, (void**)&pTaskbarInterface);
OpenSSL_Init();
-
+
+ g_pSystemWindow = new MSystemWindow();
+
int result = 0;
if (LoadDefaultModules()) {
g_bMirandaTerminated = true;
@@ -393,14 +414,18 @@ int WINAPI mir_main(LPTSTR cmdLine) UnloadNewPluginsModule();
UnloadCoreModule();
- FreeLibrary(hDwmApi);
- FreeLibrary(hThemeAPI);
+
+ if (hDwmApi)
+ FreeLibrary(hDwmApi);
+ if (hThemeAPI)
+ FreeLibrary(hThemeAPI);
if (pTaskbarInterface)
pTaskbarInterface->Release();
+ delete g_pSystemWindow;
+
OpenSSL_Cleanup();
-
OleUninitialize();
if (bufferedPaintUninit)
@@ -491,6 +516,11 @@ MIR_APP_DLL(void) Miranda_GetVersionText(char *pDest, size_t cbSize) #endif
}
+MIR_APP_DLL(CDlgBase *) Miranda_GetSystemWindow()
+{
+ return g_pSystemWindow;
+}
+
///////////////////////////////////////////////////////////////////////////////
extern HANDLE hOptionsInitEvent;
|