diff options
Diffstat (limited to 'plugins/StatusPlugins/KeepStatus/keepstatus.cpp')
-rw-r--r-- | plugins/StatusPlugins/KeepStatus/keepstatus.cpp | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 024b2c5f40..d2f58536bb 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -30,9 +30,6 @@ struct TimerInfo { static CRITICAL_SECTION GenTimerCS, GenStatusCS, CheckContinueslyCS;
-static HANDLE hOptionsHook = NULL;
-static HANDLE hShutdownHook = NULL;
-static HANDLE hAccChangeHook = NULL;
static HANDLE hProtoAckHook = NULL;
static HANDLE hStatusChangeHook = NULL;
static HANDLE hCSStatusChangeHook = NULL;
@@ -92,8 +89,6 @@ static INT_PTR ShowPopup(TCHAR *msg, HICON hIcon); LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
static DWORD CALLBACK MessageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-static int Exit(WPARAM wParam, LPARAM lParam);
-
// options.c
extern int OptionsInit(WPARAM wparam,LPARAM);
extern int InitCommonStatus();
@@ -1229,27 +1224,8 @@ int OnAccChanged(WPARAM wParam,LPARAM lParam) // =============== init stuff =================
-int CSModuleLoaded(WPARAM,LPARAM)
-{
- InitializeCriticalSection(&GenTimerCS);
- InitializeCriticalSection(&GenStatusCS);
- InitializeCriticalSection(&CheckContinueslyCS);
-
- protoList = ( OBJLIST<PROTOCOLSETTINGEX>* )&connectionSettings;
-
- hMessageWindow = NULL;
- LoadMainOptions();
- hOptionsHook = HookEvent(ME_OPT_INITIALISE, OptionsInit);
- hShutdownHook = HookEvent(ME_SYSTEM_OKTOEXIT, Exit);
- hAccChangeHook = HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged);
- return 0;
-}
-
-static int Exit(WPARAM,LPARAM)
+static int onShutdown(WPARAM,LPARAM)
{
- UnhookEvent(hOptionsHook);
- UnhookEvent(hShutdownHook);
- UnhookEvent(hAccChangeHook);
UnhookEvent(hStatusChangeHook);
UnhookEvent(hProtoAckHook);
UnhookEvent(hCSStatusChangeHook);
@@ -1266,3 +1242,20 @@ static int Exit(WPARAM,LPARAM) DeleteCriticalSection(&CheckContinueslyCS);
return 0;
}
+
+int CSModuleLoaded(WPARAM,LPARAM)
+{
+ InitializeCriticalSection(&GenTimerCS);
+ InitializeCriticalSection(&GenStatusCS);
+ InitializeCriticalSection(&CheckContinueslyCS);
+
+ protoList = ( OBJLIST<PROTOCOLSETTINGEX>* )&connectionSettings;
+
+ hMessageWindow = NULL;
+ LoadMainOptions();
+
+ HookEvent(ME_OPT_INITIALISE, OptionsInit);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, onShutdown);
+ HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged);
+ return 0;
+}
|