diff options
Diffstat (limited to 'plugins/StatusManager')
-rw-r--r-- | plugins/StatusManager/StatusManager.vcxproj | 14 | ||||
-rw-r--r-- | plugins/StatusManager/StatusManager.vcxproj.filters | 372 | ||||
-rw-r--r-- | plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp (renamed from plugins/StatusManager/src/aaa_msgoptions.cpp) | 2 | ||||
-rw-r--r-- | plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp (renamed from plugins/StatusManager/src/aaa_options.cpp) | 8 | ||||
-rw-r--r-- | plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp (renamed from plugins/StatusManager/src/advancedautoaway.cpp) | 30 | ||||
-rw-r--r-- | plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.h (renamed from plugins/StatusManager/src/advancedautoaway.h) | 12 | ||||
-rw-r--r-- | plugins/StatusManager/src/KeepStatus/keepstatus.cpp (renamed from plugins/StatusManager/src/keepstatus.cpp) | 61 | ||||
-rw-r--r-- | plugins/StatusManager/src/KeepStatus/keepstatus.h (renamed from plugins/StatusManager/src/keepstatus.h) | 14 | ||||
-rw-r--r-- | plugins/StatusManager/src/KeepStatus/ks_options.cpp (renamed from plugins/StatusManager/src/ks_options.cpp) | 6 | ||||
-rw-r--r-- | plugins/StatusManager/src/StartupStatus/ss_options.cpp (renamed from plugins/StatusManager/src/ss_options.cpp) | 4 | ||||
-rw-r--r-- | plugins/StatusManager/src/StartupStatus/ss_profiles.cpp (renamed from plugins/StatusManager/src/ss_profiles.cpp) | 12 | ||||
-rw-r--r-- | plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp (renamed from plugins/StatusManager/src/ss_toolbars.cpp) | 2 | ||||
-rw-r--r-- | plugins/StatusManager/src/StartupStatus/startupstatus.cpp (renamed from plugins/StatusManager/src/startupstatus.cpp) | 54 | ||||
-rw-r--r-- | plugins/StatusManager/src/StartupStatus/startupstatus.h (renamed from plugins/StatusManager/src/startupstatus.h) | 16 | ||||
-rw-r--r-- | plugins/StatusManager/src/main.cpp | 87 | ||||
-rw-r--r-- | plugins/StatusManager/src/stdafx.h | 10 |
16 files changed, 185 insertions, 519 deletions
diff --git a/plugins/StatusManager/StatusManager.vcxproj b/plugins/StatusManager/StatusManager.vcxproj index 8fb9c5748d..f194247e9c 100644 --- a/plugins/StatusManager/StatusManager.vcxproj +++ b/plugins/StatusManager/StatusManager.vcxproj @@ -26,6 +26,18 @@ <Import Project="$(ProjectDir)..\..\build\vc.common\plugin.props" /> </ImportGroup> <ItemGroup> + <ClInclude Include="src\KeepStatus\*.h" /> + <ClCompile Include="src\KeepStatus\*.cpp"> + <PrecompiledHeaderFile>..\stdafx.h</PrecompiledHeaderFile> + </ClCompile> + <ClInclude Include="src\StartupStatus\*.h" /> + <ClCompile Include="src\StartupStatus\*.cpp"> + <PrecompiledHeaderFile>..\stdafx.h</PrecompiledHeaderFile> + </ClCompile> + <ClInclude Include="src\AdvancedAutoAway\*.h" /> + <ClCompile Include="src\AdvancedAutoAway\*.cpp"> + <PrecompiledHeaderFile>..\stdafx.h</PrecompiledHeaderFile> + </ClCompile> <ClCompile Include="..\helpers\gen_helpers.cpp"> <PrecompiledHeader>NotUsing</PrecompiledHeader> </ClCompile> @@ -39,4 +51,4 @@ <ExceptionHandling>Sync</ExceptionHandling> </ClCompile> </ItemDefinitionGroup> -</Project>
\ No newline at end of file +</Project> diff --git a/plugins/StatusManager/StatusManager.vcxproj.filters b/plugins/StatusManager/StatusManager.vcxproj.filters index 3361c3477f..8f90aeb3d5 100644 --- a/plugins/StatusManager/StatusManager.vcxproj.filters +++ b/plugins/StatusManager/StatusManager.vcxproj.filters @@ -1,374 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(ProjectDir)..\..\build\vc.common\common.filters" /> - <ItemGroup> - <ClCompile Include="src\stdafx.cxx"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\commonstatus.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\options.cpp" /> - <ClCompile Include="src\commonstatus.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\options.cpp" /> - <ClCompile Include="src\commonstatus.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\options.cpp" /> - <ClCompile Include="src\commonstatus.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\options.cpp" /> - <ClCompile Include="src\commonstatus.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\options.cpp" /> - <ClCompile Include="src\commonstatus.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\options.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="src\aaa_msgoptions.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\aaa_options.cpp" /> - <ClCompile Include="src\advancedautoaway.cpp" /> - <ClCompile Include="src\commonstatus.cpp" /> - <ClCompile Include="src\confirmdialog.cpp" /> - <ClCompile Include="src\keepstatus.cpp" /> - <ClCompile Include="src\ks_options.cpp" /> - <ClCompile Include="src\main.cpp" /> - <ClCompile Include="src\ss_options.cpp" /> - <ClCompile Include="src\ss_profiles.cpp" /> - <ClCompile Include="src\ss_toolbars.cpp" /> - <ClCompile Include="src\startupstatus.cpp" /> - <ClCompile Include="..\helpers\gen_helpers.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="src\commonstatus.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\commonstatus.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\commonstatus.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\commonstatus.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\commonstatus.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\commonstatus.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\commonstatus.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\commonstatus.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\advancedautoaway.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\commonstatus.h" /> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\startupstatus.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\advancedautoaway.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\commonstatus.h" /> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\startupstatus.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\advancedautoaway.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\commonstatus.h" /> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\startupstatus.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\advancedautoaway.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\commonstatus.h" /> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\startupstatus.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\advancedautoaway.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\commonstatus.h" /> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\startupstatus.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\advancedautoaway.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\commonstatus.h" /> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\startupstatus.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - <ClInclude Include="src\advancedautoaway.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\commonstatus.h" /> - <ClInclude Include="src\keepstatus.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\startupstatus.h" /> - <ClInclude Include="src\stdafx.h" /> - <ClInclude Include="src\version.h" /> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="res\resource.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - <ResourceCompile Include="res\StartupStatus.rc" /> - <ResourceCompile Include="res\version.rc" /> - <ResourceCompile Include="res\resource.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - <ResourceCompile Include="res\StartupStatus.rc" /> - <ResourceCompile Include="res\version.rc" /> - <ResourceCompile Include="res\resource.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - <ResourceCompile Include="res\StartupStatus.rc" /> - <ResourceCompile Include="res\version.rc" /> - <ResourceCompile Include="res\resource.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - <ResourceCompile Include="res\StartupStatus.rc" /> - <ResourceCompile Include="res\version.rc" /> - <ResourceCompile Include="res\resource.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - <ResourceCompile Include="res\StartupStatus.rc" /> - <ResourceCompile Include="res\version.rc" /> - <ResourceCompile Include="res\resource.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - <ResourceCompile Include="res\StartupStatus.rc" /> - <ResourceCompile Include="res\version.rc" /> - <ResourceCompile Include="res\resource.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - <ResourceCompile Include="res\StartupStatus.rc" /> - <ResourceCompile Include="res\version.rc" /> - </ItemGroup> -</Project>
\ No newline at end of file +</Project> diff --git a/plugins/StatusManager/src/aaa_msgoptions.cpp b/plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp index 5647199a43..2484440b2a 100644 --- a/plugins/StatusManager/src/aaa_msgoptions.cpp +++ b/plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "stdafx.h" +#include "..\stdafx.h" extern char *StatusModeToDbSetting(int status,const char *suffix); diff --git a/plugins/StatusManager/src/aaa_options.cpp b/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp index d26678c1ce..93204a033d 100644 --- a/plugins/StatusManager/src/aaa_options.cpp +++ b/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "stdafx.h" +#include "..\stdafx.h" int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName); @@ -119,7 +119,7 @@ static void SetDialogStatus(HWND hwndDlg, TAAAProtoSetting *sameSetting) ///////////////////////////////////////////////////////////////////////////////////////// // Rules dialog window procedure -static TAAAProtoSettingList optionSettings(10, CompareSettings); +static TAAAProtoSettingList optionSettings(10, AAACompareSettings); static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -337,7 +337,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM for (int i = 0; i < optionSettings.getCount(); i++) WriteAutoAwaySetting(optionSettings[i], optionSettings[i].szName); } - LoadOptions(autoAwaySettings, FALSE); + AAALoadOptions(autoAwaySettings, FALSE); } break; @@ -402,7 +402,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA db_set_w(NULL, AAAMODULENAME, SETTING_CONFIRMDELAY, (WORD)GetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, NULL, FALSE)); db_set_b(NULL, AAAMODULENAME, SETTING_MONITORMOUSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)); db_set_b(NULL, AAAMODULENAME, SETTING_MONITORKEYBOARD, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)); - LoadOptions(autoAwaySettings, FALSE); + AAALoadOptions(autoAwaySettings, FALSE); } break; } diff --git a/plugins/StatusManager/src/advancedautoaway.cpp b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp index 7f09466bd2..d0eb48801c 100644 --- a/plugins/StatusManager/src/advancedautoaway.cpp +++ b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp @@ -20,7 +20,7 @@ Some code is copied from Miranda's AutoAway module */ -#include "stdafx.h" +#include "..\stdafx.h" #ifdef _DEBUG #define SECS_PER_MINUTE 20 /* speedup */ @@ -30,12 +30,7 @@ ///////////////////////////////////////////////////////////////////////////////////////// -int CompareSettings(const TAAAProtoSetting *p1, const TAAAProtoSetting *p2) -{ - return mir_strcmp(p1->szName, p2->szName); -} - -TAAAProtoSettingList autoAwaySettings(10, CompareSettings); +TAAAProtoSettingList autoAwaySettings(10, AAACompareSettings); TAAAProtoSetting::TAAAProtoSetting(PROTOACCOUNT *pa) { @@ -55,7 +50,8 @@ TAAAProtoSetting::~TAAAProtoSetting() ///////////////////////////////////////////////////////////////////////////////////////// -extern HANDLE hStateChangedEvent; +HANDLE hAAAModuleLoadedHook = NULL, + hStateChangedEvent = NULL; static BOOL ignoreLockKeys = FALSE; static BOOL ignoreSysKeys = FALSE; @@ -95,7 +91,7 @@ extern char *StatusModeToDbSetting(int status,const char *suffix); ///////////////////////////////////////////////////////////////////////////////////////// // Load from DB -void LoadOptions(TAAAProtoSettingList &loadSettings, BOOL override) +void AAALoadOptions(TAAAProtoSettingList &loadSettings, BOOL override) { // if override is enabled, samesettings will be ignored (for options loading) int monitorMiranda = FALSE; // use windows hooks? @@ -562,7 +558,7 @@ static int AutoAwayShutdown(WPARAM, LPARAM) return 0; } -int AAACSModuleLoaded(WPARAM, LPARAM) +int AAAModuleLoaded(WPARAM, LPARAM) { HookEvent(ME_PROTO_ACCLISTCHANGED, OnAAAAccChanged); HookEvent(ME_OPT_INITIALISE, AutoAwayOptInitialise); @@ -585,6 +581,18 @@ int AAACSModuleLoaded(WPARAM, LPARAM) //////////////////////////////////////////////////////////////////////////////////////// - LoadOptions(autoAwaySettings, FALSE); + AAALoadOptions(autoAwaySettings, FALSE); return 0; } + +void AdvancedAutoAwayLoad() +{ + hAAAModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, AAAModuleLoaded); + hStateChangedEvent = CreateHookableEvent(ME_AAA_STATECHANGED); +} + +void AdvancedAutoAwayUnload() +{ + UnhookEvent(hAAAModuleLoadedHook); + DestroyHookableEvent(hStateChangedEvent); +}
\ No newline at end of file diff --git a/plugins/StatusManager/src/advancedautoaway.h b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.h index a8177c2a77..70118e0e38 100644 --- a/plugins/StatusManager/src/advancedautoaway.h +++ b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.h @@ -70,6 +70,11 @@ struct TAAAProtoSetting : public PROTOCOLSETTINGEX, public MZeroedObject unsigned int sts1setTimer; }; +static int AAACompareSettings(const TAAAProtoSetting *p1, const TAAAProtoSetting *p2) +{ + return mir_strcmp(p1->szName, p2->szName); +} + struct AAMSGSETTING { short useCustom; @@ -77,14 +82,13 @@ struct AAMSGSETTING char* msg; }; -extern HINSTANCE hInst; - -int CompareSettings( const TAAAProtoSetting *p1, const TAAAProtoSetting *p2 ); +void AdvancedAutoAwayLoad(); +void AdvancedAutoAwayUnload(); typedef OBJLIST<TAAAProtoSetting> TAAAProtoSettingList; extern TAAAProtoSettingList autoAwaySettings; int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char *protoName); -void LoadOptions(TAAAProtoSettingList &settings, BOOL override); +void AAALoadOptions(TAAAProtoSettingList &settings, BOOL override); #endif diff --git a/plugins/StatusManager/src/keepstatus.cpp b/plugins/StatusManager/src/KeepStatus/keepstatus.cpp index 41c244cde4..f975b64793 100644 --- a/plugins/StatusManager/src/keepstatus.cpp +++ b/plugins/StatusManager/src/KeepStatus/keepstatus.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "stdafx.h" +#include "..\stdafx.h" struct TimerInfo { int timer; @@ -27,6 +27,16 @@ struct TimerInfo { HANDLE hEvent; }; +HANDLE hMainThread = 0; +unsigned long mainThreadId = 0; + +HANDLE hKSModuleLoadedHook = NULL, + hConnectionEvent = NULL, + hStopRecon = NULL, + hEnableProto = NULL, + hIsProtoEnabled = NULL, + hAnnounceStat = NULL; + static mir_cs GenTimerCS, GenStatusCS, CheckContinueslyCS; static HANDLE hProtoAckHook = NULL; @@ -34,9 +44,6 @@ static HANDLE hStatusChangeHook = NULL; static HANDLE hCSStatusChangeHook = NULL; static HANDLE hCSStatusChangeExHook = NULL; -extern HANDLE hConnectionEvent; -extern PLUGININFOEX pluginInfoEx; - static HWND hMessageWindow = NULL; static int CompareConnections(const TConnectionSettings *p1, const TConnectionSettings *p2) @@ -64,7 +71,6 @@ static int showConnectionPopups = 0; // prototypes static int StartTimer(int timer, int timeout, BOOL restart); static int StopTimer(int timer); -int KSLoadMainOptions(); static void GetCurrentConnectionSettings(); static int AssignStatus(TConnectionSettings* connSetting, int status, int lastStatus, wchar_t *szMsg); static int ProcessProtoAck(WPARAM wParam, LPARAM lParam); @@ -83,7 +89,7 @@ INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam); static int ProcessPopup(int reason, LPARAM lParam); static INT_PTR ShowPopup(wchar_t *msg, HICON hIcon); -LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); +LRESULT CALLBACK KSPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); static DWORD CALLBACK MessageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); // options.c @@ -106,7 +112,7 @@ TConnectionSettings::~TConnectionSettings() free(szMsg); } -int KSLoadMainOptions() +int KSLoadOptions() { UnhookEvent(hProtoAckHook); UnhookEvent(hStatusChangeHook); @@ -991,7 +997,7 @@ static INT_PTR ShowPopup(wchar_t *msg, HICON hIcon) ppd.colorBack = db_get_dw(NULL, KSMODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA); ppd.colorText = db_get_dw(NULL, KSMODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC); } - ppd.PluginWindowProc = PopupDlgProc; + ppd.PluginWindowProc = KSPopupDlgProc; switch (db_get_b(NULL, KSMODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) { case POPUP_DELAYCUSTOM: @@ -1012,7 +1018,7 @@ static INT_PTR ShowPopup(wchar_t *msg, HICON hIcon) return PUAddPopupT(&ppd); } -LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK KSPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_CONTEXTMENU: // right @@ -1193,15 +1199,48 @@ static int onShutdown(WPARAM, LPARAM) return 0; } -int KSCSModuleLoaded(WPARAM, LPARAM) +int KSModuleLoaded(WPARAM, LPARAM) { protoList = (OBJLIST<PROTOCOLSETTINGEX>*)&connectionSettings; hMessageWindow = NULL; - KSLoadMainOptions(); + KSLoadOptions(); HookEvent(ME_OPT_INITIALISE, KeepStatusOptionsInit); HookEvent(ME_SYSTEM_PRESHUTDOWN, onShutdown); HookEvent(ME_PROTO_ACCLISTCHANGED, OnKSAccChanged); return 0; } + +void KeepStatusLoad() +{ + hKSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, KSModuleLoaded); + + CreateHookableEvent(ME_KS_CONNECTIONEVENT); + + hStopRecon = CreateServiceFunction(MS_KS_STOPRECONNECTING, StopReconnectingService); + hEnableProto = CreateServiceFunction(MS_KS_ENABLEPROTOCOL, EnableProtocolService); + hIsProtoEnabled = CreateServiceFunction(MS_KS_ISPROTOCOLENABLED, IsProtocolEnabledService); + hAnnounceStat = CreateServiceFunction(MS_KS_ANNOUNCESTATUSCHANGE, AnnounceStatusChangeService); + + DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0); + mainThreadId = GetCurrentThreadId(); +} + +void KeepStatusUnload() +{ + if (hMainThread) + CloseHandle(hMainThread); + + DestroyServiceFunction(hStopRecon); + DestroyServiceFunction(hEnableProto); + DestroyServiceFunction(hIsProtoEnabled); + DestroyServiceFunction(hAnnounceStat); + + if (hMainThread) + CloseHandle(hMainThread); + + DestroyHookableEvent(hConnectionEvent); + + UnhookEvent(hKSModuleLoadedHook); +} diff --git a/plugins/StatusManager/src/keepstatus.h b/plugins/StatusManager/src/KeepStatus/keepstatus.h index d44b312e80..18e13f242c 100644 --- a/plugins/StatusManager/src/keepstatus.h +++ b/plugins/StatusManager/src/KeepStatus/keepstatus.h @@ -113,16 +113,12 @@ typedef struct { #define ME_CS_STATUSCHANGE "CommonStatus/StatusChange" ///////////////////////////////////////////////////////////////////////////////////////// -// main.cpp - -extern HINSTANCE hInst; -extern HANDLE hMainThread; -extern unsigned long mainThreadId; - -///////////////////////////////////////////////////////////////////////////////////////// // keepstatus.cpp -int KSLoadMainOptions(); -LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); +void KeepStatusLoad(); +void KeepStatusUnload(); +int KSLoadOptions(); + +LRESULT CALLBACK KSPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); #endif //__KEEPSTATUS_HEADER diff --git a/plugins/StatusManager/src/ks_options.cpp b/plugins/StatusManager/src/KeepStatus/ks_options.cpp index 890981a8c1..0f321dfd14 100644 --- a/plugins/StatusManager/src/ks_options.cpp +++ b/plugins/StatusManager/src/KeepStatus/ks_options.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "stdafx.h" +#include "..\stdafx.h" // prototypes INT_PTR CALLBACK OptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); @@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProcKsTabs(HWND hwndDlg, UINT msg, WPARAM wParam, LPA SendMessage((HWND)tci.lParam, WM_NOTIFY, 0, lParam); } // let main reload options - KSLoadMainOptions(); + KSLoadOptions(); } break; } @@ -497,7 +497,7 @@ INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ppd.colorBack = SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_GETCOLOUR, 0, 0); ppd.colorText = SendDlgItemMessage(hwndDlg, IDC_TEXTCOLOR, CPM_GETCOLOUR, 0, 0); } - ppd.PluginWindowProc = PopupDlgProc; + ppd.PluginWindowProc = KSPopupDlgProc; ppd.PluginData = NULL; if (IsDlgButtonChecked(hwndDlg, IDC_DELAYFROMPU)) { diff --git a/plugins/StatusManager/src/ss_options.cpp b/plugins/StatusManager/src/StartupStatus/ss_options.cpp index 2acf61483f..644be1f1e6 100644 --- a/plugins/StatusManager/src/ss_options.cpp +++ b/plugins/StatusManager/src/StartupStatus/ss_options.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "stdafx.h" +#include "..\stdafx.h" ///////////////////////////////////////////////////////////////////////////////////////// @@ -27,7 +27,7 @@ TSettingsList* GetCurrentProtoSettings() PROTOACCOUNT **protos; Proto_EnumAccounts(&count, &protos); - TSettingsList *result = new TSettingsList(count, CompareSettings); + TSettingsList *result = new TSettingsList(count, SSCompareSettings); if (result == NULL) return NULL; diff --git a/plugins/StatusManager/src/ss_profiles.cpp b/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp index 521d498fe9..8abeeaa495 100644 --- a/plugins/StatusManager/src/ss_profiles.cpp +++ b/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "stdafx.h" +#include "..\stdafx.h" #define MAX_MMITEMS 6 @@ -199,7 +199,7 @@ INT_PTR LoadAndSetProfile(WPARAM iProfileNo, LPARAM) { // wParam == profile no. int profile = (int)iProfileNo; - TSettingsList profileSettings(10, CompareSettings); + TSettingsList profileSettings(10, SSCompareSettings); if (!GetProfile(profile, profileSettings)) { profile = (profile >= 0) ? profile : db_get_w(NULL, SSMODULENAME, SETTING_DEFAULTPROFILE, 0); @@ -313,6 +313,12 @@ int LoadProfileModule() return 0; } +int UnloadProfileModule() +{ + DestroyServiceFunction(hLoadAndSetProfileService); + return 0; +} + int InitProfileModule() { hTTBModuleLoadedHook = HookEvent(ME_TTB_MODULELOADED, CreateTopToolbarButtons); @@ -337,7 +343,5 @@ int DeinitProfilesModule() UnregisterHotKeys(); RemoveTopToolbarButtons(); - - DestroyServiceFunction(hLoadAndSetProfileService); return 0; } diff --git a/plugins/StatusManager/src/ss_toolbars.cpp b/plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp index 2ecf0a6b95..e9d153670a 100644 --- a/plugins/StatusManager/src/ss_toolbars.cpp +++ b/plugins/StatusManager/src/StartupStatus/ss_toolbars.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "stdafx.h" +#include "..\stdafx.h" #define MAX_MMITEMS 6 diff --git a/plugins/StatusManager/src/startupstatus.cpp b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp index 995aa68934..2af4dc146d 100644 --- a/plugins/StatusManager/src/startupstatus.cpp +++ b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp @@ -17,16 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "stdafx.h" +#include "..\stdafx.h" static UINT_PTR setStatusTimerId = 0; -int CompareSettings(const TSSSetting *p1, const TSSSetting *p2) -{ - return mir_strcmp(p1->szName, p2->szName); -} - -static TSettingsList startupSettings(10, CompareSettings); +static TSettingsList startupSettings(10, SSCompareSettings); TSSSetting::TSSSetting(PROTOACCOUNT *pa) { @@ -343,6 +338,7 @@ static int OnOkToExit(WPARAM, LPARAM) static int OnShutdown(WPARAM, LPARAM) { DeinitProfilesModule(); + UnloadProfileModule(); // set windowstate and docked for next startup if (db_get_b(NULL, SSMODULENAME, SETTING_SETWINSTATE, 0)) { @@ -402,7 +398,7 @@ static DWORD CALLBACK MessageWndProc(HWND, UINT msg, WPARAM wParam, LPARAM) return TRUE; } -int SSCSModuleLoaded(WPARAM, LPARAM) +int SSModuleLoaded(WPARAM, LPARAM) { protoList = (OBJLIST<PROTOCOLSETTINGEX>*)&startupSettings; @@ -484,3 +480,45 @@ int SSCSModuleLoaded(WPARAM, LPARAM) return 0; } + +HANDLE hSSModuleLoadedHook = NULL, + hGetProfileService, + hGetProfileCountService, + hGetProfileNameService; + +void StartupStatusLoad() +{ + hSSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, SSModuleLoaded); + + if (db_get_b(NULL, SSMODULENAME, SETTING_SETPROFILE, 1) || + db_get_b(NULL, SSMODULENAME, SETTING_OFFLINECLOSE, 0)) + db_set_w(NULL, "CList", "Status", (WORD)ID_STATUS_OFFLINE); + + // docking + if (db_get_b(NULL, SSMODULENAME, SETTING_SETDOCKED, 0)) { + int docked = db_get_b(NULL, SSMODULENAME, SETTING_DOCKED, DOCKED_NONE); + if (docked == DOCKED_LEFT || docked == DOCKED_RIGHT) + docked = -docked; + + db_set_b(NULL, MODULE_CLIST, SETTING_DOCKED, (BYTE)docked); + } + + // Create service functions; the get functions are created here; they don't rely on commonstatus + hGetProfileService = CreateServiceFunction(MS_SS_GETPROFILE, SrvGetProfile); + hGetProfileCountService = CreateServiceFunction(MS_SS_GETPROFILECOUNT, GetProfileCount); + hGetProfileNameService = CreateServiceFunction(MS_SS_GETPROFILENAME, GetProfileName); + + LoadProfileModule(); +} + +void StartupStatusUnload() +{ + DeinitProfilesModule(); + UnloadProfileModule(); + + DestroyServiceFunction(hGetProfileService); + DestroyServiceFunction(hGetProfileCountService); + DestroyServiceFunction(hGetProfileNameService); + + UnhookEvent(hSSModuleLoadedHook); +} diff --git a/plugins/StatusManager/src/startupstatus.h b/plugins/StatusManager/src/StartupStatus/startupstatus.h index f106a141d9..5686e03981 100644 --- a/plugins/StatusManager/src/startupstatus.h +++ b/plugins/StatusManager/src/StartupStatus/startupstatus.h @@ -28,6 +28,11 @@ struct TSSSetting : public PROTOCOLSETTINGEX, public MZeroedObject ~TSSSetting(); }; +static int SSCompareSettings(const TSSSetting *p1, const TSSSetting *p2) +{ + return mir_strcmp(p1->szName, p2->szName); +} + typedef OBJLIST<TSSSetting> TSettingsList; struct PROFILECE @@ -130,9 +135,10 @@ int StartupStatusOptionsInit(WPARAM wparam,LPARAM lparam); char* OptName(int i, const char* setting); // startupstatus -int SSLoadMainOptions(); +void StartupStatusLoad(); +void StartupStatusUnload(); -int CompareSettings( const TSSSetting* p1, const TSSSetting* p2 ); +int SSLoadMainOptions(); TSettingsList* GetCurrentProtoSettings(); @@ -140,6 +146,11 @@ TSettingsList* GetCurrentProtoSettings(); int GetProfile(int profileID, TSettingsList& arSettings ); wchar_t *GetStatusMessage(int profile, char *szProto); +static INT_PTR SrvGetProfile(WPARAM wParam, LPARAM lParam) +{ + return GetProfile((int)wParam, *(TSettingsList*)lParam); +} + INT_PTR LoadAndSetProfile(WPARAM wParam, LPARAM lParam); INT_PTR GetProfileCount(WPARAM wParam, LPARAM lParam); INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam); @@ -149,6 +160,7 @@ void RemoveTopToolbarButtons(); int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam); int LoadProfileModule(); +int UnloadProfileModule(); int InitProfileModule(); int DeinitProfilesModule(); diff --git a/plugins/StatusManager/src/main.cpp b/plugins/StatusManager/src/main.cpp index 41455e029a..2264b63fb2 100644 --- a/plugins/StatusManager/src/main.cpp +++ b/plugins/StatusManager/src/main.cpp @@ -19,21 +19,6 @@ #include "stdafx.h" -unsigned long mainThreadId = 0; - -HANDLE hMainThread = 0, - hCSModuleLoadedHook, - hGetProfileService, - hGetProfileCountService, - hGetProfileNameService, - hStateChangedEvent; - -HANDLE hConnectionEvent = NULL, - hStopRecon = NULL, - hEnableProto = NULL, - hIsProtoEnabled = NULL, - hAnnounceStat = NULL; - HINSTANCE hInst; int hLangpack = 0; CLIST_INTERFACE *pcli; @@ -79,63 +64,16 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_AUTOAW ///////////////////////////////////////////////////////////////////////////////////////// // plugin's entry point -INT_PTR StopReconnectingService(WPARAM wParam, LPARAM lParam); -INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam); -INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam); -INT_PTR AnnounceStatusChangeService(WPARAM wParam, LPARAM lParam); - -static INT_PTR SrvGetProfile(WPARAM wParam, LPARAM lParam) -{ - return GetProfile((int)wParam, *(TSettingsList*)lParam); -} - extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfoEx); pcli = Clist_GetInterface(); - //common InitCommonStatus(); - /* KeepStatus */ - hCSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, KSCSModuleLoaded); - - hConnectionEvent = CreateHookableEvent(ME_KS_CONNECTIONEVENT); - - hStopRecon = CreateServiceFunction(MS_KS_STOPRECONNECTING, StopReconnectingService); - hEnableProto = CreateServiceFunction(MS_KS_ENABLEPROTOCOL, EnableProtocolService); - hIsProtoEnabled = CreateServiceFunction(MS_KS_ISPROTOCOLENABLED, IsProtocolEnabledService); - hAnnounceStat = CreateServiceFunction(MS_KS_ANNOUNCESTATUSCHANGE, AnnounceStatusChangeService); - - DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0); - mainThreadId = GetCurrentThreadId(); - - /* StartupStatus */ - hCSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, SSCSModuleLoaded); - - if (db_get_b(NULL, SSMODULENAME, SETTING_SETPROFILE, 1) || - db_get_b(NULL, SSMODULENAME, SETTING_OFFLINECLOSE, 0)) - db_set_w(NULL, "CList", "Status", (WORD)ID_STATUS_OFFLINE); - - // docking - if (db_get_b(NULL, SSMODULENAME, SETTING_SETDOCKED, 0)) { - int docked = db_get_b(NULL, SSMODULENAME, SETTING_DOCKED, DOCKED_NONE); - if (docked == DOCKED_LEFT || docked == DOCKED_RIGHT) - docked = -docked; - - db_set_b(NULL, MODULE_CLIST, SETTING_DOCKED, (BYTE)docked); - } - - // Create service functions; the get functions are created here; they don't rely on commonstatus - hGetProfileService = CreateServiceFunction(MS_SS_GETPROFILE, SrvGetProfile); - hGetProfileCountService = CreateServiceFunction(MS_SS_GETPROFILECOUNT, GetProfileCount); - hGetProfileNameService = CreateServiceFunction(MS_SS_GETPROFILENAME, GetProfileName); - - LoadProfileModule(); - - /* AdvancedAutoAway */ - hCSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, AAACSModuleLoaded); - hStateChangedEvent = CreateHookableEvent(ME_AAA_STATECHANGED); + KeepStatusLoad(); + StartupStatusLoad(); + AdvancedAutoAwayLoad(); return 0; } @@ -145,22 +83,9 @@ extern "C" int __declspec(dllexport) Load(void) extern "C" int __declspec(dllexport) Unload(void) { - UnhookEvent(hCSModuleLoadedHook); - - // StartupStatus - DestroyHookableEvent(hConnectionEvent); - - if (hMainThread) - CloseHandle(hMainThread); - DestroyServiceFunction(hStopRecon); - DestroyServiceFunction(hEnableProto); - DestroyServiceFunction(hIsProtoEnabled); - DestroyServiceFunction(hAnnounceStat); - - // StartupStatus - DestroyServiceFunction(hGetProfileService); - DestroyServiceFunction(hGetProfileCountService); - DestroyServiceFunction(hGetProfileNameService); + KeepStatusUnload(); + StartupStatusUnload(); + AdvancedAutoAwayUnload(); return 0; } diff --git a/plugins/StatusManager/src/stdafx.h b/plugins/StatusManager/src/stdafx.h index a8fd9051a7..0e481e36ca 100644 --- a/plugins/StatusManager/src/stdafx.h +++ b/plugins/StatusManager/src/stdafx.h @@ -26,12 +26,10 @@ #include "resource.h" #include "commonstatus.h" -#include "keepstatus.h" -#include "startupstatus.h" -#include "advancedautoaway.h" +#include "KeepStatus\keepstatus.h" +#include "StartupStatus\startupstatus.h" +#include "AdvancedAutoAway\advancedautoaway.h" -int KSCSModuleLoaded(WPARAM, LPARAM); -int SSCSModuleLoaded(WPARAM, LPARAM); -int AAACSModuleLoaded(WPARAM, LPARAM); +extern HINSTANCE hInst; #endif //_COMMON_H_ |