diff options
Diffstat (limited to 'plugins/Weather/src/weather.cpp')
-rw-r--r-- | plugins/Weather/src/weather.cpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index afa14ccf0c..55c5b92c25 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -31,7 +31,6 @@ belong to any other file. WIDATALIST *WIHead;
WIDATALIST *WITail;
-HINSTANCE g_hInstance;
HWND hPopupWindow;
HANDLE hHookWeatherUpdated;
@@ -59,6 +58,12 @@ BOOL ModuleLoaded; HANDLE hTBButton = nullptr;
/////////////////////////////////////////////////////////////////////////////////////////
+
+CMPlugin g_plugin;
+
+extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
+
+/////////////////////////////////////////////////////////////////////////////////////////
// plugin info
static const PLUGININFOEX pluginInfoEx =
@@ -204,7 +209,7 @@ extern "C" int __declspec(dllexport) Load(void) wchar_t SvcFunc[100];
mir_snwprintf(SvcFunc, L"%s__PopupWindow", _A2W(WEATHERPROTONAME));
hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, L"static", SvcFunc, 0, CW_USEDEFAULT, CW_USEDEFAULT,
- CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, nullptr, g_hInstance, nullptr);
+ CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, nullptr, g_plugin.getInst(), nullptr);
SetWindowLongPtr(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc);
return 0;
}
@@ -233,19 +238,3 @@ extern "C" int __declspec(dllexport) Unload(void) CloseHandle(hUpdateMutex);
return 0;
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-struct CMPlugin : public PLUGIN<CMPlugin>
-{
- CMPlugin() :
- PLUGIN<CMPlugin>(WEATHERPROTONAME)
- {
- opt.NoProtoCondition = db_get_b(NULL, WEATHERPROTONAME, "NoStatus", true);
- RegisterProtocol((opt.NoProtoCondition) ? PROTOTYPE_VIRTUAL : PROTOTYPE_PROTOCOL);
- SetUniqueId("ID");
- }
-}
- g_plugin;
-
-extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
|