From a66836887fc4aa7514fdf1b3b89b81aee94c145b Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Sun, 14 Nov 2010 16:15:33 +0000 Subject: Added hotkeys (patch by FREAK_THEMIGHTY) Version Update git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@561 4f64403b-2f21-0410-a795-97e2b3489a10 --- updater/updater.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'updater/updater.cpp') diff --git a/updater/updater.cpp b/updater/updater.cpp index 77f7c83..c5d6612 100644 --- a/updater/updater.cpp +++ b/updater/updater.cpp @@ -1,5 +1,6 @@ #include "common.h" #include "updater.h" +#include HINSTANCE hInst; PLUGINLINK *pluginLink; @@ -166,7 +167,11 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { update.cpbVersionPrefix = strlen((char *)update.pbVersionPrefix); #endif //REGISTER_AUTO +#ifdef _WIN64 + update.szBetaUpdateURL = BETA_HOST_URL_PREFIX "/updater_x64.zip"; +#else update.szBetaUpdateURL = BETA_HOST_URL_PREFIX "/updater.zip"; +#endif update.szBetaVersionURL = BETA_HOST_URL_PREFIX "/ver_updater.html"; update.pbBetaVersionPrefix = (BYTE *)"Updater version "; update.cpbBetaVersionPrefix = (int)strlen((char *)update.pbBetaVersionPrefix); @@ -187,7 +192,8 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { hEventIdleChanged = HookEvent(ME_IDLE_CHANGED, IdleChanged); - if(ServiceExists(MS_TRIGGER_REGISTERACTION)) { + if (ServiceExists(MS_TRIGGER_REGISTERACTION)) + { // create update action for triggerplugin ACTIONREGISTER ar = {0}; ar.cbSize = sizeof(ACTIONREGISTER); @@ -197,6 +203,32 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { CallService(MS_TRIGGER_REGISTERACTION, 0, (LPARAM)&ar); } + if (ServiceExists(MS_HOTKEY_REGISTER)) + { + HOTKEYDESC shk = {0}; + + shk.cbSize = sizeof(shk); + shk.pszSection = LPGEN("Updater"); + + shk.pszDescription = LPGEN("Check for Updates"); + shk.pszName = "Update"; + shk.pszService = MS_UPDATE_CHECKFORUPDATES; + shk.DefHotKey = HOTKEYCODE(HOTKEYF_ALT, 'U'); + CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk); + + shk.pszDescription = LPGEN("Restart"); + shk.pszName = "Restart"; + shk.pszService = MS_UPDATE_MENURESTART; + shk.DefHotKey = HOTKEYCODE(HOTKEYF_ALT, 'R'); + CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk); + + shk.pszDescription = LPGEN("Update and Exit"); + shk.pszName = "UpdateAndExit"; + shk.pszService = MS_UPDATE_MENUUPDATEANDEXIT; + shk.DefHotKey = 0; + CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&shk); + } + return 0; } -- cgit v1.2.3