From 9a8ea65ccec0256ecda95581edd69c8d91020867 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Mon, 5 Apr 2010 05:44:52 +0000 Subject: Added x64 port Converted to Unicode Reduced size git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@494 4f64403b-2f21-0410-a795-97e2b3489a10 --- worldtime/WorldTime.cpp | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'worldtime/WorldTime.cpp') diff --git a/worldtime/WorldTime.cpp b/worldtime/WorldTime.cpp index 5978cba..5451e94 100644 --- a/worldtime/WorldTime.cpp +++ b/worldtime/WorldTime.cpp @@ -18,21 +18,8 @@ PLUGININFOEX pluginInfo={ { 0x6e8c83d3, 0x418e, 0x4cec, { 0xb3, 0x4e, 0xed, 0x61, 0x3f, 0x51, 0xae, 0x58 } } // {6E8C83D3-418E-4cec-B34E-ED613F51AE58} }; -int winver = 0; - -#define VER_9X 1 -#define VER_NT40 2 -#define VER_2KXP 3 - -void detect_win_version() { - OSVERSIONINFO version; - - version.dwOSVersionInfoSize = sizeof(version); - GetVersionEx(&version); - - winver = (version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) ? VER_9X - : (version.dwMajorVersion == 4) ? VER_NT40 : VER_2KXP; -} +MM_INTERFACE mmi; +LIST_INTERFACE li; extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) @@ -67,7 +54,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) { update.szComponentName = pluginInfo.shortName; update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion); - update.cpbVersion = strlen((char *)update.pbVersion); + update.cpbVersion = (int)strlen((char *)update.pbVersion); update.szUpdateURL = UPDATER_AUTOREGISTER; @@ -79,7 +66,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) { update.szBetaVersionURL = "http://www.scottellis.com.au/miranda_plugins/ver_worldtime.html"; update.pbBetaVersionPrefix = (BYTE *)"World Time version "; - update.cpbBetaVersionPrefix = strlen((char *)update.pbBetaVersionPrefix); + update.cpbBetaVersionPrefix = (int)strlen((char *)update.pbBetaVersionPrefix); CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); } @@ -95,13 +82,8 @@ extern "C" WORLDTIME_API int Load(PLUGINLINK *link) { pluginLink=link; -/* - detect_win_version(); - if(winver < 2) { - MessageBox(0, "Sorry, this plugin does not work on Win9x (yet).\nPlugin disabled.", "World Time", MB_ICONERROR | MB_OK); - return 0; - } -*/ + mir_getMMI(&mmi); + mir_getLI(&li); // ensure datetime picker is loaded INITCOMMONCONTROLSEX ccx = {0}; @@ -118,7 +100,7 @@ extern "C" WORLDTIME_API int Load(PLUGINLINK *link) HookEvent( ME_OPT_INITIALISE, WorldTimeOptInit ); } else { - MessageBox(0, "Unable to read timezone information.\nPlugin disabled.", "World Time", MB_ICONERROR | MB_OK); + MessageBox(0, _T("Unable to read timezone information.\nPlugin disabled."), _T("World Time"), MB_ICONERROR | MB_OK); } return 0; -- cgit v1.2.3