From 615f5963a421bb4d4bfcb94ed2c39623e54bf328 Mon Sep 17 00:00:00 2001 From: "jokusoftware@gmail.com" Date: Wed, 23 Nov 2011 19:43:59 +0000 Subject: updated Contacts+ plug-in: - applied x64 compatibility patch from FREAK_THEMIGHTY git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@203 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- ContactsPlus/SendContacts.ico | Bin 2606 -> 0 bytes ContactsPlus/contacts.dsp | 9 +- ContactsPlus/contacts.rc | 2 +- ContactsPlus/contacts.sln | 20 ++- ContactsPlus/contacts.vcxproj | 268 ++++++++++++++++++++++++++------------ ContactsPlus/main.cpp | 14 +- ContactsPlus/receive.cpp | 6 +- ContactsPlus/receive.h | 2 +- ContactsPlus/res/SendContacts.ico | Bin 0 -> 2606 bytes ContactsPlus/send.cpp | 8 +- ContactsPlus/send.h | 4 +- ContactsPlus/utils.cpp | 2 +- 12 files changed, 228 insertions(+), 107 deletions(-) delete mode 100644 ContactsPlus/SendContacts.ico create mode 100644 ContactsPlus/res/SendContacts.ico (limited to 'ContactsPlus') diff --git a/ContactsPlus/SendContacts.ico b/ContactsPlus/SendContacts.ico deleted file mode 100644 index 6c118a1..0000000 Binary files a/ContactsPlus/SendContacts.ico and /dev/null differ diff --git a/ContactsPlus/contacts.dsp b/ContactsPlus/contacts.dsp index 3f2e5d2..29adec3 100644 --- a/ContactsPlus/contacts.dsp +++ b/ContactsPlus/contacts.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CONTACTS_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "E:\!Miranda\miranda\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CONTACTS_EXPORTS" /Yu"contacts.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\include" /I "..\ExternalAPI" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CONTACTS_EXPORTS" /Yu"contacts.h" /FD /c # SUBTRACT CPP /Fr # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 @@ -68,9 +68,10 @@ LINK32=link.exe # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CONTACTS_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CONTACTS_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\ExternalAPI" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CONTACTS_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x405 /d "_DEBUG" @@ -80,7 +81,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept !ENDIF @@ -163,7 +164,7 @@ SOURCE=.\contacts.rc # End Source File # Begin Source File -SOURCE=.\SendContacts.ico +SOURCE=.\res\SendContacts.ico # End Source File # End Group # End Target diff --git a/ContactsPlus/contacts.rc b/ContactsPlus/contacts.rc index b5b8d74..3edfca4 100644 --- a/ContactsPlus/contacts.rc +++ b/ContactsPlus/contacts.rc @@ -186,6 +186,6 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_CONTACTS ICON DISCARDABLE "SendContacts.ico" +IDI_CONTACTS ICON DISCARDABLE "res\\SendContacts.ico" #endif // Neutral resources ///////////////////////////////////////////////////////////////////////////// diff --git a/ContactsPlus/contacts.sln b/ContactsPlus/contacts.sln index b2c8cfc..cc02a85 100644 --- a/ContactsPlus/contacts.sln +++ b/ContactsPlus/contacts.sln @@ -1,18 +1,24 @@ - + Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "contacts", "contacts.vcxproj", "{546604FA-B25F-4D58-B05D-0F9018B54664}" +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "contacts", "contacts.vcxproj", "{6313461F-4A15-F5D1-DFA5-5BFEC3A6D97E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {546604FA-B25F-4D58-B05D-0F9018B54664}.Debug|Win32.ActiveCfg = Debug|Win32 - {546604FA-B25F-4D58-B05D-0F9018B54664}.Debug|Win32.Build.0 = Debug|Win32 - {546604FA-B25F-4D58-B05D-0F9018B54664}.Release|Win32.ActiveCfg = Release|Win32 - {546604FA-B25F-4D58-B05D-0F9018B54664}.Release|Win32.Build.0 = Release|Win32 + {6313461F-4A15-F5D1-DFA5-5BFEC3A6D97E}.Debug|Win32.ActiveCfg = Debug|Win32 + {6313461F-4A15-F5D1-DFA5-5BFEC3A6D97E}.Debug|Win32.Build.0 = Debug|Win32 + {6313461F-4A15-F5D1-DFA5-5BFEC3A6D97E}.Debug|x64.ActiveCfg = Debug|x64 + {6313461F-4A15-F5D1-DFA5-5BFEC3A6D97E}.Debug|x64.Build.0 = Debug|x64 + {6313461F-4A15-F5D1-DFA5-5BFEC3A6D97E}.Release|Win32.ActiveCfg = Release|Win32 + {6313461F-4A15-F5D1-DFA5-5BFEC3A6D97E}.Release|Win32.Build.0 = Release|Win32 + {6313461F-4A15-F5D1-DFA5-5BFEC3A6D97E}.Release|x64.ActiveCfg = Release|x64 + {6313461F-4A15-F5D1-DFA5-5BFEC3A6D97E}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ContactsPlus/contacts.vcxproj b/ContactsPlus/contacts.vcxproj index cf5fdcd..2eea585 100644 --- a/ContactsPlus/contacts.vcxproj +++ b/ContactsPlus/contacts.vcxproj @@ -1,17 +1,26 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + - {546604FA-B25F-4D58-B05D-0F9018B54664} + + @@ -19,139 +28,241 @@ false MultiByte + + DynamicLibrary + false + MultiByte + DynamicLibrary false MultiByte + + DynamicLibrary + false + MultiByte + - + + + + + - + + + + + - - <_ProjectFileVersion>10.0.40219.1 - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - false - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - true + + false + + + false + + + .\Debug\ + .\Debug\ + true + + + .\Debug\ + .\Debug\ + true + + MultiThreadedDLL + OnlyExplicitInline + true + true + MaxSpeed + true + Level3 + E:\!Miranda\miranda\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CONTACTS_EXPORTS;%(PreprocessorDefinitions) + .\Release\ + .\Release\contacts.pch + Use + contacts.h + .\Release\ + .\Release\ + + true NDEBUG;%(PreprocessorDefinitions) + .\Release\contacts.tlb true - true Win32 - .\Release/contacts.tlb - - + + 0x0405 + NDEBUG;%(PreprocessorDefinitions) + + + true + .\Release\contacts.bsc + + + true + true + false + Console + .\Release\contacts.dll + .\Release\contacts.lib + /ALIGN:4096 /ignore:4108 + comctl32.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + - MaxSpeed + MultiThreadedDLL OnlyExplicitInline - ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;CONTACTS_EXPORTS;_CRT_SECURE_NO_WARNINGS; _CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) true - MultiThreaded true + MaxSpeed + true + Level3 + E:\!Miranda\miranda\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CONTACTS_EXPORTS;%(PreprocessorDefinitions) + .\Release\ + .\Release\contacts.pch Use contacts.h - Level3 - true - Size + .\Release\ + .\Release\ - + + true NDEBUG;%(PreprocessorDefinitions) + .\Release\contacts.tlb + true + + 0x0405 + NDEBUG;%(PreprocessorDefinitions) - - /ALIGN:4096 /ignore:4108 %(AdditionalOptions) - comctl32.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - true - true - false - - - MachineX86 - true + .\Release\contacts.bsc + + true + true + false + Console + .\Release\contacts.lib + /ALIGN:4096 /ignore:4108 + comctl32.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + MultiThreadedDebug + Default + false + Disabled + true + Level3 + true + EditAndContinue + E:\!Miranda\miranda\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CONTACTS_EXPORTS;%(PreprocessorDefinitions) + .\Debug\ + .\Debug\contacts.pch + .\Debug\ + .\Debug\ + EnableFastChecks + + true _DEBUG;%(PreprocessorDefinitions) + .\Debug\contacts.tlb true - true Win32 - .\Debug/contacts.tlb - - + + 0x0405 + _DEBUG;%(PreprocessorDefinitions) + + + true + .\Debug\contacts.bsc + + + true + true + true + Console + .\Debug\contacts.dll + .\Debug\contacts.lib + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + MultiThreadedDebug + Default + false Disabled + true + Level3 + ProgramDatabase + E:\!Miranda\miranda\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;CONTACTS_EXPORTS;%(PreprocessorDefinitions) - true + .\Debug\ + .\Debug\contacts.pch + .\Debug\ + .\Debug\ EnableFastChecks - MultiThreadedDebug - Level3 - true - EditAndContinue - ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) - Size - + + true _DEBUG;%(PreprocessorDefinitions) + .\Debug\contacts.tlb + true + + 0x0405 + _DEBUG;%(PreprocessorDefinitions) + + true + .\Debug\contacts.bsc + true + true true - false - - - MachineX86 + Console + .\Debug\contacts.dll + .\Debug\contacts.lib + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - true - - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) Create + Create + contacts.h + contacts.h - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) + Use + Use + + + @@ -161,15 +272,12 @@ - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - + - + - \ No newline at end of file + diff --git a/ContactsPlus/main.cpp b/ContactsPlus/main.cpp index 3ea902b..7f167c8 100644 --- a/ContactsPlus/main.cpp +++ b/ContactsPlus/main.cpp @@ -52,7 +52,11 @@ int g_UnicodeCore; PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), +#ifdef WIN64 + "Send/Receive Contacts+ (x64)", +#else "Send/Receive Contacts+", +#endif PLUGIN_MAKE_VERSION(1,5,2,0), "Allows you to send and receive contacts", "Joe Kucera, Todor Totev", @@ -206,8 +210,10 @@ static int HookModulesLoaded(WPARAM wParam, LPARAM lParam) ghSendWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); // no need to destroy this ghRecvWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0); // no need to destroy this +#ifndef WIN64 //register for Update (the FL name is different...) CallService(MS_UPDATE_REGISTERFL, 1253, (WPARAM)&pluginInfo); +#endif ProcessUnreadEvents(); return 0; @@ -245,7 +251,7 @@ static int HookContactDeleted(WPARAM wParam, LPARAM lParam) } -static int ServiceSendCommand(WPARAM wParam, LPARAM lParam) +static INT_PTR ServiceSendCommand(WPARAM wParam, LPARAM lParam) { HWND hWnd; //find window for hContact @@ -261,7 +267,7 @@ static int ServiceSendCommand(WPARAM wParam, LPARAM lParam) return 0; } -static int ServiceReceiveCommand(WPARAM wParam, LPARAM lParam) +static INT_PTR ServiceReceiveCommand(WPARAM wParam, LPARAM lParam) { CLISTEVENT* pcle = (CLISTEVENT*)lParam; @@ -336,8 +342,8 @@ extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) hServiceSend = CreateServiceFunction(MS_CONTACTS_SEND, ServiceSendCommand); hServiceReceive = CreateServiceFunction(MS_CONTACTS_RECEIVE, ServiceReceiveCommand); //define event sounds - SkinAddNewSound("RecvContacts", Translate("Incoming Contacts"), "contacts.wav"); - SkinAddNewSound("SentContacts", Translate("Outgoing Contacts"), "ocontacts.wav"); + SkinAddNewSound("RecvContacts", LPGEN("Incoming Contacts"), "contacts.wav"); + SkinAddNewSound("SentContacts", LPGEN("Outgoing Contacts"), "ocontacts.wav"); return 0; } diff --git a/ContactsPlus/receive.cpp b/ContactsPlus/receive.cpp index d639f04..16c63e6 100644 --- a/ContactsPlus/receive.cpp +++ b/ContactsPlus/receive.cpp @@ -170,9 +170,9 @@ void RecvListView_AddColumn(HWND hList, int nWidth, const char* szTitle, int nTr } -int CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - TRecvContactsData* wndData = (TRecvContactsData*)GetWindowLong(hwndDlg, DWL_USER); + TRecvContactsData* wndData = (TRecvContactsData*)GetWindowLong(hwndDlg, DWLP_USER); switch (msg) { @@ -186,7 +186,7 @@ int CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) EnableDlgItem(hwndDlg, IDOK, FALSE); EnableDlgItem(hwndDlg, IDDETAILS, FALSE); wndData = new TRecvContactsData(pcle->hContact); - SetWindowLong(hwndDlg, DWL_USER, (LONG)wndData); + SetWindowLong(hwndDlg, DWLP_USER, (LONG)wndData); wndData->mhDbEvent = pcle->hDbEvent; /// initialized, pcle not needed anymore wndData->mhListIcon = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLORDDB|ILC_MASK, 0, 1); wndData->mhPopup = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTACTMENU)); diff --git a/ContactsPlus/receive.h b/ContactsPlus/receive.h index 3580033..fe35d94 100644 --- a/ContactsPlus/receive.h +++ b/ContactsPlus/receive.h @@ -60,6 +60,6 @@ struct TRecvContactsData { extern HANDLE ghRecvWindowList; -int CALLBACK RecvDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK RecvDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); #endif /* __RECEIVE_H */ \ No newline at end of file diff --git a/ContactsPlus/res/SendContacts.ico b/ContactsPlus/res/SendContacts.ico new file mode 100644 index 0000000..6c118a1 Binary files /dev/null and b/ContactsPlus/res/SendContacts.ico differ diff --git a/ContactsPlus/send.cpp b/ContactsPlus/send.cpp index be0c510..58007cb 100644 --- a/ContactsPlus/send.cpp +++ b/ContactsPlus/send.cpp @@ -251,9 +251,9 @@ static void SetAllContactChecks(HWND hwndList, HANDLE hReceiver) // doubtful nam } -int CALLBACK SendDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK SendDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - TSendContactsData* wndData = (TSendContactsData*)GetWindowLong(hwndDlg, DWL_USER); + TSendContactsData* wndData = (TSendContactsData*)GetWindowLong(hwndDlg, DWLP_USER); switch (msg) { @@ -265,7 +265,7 @@ int CALLBACK SendDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) SetAllContactChecks(GetDlgItem(hwndDlg,IDC_LIST), (HANDLE)lParam); WindowList_Add(ghSendWindowList, hwndDlg, (HANDLE)lParam); wndData = new TSendContactsData((HANDLE)lParam); - SetWindowLong(hwndDlg, DWL_USER, (LONG)wndData); + SetWindowLong(hwndDlg, DWLP_USER, (LONG)wndData); // new dlg init wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, MAKEINTRESOURCEA(IDI_ADDCONTACT), "Add Contact Permanently to List"); wndData->hIcons[1] = InitMButton(hwndDlg, IDC_DETAILS, MAKEINTRESOURCEA(IDI_USERDETAILS), "View User's Details"); @@ -559,7 +559,7 @@ int CALLBACK SendDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) // Error Dialog -BOOL CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { diff --git a/ContactsPlus/send.h b/ContactsPlus/send.h index 90cdd5f..c8580a4 100644 --- a/ContactsPlus/send.h +++ b/ContactsPlus/send.h @@ -103,8 +103,8 @@ struct gAckList { extern HANDLE ghSendWindowList; extern gAckList gaAckData; -int CALLBACK SendDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK SendDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); #endif /* __SEND_H */ \ No newline at end of file diff --git a/ContactsPlus/utils.cpp b/ContactsPlus/utils.cpp index e9332d8..864e3bb 100644 --- a/ContactsPlus/utils.cpp +++ b/ContactsPlus/utils.cpp @@ -152,7 +152,7 @@ char *GetContactUID(HANDLE hContact, int bTchar) TCHAR* MirandaStatusToStringT(int mirandaStatus) { - return (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, mirandaStatus, g_UnicodeCore ? GCMDF_UNICODE : 0); + return (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, mirandaStatus, g_UnicodeCore ? GSMDF_UNICODE : 0); } HANDLE __fastcall SRCFindFirstContact() -- cgit v1.2.3