summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/KeyboardNotify/EnumProc.cpp (renamed from plugins/KeyboardNotify/EnumProc.c)7
-rw-r--r--plugins/KeyboardNotify/KeyboardNotify_10.vcxproj18
-rw-r--r--plugins/KeyboardNotify/KeyboardNotify_10.vcxproj.filters18
-rw-r--r--plugins/KeyboardNotify/flash.cpp (renamed from plugins/KeyboardNotify/flash.c)2
-rw-r--r--plugins/KeyboardNotify/ignore.cpp (renamed from plugins/KeyboardNotify/ignore.c)0
-rw-r--r--plugins/KeyboardNotify/keyboard.cpp (renamed from plugins/KeyboardNotify/keyboard.c)0
-rw-r--r--plugins/KeyboardNotify/keypresses.cpp (renamed from plugins/KeyboardNotify/keypresses.c)0
-rw-r--r--plugins/KeyboardNotify/main.cpp (renamed from plugins/KeyboardNotify/main.c)48
-rw-r--r--plugins/KeyboardNotify/options.cpp (renamed from plugins/KeyboardNotify/options.c)2
-rw-r--r--plugins/KeyboardNotify/trigger.cpp (renamed from plugins/KeyboardNotify/trigger.c)0
-rw-r--r--plugins/KeyboardNotify/utils.cpp (renamed from plugins/KeyboardNotify/utils.c)0
11 files changed, 48 insertions, 47 deletions
diff --git a/plugins/KeyboardNotify/EnumProc.c b/plugins/KeyboardNotify/EnumProc.cpp
index d1d2d6f8c5..a225bd0a03 100644
--- a/plugins/KeyboardNotify/EnumProc.c
+++ b/plugins/KeyboardNotify/EnumProc.cpp
@@ -87,7 +87,12 @@ void UnloadProcsLibrary(void)
hInstLib = hInstLib = NULL;
lpfCreateToolhelp32Snapshot = NULL;
- lpfProcess32First = (void *)lpfProcess32Next = (void *)lpfEnumProcesses = (void *)lpfEnumProcessModules = (void *)lpfGetModuleBaseName = (void *)lpfVDMEnumTaskWOWEx = NULL;
+ lpfProcess32First = NULL;
+ lpfProcess32Next = NULL;
+ lpfEnumProcesses = NULL;
+ lpfEnumProcessModules = NULL;
+ lpfGetModuleBaseName = NULL;
+ lpfVDMEnumTaskWOWEx = NULL;
}
diff --git a/plugins/KeyboardNotify/KeyboardNotify_10.vcxproj b/plugins/KeyboardNotify/KeyboardNotify_10.vcxproj
index 1676362bc4..15c7350429 100644
--- a/plugins/KeyboardNotify/KeyboardNotify_10.vcxproj
+++ b/plugins/KeyboardNotify/KeyboardNotify_10.vcxproj
@@ -177,15 +177,15 @@
<ClInclude Include="utils.h" />
</ItemGroup>
<ItemGroup>
- <ClCompile Include="EnumProc.c" />
- <ClCompile Include="flash.c" />
- <ClCompile Include="ignore.c" />
- <ClCompile Include="keyboard.c" />
- <ClCompile Include="keypresses.c" />
- <ClCompile Include="main.c" />
- <ClCompile Include="options.c" />
- <ClCompile Include="trigger.c" />
- <ClCompile Include="utils.c" />
+ <ClCompile Include="EnumProc.cpp" />
+ <ClCompile Include="flash.cpp" />
+ <ClCompile Include="ignore.cpp" />
+ <ClCompile Include="keyboard.cpp" />
+ <ClCompile Include="keypresses.cpp" />
+ <ClCompile Include="main.cpp" />
+ <ClCompile Include="options.cpp" />
+ <ClCompile Include="trigger.cpp" />
+ <ClCompile Include="utils.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resources.rc" />
diff --git a/plugins/KeyboardNotify/KeyboardNotify_10.vcxproj.filters b/plugins/KeyboardNotify/KeyboardNotify_10.vcxproj.filters
index 885c295393..35c9d4b195 100644
--- a/plugins/KeyboardNotify/KeyboardNotify_10.vcxproj.filters
+++ b/plugins/KeyboardNotify/KeyboardNotify_10.vcxproj.filters
@@ -47,31 +47,31 @@
</ClInclude>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="EnumProc.c">
+ <ClCompile Include="EnumProc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="flash.c">
+ <ClCompile Include="utils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="ignore.c">
+ <ClCompile Include="flash.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="keyboard.c">
+ <ClCompile Include="ignore.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="keypresses.c">
+ <ClCompile Include="keyboard.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="main.c">
+ <ClCompile Include="keypresses.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="options.c">
+ <ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="trigger.c">
+ <ClCompile Include="options.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="utils.c">
+ <ClCompile Include="trigger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
diff --git a/plugins/KeyboardNotify/flash.c b/plugins/KeyboardNotify/flash.cpp
index 515f39bbb3..fd3815d0b1 100644
--- a/plugins/KeyboardNotify/flash.c
+++ b/plugins/KeyboardNotify/flash.cpp
@@ -188,7 +188,7 @@ FLASHING_SEQUENCE *getTrillianSeq(void)
void updateTrillianSeq(void)
{
- unsigned int i, msgCount=0, fileCount=0, urlCount=0, otherCount=0;
+ int i, msgCount=0, fileCount=0, urlCount=0, otherCount=0;
pFS->size = 2;
countUnopenEvents(&msgCount, &fileCount, &urlCount, &otherCount);
diff --git a/plugins/KeyboardNotify/ignore.c b/plugins/KeyboardNotify/ignore.cpp
index ededae2c84..ededae2c84 100644
--- a/plugins/KeyboardNotify/ignore.c
+++ b/plugins/KeyboardNotify/ignore.cpp
diff --git a/plugins/KeyboardNotify/keyboard.c b/plugins/KeyboardNotify/keyboard.cpp
index cb77a88827..cb77a88827 100644
--- a/plugins/KeyboardNotify/keyboard.c
+++ b/plugins/KeyboardNotify/keyboard.cpp
diff --git a/plugins/KeyboardNotify/keypresses.c b/plugins/KeyboardNotify/keypresses.cpp
index 6d1cef58e6..6d1cef58e6 100644
--- a/plugins/KeyboardNotify/keypresses.c
+++ b/plugins/KeyboardNotify/keypresses.cpp
diff --git a/plugins/KeyboardNotify/main.c b/plugins/KeyboardNotify/main.cpp
index 5c91d200a4..fbadbf7e19 100644
--- a/plugins/KeyboardNotify/main.c
+++ b/plugins/KeyboardNotify/main.cpp
@@ -24,7 +24,7 @@
Description
-----------
- This plugin for Miranda-IM notifies user of specified events (as incoming messages,
+ This plugin for Miranda-IM notifies user of specified events (as incoming messages,
incoming files, incoming URLs or other events). This plugin is based on the original one
by Martin Öberg (aka strickz) and Std's modifications (mainly the idea of using direct
port handling using a driver).
@@ -51,7 +51,7 @@
Thanks
------
- - Pete for the numerous patches he sent, actively helping to improve the code and
+ - Pete for the numerous patches he sent, actively helping to improve the code and
functionality
- UnregistereD for great help in solving problem with Windows activity detection
- Slacktarn, Sir_qwerty and Tweety for giving great help with ideas (most of the new
@@ -182,8 +182,6 @@
#define WIN32_LEAN_AND_MEAN
#define _WIN32_WINNT 0x0500
-#include "AggressiveOptimize.h"
-
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
@@ -317,7 +315,7 @@ PLUGININFOEX pluginInfo={
"tioduke@yahoo.ca",
"© 2002-2003 M.Öberg, 2004 Std, 2005-2008 TioDuke",
"http://addons.miranda-im.org/",
- 0, //not transient
+ UNICODE_AWARE,
0, //doesn't replace anything built-in
{0x119d7288, 0x2050, 0x448d, { 0x99, 0x00, 0xd8, 0x6a, 0xc7, 0x04, 0x26, 0xbf }} //{119D7288-2050-448d-9900-D86AC70426BF}
};
@@ -391,7 +389,7 @@ BOOL isScreenSaverRunning()
SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, &screenSaverIsRunning, FALSE);
return screenSaverIsRunning;
-}
+}
/* this function is from the original idle module */
@@ -489,13 +487,13 @@ BOOL checkGlobalXstatus()
for(i=0, protosSupporting=0; i < ProtoList.protoCount; i++) {
if (!ProtoList.protoInfo[i].enabled || !ProtoList.protoInfo[i].xstatus.count) continue;
- protosSupporting++;
+ protosSupporting++;
// Retrieve xstatus for protocol
xstatus.cbSize = sizeof(ICQ_CUSTOM_STATUS);
xstatus.flags = CSSF_MASK_STATUS;
xstatus.status = &status;
CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
-
+
if (ProtoList.protoInfo[i].xstatus.enabled[status]) return TRUE;
}
@@ -596,11 +594,11 @@ static void FlashThreadFunction()
BOOL bEvent = FALSE;
DWORD dwEventStarted, dwFlashStarted;
BYTE data, unchangedLeds;
-
+
while (TRUE) {
unchangedLeds = (BYTE)(LedState(VK_PAUSE) * !bFlashLed[2] + ((LedState(VK_NUMLOCK) * !bFlashLed[0])<<1) + ((LedState(VK_CAPITAL) * !bFlashLed[1])<<2));
GetAsyncKeyState(VK_PAUSE); // empty Pause/Break's keystroke buffer
-
+
// Start flashing
while(bEvent && bFlashingEnabled)
{
@@ -631,7 +629,7 @@ static void FlashThreadFunction()
// Wait for exit event
if (WaitForSingleObject(hExitEvent, nWaitDelay) == WAIT_OBJECT_0)
- return;
+ return;
}
RestoreLEDState();
@@ -658,7 +656,7 @@ static void FlashThreadFunction()
dwFlashStarted = GetTickCount();
}
-
+
}
@@ -671,7 +669,7 @@ BOOL checkMsgTimestamp(HANDLE hEventCurrent, DWORD timestampCurrent)
for (hEvent=(HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hEventCurrent, 0); hEvent; hEvent=(HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hEvent, 0)) {
DBEVENTINFO einfo = {0};
-
+
einfo.cbSize = sizeof(einfo);
einfo.cbBlob = 0;
einfo.pBlob = NULL;
@@ -702,7 +700,7 @@ BOOL checkStatus(char *szProto)
{
if(!szProto)
return checkGlobalStatus();
-
+
return isStatusEnabled(CallProtoService(szProto, PS_GETSTATUS, 0, 0));
}
@@ -724,7 +722,7 @@ BOOL checkXstatus(char *szProto)
xstatus.flags = CSSF_MASK_STATUS;
xstatus.status = &status;
CallProtoService(ProtoList.protoInfo[i].szProto, PS_ICQ_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
-
+
return ProtoList.protoInfo[i].xstatus.enabled[status];
}
@@ -971,7 +969,7 @@ void LoadSettings(void)
for(j=0; j < ProtoList.protoInfo[i].xstatus.count; j++)
ProtoList.protoInfo[i].xstatus.enabled[j] = DBGetContactSettingByte(NULL, KEYBDMODULE, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), DEF_SETTING_XSTATUS);
}
-
+
if (szMetaProto)
bMetaProtoEnabled = DBGetContactSettingByte(NULL, szMetaProto, "Enabled", 1);
@@ -1097,7 +1095,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
LoadProcsLibrary();
if (bWindowsNT && dWinVer >= 5)
MyGetLastInputInfo = (BOOL (WINAPI *)(PLASTINPUTINFO)) GetProcAddress(GetModuleHandle(L"user32"), "GetLastInputInfo");
- else
+ else
MyGetLastInputInfo = NULL;
createProtocolList();
@@ -1143,7 +1141,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
-__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
{
pluginInfo.cbSize = sizeof(PLUGININFO);
@@ -1153,7 +1151,7 @@ __declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
-__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
pluginInfo.cbSize = sizeof(PLUGININFOEX);
@@ -1165,16 +1163,14 @@ __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
#define MIID_KBDNOTIFY {0x119d7288, 0x2050, 0x448d, { 0x99, 0x00, 0xd8, 0x6a, 0xc7, 0x04, 0x26, 0xbf }}
static const MUUID interfaces[] = {MIID_KBDNOTIFY, MIID_LAST};
-__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
{
return interfaces;
}
-
-
-int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
{
pluginLink = link;
@@ -1207,7 +1203,7 @@ void destroyProtocolList(void)
}
-int __declspec(dllexport) Unload(void)
+extern "C" __declspec(dllexport) int Unload(void)
{
UnhookWindowsHooks();
@@ -1366,7 +1362,7 @@ static LRESULT CALLBACK MirandaWndProcHookFunction(int code, WPARAM wParam, LPAR
if(cwpInfo->message == WM_ACTIVATEAPP && cwpInfo->wParam)
dwLastInput = GetTickCount();
}
-
+
return CallNextHookEx(hMirandaWndProcHook, code, wParam, lParam);
}
@@ -1434,7 +1430,7 @@ BOOL CheckMsgWnd(HANDLE hContact, BOOL *focus)
if (ServiceExists(MS_MSG_GETWINDOWDATA)) { // use the new message API
MessageWindowData mwd;
MessageWindowInputData mwid;
- mwid.cbSize = sizeof(MessageWindowInputData);
+ mwid.cbSize = sizeof(MessageWindowInputData);
mwid.hContact = hContact;
mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
mwd.cbSize = sizeof(MessageWindowData);
diff --git a/plugins/KeyboardNotify/options.c b/plugins/KeyboardNotify/options.cpp
index 85c63049a4..d415862503 100644
--- a/plugins/KeyboardNotify/options.c
+++ b/plugins/KeyboardNotify/options.cpp
@@ -1450,7 +1450,7 @@ INT_PTR CALLBACK DlgProcXstatusList(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (bWindowsNT && dWinVer >= 5.01?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, imageCount, imageCount);
TreeView_SetImageList(hwndTree, hImageList, TVSIL_NORMAL);
- ImageList_AddIcon(hImageList, hIconAux=LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 0, 0, 0));
+ ImageList_AddIcon(hImageList, hIconAux=(HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 0, 0, 0));
if (hIconAux) DestroyIcon(hIconAux);
TreeView_SelectItem(hwndTree, NULL);
diff --git a/plugins/KeyboardNotify/trigger.c b/plugins/KeyboardNotify/trigger.cpp
index 2f07230696..2f07230696 100644
--- a/plugins/KeyboardNotify/trigger.c
+++ b/plugins/KeyboardNotify/trigger.cpp
diff --git a/plugins/KeyboardNotify/utils.c b/plugins/KeyboardNotify/utils.cpp
index 9c710ba217..9c710ba217 100644
--- a/plugins/KeyboardNotify/utils.c
+++ b/plugins/KeyboardNotify/utils.cpp