From 406c1bbcb1859d7f57e84c3c637b2b064dea7c67 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 8 Feb 2013 09:52:37 +0000 Subject: project and code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@3471 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Msg_Export/msg_export_11.vcxproj | 158 ++++------------ plugins/Msg_Export/msg_export_11.vcxproj.filters | 17 +- plugins/Msg_Export/res/Version.rc | 38 ++++ plugins/Msg_Export/res/resource.rc | 114 +----------- plugins/Msg_Export/src/FileViewer.cpp | 25 --- plugins/Msg_Export/src/FileViewer.h | 2 - plugins/Msg_Export/src/Glob.h | 27 +++ plugins/Msg_Export/src/Version.h | 14 ++ plugins/Msg_Export/src/main.cpp | 221 ++++++++--------------- plugins/Msg_Export/src/options.cpp | 26 +-- plugins/Msg_Export/src/utils.cpp | 9 - plugins/Msg_Export/src/utils.h | 33 ---- 12 files changed, 202 insertions(+), 482 deletions(-) create mode 100644 plugins/Msg_Export/res/Version.rc create mode 100644 plugins/Msg_Export/src/Version.h (limited to 'plugins') diff --git a/plugins/Msg_Export/msg_export_11.vcxproj b/plugins/Msg_Export/msg_export_11.vcxproj index 7a4a546b1f..4c268f58cb 100644 --- a/plugins/Msg_Export/msg_export_11.vcxproj +++ b/plugins/Msg_Export/msg_export_11.vcxproj @@ -20,7 +20,9 @@ - + + Create + @@ -30,43 +32,35 @@ - - - - - + + {4CE78D43-FF23-4134-A5AC-B2CF0F8D9F3B} - msg_export Msg_Export DynamicLibrary - false Unicode v110 DynamicLibrary - false Unicode v110 DynamicLibrary - false Unicode true v110 DynamicLibrary - false Unicode true v110 @@ -76,19 +70,15 @@ - - - - @@ -97,205 +87,121 @@ $(SolutionDir)$(Configuration)64\Plugins\ $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - false - false - false - false $(SolutionDir)$(Configuration)\Plugins\ $(SolutionDir)$(Configuration)64\Plugins\ $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - true - false - false - false - false - AllRules.ruleset - AllRules.ruleset - - - - - AllRules.ruleset - AllRules.ruleset - - - - + true - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/msg_export.tlb - - - Full OnlyExplicitInline - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);_CRT_SECURE_NO_DEPRECATE;UNICODE;_UNICODE + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - MultiThreadedDLL true - - - Level4 - true - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + Level3 + ..\..\include;%(AdditionalIncludeDirectories) Size + Use + Glob.h NDEBUG;%(PreprocessorDefinitions) - 0x0409 ..\..\include\msapi /PDBALTPATH:%_PDB% comctl32.lib;%(AdditionalDependencies) - true - false 0x22100000 false - - - MachineX86 $(ProfileDir)..\..\bin11\lib true true $(IntDir)$(TargetName).lib true + Windows - - NDEBUG;%(PreprocessorDefinitions) - true - true - .\Release/msg_export.tlb - - - Full OnlyExplicitInline - WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);_CRT_SECURE_NO_DEPRECATE;UNICODE;_UNICODE + WIN64;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - MultiThreadedDLL true - - - Level4 - true - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + Level3 + ..\..\include;%(AdditionalIncludeDirectories) Size + Use + Glob.h NDEBUG;%(PreprocessorDefinitions) - 0x0409 ..\..\include\msapi /PDBALTPATH:%_PDB% comctl32.lib;%(AdditionalDependencies) - true - false 0x22100000 false - - $(ProfileDir)..\..\bin11\lib true true $(IntDir)$(TargetName).lib true + Windows - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\msg_export___Win32_Debug/msg_export.tlb - - - Disabled - _DEBUG;WIN32;_WINDOWS;%(PreprocessorDefinitions);_CRT_SECURE_NO_DEPRECATE;UNICODE;_UNICODE + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - - true - Level4 - true - ProgramDatabase - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + Level3 + EditAndContinue + ..\..\include;%(AdditionalIncludeDirectories) EnableFastChecks + Use + Glob.h _DEBUG;%(PreprocessorDefinitions) - 0x0409 ..\..\include\msapi - /filealign:0x200 %(AdditionalOptions) - comctl32.lib;%(AdditionalDependencies) - true - false true 0x22100000 false - - - MachineX86 $(ProfileDir)..\..\bin11\lib $(IntDir)$(TargetName).lib + Windows + comctl32.lib;%(AdditionalDependencies) - - NDEBUG;%(PreprocessorDefinitions) - true - true - .\msg_export___Win32_Debug/msg_export.tlb - - - Disabled - _DEBUG;WIN64;_WINDOWS;%(PreprocessorDefinitions);_CRT_SECURE_NO_DEPRECATE;UNICODE;_UNICODE + WIN64;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) MultiThreadedDebugDLL - - - true - Level4 - true - ProgramDatabase - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + Level3 + ..\..\include;%(AdditionalIncludeDirectories) EnableFastChecks + Use + Glob.h _DEBUG;%(PreprocessorDefinitions) - 0x0409 ..\..\include\msapi - /filealign:0x200 %(AdditionalOptions) comctl32.lib;%(AdditionalDependencies) - true - false true 0x22100000 false - - $(ProfileDir)..\..\bin11\lib $(IntDir)$(TargetName).lib + Windows diff --git a/plugins/Msg_Export/msg_export_11.vcxproj.filters b/plugins/Msg_Export/msg_export_11.vcxproj.filters index ada2a79e40..a3c870b24f 100644 --- a/plugins/Msg_Export/msg_export_11.vcxproj.filters +++ b/plugins/Msg_Export/msg_export_11.vcxproj.filters @@ -43,21 +43,16 @@ Headers - - - - Resource Files - - - Resource Files - - - Resource Files - + + Headers + Resource Files + + Resource Files + \ No newline at end of file diff --git a/plugins/Msg_Export/res/Version.rc b/plugins/Msg_Export/res/Version.rc new file mode 100644 index 0000000000..5bfbab4754 --- /dev/null +++ b/plugins/Msg_Export/res/Version.rc @@ -0,0 +1,38 @@ +// Microsoft Visual C++ generated resource script. +// +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + +#include "afxres.h" +#include "..\src\version.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", __DESCRIPTION + VALUE "InternalName", __PLUGIN_NAME + VALUE "LegalCopyright", __COPYRIGHT + VALUE "OriginalFilename", __FILENAME + VALUE "ProductName", __PLUGIN_NAME + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/plugins/Msg_Export/res/resource.rc b/plugins/Msg_Export/res/resource.rc index 76839c4ff5..0c41cc0389 100755 --- a/plugins/Msg_Export/res/resource.rc +++ b/plugins/Msg_Export/res/resource.rc @@ -7,68 +7,10 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include -#include +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// Neutral (Default) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD) -LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT -#pragma code_page(1252) - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,0,3 - PRODUCTVERSION 3,1,0,3 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "Comments", "Message export plugin for Miranda NG (mod by ring0)" - VALUE "CompanyName", "Tip Top Tools" - VALUE "FileDescription", "Message export" - VALUE "FileVersion", "3, 1, 0, 3" - VALUE "InternalName", "Msg_export" - VALUE "LegalCopyright", "© 2002 Kennet Nielsen, mod by ring0" - VALUE "OriginalFilename", "Msg_Export" - VALUE "ProductName", "Message export (mod by ring0)" - VALUE "ProductVersion", "3, 1, 0, 3" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END - -#endif // Neutral (Default) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// Danish (Denmark) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DAN) -LANGUAGE LANG_DANISH, SUBLANG_DEFAULT -#pragma code_page(1252) - ///////////////////////////////////////////////////////////////////////////// // // String Table @@ -79,17 +21,6 @@ BEGIN ID_EDIT_COPY "Copies the selection and puts it on the Clipboard\nCopy" END -#endif // Danish (Denmark) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// German (Germany) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) -LANGUAGE LANG_GERMAN, SUBLANG_GERMAN -#pragma code_page(1252) - #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // @@ -98,13 +29,12 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN 1 TEXTINCLUDE BEGIN - "resource.h\0" + "..\\src\\resource.h\0" END 2 TEXTINCLUDE BEGIN - "#include \r\n" - "#include \0" + "#include \0" END 3 TEXTINCLUDE @@ -115,17 +45,6 @@ END #endif // APSTUDIO_INVOKED -#endif // German (Germany) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - ///////////////////////////////////////////////////////////////////////////// // // Dialog @@ -265,6 +184,8 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_EXPORT_MESSAGE ICON "export_m.ico" +IDI_TICK ICON "tick.ico" +IDI_NOTICK ICON "notick.ico" ///////////////////////////////////////////////////////////////////////////// // @@ -292,31 +213,6 @@ BEGIN END END -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (United Kingdom) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_TICK ICON "tick.ico" -IDI_NOTICK ICON "notick.ico" -#endif // English (United Kingdom) resources -///////////////////////////////////////////////////////////////////////////// - - - #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index 065a4b5f32..c2f05bf8b4 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -16,32 +16,7 @@ //along with this program; if not, write to the Free Software //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#include -#include - -#include -#include - -using namespace std; - - -#include "Utils.h" #include "Glob.h" -#include "FileViewer.h" - -#include "resource.h" - -#include -#include - -//#include - -#define szFileViewDB "FileV_" - -#define WM_RELOAD_FILE (WM_USER+10) - -using namespace std; static UINT UM_FIND_CMD = RegisterWindowMessage( FINDMSGSTRING ); diff --git a/plugins/Msg_Export/src/FileViewer.h b/plugins/Msg_Export/src/FileViewer.h index 6da79c9620..737674d61a 100755 --- a/plugins/Msg_Export/src/FileViewer.h +++ b/plugins/Msg_Export/src/FileViewer.h @@ -19,8 +19,6 @@ #ifndef MSG_EXP_FILE_VIEWER #define MSG_EXP_FILE_VIEWER -#include - void Initilize(); void Uninitilize(); diff --git a/plugins/Msg_Export/src/Glob.h b/plugins/Msg_Export/src/Glob.h index 2fba4e868d..6825f827f7 100755 --- a/plugins/Msg_Export/src/Glob.h +++ b/plugins/Msg_Export/src/Glob.h @@ -19,10 +19,37 @@ #ifndef MSG_EXP_GLOB_H #define MSG_EXP_GLOB_H +#define _CRT_SECURE_NO_WARNINGS + #include +#include +using namespace std; +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "utils.h" +#include "options.h" +#include "FileViewer.h" +#include "resource.h" +#include "version.h" #define MODULE "Msg_Export" #define MSG_BOX_TITEL TranslateT("Miranda NG (Message Export Plugin)") +#define MS_SHOW_EXPORT_HISTORY "History/ShowExportHistory" +#define szFileViewDB "FileV_" +#define WM_RELOAD_FILE (WM_USER+10) extern HINSTANCE hInstance; diff --git a/plugins/Msg_Export/src/Version.h b/plugins/Msg_Export/src/Version.h new file mode 100644 index 0000000000..5d52a0e747 --- /dev/null +++ b/plugins/Msg_Export/src/Version.h @@ -0,0 +1,14 @@ +#define __MAJOR_VERSION 3 +#define __MINOR_VERSION 1 +#define __RELEASE_NUM 0 +#define __BUILD_NUM 3 + +#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM + +#define __PLUGIN_NAME "Message export" +#define __FILENAME "Msg_Export.dll" +#define __DESCRIPTION "Exports every message, URL or File you receive to a text file." +#define __AUTHOR "Kennet Nielsen, mod by ring0" +#define __AUTHOREMAIL "Kennet_N@ofir.dk" +#define __AUTHORWEB "http://miranda-ng.org/" +#define __COPYRIGHT "© 2002 Kennet Nielsen, © 2012-2013 Miranda NG Team" diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp index 15b43dab30..48aa0b9afe 100755 --- a/plugins/Msg_Export/src/main.cpp +++ b/plugins/Msg_Export/src/main.cpp @@ -16,21 +16,8 @@ //along with this program; if not, write to the Free Software //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include -#include - -//#include "../Miranda-IM/resource.h" - -#include "utils.h" -#include "options.h" -#include "FileViewer.h" #include "Glob.h" -#include "resource.h" - - -#define MS_SHOW_EXPORT_HISTORY "History/ShowExportHistory" - HINSTANCE hInstance = NULL; int hLangpack = 0; @@ -53,16 +40,16 @@ HANDLE hInternalWindowList = NULL; PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), - "Message export (mod by ring0)", - PLUGIN_MAKE_VERSION(3,1,0,3), - "Exports every message, URL or File you receive to a text file.\r\n" - "Messages are exported to one file per user, users may be set to use the same file.", - "Kennet Nielsen, mod by ring0", - "Kennet_N@ofir.dk", - "© 2002 Kennet Nielsen", - "http://sourceforge.net/projects/msg-export/", + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, UNICODE_AWARE, - { 0x46102b07, 0xc215, 0x4162, { 0x9c, 0x83, 0xd3, 0x77, 0x88, 0x1d, 0xa7, 0xcc } } // {46102B07-C215-4162-9C83-D377881DA7CC} + // {46102B07-C215-4162-9C83-D377881DA7CC} + {0x46102b07, 0xc215, 0x4162, {0x9c, 0x83, 0xd3, 0x77, 0x88, 0x1d, 0xa7, 0xcc}} }; @@ -80,14 +67,14 @@ PLUGININFOEX pluginInfo = { // Developer : KN ///////////////////////////////////////////////////////////////////// -static INT_PTR ShowExportHistory(WPARAM wParam,LPARAM /*lParam*/) +static INT_PTR ShowExportHistory(WPARAM wParam, LPARAM /*lParam*/) { - if( bUseInternalViewer() ) + if (bUseInternalViewer()) { - bShowFileViewer( (HANDLE)wParam ); + bShowFileViewer((HANDLE)wParam); return 0; } - bOpenExternaly( (HANDLE)wParam ); + bOpenExternaly((HANDLE)wParam); return 0; } @@ -105,41 +92,41 @@ static INT_PTR ShowExportHistory(WPARAM wParam,LPARAM /*lParam*/) // Developer : KN ///////////////////////////////////////////////////////////////////// -int nSystemShutdown(WPARAM /*wparam*/,LPARAM /*lparam*/) +int nSystemShutdown(WPARAM /*wparam*/, LPARAM /*lparam*/) { - WindowList_Broadcast(hInternalWindowList,WM_CLOSE,0,0); + WindowList_Broadcast(hInternalWindowList, WM_CLOSE, 0, 0); - if( hEventOptionsInitialize ) + if (hEventOptionsInitialize) { UnhookEvent(hEventOptionsInitialize); hEventOptionsInitialize = 0; } - if( hDBEventAdded ) + if (hDBEventAdded) { UnhookEvent(hDBEventAdded); hDBEventAdded = 0; } - if( hDBContactDeleted ) + if (hDBContactDeleted) { UnhookEvent(hDBContactDeleted); hDBContactDeleted = 0; } - if( hServiceFunc ) + if (hServiceFunc) { - DestroyServiceFunction( hServiceFunc ); + DestroyServiceFunction(hServiceFunc); hServiceFunc = 0; } - if( hEventSystemInit ) + if (hEventSystemInit) { UnhookEvent(hEventSystemInit); hEventSystemInit = 0; } - if( hEventSystemShutdown ) + if (hEventSystemShutdown) { UnhookEvent(hEventSystemShutdown); // here we unhook the fun we are in, might not bee good hEventSystemShutdown = 0; @@ -161,7 +148,7 @@ int nSystemShutdown(WPARAM /*wparam*/,LPARAM /*lparam*/) // Developer : KN ///////////////////////////////////////////////////////////////////// -int MainInit(WPARAM /*wparam*/,LPARAM /*lparam*/) +int MainInit(WPARAM /*wparam*/, LPARAM /*lparam*/) { Initilize(); @@ -169,68 +156,38 @@ int MainInit(WPARAM /*wparam*/,LPARAM /*lparam*/) bReadMirandaDirAndPath(); UpdateFileToColWidth(); - hDBEventAdded = HookEvent( ME_DB_EVENT_ADDED , nExportEvent ); - if( !hDBEventAdded ) - MessageBox(NULL, _T("Failed to HookEvent ME_DB_EVENT_ADDED"), MSG_BOX_TITEL, MB_OK ); - - - hDBContactDeleted = HookEvent(ME_DB_CONTACT_DELETED , nContactDeleted ); - if( !hDBContactDeleted ) - MessageBox(NULL, _T("Failed to HookEvent ME_DB_CONTACT_DELETED"), MSG_BOX_TITEL, MB_OK ); - - - hEventOptionsInitialize = HookEvent(ME_OPT_INITIALISE, OptionsInitialize ); - if( !hEventOptionsInitialize ) - MessageBox(NULL, _T("Failed to HookEvent ME_OPT_INITIALISE"), MSG_BOX_TITEL, MB_OK ); + hDBEventAdded = HookEvent(ME_DB_EVENT_ADDED, nExportEvent); + if ( !hDBEventAdded) + MessageBox(NULL, TranslateT("Failed to HookEvent ME_DB_EVENT_ADDED"), MSG_BOX_TITEL, MB_OK); + hDBContactDeleted = HookEvent(ME_DB_CONTACT_DELETED, nContactDeleted); + if ( !hDBContactDeleted) + MessageBox(NULL, TranslateT("Failed to HookEvent ME_DB_CONTACT_DELETED"), MSG_BOX_TITEL, MB_OK); + hEventOptionsInitialize = HookEvent(ME_OPT_INITIALISE, OptionsInitialize); + if ( !hEventOptionsInitialize) + MessageBox(NULL, TranslateT("Failed to HookEvent ME_OPT_INITIALISE"), MSG_BOX_TITEL, MB_OK); - if( !bReplaceHistory ) + if ( !bReplaceHistory) { CLISTMENUITEM mi = { sizeof(mi) }; - mi.flags=0; - mi.pszContactOwner=NULL; //all contacts - mi.hIcon=LoadIcon(hInstance,MAKEINTRESOURCE(IDI_EXPORT_MESSAGE)); + mi.flags = 0; + mi.pszContactOwner = NULL; //all contacts + mi.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_EXPORT_MESSAGE)); mi.position = 1000090100; - mi.pszName=LPGEN("Open E&xported History"); - mi.pszService=MS_SHOW_EXPORT_HISTORY; - hOpenHistoryMenuItem = Menu_AddContactMenuItem(&mi); + mi.pszName = LPGEN("Open E&xported History"); + mi.pszService = MS_SHOW_EXPORT_HISTORY; + hOpenHistoryMenuItem = Menu_AddContactMenuItem(&mi); - if( !hOpenHistoryMenuItem ) - MessageBox(NULL, _T("Failed to add menu item Open Exported History\nCallService(MS_CLIST_ADDCONTACTMENUITEM,...)"), MSG_BOX_TITEL, MB_OK ); + if ( !hOpenHistoryMenuItem) + MessageBox(NULL, TranslateT("Failed to add menu item Open Exported History\nCallService(MS_CLIST_ADDCONTACTMENUITEM,...)"), MSG_BOX_TITEL, MB_OK); } + hEventSystemShutdown = HookEvent(ME_SYSTEM_SHUTDOWN, nSystemShutdown); + if ( !hEventSystemShutdown) + MessageBox(NULL, TranslateT("Failed to HookEvent ME_SYSTEM_SHUTDOWN"), MSG_BOX_TITEL, MB_OK); - hEventSystemShutdown = HookEvent( ME_SYSTEM_SHUTDOWN , nSystemShutdown ); - - if( !hEventSystemShutdown ) - MessageBox(NULL, _T("Failed to HookEvent ME_SYSTEM_SHUTDOWN"), MSG_BOX_TITEL, MB_OK ); - - -/* - _TCHAR szBuf[ 10000 ]; - for( int n = 0 ; n < 1000 ; n++ ) - { - for( int y = 0 ; y < n ; y++ ) - { - szBuf[ y ] = '0' + y%10;//((n + y) % 8 ) ? ('0' + ((n + y) % 10)) : ' ' ; - } - szBuf[ y ] = 0; - - HANDLE hFile = CreateFile( "C:\\test.txt" , GENERIC_WRITE , FILE_SHARE_READ , 0 ,OPEN_ALWAYS , FILE_ATTRIBUTE_NORMAL , NULL ); - SetFilePointer( hFile , 0 , 0 , FILE_END ); - - bWriteNewLine( hFile , 10 ); - bWriteNewLine( hFile , 0 ); - bWriteNewLine( hFile , 120 ); - - DWORD dwBytesWritten; - WriteFile( hFile , "\r\n\r\n" , 4 , &dwBytesWritten , NULL ); - - CloseHandle( hFile ); - //}*/ - return 0; } @@ -251,18 +208,13 @@ int MainInit(WPARAM /*wparam*/,LPARAM /*lparam*/) // Developer : KN ///////////////////////////////////////////////////////////////////// -BOOL WINAPI DllMain(HINSTANCE hinst,DWORD /*fdwReason*/,LPVOID /*lpvReserved*/) +BOOL WINAPI DllMain(HINSTANCE hinst, DWORD /*fdwReason*/, LPVOID /*lpvReserved*/) { - hInstance=hinst; + hInstance = hinst; return 1; } -#ifdef __cplusplus -extern "C" { -#endif - - ///////////////////////////////////////////////////////////////////// // Member Function : MirandaPluginInfo // Type : Global @@ -276,17 +228,11 @@ extern "C" { // Developer : KN ///////////////////////////////////////////////////////////////////// -__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD /*mirandaVersion*/) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { return &pluginInfo; } -static const MUUID interfaces[] = { MIID_HISTORYEXPORT, MIID_LAST}; -extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void) -{ - return interfaces; -} - ///////////////////////////////////////////////////////////////////// // Member Function : Load // Type : Global @@ -300,72 +246,59 @@ extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void) // Developer : KN ///////////////////////////////////////////////////////////////////// -int __declspec(dllexport)Load() +extern "C" __declspec(dllexport) int Load() { mir_getLP(&pluginInfo); - hEventSystemInit = HookEvent(ME_SYSTEM_MODULESLOADED,MainInit); + hEventSystemInit = HookEvent(ME_SYSTEM_MODULESLOADED, MainInit); - if( !hEventSystemInit ) + if ( !hEventSystemInit) { - MessageBox(NULL, _T("Failed to HookEvent ME_SYSTEM_MODULESLOADED"), MSG_BOX_TITEL, MB_OK); + MessageBox(NULL, TranslateT("Failed to HookEvent ME_SYSTEM_MODULESLOADED"), MSG_BOX_TITEL, MB_OK); return 0; } - nMaxLineWidth = db_get_w( NULL , MODULE , "MaxLineWidth" , nMaxLineWidth ); - if( nMaxLineWidth < 5 ) + nMaxLineWidth = db_get_w(NULL, MODULE, "MaxLineWidth", nMaxLineWidth); + if(nMaxLineWidth < 5) nMaxLineWidth = 5; - sExportDir = _DBGetString( NULL , MODULE , "ExportDir" , _T("%dbpath%\\MsgExport\\") ); - sDefaultFile = _DBGetString( NULL , MODULE , "DefaultFile" , _T("%nick%.txt") ); + sExportDir = _DBGetString(NULL, MODULE, "ExportDir", _T("%dbpath%\\MsgExport\\")); + sDefaultFile = _DBGetString(NULL, MODULE, "DefaultFile", _T("%nick%.txt")); - sTimeFormat = _DBGetString( NULL , MODULE , "TimeFormat" , _T("d s") ); + sTimeFormat = _DBGetString(NULL, MODULE, "TimeFormat", _T("d s")); - sFileViewerPrg = _DBGetString( NULL , MODULE , "FileViewerPrg" , _T("") ); - bUseInternalViewer( db_get_b( NULL , MODULE , "UseInternalViewer" , bUseInternalViewer() ) != 0 ); + sFileViewerPrg = _DBGetString(NULL, MODULE, "FileViewerPrg", _T("")); + bUseInternalViewer(db_get_b(NULL, MODULE, "UseInternalViewer", bUseInternalViewer()) != 0); - bReplaceHistory = db_get_b( NULL , MODULE , "ReplaceHistory" , bReplaceHistory ) != 0; - bAppendNewLine = db_get_b( NULL , MODULE , "AppendNewLine" , bAppendNewLine ) != 0; - bUseUtf8InNewFiles = db_get_b( NULL , MODULE , "UseUtf8InNewFiles" , bUseUtf8InNewFiles ) != 0; - bUseLessAndGreaterInExport = db_get_b( NULL , MODULE , "UseLessAndGreaterInExport" , bUseLessAndGreaterInExport ) != 0; + bReplaceHistory = db_get_b(NULL, MODULE, "ReplaceHistory", bReplaceHistory) != 0; + bAppendNewLine = db_get_b(NULL, MODULE, "AppendNewLine", bAppendNewLine) != 0; + bUseUtf8InNewFiles = db_get_b(NULL, MODULE, "UseUtf8InNewFiles", bUseUtf8InNewFiles) != 0; + bUseLessAndGreaterInExport = db_get_b(NULL, MODULE, "UseLessAndGreaterInExport", bUseLessAndGreaterInExport) != 0; - enRenameAction = (ENDialogAction)db_get_b( NULL , MODULE , "RenameAction" , enRenameAction ); - enDeleteAction = (ENDialogAction)db_get_b( NULL , MODULE , "DeleteAction" , enDeleteAction );; + enRenameAction = (ENDialogAction)db_get_b(NULL, MODULE, "RenameAction", enRenameAction); + enDeleteAction = (ENDialogAction)db_get_b(NULL, MODULE, "DeleteAction", enDeleteAction); // Plugin sweeper support db_set_ts(NULL, "Uninstall", "Message Export", _T(MODULE)); - if( bReplaceHistory ) + if (bReplaceHistory) { - hServiceFunc = CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY,ShowExportHistory); //this need new code -/* if( hServiceFunc ) - { - int *disableDefaultModule=(int*)CallService(MS_PLUGINS_GETDISABLEDEFAULTARRAY,0,0); - if( disableDefaultModule ) - { - disableDefaultModule[DEFMOD_UIHISTORY] = TRUE; - } - else - { - DestroyServiceFunction( hServiceFunc ); - hServiceFunc = 0; - } - }*/ - - if( !hServiceFunc ) + hServiceFunc = CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY, ShowExportHistory); //this need new code + + if ( !hServiceFunc) MessageBox(NULL, TranslateT("Failed to replace Miranda History.\r\nThis is most likely due to changes in Miranda."), MSG_BOX_TITEL, MB_OK); } - if( !hServiceFunc ) + if ( !hServiceFunc) { hServiceFunc = CreateServiceFunction(MS_SHOW_EXPORT_HISTORY, ShowExportHistory); } - if( !hServiceFunc ) + if ( !hServiceFunc) { - MessageBox(NULL, _T("Failed to CreateServiceFunction MS_SHOW_EXPORT_HISTORY"), MSG_BOX_TITEL, MB_OK); + MessageBox(NULL, TranslateT("Failed to CreateServiceFunction MS_SHOW_EXPORT_HISTORY"), MSG_BOX_TITEL, MB_OK); } - hInternalWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST,0,0); + hInternalWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); return 0; } @@ -383,13 +316,9 @@ int __declspec(dllexport)Load() // Developer : KN ///////////////////////////////////////////////////////////////////// -__declspec(dllexport)int Unload(void) +extern "C" __declspec(dllexport) int Unload(void) { Uninitilize(); - bUseInternalViewer( false ); + bUseInternalViewer(false); return 0; -} - -#ifdef __cplusplus -} -#endif +} \ No newline at end of file diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 0e015acaab..be86c3c82e 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -16,21 +16,7 @@ //along with this program; if not, write to the Free Software //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#include -#include -#include "Shlobj.h" - - -#include "Utils.h" #include "Glob.h" -#include "FileViewer.h" - -#include "resource.h" - -#include -#include -//#include #define STRINGIZE(x) #x #define EVAL_STRINGIZE(x) STRINGIZE(x) @@ -56,8 +42,6 @@ You need to change this in the file function sort() and sort(_Pr3 _Pr) */ -using namespace std; - // width in pixels of the UIN column in the List Ctrl const int nUINColWitdh = 80; @@ -565,7 +549,7 @@ void AutoFindeFileNames(HWND hwndDlg) size_t nLen = _tcslen( szSubCur ); if( _tcsncicmp( szSubCur , szSearch , nLen ) == 0 ) { - if( nLen < nShortestMatch ) + if( nLen < (size_t)nShortestMatch ) { nShortestMatch = nLen; nStortestIndex = nSubCur; @@ -703,17 +687,17 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar LVCOLUMN cCol = { 0 }; cCol.mask = LVCF_TEXT | LVCF_WIDTH; cCol.cx = nColumnWidth; - cCol.pszText = LPGENT("File"); + cCol.pszText = TranslateT("File"); ListView_InsertColumn( hMapUser , 0 , &cCol ); - cCol.pszText = LPGENT("Nick"); + cCol.pszText = TranslateT("Nick"); ListView_InsertColumn( hMapUser , 1 , &cCol ); cCol.cx = nProtoColWitdh; - cCol.pszText = LPGENT("Proto"); + cCol.pszText = TranslateT("Proto"); ListView_InsertColumn( hMapUser , 2 , &cCol ); cCol.cx = nUINColWitdh; cCol.mask |= LVCF_FMT; cCol.fmt = LVCFMT_RIGHT; - cCol.pszText = LPGENT("UIN"); + cCol.pszText = TranslateT("UIN"); ListView_InsertColumn( hMapUser , 3 , &cCol ); diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index cad4fd01a5..265682ee8d 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -16,16 +16,7 @@ //along with this program; if not, write to the Free Software //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - -#include - #include "Glob.h" -#include "Utils.h" -#include "FileViewer.h" - -#include -#include // Default error string used upon errors const _TCHAR *pszNickError = LPGENT("No_Nick"); diff --git a/plugins/Msg_Export/src/utils.h b/plugins/Msg_Export/src/utils.h index 1e254c7843..37b16b23e5 100755 --- a/plugins/Msg_Export/src/utils.h +++ b/plugins/Msg_Export/src/utils.h @@ -20,41 +20,8 @@ #ifndef MSG_EXP_UTILS_H #define MSG_EXP_UTILS_H -#include - -#if defined ( _MSC_VER ) // A Microsoft C Compiler - #ifdef _DEBUG // The _ASSERT macro contains a constant expression - #pragma warning( disable : 4786 ) - #endif -#endif // defined ( _MSC_VER ) - -#pragma warning (push, 3 ) - -#include "stdio.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #define EVENTTYPE_STATUSCHANGE 25368 -#include -#include -#include - -#pragma warning (pop) - -using namespace std; - - #define tstring wstring #define _DBGetString _DBGetStringW -- cgit v1.2.3