diff options
author | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2009-03-29 15:58:48 +0000 |
---|---|---|
committer | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2009-03-29 15:58:48 +0000 |
commit | d1ef727e95bac24bc97ebe5cb3c3f0ee42271f86 (patch) | |
tree | 712f6e5275e7fb54b1814c73c372fca660028632 | |
parent | ba2f55ddc45ea29cce65ad1bfcc178da9684141f (diff) |
x64 portability
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@439 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r-- | yapp/common.h | 2 | ||||
-rw-r--r-- | yapp/notify_imp.cpp | 26 | ||||
-rw-r--r-- | yapp/options.cpp | 4 | ||||
-rw-r--r-- | yapp/popup_history.h | 2 | ||||
-rw-r--r-- | yapp/popup_history_dlg.cpp | 14 | ||||
-rw-r--r-- | yapp/popups2.cpp | 1 | ||||
-rw-r--r-- | yapp/popups2.dsp | 4 | ||||
-rw-r--r-- | yapp/popups2_9.vcproj | 480 | ||||
-rw-r--r-- | yapp/popwin.cpp | 6 | ||||
-rw-r--r-- | yapp/services.cpp | 944 | ||||
-rw-r--r-- | yapp/services.h | 40 |
11 files changed, 1004 insertions, 519 deletions
diff --git a/yapp/common.h b/yapp/common.h index c1c6cf6..7cfcd5f 100644 --- a/yapp/common.h +++ b/yapp/common.h @@ -54,7 +54,7 @@ #include <m_yapp.h>
-#include <m_updater.h>
+#include "m_updater.h"
#include <m_fontservice.h>
#include <m_avatars.h>
diff --git a/yapp/notify_imp.cpp b/yapp/notify_imp.cpp index 5b20a19..9dc0b2e 100644 --- a/yapp/notify_imp.cpp +++ b/yapp/notify_imp.cpp @@ -20,19 +20,31 @@ int Popup2Show(WPARAM wParam, LPARAM lParam) { return 0;
}
+INT_PTR svcPopup2Show(WPARAM wParam, LPARAM lParam) {
+ return Popup2Show(wParam, lParam);
+}
+
int Popup2Update(WPARAM wParam, LPARAM lParam) {
HANDLE hNotify = (HANDLE)lParam;
PostMPMessage(MUM_NMUPDATE, (WPARAM)hNotify, (LPARAM)0);
return 0;
}
+INT_PTR svcPopup2Update(WPARAM wParam, LPARAM lParam) {
+ return Popup2Update(wParam, lParam);
+}
+
int Popup2Remove(WPARAM wParam, LPARAM lParam) {
HANDLE hNotify = (HANDLE)lParam;
PostMPMessage(MUM_NMREMOVE, (WPARAM)hNotify, (LPARAM)0);
return 0;
}
-int svcPopup2DefaultActions(WPARAM wParam, LPARAM lParam)
+INT_PTR svcPopup2Remove(WPARAM wParam, LPARAM lParam) {
+ return Popup2Remove(wParam, lParam);
+}
+
+INT_PTR svcPopup2DefaultActions(WPARAM wParam, LPARAM lParam)
{
//PopupWindow *wnd = (PopupWindow *)MNotifyGetDWord((HANDLE)lParam, "Popup2/data", (DWORD)NULL);
//if (!wnd) return 0;
@@ -53,10 +65,10 @@ int svcPopup2DefaultActions(WPARAM wParam, LPARAM lParam) return 0;
}
-BOOL CALLBACK DlgProcPopUps(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcPopUps(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
/* To change options use MNotifySet*(hNotify, ....) Apply/Cancel is implemented in notify.dll */
- HANDLE hNotify = (HANDLE)GetWindowLong(hwnd, GWL_USERDATA);
+ HANDLE hNotify = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
switch (msg)
{
case WM_USER+100:
@@ -64,7 +76,7 @@ BOOL CALLBACK DlgProcPopUps(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) // This will be extendet to handle array of handles for multiselect lParam
// will be HANDLE * and wParam wil; store amount of handles passed
hNotify = (HANDLE)lParam;
- SetWindowLong(hwnd, GWL_USERDATA, lParam);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
return TRUE;
}
@@ -105,9 +117,9 @@ void InitNotify() { hServicesNotify[0] = CreateServiceFunction("Popup2/DefaultActions", svcPopup2DefaultActions);
- hServicesNotify[1] = CreateServiceFunction(MS_POPUP2_SHOW, Popup2Show);
- hServicesNotify[2] = CreateServiceFunction(MS_POPUP2_UPDATE, Popup2Update);
- hServicesNotify[3] = CreateServiceFunction(MS_POPUP2_REMOVE, Popup2Remove);
+ hServicesNotify[1] = CreateServiceFunction(MS_POPUP2_SHOW, svcPopup2Show);
+ hServicesNotify[2] = CreateServiceFunction(MS_POPUP2_UPDATE, svcPopup2Update);
+ hServicesNotify[3] = CreateServiceFunction(MS_POPUP2_REMOVE, svcPopup2Remove);
hEventNotifyModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, NotifyModulesLoaded);
}
diff --git a/yapp/options.cpp b/yapp/options.cpp index 94a12c4..d52aed2 100644 --- a/yapp/options.cpp +++ b/yapp/options.cpp @@ -116,7 +116,7 @@ void ShowExamplePopups() { }
}
-static BOOL CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
+static INT_PTR CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
switch ( msg ) {
case WM_INITDIALOG:
@@ -355,7 +355,7 @@ static BOOL CALLBACK DlgProcOpts1(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
PopupClass *newclasses = 0;
-static BOOL CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
+static INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
switch ( msg ) {
case WM_INITDIALOG:
TranslateDialogDefault( hwndDlg );
diff --git a/yapp/popup_history.h b/yapp/popup_history.h index cf8b6b3..db48a8c 100644 --- a/yapp/popup_history.h +++ b/yapp/popup_history.h @@ -92,6 +92,6 @@ extern HWND hHistoryWindow; //the history window extern HICON hiPopupHistory; void RefreshPopupHistory(HWND hWnd, int renderer); -BOOL CALLBACK DlgProcHistLst(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK DlgProcHistLst(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); #endif //__popup_history_h__ diff --git a/yapp/popup_history_dlg.cpp b/yapp/popup_history_dlg.cpp index 1373526..2ab979b 100644 --- a/yapp/popup_history_dlg.cpp +++ b/yapp/popup_history_dlg.cpp @@ -220,7 +220,7 @@ void MoveCustomControl(HWND hWnd, int renderer) case RENDER_HISTORYPP:
case RENDER_IEVIEW:
{
- PopupHistoryWindowData *data = (PopupHistoryWindowData *) GetWindowLong(hWnd, GWL_USERDATA);
+ PopupHistoryWindowData *data = (PopupHistoryWindowData *) GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (data)
{
IEVIEWWINDOW ieWnd = {0};
@@ -259,7 +259,7 @@ void LoadRenderer(HWND hWnd, int renderer) PopupHistoryWindowData *data = (PopupHistoryWindowData *) malloc(sizeof(PopupHistoryWindowData)); //create custom control data
data->hIEView = ieWnd.hwnd;
ShowWindow(data->hIEView, SW_SHOW);
- SetWindowLong(hWnd, GWL_USERDATA, (LONG) data); //set it as the window's user data
+ SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) data); //set it as the window's user data
ShowWindow(GetDlgItem(hWnd, IDC_LST_HISTORY), SW_HIDE);
//SetWindowPos(GetDlgItem(hWnd, IDC_LST_HISTORY), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
@@ -275,7 +275,7 @@ void UnloadRenderer(HWND hWnd, int renderer) case RENDER_HISTORYPP:
case RENDER_IEVIEW:
{
- PopupHistoryWindowData *data = (PopupHistoryWindowData *) GetWindowLong(hWnd, GWL_USERDATA);
+ PopupHistoryWindowData *data = (PopupHistoryWindowData *) GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (data)
{
@@ -301,7 +301,7 @@ void DeleteOldEvents(HWND hWnd, int renderer) case RENDER_HISTORYPP:
case RENDER_IEVIEW:
{
- PopupHistoryWindowData *data = (PopupHistoryWindowData *) GetWindowLong(hWnd, GWL_USERDATA);
+ PopupHistoryWindowData *data = (PopupHistoryWindowData *) GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (data)
{
IEVIEWEVENT ieEvent = {0};
@@ -352,7 +352,7 @@ IEVIEWEVENTDATA *CreateAndFillEventData(PopupHistoryData *popupItem) void AddEventsCustomControl(HWND hWnd, int renderer, TCHAR *filter, SIG_MATCHESFILTER MatchesFilter)
{
- PopupHistoryWindowData *pwData = (PopupHistoryWindowData *) GetWindowLong(hWnd, GWL_USERDATA);
+ PopupHistoryWindowData *pwData = (PopupHistoryWindowData *) GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (pwData)
{
IEVIEWEVENT ieEvent = {0};
@@ -600,7 +600,7 @@ void LoadHistoryColumns(HWND hHistoryList) }
//this is the history list window handler
-BOOL CALLBACK DlgProcHistLst(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgProcHistLst(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int bInitializing;
@@ -620,7 +620,7 @@ BOOL CALLBACK DlgProcHistLst(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) ListView_SetExtendedListViewStyleEx(hHistoryList, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
- oldPopupsListProc = (WNDPROC) SetWindowLong(hHistoryList, GWL_WNDPROC, (LONG) PopupsListSubclassProc);
+ oldPopupsListProc = (WNDPROC) SetWindowLongPtr(hHistoryList, GWLP_WNDPROC, (LONG_PTR) PopupsListSubclassProc);
LoadHistoryColumns(hHistoryList);
diff --git a/yapp/popups2.cpp b/yapp/popups2.cpp index d6d276d..8f12292 100644 --- a/yapp/popups2.cpp +++ b/yapp/popups2.cpp @@ -324,6 +324,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) { int PreShutdown(WPARAM wParam, LPARAM lParam) {
if(hAvChangeEvent) UnhookEvent(hAvChangeEvent);
DeinitMessagePump();
+ DeinitNotify();
return 0;
}
diff --git a/yapp/popups2.dsp b/yapp/popups2.dsp index f50027e..813b20d 100644 --- a/yapp/popups2.dsp +++ b/yapp/popups2.dsp @@ -101,7 +101,7 @@ LINK32=link.exe # PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /Zi /O1 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NO_GZIP" /D "PNG_NO_STDIO" /D "PNG_NO_CONSOLE_IO" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MD /W3 /GX /Zi /O1 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "UNICODE" /D "_USRDLL" /D "POPUPS2_EXPORTS" /Yu"common.h" /FD /c
+# ADD CPP /nologo /MD /W3 /GX /Zi /O1 /I "../../../include" /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "UNICODE" /D "_USRDLL" /D "POPUPS2_EXPORTS" /Yu"common.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x419 /d "NDEBUG"
@@ -130,7 +130,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NO_GZIP" /D "PNG_NO_STDIO" /D "PNG_NO_CONSOLE_IO" /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "UNICODE" /D "_USRDLL" /D "POPUPS2_EXPORTS" /FR /Yu"common.h" /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "UNICODE" /D "_USRDLL" /D "POPUPS2_EXPORTS" /FR /Yu"common.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x419 /d "_DEBUG"
diff --git a/yapp/popups2_9.vcproj b/yapp/popups2_9.vcproj index ec98797..e8ab620 100644 --- a/yapp/popups2_9.vcproj +++ b/yapp/popups2_9.vcproj @@ -1,15 +1,19 @@ <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="9,00"
+ Version="9.00"
Name="yapp"
ProjectGUID="{B6FC188B-8E54-4197-9444-8BADE9AA75E2}"
+ RootNamespace="yapp"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -117,13 +121,17 @@ Name="VCCLCompilerTool"
Optimization="3"
InlineFunctionExpansion="1"
- EnableIntrinsicFunctions="false"
+ EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="./docs;../../include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1"
StringPooling="true"
+ ExceptionHandling="0"
RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ FloatingPointModel="2"
+ RuntimeTypeInfo="false"
PrecompiledHeaderThrough="common.h"
WarningLevel="3"
DebugInformationFormat="3"
@@ -199,7 +207,7 @@ <Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="./docs;../../include"
+ AdditionalIncludeDirectories="./docs;../../../include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -283,8 +291,11 @@ AdditionalIncludeDirectories="./docs;../../include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1"
StringPooling="true"
+ ExceptionHandling="0"
RuntimeLibrary="2"
- BufferSecurityCheck="true"
+ BufferSecurityCheck="false"
+ FloatingPointModel="2"
+ RuntimeTypeInfo="false"
PrecompiledHeaderThrough="common.h"
WarningLevel="3"
DebugInformationFormat="3"
@@ -336,6 +347,339 @@ Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="./docs;../../include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ PrecompiledHeaderThrough="common.h"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="1"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="2"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="./docs;../../include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ FloatingPointModel="2"
+ RuntimeTypeInfo="false"
+ PrecompiledHeaderThrough="common.h"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="./docs;../../../include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="true"
+ PrecompiledHeaderThrough="common.h"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="1"
+ FavorSizeOrSpeed="2"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="./docs;../../include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE;MICROSOFT_LAYER_FOR_UNICODE=1"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ FloatingPointModel="2"
+ RuntimeTypeInfo="false"
+ PrecompiledHeaderThrough="common.h"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="true"
+ GenerateMapFile="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -380,6 +724,38 @@ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\notify_imp.cpp"
@@ -432,6 +808,38 @@ UsePrecompiledHeader="1"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\popwin.cpp"
@@ -536,6 +944,38 @@ Name="VCResourceCompilerTool"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\resource.rc"
@@ -576,6 +1016,38 @@ Name="VCResourceCompilerTool"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ </FileConfiguration>
</File>
</Filter>
<File
diff --git a/yapp/popwin.cpp b/yapp/popwin.cpp index 9d1ba45..1b0aa3e 100644 --- a/yapp/popwin.cpp +++ b/yapp/popwin.cpp @@ -153,7 +153,7 @@ struct PopupWindowData { };
LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
- PopupWindowData *pwd = (PopupWindowData *)GetWindowLong(hwnd, GWL_USERDATA);
+ PopupWindowData *pwd = (PopupWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
PopupData *pd = 0;
if(pwd) pd = pwd->pd;
@@ -200,7 +200,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa GetLocalTime(&st);
GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, 0, pwd->tbuff, 128);
- SetWindowLong(hwnd, GWL_USERDATA, (LONG)pwd);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pwd);
if(pd->timeout == -1 || (pd->timeout == 0 && options.default_timeout == -1)) {
// make a really long timeout - say 7 days? ;)
@@ -527,7 +527,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if(pd && pd->pwzText) free(pd->pwzText);
if(pd) free(pd);
free(pwd); pwd = 0; pd = 0;
- SetWindowLong(hwnd, GWL_USERDATA, 0);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
break;
case PUM_UPDATERGN:
diff --git a/yapp/services.cpp b/yapp/services.cpp index 86a753f..1864728 100644 --- a/yapp/services.cpp +++ b/yapp/services.cpp @@ -1,189 +1,189 @@ -#include "common.h" -#include "services.h" -#include "popwin.h" -#include "message_pump.h" -#include "resource.h" -#include "popup_history.h" -#include <time.h> -#include "str_utils.h" - -#define NUM_SERVICES 20 -HANDLE hService[NUM_SERVICES]; -HANDLE hMenuShowHistory, hMenuToggleOnOff; - -void StripBBCodesInPlace(wchar_t *text) { - if(text == 0 || DBGetContactSettingByte(0, MODULE, "StripBBCodes", 1) == 0) - return; - - int read = 0, write = 0; - int len = wcslen(text); - - while(read <= len) { // copy terminating null too - while(read <= len && text[read] != L'[') { - if(text[read] != text[write]) text[write] = text[read]; - read++; write++; - } - if(read > len) break; - - if(len - read >= 3 && (wcsnicmp(text + read, L"[b]", 3) == 0 || wcsnicmp(text + read, L"[i]", 3) == 0)) - read += 3; - else if(len - read >= 4 && (wcsnicmp(text + read, L"[/b]", 4) == 0 || wcsnicmp(text + read, L"[/i]", 4) == 0)) - read += 4; - else if(len - read >= 6 && (wcsnicmp(text + read, L"[color", 6) == 0)) { - while(read < len && text[read] != L']') read++; - read++;// skip the ']' - } else if(len - read >= 8 && (wcsnicmp(text + read, L"[/color]", 8) == 0)) - read += 8; - else if(len - read >= 5 && (wcsnicmp(text + read, L"[size", 5) == 0)) { - while(read < len && text[read] != L']') read++; - read++;// skip the ']' - } else if(len - read >= 7 && (wcsnicmp(text + read, L"[/size]", 7) == 0)) - read += 7; - else { - if(text[read] != text[write]) text[write] = text[read]; - read++; write++; - } - } -} - -int OldCreatePopupA(WPARAM wParam, LPARAM lParam) { - POPUPDATA *pd_in = (POPUPDATA *)wParam; - PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData)); - ZeroMemory(pd_out, sizeof(PopupData)); - - pd_out->cbSize = sizeof(PopupData); - pd_out->flags = PDF_UNICODE; - pd_out->pwzTitle = a2w(pd_in->lpzContactName); - pd_out->pwzText = a2w(pd_in->lpzText); - StripBBCodesInPlace(pd_out->pwzTitle); - StripBBCodesInPlace(pd_out->pwzText); - - pd_out->hContact = pd_in->lchContact; - pd_out->hIcon = pd_in->lchIcon; - if(pd_in->colorBack == 0xffffffff) // that's the old #define for 'skinned bg' - pd_out->colorBack = pd_out->colorText = 0; - else { - pd_out->colorBack = pd_in->colorBack & 0xFFFFFF; - pd_out->colorText = pd_in->colorText & 0xFFFFFF; - } - pd_out->windowProc = pd_in->PluginWindowProc; - pd_out->opaque = pd_in->PluginData; - pd_out->timeout = 0; - - lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0)); - - if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) { - free(pd_out->pwzTitle); - free(pd_out->pwzText); - free(pd_out); - return -1; - } - - //MessageBox(0, pd_out->lpwzContactName, _T("CreatePopupA"), MB_OK); - PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)pd_out); - return 0; -} - -int OldCreatePopupExA(WPARAM wParam, LPARAM lParam) { - - POPUPDATAEX *pd_in = (POPUPDATAEX *)wParam; - PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData)); - ZeroMemory(pd_out, sizeof(PopupData)); - pd_out->cbSize = sizeof(PopupData); - pd_out->flags = PDF_UNICODE; - pd_out->pwzTitle = a2w(pd_in->lpzContactName); - pd_out->pwzText = a2w(pd_in->lpzText); - StripBBCodesInPlace(pd_out->pwzTitle); - StripBBCodesInPlace(pd_out->pwzText); - - pd_out->hContact = pd_in->lchContact; - pd_out->hIcon = pd_in->lchIcon; - if(pd_in->colorBack == 0xffffffff) // that's the old #define for 'skinned bg' - pd_out->colorBack = pd_out->colorText = 0; - else { - pd_out->colorBack = pd_in->colorBack & 0xFFFFFF; - pd_out->colorText = pd_in->colorText & 0xFFFFFF; - } - pd_out->windowProc = pd_in->PluginWindowProc; - pd_out->opaque= pd_in->PluginData; - pd_out->timeout = pd_in->iSeconds; - - lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0)); - if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) { - free(pd_out->pwzTitle); - free(pd_out->pwzText); - free(pd_out); - return -1; - } - - //MessageBox(0, pd_out->lpwzContactName, _T("CreatePopupExA"), MB_OK); - PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)pd_out); - return 0; -} - -int OldCreatePopupW(WPARAM wParam, LPARAM lParam) { - - POPUPDATAW *pd_in = (POPUPDATAW *)wParam; - PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData)); - ZeroMemory(pd_out, sizeof(PopupData)); - pd_out->cbSize = sizeof(PopupData); - pd_out->flags = PDF_UNICODE; - pd_out->pwzTitle = wcsdup(pd_in->lpwzContactName); - pd_out->pwzText = wcsdup(pd_in->lpwzText); - StripBBCodesInPlace(pd_out->pwzTitle); - StripBBCodesInPlace(pd_out->pwzText); - - pd_out->hContact = pd_in->lchContact; - pd_out->hIcon = pd_in->lchIcon; - if(pd_in->colorBack == 0xffffffff) // that's the old #define for 'skinned bg' - pd_out->colorBack = pd_out->colorText = 0; - else { - pd_out->colorBack = pd_in->colorBack & 0xFFFFFF; - pd_out->colorText = pd_in->colorText & 0xFFFFFF; - } - pd_out->windowProc = pd_in->PluginWindowProc; - pd_out->opaque= pd_in->PluginData; - pd_out->timeout = pd_in->iSeconds; - - lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0)); - if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) { - free(pd_out->pwzTitle); - free(pd_out->pwzText); - free(pd_out); - return -1; - } - - //MessageBox(0, pd_out->lpwzContactName, _T("CreatePopupW"), MB_OK); - PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)pd_out); - return 0; -} - -int ChangeTextW(WPARAM wParam, LPARAM lParam) { - HWND hwndPop = (HWND)wParam; - wchar_t *newText = wcsdup((wchar_t *)lParam); - StripBBCodesInPlace(newText); - - if(IsWindow(hwndPop)) - PostMessage(hwndPop, PUM_SETTEXT, 0, (LPARAM)newText); - return 0; -} - -int ChangeTextA(WPARAM wParam, LPARAM lParam) { - HWND hwndPop = (HWND)wParam; - char *newText = (char *)lParam; - wchar_t buff[MAX_SECONDLINE]; - a2w(newText, buff, MAX_SECONDLINE); - StripBBCodesInPlace(buff); - - if(IsWindow(hwndPop)) - PostMessage(hwndPop, PUM_SETTEXT, 0, (LPARAM)wcsdup(buff)); - return 0; -} - -int ShowPopup(WPARAM wParam, LPARAM lParam) { - PopupData *pd_in = (PopupData *)wParam; - PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData)); - *pd_out = *pd_in; +#include "common.h"
+#include "services.h"
+#include "popwin.h"
+#include "message_pump.h"
+#include "resource.h"
+#include "popup_history.h"
+#include <time.h>
+#include "str_utils.h"
+
+#define NUM_SERVICES 20
+HANDLE hService[NUM_SERVICES];
+HANDLE hMenuShowHistory, hMenuToggleOnOff;
+
+void StripBBCodesInPlace(wchar_t *text) {
+ if(text == 0 || DBGetContactSettingByte(0, MODULE, "StripBBCodes", 1) == 0)
+ return;
+
+ int read = 0, write = 0;
+ int len = wcslen(text);
+
+ while(read <= len) { // copy terminating null too
+ while(read <= len && text[read] != L'[') {
+ if(text[read] != text[write]) text[write] = text[read];
+ read++; write++;
+ }
+ if(read > len) break;
+
+ if(len - read >= 3 && (wcsnicmp(text + read, L"[b]", 3) == 0 || wcsnicmp(text + read, L"[i]", 3) == 0))
+ read += 3;
+ else if(len - read >= 4 && (wcsnicmp(text + read, L"[/b]", 4) == 0 || wcsnicmp(text + read, L"[/i]", 4) == 0))
+ read += 4;
+ else if(len - read >= 6 && (wcsnicmp(text + read, L"[color", 6) == 0)) {
+ while(read < len && text[read] != L']') read++;
+ read++;// skip the ']'
+ } else if(len - read >= 8 && (wcsnicmp(text + read, L"[/color]", 8) == 0))
+ read += 8;
+ else if(len - read >= 5 && (wcsnicmp(text + read, L"[size", 5) == 0)) {
+ while(read < len && text[read] != L']') read++;
+ read++;// skip the ']'
+ } else if(len - read >= 7 && (wcsnicmp(text + read, L"[/size]", 7) == 0))
+ read += 7;
+ else {
+ if(text[read] != text[write]) text[write] = text[read];
+ read++; write++;
+ }
+ }
+}
+
+INT_PTR OldCreatePopupA(WPARAM wParam, LPARAM lParam) {
+ POPUPDATA *pd_in = (POPUPDATA *)wParam;
+ PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData));
+ ZeroMemory(pd_out, sizeof(PopupData));
+
+ pd_out->cbSize = sizeof(PopupData);
+ pd_out->flags = PDF_UNICODE;
+ pd_out->pwzTitle = a2w(pd_in->lpzContactName);
+ pd_out->pwzText = a2w(pd_in->lpzText);
+ StripBBCodesInPlace(pd_out->pwzTitle);
+ StripBBCodesInPlace(pd_out->pwzText);
+
+ pd_out->hContact = pd_in->lchContact;
+ pd_out->hIcon = pd_in->lchIcon;
+ if(pd_in->colorBack == 0xffffffff) // that's the old #define for 'skinned bg'
+ pd_out->colorBack = pd_out->colorText = 0;
+ else {
+ pd_out->colorBack = pd_in->colorBack & 0xFFFFFF;
+ pd_out->colorText = pd_in->colorText & 0xFFFFFF;
+ }
+ pd_out->windowProc = pd_in->PluginWindowProc;
+ pd_out->opaque = pd_in->PluginData;
+ pd_out->timeout = 0;
+
+ lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0));
+
+ if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) {
+ free(pd_out->pwzTitle);
+ free(pd_out->pwzText);
+ free(pd_out);
+ return -1;
+ }
+
+ //MessageBox(0, pd_out->lpwzContactName, _T("CreatePopupA"), MB_OK);
+ PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)pd_out);
+ return 0;
+}
+
+INT_PTR OldCreatePopupExA(WPARAM wParam, LPARAM lParam) {
+
+ POPUPDATAEX *pd_in = (POPUPDATAEX *)wParam;
+ PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData));
+ ZeroMemory(pd_out, sizeof(PopupData));
+ pd_out->cbSize = sizeof(PopupData);
+ pd_out->flags = PDF_UNICODE;
+ pd_out->pwzTitle = a2w(pd_in->lpzContactName);
+ pd_out->pwzText = a2w(pd_in->lpzText);
+ StripBBCodesInPlace(pd_out->pwzTitle);
+ StripBBCodesInPlace(pd_out->pwzText);
+
+ pd_out->hContact = pd_in->lchContact;
+ pd_out->hIcon = pd_in->lchIcon;
+ if(pd_in->colorBack == 0xffffffff) // that's the old #define for 'skinned bg'
+ pd_out->colorBack = pd_out->colorText = 0;
+ else {
+ pd_out->colorBack = pd_in->colorBack & 0xFFFFFF;
+ pd_out->colorText = pd_in->colorText & 0xFFFFFF;
+ }
+ pd_out->windowProc = pd_in->PluginWindowProc;
+ pd_out->opaque= pd_in->PluginData;
+ pd_out->timeout = pd_in->iSeconds;
+
+ lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0));
+ if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) {
+ free(pd_out->pwzTitle);
+ free(pd_out->pwzText);
+ free(pd_out);
+ return -1;
+ }
+
+ //MessageBox(0, pd_out->lpwzContactName, _T("CreatePopupExA"), MB_OK);
+ PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)pd_out);
+ return 0;
+}
+
+INT_PTR OldCreatePopupW(WPARAM wParam, LPARAM lParam) {
+
+ POPUPDATAW *pd_in = (POPUPDATAW *)wParam;
+ PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData));
+ ZeroMemory(pd_out, sizeof(PopupData));
+ pd_out->cbSize = sizeof(PopupData);
+ pd_out->flags = PDF_UNICODE;
+ pd_out->pwzTitle = wcsdup(pd_in->lpwzContactName);
+ pd_out->pwzText = wcsdup(pd_in->lpwzText);
+ StripBBCodesInPlace(pd_out->pwzTitle);
+ StripBBCodesInPlace(pd_out->pwzText);
+
+ pd_out->hContact = pd_in->lchContact;
+ pd_out->hIcon = pd_in->lchIcon;
+ if(pd_in->colorBack == 0xffffffff) // that's the old #define for 'skinned bg'
+ pd_out->colorBack = pd_out->colorText = 0;
+ else {
+ pd_out->colorBack = pd_in->colorBack & 0xFFFFFF;
+ pd_out->colorText = pd_in->colorText & 0xFFFFFF;
+ }
+ pd_out->windowProc = pd_in->PluginWindowProc;
+ pd_out->opaque= pd_in->PluginData;
+ pd_out->timeout = pd_in->iSeconds;
+
+ lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0));
+ if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) {
+ free(pd_out->pwzTitle);
+ free(pd_out->pwzText);
+ free(pd_out);
+ return -1;
+ }
+
+ //MessageBox(0, pd_out->lpwzContactName, _T("CreatePopupW"), MB_OK);
+ PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)pd_out);
+ return 0;
+}
+
+INT_PTR ChangeTextW(WPARAM wParam, LPARAM lParam) {
+ HWND hwndPop = (HWND)wParam;
+ wchar_t *newText = wcsdup((wchar_t *)lParam);
+ StripBBCodesInPlace(newText);
+
+ if(IsWindow(hwndPop))
+ PostMessage(hwndPop, PUM_SETTEXT, 0, (LPARAM)newText);
+ return 0;
+}
+
+INT_PTR ChangeTextA(WPARAM wParam, LPARAM lParam) {
+ HWND hwndPop = (HWND)wParam;
+ char *newText = (char *)lParam;
+ wchar_t buff[MAX_SECONDLINE];
+ a2w(newText, buff, MAX_SECONDLINE);
+ StripBBCodesInPlace(buff);
+
+ if(IsWindow(hwndPop))
+ PostMessage(hwndPop, PUM_SETTEXT, 0, (LPARAM)wcsdup(buff));
+ return 0;
+}
+
+INT_PTR ShowPopup(WPARAM wParam, LPARAM lParam) {
+ PopupData *pd_in = (PopupData *)wParam;
+ PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData));
+ *pd_out = *pd_in;
if(pd_in->flags & PDF_UNICODE) {
if(pd_in->pwzTitle) pd_out->pwzTitle = wcsdup(pd_in->pwzTitle);
if(pd_in->pwzText) pd_out->pwzText = wcsdup(pd_in->pwzText);
@@ -191,214 +191,214 @@ int ShowPopup(WPARAM wParam, LPARAM lParam) { pd_out->flags |= PDF_UNICODE;
if(pd_in->pszTitle) pd_out->pwzTitle = a2w(pd_in->pszTitle);
if(pd_in->pszText) pd_out->pwzText = a2w(pd_in->pszText);
- } - StripBBCodesInPlace(pd_out->pwzTitle); - StripBBCodesInPlace(pd_out->pwzText); - - lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0)); - if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) { - if(pd_out->pwzTitle) free(pd_out->pwzTitle); - if(pd_out->pwzText) free(pd_out->pwzText); - free(pd_out); - return -1; - } - - //MessageBox(0, pd_out->lpwzContactName, _T("CreatePopupW"), MB_OK); - PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)pd_out); - return 0; -} - -int GetContact(WPARAM wParam, LPARAM lParam) { - HWND hwndPop = (HWND)wParam; - HANDLE hContact; - if(GetCurrentThreadId() == message_pump_thread_id) { - SendMessage(hwndPop, PUM_GETCONTACT, (WPARAM)&hContact, 0); - } else { - HANDLE hEvent = CreateEvent(0, 0, 0, 0); - PostMessage(hwndPop, PUM_GETCONTACT, (WPARAM)&hContact, (LPARAM)hEvent); - MsgWaitForMultipleObjectsEx(1, &hEvent, INFINITE, 0, 0); - CloseHandle(hEvent); - } - - return (int)hContact; -} - -int GetOpaque(WPARAM wParam, LPARAM lParam) { - HWND hwndPop = (HWND)wParam; - void *data = 0; - if(GetCurrentThreadId() == message_pump_thread_id) { - SendMessage(hwndPop, PUM_GETOPAQUE, (WPARAM)&data, 0); - } else { - HANDLE hEvent = CreateEvent(0, 0, 0, 0); - PostMessage(hwndPop, PUM_GETOPAQUE, (WPARAM)&data, (LPARAM)hEvent); - MsgWaitForMultipleObjectsEx(1, &hEvent, INFINITE, 0, 0); - CloseHandle(hEvent); - } - - return (int)data; -} - -int IsSecondLineShown(WPARAM wParam, LPARAM lParam) { - return TRUE; -} - -void UpdateMenu() { - CLISTMENUITEM menu = {0}; - menu.cbSize = sizeof(CLISTMENUITEM); - menu.pszName = (DBGetContactSettingByte(0, MODULE, "Enabled", 1) == 1 ? Translate("Disable Popups") : Translate("Enable Popups")); - menu.flags = CMIM_NAME;// | CMIM_ICON; - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuToggleOnOff, (LPARAM)&menu); -} - -int PopupQuery(WPARAM wParam, LPARAM lParam) { - switch(wParam) { - case PUQS_ENABLEPOPUPS: - { - bool enabled = (DBGetContactSettingByte(0, MODULE, "Enabled", 1) == 1); - if(!enabled) DBWriteContactSettingByte(0, MODULE, "Enabled", 1); - return enabled ? 0: 1; - } - break; - case PUQS_DISABLEPOPUPS: - { - bool enabled = (DBGetContactSettingByte(0, MODULE, "Enabled", 1) == 1); - if(enabled) DBWriteContactSettingByte(0, MODULE, "Enabled", 0); - DBWriteContactSettingByte(0, MODULE, "Enabled", 0); - return enabled ? 1 : 0; - } - break; - case PUQS_GETSTATUS: - return DBGetContactSettingByte(0, MODULE, "Enabled", 1); - default: - return 1; - } - UpdateMenu(); - return 0; -} - -int TogglePopups(WPARAM wParam, LPARAM lParam) { - if(DBGetContactSettingByte(0, MODULE, "Enabled", 1)) { - DBWriteContactSettingByte(0, MODULE, "Enabled", 0); - } else { - DBWriteContactSettingByte(0, MODULE, "Enabled", 1); - } - UpdateMenu(); - return 0; -} - -int PopupChangeA(WPARAM wParam, LPARAM lParam) { - HWND hwndPop = (HWND)wParam; - POPUPDATAEX *pd_in = (POPUPDATAEX *)lParam; - - if(IsWindow(hwndPop)) { - PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData)); - pd_out->cbSize = sizeof(PopupData); - pd_out->flags = PDF_UNICODE; - - pd_out->pwzTitle = a2w(pd_in->lpzContactName); - pd_out->pwzText = a2w(pd_in->lpzText); - StripBBCodesInPlace(pd_out->pwzTitle); - StripBBCodesInPlace(pd_out->pwzText); - - pd_out->hContact = pd_in->lchContact; - pd_out->hIcon = pd_in->lchIcon; - if(pd_in->colorBack == 0xffffffff) // that's the old #define for 'skinned bg' - pd_out->colorBack = pd_out->colorText = 0; - else { - pd_out->colorBack = pd_in->colorBack & 0xFFFFFF; - pd_out->colorText = pd_in->colorText & 0xFFFFFF; - } - pd_out->colorBack = pd_in->colorBack; - pd_out->colorText = pd_in->colorText; - pd_out->windowProc = pd_in->PluginWindowProc; - pd_out->opaque = pd_in->PluginData; - pd_out->timeout = pd_in->iSeconds; - - lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0)); - - PostMessage(hwndPop, PUM_CHANGE, 0, (LPARAM)pd_out); - } - return 0; -} - -int PopupChangeW(WPARAM wParam, LPARAM lParam) { - HWND hwndPop = (HWND)wParam; - POPUPDATAW *pd_in = (POPUPDATAW *)lParam; - - if(IsWindow(hwndPop)) { - PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData)); - pd_out->cbSize = sizeof(PopupData); - pd_out->flags = PDF_UNICODE; - - pd_out->pwzTitle = wcsdup(pd_in->lpwzContactName); - pd_out->pwzText = wcsdup(pd_in->lpwzText); - StripBBCodesInPlace(pd_out->pwzTitle); - StripBBCodesInPlace(pd_out->pwzText); - - pd_out->hContact = pd_in->lchContact; - pd_out->hIcon = pd_in->lchIcon; - if(pd_in->colorBack == 0xffffffff) // that's the old #define for 'skinned bg' - pd_out->colorBack = pd_out->colorText = 0; - else { - pd_out->colorBack = pd_in->colorBack & 0xFFFFFF; - pd_out->colorText = pd_in->colorText & 0xFFFFFF; - } - pd_out->colorBack = pd_in->colorBack; - pd_out->colorText = pd_in->colorText; - pd_out->windowProc = pd_in->PluginWindowProc; - pd_out->opaque = pd_in->PluginData; - pd_out->timeout = pd_in->iSeconds; - - lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0)); - - PostMessage(hwndPop, PUM_CHANGE, 0, (LPARAM)pd_out); - } - return 0; -} - -int ShowMessage(WPARAM wParam, LPARAM lParam) { - if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) return 0; - - POPUPDATAT pd = {0}; - _tcscpy(pd.lptzContactName, lParam == SM_WARNING ? _T("Warning") : _T("Notification")); - pd.lchIcon = LoadIcon(0, lParam == SM_WARNING ? IDI_WARNING : IDI_INFORMATION); - TCHAR buff[MAX_SECONDLINE]; - a2t((char *)wParam, buff, MAX_SECONDLINE); - _tcscpy(pd.lptzText, buff); - - CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, 0); - - return 0; -} - -int ShowMessageW(WPARAM wParam, LPARAM lParam) { - if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) return 0; - - POPUPDATAW pd = {0}; - wcscpy(pd.lpwzContactName, lParam == SM_WARNING ? L"Warning" : L"Notification"); - pd.lchIcon = LoadIcon(0, lParam == SM_WARNING ? IDI_WARNING : IDI_INFORMATION); - wcsncpy(pd.lpwzText, (wchar_t *)wParam, MAX_SECONDLINE); - - CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, 0); - - return 0; -} - -//=====PopUp/ShowHistory -//extern BOOL CALLBACK DlgProcHistLstOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); -int PopUp_ShowHistory(WPARAM wParam, LPARAM lParam) -{ - if (!hHistoryWindow) { - hHistoryWindow = CreateDialog(hInst, MAKEINTRESOURCE(IDD_LST_HISTORY), NULL, DlgProcHistLst); - } - ShowWindow(hHistoryWindow, SW_SHOW); - return 0; -} - -int num_classes = 0; -PopupClass *classes = 0; - -int RegisterPopupClass(WPARAM wParam, LPARAM lParam) {
+ }
+ StripBBCodesInPlace(pd_out->pwzTitle);
+ StripBBCodesInPlace(pd_out->pwzText);
+
+ lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0));
+ if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) {
+ if(pd_out->pwzTitle) free(pd_out->pwzTitle);
+ if(pd_out->pwzText) free(pd_out->pwzText);
+ free(pd_out);
+ return -1;
+ }
+
+ //MessageBox(0, pd_out->lpwzContactName, _T("CreatePopupW"), MB_OK);
+ PostMPMessage(MUM_CREATEPOPUP, 0, (LPARAM)pd_out);
+ return 0;
+}
+
+INT_PTR GetContact(WPARAM wParam, LPARAM lParam) {
+ HWND hwndPop = (HWND)wParam;
+ HANDLE hContact;
+ if(GetCurrentThreadId() == message_pump_thread_id) {
+ SendMessage(hwndPop, PUM_GETCONTACT, (WPARAM)&hContact, 0);
+ } else {
+ HANDLE hEvent = CreateEvent(0, 0, 0, 0);
+ PostMessage(hwndPop, PUM_GETCONTACT, (WPARAM)&hContact, (LPARAM)hEvent);
+ MsgWaitForMultipleObjectsEx(1, &hEvent, INFINITE, 0, 0);
+ CloseHandle(hEvent);
+ }
+
+ return (INT_PTR)hContact;
+}
+
+INT_PTR GetOpaque(WPARAM wParam, LPARAM lParam) {
+ HWND hwndPop = (HWND)wParam;
+ void *data = 0;
+ if(GetCurrentThreadId() == message_pump_thread_id) {
+ SendMessage(hwndPop, PUM_GETOPAQUE, (WPARAM)&data, 0);
+ } else {
+ HANDLE hEvent = CreateEvent(0, 0, 0, 0);
+ PostMessage(hwndPop, PUM_GETOPAQUE, (WPARAM)&data, (LPARAM)hEvent);
+ MsgWaitForMultipleObjectsEx(1, &hEvent, INFINITE, 0, 0);
+ CloseHandle(hEvent);
+ }
+
+ return (INT_PTR)data;
+}
+
+INT_PTR IsSecondLineShown(WPARAM wParam, LPARAM lParam) {
+ return TRUE;
+}
+
+void UpdateMenu() {
+ CLISTMENUITEM menu = {0};
+ menu.cbSize = sizeof(CLISTMENUITEM);
+ menu.pszName = (DBGetContactSettingByte(0, MODULE, "Enabled", 1) == 1 ? Translate("Disable Popups") : Translate("Enable Popups"));
+ menu.flags = CMIM_NAME;// | CMIM_ICON;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuToggleOnOff, (LPARAM)&menu);
+}
+
+INT_PTR PopupQuery(WPARAM wParam, LPARAM lParam) {
+ switch(wParam) {
+ case PUQS_ENABLEPOPUPS:
+ {
+ bool enabled = (DBGetContactSettingByte(0, MODULE, "Enabled", 1) == 1);
+ if(!enabled) DBWriteContactSettingByte(0, MODULE, "Enabled", 1);
+ return enabled ? 0: 1;
+ }
+ break;
+ case PUQS_DISABLEPOPUPS:
+ {
+ bool enabled = (DBGetContactSettingByte(0, MODULE, "Enabled", 1) == 1);
+ if(enabled) DBWriteContactSettingByte(0, MODULE, "Enabled", 0);
+ DBWriteContactSettingByte(0, MODULE, "Enabled", 0);
+ return enabled ? 1 : 0;
+ }
+ break;
+ case PUQS_GETSTATUS:
+ return DBGetContactSettingByte(0, MODULE, "Enabled", 1);
+ default:
+ return 1;
+ }
+ UpdateMenu();
+ return 0;
+}
+
+INT_PTR TogglePopups(WPARAM wParam, LPARAM lParam) {
+ if(DBGetContactSettingByte(0, MODULE, "Enabled", 1)) {
+ DBWriteContactSettingByte(0, MODULE, "Enabled", 0);
+ } else {
+ DBWriteContactSettingByte(0, MODULE, "Enabled", 1);
+ }
+ UpdateMenu();
+ return 0;
+}
+
+INT_PTR PopupChangeA(WPARAM wParam, LPARAM lParam) {
+ HWND hwndPop = (HWND)wParam;
+ POPUPDATAEX *pd_in = (POPUPDATAEX *)lParam;
+
+ if(IsWindow(hwndPop)) {
+ PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData));
+ pd_out->cbSize = sizeof(PopupData);
+ pd_out->flags = PDF_UNICODE;
+
+ pd_out->pwzTitle = a2w(pd_in->lpzContactName);
+ pd_out->pwzText = a2w(pd_in->lpzText);
+ StripBBCodesInPlace(pd_out->pwzTitle);
+ StripBBCodesInPlace(pd_out->pwzText);
+
+ pd_out->hContact = pd_in->lchContact;
+ pd_out->hIcon = pd_in->lchIcon;
+ if(pd_in->colorBack == 0xffffffff) // that's the old #define for 'skinned bg'
+ pd_out->colorBack = pd_out->colorText = 0;
+ else {
+ pd_out->colorBack = pd_in->colorBack & 0xFFFFFF;
+ pd_out->colorText = pd_in->colorText & 0xFFFFFF;
+ }
+ pd_out->colorBack = pd_in->colorBack;
+ pd_out->colorText = pd_in->colorText;
+ pd_out->windowProc = pd_in->PluginWindowProc;
+ pd_out->opaque = pd_in->PluginData;
+ pd_out->timeout = pd_in->iSeconds;
+
+ lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0));
+
+ PostMessage(hwndPop, PUM_CHANGE, 0, (LPARAM)pd_out);
+ }
+ return 0;
+}
+
+INT_PTR PopupChangeW(WPARAM wParam, LPARAM lParam) {
+ HWND hwndPop = (HWND)wParam;
+ POPUPDATAW *pd_in = (POPUPDATAW *)lParam;
+
+ if(IsWindow(hwndPop)) {
+ PopupData *pd_out = (PopupData *)malloc(sizeof(PopupData));
+ pd_out->cbSize = sizeof(PopupData);
+ pd_out->flags = PDF_UNICODE;
+
+ pd_out->pwzTitle = wcsdup(pd_in->lpwzContactName);
+ pd_out->pwzText = wcsdup(pd_in->lpwzText);
+ StripBBCodesInPlace(pd_out->pwzTitle);
+ StripBBCodesInPlace(pd_out->pwzText);
+
+ pd_out->hContact = pd_in->lchContact;
+ pd_out->hIcon = pd_in->lchIcon;
+ if(pd_in->colorBack == 0xffffffff) // that's the old #define for 'skinned bg'
+ pd_out->colorBack = pd_out->colorText = 0;
+ else {
+ pd_out->colorBack = pd_in->colorBack & 0xFFFFFF;
+ pd_out->colorText = pd_in->colorText & 0xFFFFFF;
+ }
+ pd_out->colorBack = pd_in->colorBack;
+ pd_out->colorText = pd_in->colorText;
+ pd_out->windowProc = pd_in->PluginWindowProc;
+ pd_out->opaque = pd_in->PluginData;
+ pd_out->timeout = pd_in->iSeconds;
+
+ lstPopupHistory.Add(pd_out->pwzTitle, pd_out->pwzText, time(0));
+
+ PostMessage(hwndPop, PUM_CHANGE, 0, (LPARAM)pd_out);
+ }
+ return 0;
+}
+
+INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam) {
+ if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) return 0;
+
+ POPUPDATAT pd = {0};
+ _tcscpy(pd.lptzContactName, lParam == SM_WARNING ? _T("Warning") : _T("Notification"));
+ pd.lchIcon = LoadIcon(0, lParam == SM_WARNING ? IDI_WARNING : IDI_INFORMATION);
+ TCHAR buff[MAX_SECONDLINE];
+ a2t((char *)wParam, buff, MAX_SECONDLINE);
+ _tcscpy(pd.lptzText, buff);
+
+ CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, 0);
+
+ return 0;
+}
+
+INT_PTR ShowMessageW(WPARAM wParam, LPARAM lParam) {
+ if(!DBGetContactSettingByte(0, MODULE, "Enabled", 1)) return 0;
+
+ POPUPDATAW pd = {0};
+ wcscpy(pd.lpwzContactName, lParam == SM_WARNING ? L"Warning" : L"Notification");
+ pd.lchIcon = LoadIcon(0, lParam == SM_WARNING ? IDI_WARNING : IDI_INFORMATION);
+ wcsncpy(pd.lpwzText, (wchar_t *)wParam, MAX_SECONDLINE);
+
+ CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, 0);
+
+ return 0;
+}
+
+//=====PopUp/ShowHistory
+//extern BOOL CALLBACK DlgProcHistLstOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR PopUp_ShowHistory(WPARAM wParam, LPARAM lParam)
+{
+ if (!hHistoryWindow) {
+ hHistoryWindow = CreateDialog(hInst, MAKEINTRESOURCE(IDD_LST_HISTORY), NULL, DlgProcHistLst);
+ }
+ ShowWindow(hHistoryWindow, SW_SHOW);
+ return 0;
+}
+
+int num_classes = 0;
+PopupClass *classes = 0;
+
+INT_PTR RegisterPopupClass(WPARAM wParam, LPARAM lParam) {
PopupClass *pc = (PopupClass *)lParam;
pc->pszName = strdup(pc->pszName);
if(pc->flags & PCF_UNICODE)
@@ -421,7 +421,7 @@ int RegisterPopupClass(WPARAM wParam, LPARAM lParam) { return 0;
}
-int CreateClassPopup(WPARAM wParam, LPARAM lParam) {
+INT_PTR CreateClassPopup(WPARAM wParam, LPARAM lParam) {
PopupClassInstance *pdc = (PopupClassInstance *)lParam;
if(pdc->cbSize != sizeof(PopupClassInstance)) return 1;
@@ -448,82 +448,82 @@ int CreateClassPopup(WPARAM wParam, LPARAM lParam) { pd.opaque = pdc->opaque;
pd.pszTitle = (char *)pdc->pszTitle;
pd.pszText = (char *)pdc->pszText;
- - CallService(MS_YAPP_SHOWPOPUP, (WPARAM)&pd, 0); +
+ CallService(MS_YAPP_SHOWPOPUP, (WPARAM)&pd, 0);
}
return 0;
-} - -int PrebuildMenu(WPARAM wParam, LPARAM lParam) { - return 0; -} - -HANDLE hEventBuildMenu; - -void InitServices() { - int i = 0; - hService[i++] = CreateServiceFunction(MS_YAPP_SHOWPOPUP, ShowPopup); - hService[i++] = CreateServiceFunction(MS_YAPP_REGISTERCLASS, RegisterPopupClass); - hService[i++] = CreateServiceFunction(MS_YAPP_CLASSINSTANCE, CreateClassPopup); - hService[i++] = CreateServiceFunction(MS_YAPP_GETCONTACT, GetContact); - hService[i++] = CreateServiceFunction(MS_YAPP_GETOPAQUE, GetOpaque); - - // legacy support - hService[i++] = CreateServiceFunction(MS_POPUP_ADDPOPUP, OldCreatePopupA); - hService[i++] = CreateServiceFunction(MS_POPUP_ADDPOPUPEX, OldCreatePopupExA); - hService[i++] = CreateServiceFunction(MS_POPUP_ADDPOPUPW, OldCreatePopupW); - hService[i++] = CreateServiceFunction(MS_POPUP_CHANGETEXTW, ChangeTextW); - hService[i++] = CreateServiceFunction(MS_POPUP_CHANGETEXT, ChangeTextA); - hService[i++] = CreateServiceFunction(MS_POPUP_CHANGE, PopupChangeA); - hService[i++] = CreateServiceFunction(MS_POPUP_CHANGEW, PopupChangeW); - hService[i++] = CreateServiceFunction(MS_POPUP_GETCONTACT, GetContact); - hService[i++] = CreateServiceFunction(MS_POPUP_GETPLUGINDATA, GetOpaque); - hService[i++] = CreateServiceFunction(MS_POPUP_ISSECONDLINESHOWN, IsSecondLineShown); - hService[i++] = CreateServiceFunction(MS_POPUP_QUERY, PopupQuery); - - hService[i++] = CreateServiceFunction(MS_POPUP_SHOWMESSAGE, ShowMessage); - hService[i++] = CreateServiceFunction(MS_POPUP_SHOWMESSAGE"W", ShowMessageW); - - hService[i++] = CreateServiceFunction(MS_POPUP_SHOWHISTORY, PopUp_ShowHistory); - hService[i++] = CreateServiceFunction("PopUp/ToggleEnabled", TogglePopups); - - - CLISTMENUITEM menu = {0}; - - menu.cbSize=sizeof(menu); - menu.flags = CMIM_ALL; - - menu.hIcon=0; - menu.position = 500010000; - menu.pszPopupName = Translate("PopUps"); - - hiPopupHistory = LoadIcon(hInst, MAKEINTRESOURCE(IDI_POPUP_HISTORY)); - menu.hIcon = hiPopupHistory; - menu.pszService= MS_POPUP_SHOWHISTORY; - menu.pszName = Translate("Popup History"); - hMenuShowHistory = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&menu); - menu.hIcon = 0; - - menu.pszService= "PopUp/ToggleEnabled"; - menu.pszName = (DBGetContactSettingByte(0, MODULE, "Enabled", 1) == 1 ? Translate("Disable Popups") : Translate("Enable Popups")); - hMenuToggleOnOff = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&menu); - - hEventBuildMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildMenu); - - if(ServiceExists(MS_LANGPACK_GETCODEPAGE)) - code_page = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0); -} - -void DeinitServices() { - int i; - for(i = 0; i < num_classes; i++) { - free(classes[i].pszName); - free(classes[i].pszDescription); - } - free(classes); num_classes = 0; - - UnhookEvent(hEventBuildMenu); - - for(i = 0; i < NUM_SERVICES; i++) - if(hService[i]) DestroyServiceFunction(hService[i]); -} +}
+
+int PrebuildMenu(WPARAM wParam, LPARAM lParam) {
+ return 0;
+}
+
+HANDLE hEventBuildMenu;
+
+void InitServices() {
+ int i = 0;
+ hService[i++] = CreateServiceFunction(MS_YAPP_SHOWPOPUP, ShowPopup);
+ hService[i++] = CreateServiceFunction(MS_YAPP_REGISTERCLASS, RegisterPopupClass);
+ hService[i++] = CreateServiceFunction(MS_YAPP_CLASSINSTANCE, CreateClassPopup);
+ hService[i++] = CreateServiceFunction(MS_YAPP_GETCONTACT, GetContact);
+ hService[i++] = CreateServiceFunction(MS_YAPP_GETOPAQUE, GetOpaque);
+
+ // legacy support
+ hService[i++] = CreateServiceFunction(MS_POPUP_ADDPOPUP, OldCreatePopupA);
+ hService[i++] = CreateServiceFunction(MS_POPUP_ADDPOPUPEX, OldCreatePopupExA);
+ hService[i++] = CreateServiceFunction(MS_POPUP_ADDPOPUPW, OldCreatePopupW);
+ hService[i++] = CreateServiceFunction(MS_POPUP_CHANGETEXTW, ChangeTextW);
+ hService[i++] = CreateServiceFunction(MS_POPUP_CHANGETEXT, ChangeTextA);
+ hService[i++] = CreateServiceFunction(MS_POPUP_CHANGE, PopupChangeA);
+ hService[i++] = CreateServiceFunction(MS_POPUP_CHANGEW, PopupChangeW);
+ hService[i++] = CreateServiceFunction(MS_POPUP_GETCONTACT, GetContact);
+ hService[i++] = CreateServiceFunction(MS_POPUP_GETPLUGINDATA, GetOpaque);
+ hService[i++] = CreateServiceFunction(MS_POPUP_ISSECONDLINESHOWN, IsSecondLineShown);
+ hService[i++] = CreateServiceFunction(MS_POPUP_QUERY, PopupQuery);
+
+ hService[i++] = CreateServiceFunction(MS_POPUP_SHOWMESSAGE, ShowMessage);
+ hService[i++] = CreateServiceFunction(MS_POPUP_SHOWMESSAGE"W", ShowMessageW);
+
+ hService[i++] = CreateServiceFunction(MS_POPUP_SHOWHISTORY, PopUp_ShowHistory);
+ hService[i++] = CreateServiceFunction("PopUp/ToggleEnabled", TogglePopups);
+
+
+ CLISTMENUITEM menu = {0};
+
+ menu.cbSize=sizeof(menu);
+ menu.flags = CMIM_ALL;
+
+ menu.hIcon=0;
+ menu.position = 500010000;
+ menu.pszPopupName = Translate("PopUps");
+
+ hiPopupHistory = LoadIcon(hInst, MAKEINTRESOURCE(IDI_POPUP_HISTORY));
+ menu.hIcon = hiPopupHistory;
+ menu.pszService= MS_POPUP_SHOWHISTORY;
+ menu.pszName = Translate("Popup History");
+ hMenuShowHistory = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&menu);
+ menu.hIcon = 0;
+
+ menu.pszService= "PopUp/ToggleEnabled";
+ menu.pszName = (DBGetContactSettingByte(0, MODULE, "Enabled", 1) == 1 ? Translate("Disable Popups") : Translate("Enable Popups"));
+ hMenuToggleOnOff = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&menu);
+
+ hEventBuildMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildMenu);
+
+ if(ServiceExists(MS_LANGPACK_GETCODEPAGE))
+ code_page = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+}
+
+void DeinitServices() {
+ int i;
+ for(i = 0; i < num_classes; i++) {
+ free(classes[i].pszName);
+ free(classes[i].pszDescription);
+ }
+ free(classes); num_classes = 0;
+
+ UnhookEvent(hEventBuildMenu);
+
+ for(i = 0; i < NUM_SERVICES; i++)
+ if(hService[i]) DestroyServiceFunction(hService[i]);
+}
diff --git a/yapp/services.h b/yapp/services.h index b47a793..efb6d15 100644 --- a/yapp/services.h +++ b/yapp/services.h @@ -7,28 +7,28 @@ void InitServices(); void DeinitServices();
/*
-int CreatePopupA(WPARAM wParam, LPARAM lParam);
-int CreatePopupExA(WPARAM wParam, LPARAM lParam);
-int CreatePopupW(WPARAM wParam, LPARAM lParam);
-int ChangeTextW(WPARAM wParam, LPARAM lParam);
-int ChangeTextA(WPARAM wParam, LPARAM lParam);
-int GetContact(WPARAM wParam, LPARAM lParam);
-int GetPluginData(WPARAM wParam, LPARAM lParam);
-int IsSecondLineShown(WPARAM wParam, LPARAM lParam);
-int PopupQuery(WPARAM wParam, LPARAM lParam);
-int PopupChange(WPARAM wParam, LPARAM lParam);
-int ShowMessage(WPARAM wParam, LPARAM lParam);
-
-int PopUp_ShowHistory(WPARAM wParam, LPARAM lParam);
-
-int TogglePopups(WPARAM wParam, LPARAM lParam);
-
-int RegisterPopupClass(WPARAM wParam, LPARAM lParam);
-int CreateClassPopup(WPARAM wParam, LPARAM lParam);
+INT_PTR CreatePopupA(WPARAM wParam, LPARAM lParam);
+INT_PTR CreatePopupExA(WPARAM wParam, LPARAM lParam);
+INT_PTR CreatePopupW(WPARAM wParam, LPARAM lParam);
+INT_PTR ChangeTextW(WPARAM wParam, LPARAM lParam);
+INT_PTR ChangeTextA(WPARAM wParam, LPARAM lParam);
+INT_PTR GetContact(WPARAM wParam, LPARAM lParam);
+INT_PTR GetPluginData(WPARAM wParam, LPARAM lParam);
+INT_PTR IsSecondLineShown(WPARAM wParam, LPARAM lParam);
+INT_PTR PopupQuery(WPARAM wParam, LPARAM lParam);
+INT_PTR PopupChange(WPARAM wParam, LPARAM lParam);
+INT_PTR ShowMessage(WPARAM wParam, LPARAM lParam);
+
+INT_PTR PopUp_ShowHistory(WPARAM wParam, LPARAM lParam);
+
+INT_PTR TogglePopups(WPARAM wParam, LPARAM lParam);
+
+INT_PTR RegisterPopupClass(WPARAM wParam, LPARAM lParam);
+INT_PTR CreateClassPopup(WPARAM wParam, LPARAM lParam);
*/
-extern int num_classes; -extern PopupClass *classes; +extern int num_classes;
+extern PopupClass *classes;
#endif
|