summaryrefslogtreecommitdiff
path: root/plugins/FingerPrintModPlus/src
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-05-15 10:38:20 +0000
commit48540940b6c28bb4378abfeb500ec45a625b37b6 (patch)
tree2ef294c0763e802f91d868bdef4229b6868527de /plugins/FingerPrintModPlus/src
parent5c350913f011e119127baeb32a6aedeb4f0d33bc (diff)
initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FingerPrintModPlus/src')
-rw-r--r--plugins/FingerPrintModPlus/src/finger_groups.h94
-rw-r--r--plugins/FingerPrintModPlus/src/fingerprint.cpp1868
-rw-r--r--plugins/FingerPrintModPlus/src/fingerprints.h748
-rw-r--r--plugins/FingerPrintModPlus/src/global.h165
-rw-r--r--plugins/FingerPrintModPlus/src/utilities.cpp333
-rw-r--r--plugins/FingerPrintModPlus/src/utilities.h46
6 files changed, 3254 insertions, 0 deletions
diff --git a/plugins/FingerPrintModPlus/src/finger_groups.h b/plugins/FingerPrintModPlus/src/finger_groups.h
new file mode 100644
index 0000000000..9502423f34
--- /dev/null
+++ b/plugins/FingerPrintModPlus/src/finger_groups.h
@@ -0,0 +1,94 @@
+case MIRANDA_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupMiranda", 1))
+ SectName = _T("Client Icons/Miranda");
+ break;
+case MULTIPROTOCOL_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupMulti", 1))
+ SectName = _T("Client Icons/Multi-Protocol");
+ break;
+case ICQ_OFF_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupIcq", 1))
+ SectName = _T("Client Icons/ICQ/Official");
+ break;
+case ICQ_UNOFF_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupIcq", 1))
+ SectName = _T("Client Icons/ICQ/Unofficial");
+ break;
+case JABBER_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupJabber", 1))
+ SectName = _T("Client Icons/Jabber");
+ break;
+case MSN_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupMsn", 1))
+ SectName = _T("Client Icons/MSN");
+ break;
+case AIM_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupAim", 1))
+ SectName = _T("Client Icons/AIM");
+ break;
+case YAHOO_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupYahoo", 1))
+ SectName = _T("Client Icons/Yahoo");
+ break;
+case IRC_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupIrc", 1))
+ SectName = _T("Client Icons/IRC");
+ break;
+case VOIP_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupVoIP", 1))
+ SectName = _T("Client Icons/VoIP");
+ break;
+case SKYPE_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupSkype", 1))
+ SectName = _T("Client Icons/Skype");
+ break;
+case GADU_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupGadu", 1))
+ SectName = _T("Client Icons/Gadu-Gadu");
+ break;
+case PACKS_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupPacks", 1))
+ SectName = _T("Client Icons/Miranda/Pack overlays");
+ break;
+case MRA_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupMail", 1))
+ SectName = _T("Client Icons/Mail.Ru Agent");
+ break;
+case OVER1_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupMiranda", 1))
+ SectName = _T("Client Icons/Miranda/Overlays#1");
+ break;
+case SECURITY_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupOtherProtos", 1))
+ SectName = _T("Client Icons/Overlays/Security");
+ break;
+case OTHER_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupOtherProtos", 1))
+ SectName = _T("Client Icons/Other");
+ break;
+case OVER2_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupMiranda", 1))
+ SectName = _T("Client Icons/Miranda/Overlays#2");
+ break;
+case PLATFORM_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupOtherProtos", 1))
+ SectName = _T("Client Icons/Overlays/Platform");
+ break;
+case WEATHER_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupWeather", 1))
+ SectName = _T("Client Icons/Weather");
+ break;
+case RSS_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupRSS", 1))
+ SectName = _T("Client Icons/RSS");
+ break;
+case QQ_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupQQ", 1))
+ SectName = _T("Client Icons/QQ");
+ break;
+case TLEN_CASE:
+ if(DBGetContactSettingByte(NULL, "Finger", "GroupTlen", 1))
+ SectName = _T("Client Icons/Tlen");
+ break;
+default:
+ SectName = _T("Client Icons"); \ No newline at end of file
diff --git a/plugins/FingerPrintModPlus/src/fingerprint.cpp b/plugins/FingerPrintModPlus/src/fingerprint.cpp
new file mode 100644
index 0000000000..5e3e2ba619
--- /dev/null
+++ b/plugins/FingerPrintModPlus/src/fingerprint.cpp
@@ -0,0 +1,1868 @@
+/*
+Fingerprint Mod+ (client version) icons module for Miranda IM
+
+Copyright © 2006-2007 Artem Shpynov aka FYR, Bio, Faith Healer. 2009-2010 HierOS
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+//Start of header
+#include "global.h"
+#include "fingerprints.h" //Including of fingerprint masks
+
+#define LIB_REG 2
+#define LIB_USE 3
+
+//#define USE_MY_SERVER
+#define REGISTER_BETA
+//#define REGISTER_AUTO
+
+//#define mir_strncpy(a, b, c) { strncpy(a, b, c)[c - 1] = 0; }
+//#define mir_tcsncpy_s(a, b, c, d) { _tcsncpy_s(a, b, c, d); c[d - 1] = 0; }
+//#define _qtoupper(_c) (((_c) >= 'a' && (_c) <= 'z') ? ((_c) - 'a' + 'A') : (_c))
+//#define _qtoupper(_c) (((_c) >= 'a' && (_c) <= 'z') ? ((_c) & 0x5F) : (_c))
+
+void InitFingerEvents();
+void UninitFingerEvents();
+void FASTCALL ClearFI();
+
+int OnIconsChanged(WPARAM wParam, LPARAM lParam);
+int OnExtraIconClick(WPARAM wParam, LPARAM lParam);
+int OnExtraIconListRebuild(WPARAM wParam, LPARAM lParam);
+int OnExtraImageApply(WPARAM wParam, LPARAM lParam);
+int OnContactSettingChanged(WPARAM wParam, LPARAM lParam);
+int OnOptInitialise(WPARAM wParam, LPARAM lParam);
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam);
+int OnPreShutdown(WPARAM wParam, LPARAM lParam);
+
+INT_PTR ServiceSameClientsA(WPARAM wParam, LPARAM lParam);
+INT_PTR ServiceGetClientIconA(WPARAM wParam, LPARAM lParam);
+#ifdef UNICODE
+INT_PTR ServiceSameClientsW(WPARAM wParam, LPARAM lParam);
+INT_PTR ServiceGetClientIconW(WPARAM wParam, LPARAM lParam);
+#endif // !UNICODE
+
+HICON FASTCALL CreateJoinedIcon(HICON hBottom, HICON hTop);
+HBITMAP __inline CreateBitmap32(int cx, int cy);
+HBITMAP FASTCALL CreateBitmap32Point(int cx, int cy, LPVOID* bits);
+HANDLE FASTCALL GetIconIndexFromFI(LPTSTR szMirVer);
+
+HICON FASTCALL LoadIconFromExternalFile(LPTSTR filename, int nLibrary, LPSTR IconName, int flag, LPTSTR Description, int internalidx, LPBOOL NeedFree);
+BOOL FASTCALL WildCompareA(LPSTR name, LPSTR mask);
+BOOL FASTCALL WildCompareW(LPWSTR name, LPWSTR mask);
+BOOL __inline WildCompareProcA(LPSTR name, LPSTR mask);
+BOOL __inline WildCompareProcW(LPWSTR name, LPWSTR mask);
+
+#ifdef UNICODE
+ #define WildCompare WildCompareW
+ #define GetIconsIndexes GetIconsIndexesW
+#else
+ #define WildCompare WildCompareA
+ #define GetIconsIndexes GetIconsIndexesA
+#endif // !UNICODE
+
+HINSTANCE g_hInst;
+PLUGINLINK* pluginLink;
+MM_INTERFACE mmi; // miranda memory interface
+int hLangpack;
+
+BOOL g_bExtraIcon_Register_ServiceExist = FALSE;
+BOOL g_bCList_Extra_Set_Icon_ServiceExist = FALSE;
+
+HANDLE hHeap = NULL;
+HANDLE hExtraImageListRebuild = NULL; // hook event handle for ME_CLIST_EXTRA_LIST_REBUILD
+HANDLE hExtraImageApply = NULL; // hook event handle for ME_CLIST_EXTRA_IMAGE_APPLY
+HANDLE hContactSettingChanged = NULL; // hook event handle for ME_DB_CONTACT_SETTINGCHANGED
+HANDLE hOptInitialise = NULL; // hook event handle for ME_OPT_INITIALISE
+HANDLE hIconsChanged = NULL; // hook event handle for ME_SKIN2_ICONSCHANGED
+HANDLE hPreShutdown = NULL; // hook event handle for ME_SYSTEM_PRESHUTDOWN
+HANDLE hExtraIconClick = NULL; // hook event handle for ME_CLIST_EXTRA_CLICK
+
+HANDLE compClientServA = NULL;
+HANDLE getClientIconA = NULL;
+#ifdef UNICODE
+HANDLE compClientServW = NULL;
+HANDLE getClientIconW = NULL;
+LPSTR g_szClientDescription = NULL;
+#endif // !UNICODE
+HANDLE hStaticHooks[1] = { NULL };
+HANDLE hExtraIcon = NULL;
+HANDLE hFolderChanged = NULL, hIconFolder = NULL;
+TCHAR g_szSkinLib[MAX_PATH];
+
+BYTE bColumn = EXTRA_ICON_CLIENT;
+
+FOUNDINFO* fiList = NULL;
+int nFICount = 0;
+BYTE gbUnicodeAPI;
+UINT g_LPCodePage;
+
+//End of header
+
+// PluginInfo & PluginInfoEx
+PLUGININFOEX pluginInfoEx = {
+ sizeof(PLUGININFOEX),
+ __INTERNAL_NAME_STRING,
+ __VERSION_DWORD,
+ "Fingerprint Mod+ (client version) icons module set extra icon of your buddies according to their client version.",
+ "Artem Shpynov aka FYR, Bio, Faith Healer, HierOS",
+ "crazy.hieros@gmail.com",
+ __LEGAL_COPYRIGHT_STRING,
+ "http://code.google.com/p/fingerprintmod/",
+ UNICODE_AWARE,
+ 0,
+ MIID_THIS_PLUGIN
+};
+
+static void LoadDBCheckState(HWND hwndDlg, int idCtrl, LPCSTR szSetting, BYTE bDef)
+{
+ CheckDlgButton(hwndDlg, idCtrl, DBGetContactSettingByte(NULL, "Finger", szSetting, bDef));
+}
+
+static void StoreDBCheckState(HWND hwndDlg, int idCtrl, LPCSTR szSetting)
+{
+ DBWriteContactSettingByte(NULL, "Finger", szSetting, (BYTE)IsDlgButtonChecked(hwndDlg, idCtrl));
+}
+
+static void OptDlgChanged(HWND hwndDlg, BOOL show)
+{
+ if (show)
+ ShowWindow(GetDlgItem(hwndDlg, IDC_OPTCHANGENOTE), SW_SHOW);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+}
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ g_hInst = hinstDLL;
+ return TRUE;
+}
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{// Tell Miranda IM about plugin
+ if(mirandaVersion < 0x8000)
+ {
+ MessageBox(NULL, TranslateT("Fingerprint Mod+ plugin requires Miranda IM 0.8.0.0 or later"), TranslateT("Fatal error"), MB_OK);
+ return NULL;
+ }
+ return &pluginInfoEx;
+}
+
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces()
+{
+ static const MUUID interfaces[] = {MIID_THIS_PLUGIN, MIID_FINGERPRINT, MIID_LAST };
+ return interfaces;
+}
+
+extern "C" int __declspec(dllexport) Load(PLUGINLINK* link)
+{
+ pluginLink = link;
+ mir_getMMI(&mmi);
+ mir_getLP(&pluginInfoEx);
+
+ hStaticHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ hPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
+ compClientServA = CreateServiceFunction(MS_FP_SAMECLIENTS, ServiceSameClientsA);
+ getClientIconA = CreateServiceFunction(MS_FP_GETCLIENTICON, ServiceGetClientIconA);
+#ifdef UNICODE
+ compClientServW = CreateServiceFunction(MS_FP_SAMECLIENTSW, ServiceSameClientsW);
+ getClientIconW = CreateServiceFunction(MS_FP_GETCLIENTICONW, ServiceGetClientIconW);
+#endif // !UNICODE
+ hHeap = HeapCreate(HEAP_NO_SERIALIZE, 0, 0);
+ gbUnicodeAPI = IsWinVerNT();
+ return 0;
+}
+
+extern "C" int __declspec(dllexport) Unload()
+{
+ size_t i;
+#ifdef UNICODE
+ if(g_szClientDescription != NULL) mir_free(g_szClientDescription);
+#endif // !UNICODE
+ HeapDestroy(hHeap);
+ ClearFI();
+
+ for(i = 0; i < SIZEOF(hStaticHooks); i++)
+ {
+ UnhookEvent(hStaticHooks[i]);
+ hStaticHooks[i] = NULL;
+ }
+ return 0;
+}
+
+/*
+* FreeIcon
+* for mode > 0 it releases icon from iconlib
+* for mode < 0 it destroys icon
+*/
+void FASTCALL FreeIcon(HICON hIcon, BOOL mode)
+{
+ if(!mode) return;
+ if(mode > 0)
+ CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, (WPARAM)0);
+ else
+ DestroyIcon(hIcon);
+}
+
+/*
+* Prepare
+* prepares upperstring masks and registers them in IcoLib
+*/
+void FASTCALL Prepare(KN_FP_MASK* mask)
+{
+ if(!mask->szMask) return;
+ size_t iMaskLen;
+ LPTSTR pszNewMask;
+ LPTSTR pszTranslatedMask;
+
+ if(mask == &def_kn_fp_mask[UNKNOWN_MASK_NUMBER])
+ pszTranslatedMask = TranslateTS(mask->szMask);
+ else
+ pszTranslatedMask = mask->szMask;
+
+ iMaskLen = _tcslen(pszTranslatedMask) + 1;
+ pszNewMask = (LPTSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, iMaskLen * sizeof(TCHAR));
+
+ _tcscpy_s(pszNewMask, iMaskLen, pszTranslatedMask);
+ _tcsupr_s(pszNewMask, iMaskLen);
+ mask->szMask = pszNewMask;
+ LoadIconFromExternalFile(mask->szIconFileName, LIB_REG, mask->szIconName, mask->iSectionFlag, mask->szClientDescription, mask->iIconIndex, NULL);
+}
+
+/*
+* OnModulesLoaded
+* Hook necessary events here
+*/
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
+{
+ int i;
+
+ Update update = { 0 };
+ char szVersion[16];
+
+ g_LPCodePage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+
+ g_bExtraIcon_Register_ServiceExist = ServiceExists(MS_EXTRAICON_REGISTER);
+ g_bCList_Extra_Set_Icon_ServiceExist = ServiceExists(MS_CLIST_EXTRA_SET_ICON);
+
+ //Hook necessary events
+ hIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
+ hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
+ hOptInitialise = HookEvent(ME_OPT_INITIALISE, OnOptInitialise);
+
+ if(g_bExtraIcon_Register_ServiceExist)
+ {
+ EXTRAICON_INFO ico = { 0 };
+
+ ico.cbSize = sizeof(ico);
+ ico.type = EXTRAICON_TYPE_CALLBACK;
+ ico.RebuildIcons = OnExtraIconListRebuild;
+ ico.ApplyIcon = OnExtraImageApply;
+ ico.OnClick = (MIRANDAHOOKPARAM)OnExtraIconClick;
+ ico.name = "Client";
+ ico.description= "Fingerprint";
+ ico.descIcon = "client_Miranda_Unknown";
+ hExtraIcon = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
+ }
+ else
+ {
+ InitFingerEvents();
+ }
+
+ if (ServiceExists(MS_FOLDERS_REGISTER_PATH))
+ {
+ hIconFolder = FoldersRegisterCustomPathT("Fingerprint", "Icons", _T(MIRANDA_PATH) _T("\\") DEFAULT_SKIN_FOLDER);
+ FoldersGetCustomPathT(hIconFolder, g_szSkinLib, SIZEOF(g_szSkinLib), _T(""));
+ }
+ else
+ CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)DEFAULT_SKIN_FOLDER, (LPARAM)g_szSkinLib);
+
+#ifdef USE_MY_SERVER
+
+ update.cbSize = sizeof(Update);
+
+ update.szComponentName = pluginInfoEx.shortName;
+ update.pbVersion = (LPBYTE)CreateVersionString(__VERSION_DWORD, szVersion);
+ update.cpbVersion = (int)strlen((LPSTR)update.pbVersion);
+
+ update.szUpdateURL = "http://fingerprintmod.googlecode.com/svn/branches/updater/" __BETA_FILE_TITLE ".zip";
+ update.szVersionURL = "http://fingerprintmod.googlecode.com/svn/branches/updater/" __BETA_FILE_TITLE ".txt";
+ update.pbVersionPrefix = (LPBYTE)__INTERNAL_NAME_STRING " version ";
+ update.cpbVersionPrefix = (int)strlen((LPSTR)update.pbVersionPrefix);
+
+ CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
+#else //!USE_MY_SERVER
+
+#ifdef REGISTER_BETA
+
+ update.cbSize = sizeof(Update);
+
+ update.szComponentName = pluginInfoEx.shortName;
+ update.pbVersion = (LPBYTE)CreateVersionString(__VERSION_DWORD, szVersion);
+ update.cpbVersion = (int)strlen((LPSTR)update.pbVersion);
+ update.szBetaChangelogURL = "http://code.google.com/p/fingerprintmod/source/list";
+
+#ifdef REGISTER_AUTO
+
+ update.szUpdateURL = UPDATER_AUTOREGISTER;
+
+#else //!REGISTER_AUTO
+
+ update.szUpdateURL = "http://addons.miranda-im.org/download.php?dlfile=" __PLUGIN_ID_STR;
+ update.szVersionURL = "http://addons.miranda-im.org/details.php?action=viewfile&id=" __PLUGIN_ID_STR;
+ update.pbVersionPrefix = (LPBYTE)"<span class=\"fileNameHeader\">" __INTERNAL_NAME_STRING " ";
+ update.cpbVersionPrefix = (int)strlen((LPSTR)update.pbVersionPrefix);
+
+#endif //REGISTER_AUTO
+
+ update.szBetaUpdateURL = "http://fingerprintmod.googlecode.com/svn/branches/updater/" __BETA_FILE_TITLE ".zip";
+ update.szBetaVersionURL = "http://fingerprintmod.googlecode.com/svn/branches/updater/" __BETA_FILE_TITLE ".txt";
+ update.pbBetaVersionPrefix = (LPBYTE)__INTERNAL_NAME_STRING " version ";
+ update.cpbBetaVersionPrefix = (int)strlen((LPSTR)update.pbBetaVersionPrefix);
+
+ CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
+
+#else // !REGISTER_BETA
+
+ CallService(MS_UPDATE_REGISTERFL, (WPARAM)__PLUGIN_ID, (LPARAM)&pluginInfoEx);
+
+#endif // REGISTER_BETA
+#endif // USE_MY_SERVER
+
+ // prepare masks
+ KN_FP_MASK* mask;
+
+ for(i = 0; i < DEFAULT_KN_FP_MASK_COUNT; i++)
+ {
+ mask = &def_kn_fp_mask[i];
+ if(mask) Prepare(mask);
+ }
+ if(DBGetContactSettingByte(NULL, "Finger", "Overlay1", 1))
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays_mask[i];
+ if(mask) Prepare(mask);
+ }
+ }
+ if(DBGetContactSettingByte(NULL, "Finger", "Overlay2", 1))
+ {
+ if (DBGetContactSettingByte(NULL, "Finger", "ShowVersion", 0))
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS2_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays2_mask[i];
+ if(mask) Prepare(mask);
+ }
+ }
+ else
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS2_NO_VER_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays2_mask[i];
+ if(mask) Prepare(mask);
+ }
+ }
+ }
+ if(DBGetContactSettingByte(NULL, "Finger", "Overlay3", 1))
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS3_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays3_mask[i];
+ if(mask) Prepare(mask);
+ }
+ }
+ return 0;
+}
+
+int OnExtraIconClicked(WPARAM wParam, LPARAM lParam)
+{
+ if(lParam == bColumn)
+ CallService(MS_USERINFO_SHOWDIALOG, wParam, NULL);
+ return 0;
+}
+
+/*
+* OnPreShutdown
+* Unhook events here (this is valid place to unhook all events to prevent crash on exiting)
+*/
+int OnPreShutdown(WPARAM wParam, LPARAM lParam)
+{
+ //Unhook events
+ UnhookEvent(hContactSettingChanged);
+ UnhookEvent(hPreShutdown);
+ UnhookEvent(hIconsChanged);
+ UnhookEvent(hOptInitialise);
+ if(!g_bExtraIcon_Register_ServiceExist) UninitFingerEvents();
+ UnhookEvent(hFolderChanged);
+ DestroyServiceFunction(compClientServA);
+ DestroyServiceFunction(getClientIconA);
+#ifdef UNICODE
+ DestroyServiceFunction(compClientServW);
+ DestroyServiceFunction(getClientIconW);
+#endif // !UNICODE
+ return 0;
+}
+
+/* ApplyFingerprintImage
+* 1)Try to find appropriate mask
+* 2)Register icon in extraimage list if not yet registered (0xFF)
+* 3)Set ExtraImage for contact
+*/
+int FASTCALL ApplyFingerprintImage(HANDLE hContact, LPTSTR szMirVer)
+{
+ HANDLE hImage = INVALID_HANDLE_VALUE;
+
+ if(szMirVer)
+ hImage = GetIconIndexFromFI(szMirVer);
+
+ if(hContact == NULL) return 0;
+
+ if(g_bCList_Extra_Set_Icon_ServiceExist && !g_bExtraIcon_Register_ServiceExist)
+ {
+ IconExtraColumn iec;
+ WORD bColumn = DBGetContactSettingWord(NULL, "Finger", "Column", EXTRA_ICON_CLIENT);
+
+ if(bColumn <= 0 || bColumn > EXTRA_ICON_COUNT)
+ {
+ bColumn = EXTRA_ICON_CLIENT;
+ }
+
+ iec.cbSize = sizeof(IconExtraColumn);
+ iec.hImage = hImage;
+ iec.ColumnType = bColumn;
+
+ CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&iec);
+ }
+ else if(g_bExtraIcon_Register_ServiceExist && hExtraIcon != INVALID_HANDLE_VALUE && hExtraIcon != NULL)
+ {
+ EXTRAICON ei = { 0 };
+
+ ei.cbSize = sizeof(ei);
+ ei.hExtraIcon = hExtraIcon;
+ ei.hContact = hContact;
+ ei.hImage = hImage;
+
+ CallService(MS_EXTRAICON_SET_ICON, (WPARAM)&ei, 0);
+ }
+ return 0;
+}
+
+void InitFingerEvents()
+{
+ hExtraIconClick = HookEvent(ME_CLIST_EXTRA_CLICK, OnExtraIconClicked);
+ hExtraImageListRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, OnExtraIconListRebuild);
+ hExtraImageApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnExtraImageApply);
+}
+
+void UninitFingerEvents()
+{
+ UnhookEvent(hExtraImageListRebuild);
+ UnhookEvent(hExtraImageApply);
+ UnhookEvent(hExtraIconClick);
+}
+
+int OnExtraIconClick(WPARAM wParam, LPARAM lParam)
+{
+ CallService(MS_USERINFO_SHOWDIALOG, wParam, NULL);
+ return 0;
+}
+
+/*
+* OnExtraIconListRebuild
+* Set all registered indexes in array to 0xFF (unregistered icon)
+*/
+int OnExtraIconListRebuild(WPARAM wParam, LPARAM lParam)
+{
+ ClearFI();
+ return 0;
+}
+
+/*
+* OnIconsChanged
+*/
+int OnIconsChanged(WPARAM wParam, LPARAM lParam)
+{
+ ClearFI();
+ return 0;
+}
+
+/*
+* OnExtraImageApply
+* Try to get MirVer value from db for contact and if success calls ApplyFingerprintImage
+*/
+int OnExtraImageApply(WPARAM wParam, LPARAM lParam)
+{
+ HANDLE hContact = (HANDLE)wParam;
+
+ if(hContact == NULL) return 0;
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
+
+ if(szProto!=NULL)
+ {
+ DBVARIANT dbvMirVer = { 0 };
+
+ if(!DBGetContactSettingTString(hContact, szProto, "MirVer", &dbvMirVer))
+ {
+ ApplyFingerprintImage(hContact, dbvMirVer.ptszVal);
+ DBFreeVariant(&dbvMirVer);
+ }
+ else
+ ApplyFingerprintImage(hContact, NULL);
+ }
+ else
+ ApplyFingerprintImage(hContact, NULL);
+ return 0;
+}
+
+/*
+* OnContactSettingChanged
+* if contact settings changed apply new image or remove it
+*/
+int OnContactSettingChanged(WPARAM wParam, LPARAM lParam)
+{
+ if((HANDLE)wParam == NULL) return 0;
+ {
+ DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam;
+ if(cws && cws->szSetting && !strcmp(cws->szSetting, "MirVer"))
+ {
+ if(cws->value.type == DBVT_UTF8)
+ {
+#ifdef UNICODE
+ LPWSTR wszVal = NULL;
+ int iValLen;
+
+ iValLen = MultiByteToWideChar(CP_UTF8, 0, cws->value.pszVal, -1, NULL, 0);
+ if(iValLen > 0)
+ {
+ wszVal = (LPWSTR)mir_alloc(iValLen * sizeof(WCHAR));
+ MultiByteToWideChar(CP_UTF8, 0, cws->value.pszVal, -1, wszVal, iValLen);
+ }
+ ApplyFingerprintImage((HANDLE)wParam, wszVal);
+ mir_free(wszVal);
+#else
+ LPSTR szVal = NULL;
+ int iValLenW;
+ int iValLenA;
+
+ iValLenW = MultiByteToWideChar(CP_UTF8, 0, cws->value.pszVal, -1, NULL, 0);
+ if(iValLenW > 0)
+ {
+ LPWSTR wszVal = (LPWSTR)mir_alloc(iValLenW * sizeof(WCHAR));
+ MultiByteToWideChar(CP_UTF8, 0, cws->value.pszVal, -1, wszVal, iValLenW);
+ mir_free(wszVal);
+ iValLenA = WideCharToMultiByte(g_LPCodePage, 0, wszVal, -1, NULL, 0, NULL, NULL);
+ if(iValLenA > 0)
+ {
+ szVal = (LPSTR)mir_alloc(iValLenA * sizeof(CHAR));
+ WideCharToMultiByte(g_LPCodePage, 0, wszVal, -1, szVal, iValLenA, NULL, NULL);
+ }
+ }
+ ApplyFingerprintImage((HANDLE)wParam, szVal);
+ mir_free(szVal);
+#endif // !UNICODE
+ }
+ else if(cws->value.type == DBVT_ASCIIZ)
+ {
+#ifdef UNICODE
+ LPWSTR wszVal = NULL;
+ int iValLen;
+
+ iValLen = MultiByteToWideChar(g_LPCodePage, 0, cws->value.pszVal, -1, NULL, 0);
+ if(iValLen > 0)
+ {
+ wszVal = (LPWSTR)mir_alloc(iValLen * sizeof(WCHAR));
+ MultiByteToWideChar(g_LPCodePage, 0, cws->value.pszVal, -1, wszVal, iValLen);
+ }
+ ApplyFingerprintImage((HANDLE)wParam, wszVal);
+ mir_free(wszVal);
+#else
+ ApplyFingerprintImage((HANDLE)wParam, cws->value.pszVal);
+#endif // !UNICODE
+ }
+ else if(cws->value.type == DBVT_WCHAR)
+ {
+#ifdef UNICODE
+ ApplyFingerprintImage((HANDLE)wParam, cws->value.pwszVal);
+#else
+ LPSTR szVal = NULL;
+ int iValLen;
+
+ iValLen = WideCharToMultiByte(g_LPCodePage, 0, cws->value.pwszVal, -1, NULL, 0, NULL, NULL);
+ if(iValLen > 0)
+ {
+ szVal = (LPSTR)mir_alloc(iValLen * sizeof(CHAR));
+ WideCharToMultiByte(g_LPCodePage, 0, cws->value.pwszVal, -1, szVal, iValLen, NULL, NULL);
+ }
+ ApplyFingerprintImage((HANDLE)wParam, szVal);
+ mir_free(szVal);
+#endif // !UNICODE
+ }
+ else
+ ApplyFingerprintImage((HANDLE)wParam, NULL);
+ }
+ }
+ return 0;
+}
+
+/*
+* LoadIconFromExternalFile
+* If iconlib module presents register icon there
+* Register and return icon within iconlib
+* or from resourse
+*/
+// TO DO: Extracting icons from clienticons.dll or other external files require futher
+// destroying of icon... need to add field to list, modify it and remove icon on unload
+// Otherwise it will cause gdi resources leaking.
+// So nowtime it is commented out
+
+HICON FASTCALL LoadIconFromExternalFile(LPTSTR filename, int nLibrary, LPSTR IconName, int flag, LPTSTR Description, int internalidx, LPBOOL NeedFree)
+{
+ HICON hIcon = NULL;
+ TCHAR destfile[MAX_PATH];
+
+ if(IconName == NULL) return NULL;
+
+ if (filename == _T(""))
+ GetModuleFileName(g_hInst,destfile,MAX_PATH);
+ else
+ {
+ mir_sntprintf(destfile, SIZEOF(destfile), _T("%s\\%s.dll"), g_szSkinLib, filename);
+ struct _stat64i32 stFileInfo;
+
+ if (_tstat(destfile, &stFileInfo) == -1)
+ return hIcon;
+ }
+
+ if(nLibrary == LIB_USE)
+ {
+ hIcon = ((HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)IconName));
+ if(!hIcon)
+ {
+ ExtractIconEx(destfile, -internalidx, NULL, &hIcon, 1);
+ return hIcon;
+ }
+ }
+ else
+ {
+ SKINICONDESC sid;
+ LPTSTR SectName = NULL;
+
+ switch(flag)
+ {
+ #include "finger_groups.h"
+ }
+
+ if(SectName == NULL)
+ return hIcon;
+
+ ZeroMemory(&sid, sizeof(sid));
+
+ sid.cbSize = sizeof(sid);
+ sid.flags = SIDF_ALL_TCHAR;
+ sid.ptszSection = SectName;
+ sid.pszName = IconName;
+ sid.ptszDescription = Description;
+ sid.ptszDefaultFile = destfile;
+ sid.iDefaultIndex = -internalidx;
+ sid.cx = sid.cy = 16;
+ CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+
+ hIcon = ((HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)IconName));
+ }
+
+ if(NeedFree)
+ *NeedFree = (BOOL)hIcon;
+ return hIcon;
+}
+
+/*
+* WildCompareA
+* Compare 'name' string with 'mask' strings.
+* Masks can contain '*' or '?' wild symbols
+* Asterics '*' symbol covers 'empty' symbol too e.g WildCompare("Tst","T*st*"), returns TRUE
+* In order to handle situation 'at least one any sybol' use "?*" combination:
+* e.g WildCompare("Tst","T?*st*"), returns FALSE, but both WildCompare("Test","T?*st*") and
+* WildCompare("Teeest","T?*st*") return TRUE.
+*
+* Function is case sensitive! so convert input or modify func to use _qtoupper()
+*
+* Mask can contain several submasks. In this case each submask (including first)
+* should start from '|' e.g: "|first*submask|second*mask".
+*
+* Dec 25, 2006 by FYR:
+* Added Exception to masks: the mask "|^mask3|mask2|mask1" means:
+* if NOT according to mask 3 AND (mask1 OR mask2)
+* EXCEPTION should be BEFORE main mask:
+* IF Exception match - the comparing stops as FALSE
+* IF Exception does not match - comparing continue
+* IF Mask match - comparing stops as TRUE
+* IF Mask does not not match comparing continue
+*/
+BOOL FASTCALL WildCompareA(LPSTR szName, LPSTR szMask)
+{
+ if(*szMask != '|') return WildCompareProcA(szName, szMask);
+ {
+ size_t s = 1, e = 1;
+// static char temp[100]; //lets made temp static local var - should be faster than dynamic
+ LPSTR szTemp = (LPSTR)_alloca(strlen(szMask) * sizeof(CHAR) + sizeof(CHAR));
+ BOOL bExcept;
+
+ while(szMask[e] != '\0')
+ {
+ s = e;
+ while(szMask[e] != '\0' && szMask[e] != '|') e++;
+
+ // exception mask
+ bExcept = (*(szMask + s) == '^');
+ if(bExcept) s++;
+
+ memcpy(szTemp, szMask + s, (e - s) * sizeof(CHAR));
+ szTemp[e - s] = '\0';
+
+ if(WildCompareProcA(szName, szTemp))
+ return !bExcept;
+
+ if(szMask[e] != '\0')
+ e++;
+ else
+ return FALSE;
+ }
+ return FALSE;
+ }
+}
+
+/*
+* WildCompareW
+* Compare 'name' string with 'mask' strings.
+* Masks can contain '*' or '?' wild symbols
+* Asterics '*' symbol covers 'empty' symbol too e.g WildCompare("Tst","T*st*"), returns TRUE
+* In order to handle situation 'at least one any sybol' use "?*" combination:
+* e.g WildCompare("Tst","T?*st*"), returns FALSE, but both WildCompare("Test","T?*st*") and
+* WildCompare("Teeest","T?*st*") return TRUE.
+*
+* Function is case sensitive! so convert input or modify func to use _qtoupper()
+*
+* Mask can contain several submasks. In this case each submask (including first)
+* should start from '|' e.g: "|first*submask|second*mask".
+*
+* Dec 25, 2006 by FYR:
+* Added Exception to masks: the mask "|^mask3|mask2|mask1" means:
+* if NOT according to mask 3 AND (mask1 OR mask2)
+* EXCEPTION should be BEFORE main mask:
+* IF Exception match - the comparing stops as FALSE
+* IF Exception does not match - comparing continue
+* IF Mask match - comparing stops as TRUE
+* IF Mask does not not match comparing continue
+*/
+BOOL FASTCALL WildCompareW(LPWSTR wszName, LPWSTR wszMask)
+{
+ if(*wszMask != L'|') return WildCompareProcW(wszName, wszMask);
+ {
+ size_t s = 1, e = 1;
+// static char temp[100]; //lets made temp static local var - should be faster than dynamic
+ LPWSTR wszTemp = (LPWSTR)_alloca(wcslen(wszMask) * sizeof(WCHAR) + sizeof(WCHAR));
+ BOOL bExcept;
+
+ while(wszMask[e] != L'\0')
+ {
+ s = e;
+ while(wszMask[e] != L'\0' && wszMask[e] != L'|') e++;
+
+ // exception mask
+ bExcept = (*(wszMask + s) == L'^');
+ if(bExcept) s++;
+
+ memcpy(wszTemp, wszMask + s, (e - s) * sizeof(WCHAR));
+ wszTemp[e - s] = L'\0';
+
+ if(WildCompareProcW(wszName, wszTemp))
+ return !bExcept;
+
+ if(wszMask[e] != L'\0')
+ e++;
+ else
+ return FALSE;
+ }
+ return FALSE;
+ }
+}
+
+INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch(msg)
+ {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwndDlg);
+ for (int i = 0; i < DEFAULT_SETTINGS_COUNT; i++)
+ {
+ if (lstrcmpA(settings[i].szSetName, "ShowVersion") == 0)
+ LoadDBCheckState(hwndDlg, settings[i].idCtrl, settings[i].szSetName, 0);
+ else
+ LoadDBCheckState(hwndDlg, settings[i].idCtrl, settings[i].szSetName, 1);
+ }
+ LPTSTR CIdComboBox[] =
+ {
+ _T("Email"),
+ _T("Protocol"),
+ _T("SMS"),
+ _T("Advanced 1"),
+ _T("Advanced 2"),
+ _T("Web"),
+ _T("Client (default)"),
+ _T("VisMode"),
+ _T("Advanced 3"),
+ _T("Advanced 4")
+ };
+
+ for(int i = 0; i < SIZEOF(CIdComboBox); i++)
+ ComboBoxAddString(GetDlgItem(hwndDlg, IDC_ADVICON), CIdComboBox[i], i);
+
+ SendDlgItemMessage(hwndDlg, IDC_ADVICON, CB_SETCURSEL, (DBGetContactSettingWord(NULL, "Finger", "Column", EXTRA_ICON_CLIENT)) - 1, 0);
+ if(g_bExtraIcon_Register_ServiceExist)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADVICON), FALSE);
+
+ ShowWindow(GetDlgItem(hwndDlg, IDC_OPTCHANGENOTE), SW_HIDE);
+ }
+ break;
+ case WM_COMMAND:
+ switch(LOWORD(wParam))
+ {
+ BOOL show;
+ case IDC_ADVICON:
+ if(HIWORD(wParam) == CBN_SELCHANGE)
+ OptDlgChanged(hwndDlg, true);
+ break;
+ case IDC_OVERLAY1:
+ case IDC_OVERLAY2:
+ case IDC_OVERLAY3:
+ case IDC_VERSION:
+ show = true;
+ OptDlgChanged(hwndDlg, show);
+ break;
+
+ case IDC_GROUPMIRANDA:
+ case IDC_GROUPMULTI:
+ case IDC_GROUPPACKS:
+ case IDC_GROUPOTHERS:
+ case IDC_GROUPAIM:
+ case IDC_GROUPGADU:
+ case IDC_GROUPICQ:
+ case IDC_GROUPIRC:
+ case IDC_GROUPJABBER:
+ case IDC_GROUPMAIL:
+ case IDC_GROUPMSN:
+ case IDC_GROUPQQ:
+ case IDC_GROUPRSS:
+ case IDC_GROUPSKYPE:
+ case IDC_GROUPTLEN:
+ case IDC_GROUPVOIP:
+ case IDC_GROUPWEATHER:
+ case IDC_GROUPYAHOO:
+ show = false;
+ OptDlgChanged(hwndDlg, show);
+ break;
+ default:
+ return 0;
+ }
+ break;
+ case WM_NOTIFY:
+ {
+ NMHDR *hdr = (NMHDR *)lParam;
+ if (hdr && hdr->code == PSN_APPLY)
+ {
+ int i = SendDlgItemMessage(hwndDlg, IDC_ADVICON, CB_GETCURSEL, 0, 0) + 1;
+ DBWriteContactSettingWord(NULL, "Finger", "Column", (WORD)i);
+
+ // prepare masks
+ KN_FP_MASK* mask;
+
+ for(i = 0; i < DEFAULT_KN_FP_MASK_COUNT; i++)
+ {
+ mask = &def_kn_fp_mask[i];
+ if(mask) CallService(MS_SKIN2_REMOVEICON, 0, (LPARAM)mask->szIconName);
+ }
+ if(DBGetContactSettingByte(NULL, "Finger", "Overlay1", 1))
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays_mask[i];
+ if(mask) CallService(MS_SKIN2_REMOVEICON, 0, (LPARAM)mask->szIconName);
+ }
+ }
+ if(DBGetContactSettingByte(NULL, "Finger", "Overlay2", 1))
+ {
+ if (DBGetContactSettingByte(NULL, "Finger", "ShowVersion", 0))
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS2_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays2_mask[i];
+ if(mask) CallService(MS_SKIN2_REMOVEICON, 0, (LPARAM)mask->szIconName);
+ }
+ }
+ else
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS2_NO_VER_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays2_mask[i];
+ if(mask) CallService(MS_SKIN2_REMOVEICON, 0, (LPARAM)mask->szIconName);
+ }
+ }
+ }
+ if(DBGetContactSettingByte(NULL, "Finger", "Overlay3", 1))
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS3_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays3_mask[i];
+ if(mask) CallService(MS_SKIN2_REMOVEICON, 0, (LPARAM)mask->szIconName);
+ }
+ }
+
+ for (int i = 0; i < DEFAULT_SETTINGS_COUNT; i++)
+ StoreDBCheckState(hwndDlg, settings[i].idCtrl, settings[i].szSetName);
+
+ for(i = 0; i < DEFAULT_KN_FP_MASK_COUNT; i++)
+ {
+ mask = &def_kn_fp_mask[i];
+ if(mask) Prepare(mask);
+ }
+ if(DBGetContactSettingByte(NULL, "Finger", "Overlay1", 1))
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays_mask[i];
+ if(mask) Prepare(mask);
+ }
+ }
+ if(DBGetContactSettingByte(NULL, "Finger", "Overlay2", 1))
+ {
+ if (DBGetContactSettingByte(NULL, "Finger", "ShowVersion", 0))
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS2_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays2_mask[i];
+ if(mask) Prepare(mask);
+ }
+ }
+ else
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS2_NO_VER_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays2_mask[i];
+ if(mask) Prepare(mask);
+ }
+ }
+ }
+ if(DBGetContactSettingByte(NULL, "Finger", "Overlay3", 1))
+ {
+ for(i = 0; i < DEFAULT_KN_FP_OVERLAYS3_COUNT; i++)
+ {
+ mask = &def_kn_fp_overlays3_mask[i];
+ if(mask) Prepare(mask);
+ }
+ }
+ }
+ break;
+ }
+ case WM_DESTROY:
+ break;
+ }
+ return FALSE;
+}
+int OnOptInitialise(WPARAM wParam, LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp;
+
+ ZeroMemory(&odp, sizeof(odp));
+
+ odp.cbSize = sizeof(odp);
+ odp.position = 0;
+ odp.hInstance = g_hInst;
+ odp.ptszGroup = LPGENT("Customize");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG);
+ odp.ptszTitle = LPGENT("Fingerprint");
+ odp.pfnDlgProc = DlgProcOptions;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
+
+ return 0;
+}
+
+BOOL __inline WildCompareProcA(LPSTR szName, LPSTR szMask)
+{
+ LPSTR szLast = NULL;
+ for(;; szMask++, szName++)
+ {
+ if(*szMask != '?' && *szMask != *szName) break;
+ if(*szName == '\0') return ((BOOL)!*szMask);
+ }
+ if(*szMask != '*') return FALSE;
+ for(;; szMask++, szName++)
+ {
+ while(*szMask == '*')
+ {
+ szLast = szMask++;
+ if(*szMask == '\0') return ((BOOL)!*szMask); /* true */
+ }
+ if(*szName == '\0') return ((BOOL)!*szMask); /* *mask == EOS */
+ if(*szMask != '?' && *szMask != *szName && szLast != NULL)
+ {
+ szName -= (size_t)(szMask - szLast) - 1;
+ szMask = szLast;
+ }
+ }
+}
+
+BOOL __inline WildCompareProcW(LPWSTR wszName, LPWSTR wszMask)
+{
+ LPWSTR wszLast = NULL;
+ for(;; wszMask++, wszName++)
+ {
+ if(*wszMask != L'?' && *wszMask != *wszName) break;
+ if(*wszName == L'\0') return ((BOOL)!*wszMask);
+ }
+ if(*wszMask != L'*') return FALSE;
+ for(;; wszMask++, wszName++)
+ {
+ while(*wszMask == L'*')
+ {
+ wszLast = wszMask++;
+ if(*wszMask == L'\0') return ((BOOL)!*wszMask); /* true */
+ }
+ if(*wszName == L'\0') return ((BOOL)!*wszMask); /* *mask == EOS */
+ if(*wszMask != L'?' && *wszMask != *wszName && wszLast != NULL)
+ {
+ wszName -= (size_t)(wszMask - wszLast) - 1;
+ wszMask = wszLast;
+ }
+ }
+}
+
+/* GetIconsIndexesA
+* Retrieves Icons indexes by Mirver
+*/
+void FASTCALL GetIconsIndexesA(LPSTR szMirVer, short *base, short *overlay,short *overlay2,short *overlay3)
+{
+ LPTSTR tszMirVerUp;
+ int iMirVerUpLen;
+ short i = 0, j = -1, k = -1, n = -1;
+
+ if(strcmp(szMirVer, "?") == 0)
+ {
+ *base = UNKNOWN_MASK_NUMBER;
+ *overlay = -1;
+ *overlay2 = -1;
+ *overlay3 = -1;
+ return;
+ }
+
+#ifdef UNICODE
+ iMirVerUpLen = MultiByteToWideChar(g_LPCodePage, 0, szMirVer, -1, NULL, 0);
+#else
+ iMirVerUpLen = strlen(szMirVer) + 1;
+#endif // !UNICODE
+ tszMirVerUp = (LPTSTR)mir_alloc(iMirVerUpLen * sizeof(TCHAR));
+#ifdef UNICODE
+ MultiByteToWideChar(g_LPCodePage, 0, szMirVer, -1, tszMirVerUp, iMirVerUpLen);
+#else
+ _tcscpy_s(tszMirVerUp, iMirVerUpLen, szMirVer);
+#endif // !UNICODE
+ _tcsupr_s(tszMirVerUp, iMirVerUpLen);
+
+ while(i < DEFAULT_KN_FP_MASK_COUNT)
+ {
+ if(WildCompare(tszMirVerUp, def_kn_fp_mask[i].szMask))
+ {
+ if (def_kn_fp_mask[i].szIconFileName != _T(""))
+ {
+ TCHAR destfile[MAX_PATH];
+ mir_sntprintf(destfile, SIZEOF(destfile), _T("%s\\%s.dll"), g_szSkinLib, def_kn_fp_mask[i].szIconFileName);
+ struct _stat64i32 stFileInfo;
+
+ if (_tstat(destfile, &stFileInfo) == -1)
+ i = NOTFOUND_MASK_NUMBER;
+ }
+ break;
+ }
+ i++;
+ }
+ if(!def_kn_fp_mask[i].fNotUseOverlay && i < DEFAULT_KN_FP_MASK_COUNT)
+ {
+ j = 0;
+ while(j < DEFAULT_KN_FP_OVERLAYS_COUNT)
+ {
+ if(WildCompare(tszMirVerUp, def_kn_fp_overlays_mask[j].szMask))
+ {
+ if (def_kn_fp_overlays_mask[j].szIconFileName == _T("ClientIcons_Packs"))
+ {
+ TCHAR destfile[MAX_PATH];
+ mir_sntprintf(destfile, SIZEOF(destfile), _T("%s\\%s.dll"), g_szSkinLib, def_kn_fp_overlays_mask[i].szIconFileName);
+ struct _stat64i32 stFileInfo;
+
+ if (_tstat(destfile, &stFileInfo) == -1)
+ j++;
+ else
+ break;
+ }
+ else
+ break;
+ }
+ j++;
+ }
+ k = 0;
+ while(k < DEFAULT_KN_FP_OVERLAYS2_COUNT)
+ {
+ if(WildCompare(tszMirVerUp, def_kn_fp_overlays2_mask[k].szMask)) break;
+ k++;
+ }
+ n = 0;
+ while(n < DEFAULT_KN_FP_OVERLAYS3_COUNT)
+ {
+ if(WildCompare(tszMirVerUp, def_kn_fp_overlays3_mask[n].szMask)) break;
+ n++;
+ }
+ }
+ *base = (i < DEFAULT_KN_FP_MASK_COUNT) ? i : -1;
+ *overlay = (j < DEFAULT_KN_FP_OVERLAYS_COUNT) ? j : -1;
+ *overlay2 = (k < DEFAULT_KN_FP_OVERLAYS2_COUNT) ? k : -1;
+ *overlay3 = (n < DEFAULT_KN_FP_OVERLAYS3_COUNT) ? n : -1;
+
+ mir_free(tszMirVerUp);
+}
+
+/* GetIconsIndexesW
+* Retrieves Icons indexes by Mirver
+*/
+#ifdef UNICODE
+void FASTCALL GetIconsIndexesW(LPWSTR wszMirVer, short *base, short *overlay,short *overlay2,short *overlay3)
+{
+ LPWSTR wszMirVerUp;
+ size_t iMirVerUpLen;
+ short i = 0, j = -1, k = -1, n = -1;
+
+ if(wcscmp(wszMirVer, L"?") == 0)
+ {
+ *base = UNKNOWN_MASK_NUMBER;
+ *overlay = -1;
+ *overlay2 = -1;
+ *overlay3 = -1;
+ return;
+ }
+
+ iMirVerUpLen = wcslen(wszMirVer) + 1;
+ wszMirVerUp = (LPWSTR)mir_alloc(iMirVerUpLen * sizeof(WCHAR));
+
+ wcscpy_s(wszMirVerUp, iMirVerUpLen, wszMirVer);
+ _wcsupr_s(wszMirVerUp, iMirVerUpLen);
+
+ while(i < DEFAULT_KN_FP_MASK_COUNT)
+ {
+ if(WildCompareW(wszMirVerUp, def_kn_fp_mask[i].szMask))
+ {
+ if (def_kn_fp_mask[i].szIconFileName != _T(""))
+ {
+ TCHAR destfile[MAX_PATH];
+ mir_sntprintf(destfile, SIZEOF(destfile), _T("%s\\%s.dll"), g_szSkinLib, def_kn_fp_mask[i].szIconFileName);
+ struct _stat64i32 stFileInfo;
+
+ if (_tstat(destfile, &stFileInfo) == -1)
+ i = NOTFOUND_MASK_NUMBER;
+ }
+ break;
+ }
+ i++;
+ }
+ if(!def_kn_fp_mask[i].fNotUseOverlay && i < DEFAULT_KN_FP_MASK_COUNT)
+ {
+ j = 0;
+ while(j < DEFAULT_KN_FP_OVERLAYS_COUNT)
+ {
+ if(WildCompare(wszMirVerUp, def_kn_fp_overlays_mask[j].szMask))
+ {
+ if (def_kn_fp_overlays_mask[j].szIconFileName == _T("ClientIcons_Packs"))
+ {
+ TCHAR destfile[MAX_PATH];
+ mir_sntprintf(destfile, SIZEOF(destfile), _T("%s\\%s.dll"), g_szSkinLib, def_kn_fp_overlays_mask[j].szIconFileName);
+ struct _stat64i32 stFileInfo;
+
+ if (_tstat(destfile, &stFileInfo) == -1)
+ j++;
+ else
+ break;
+ }
+ else
+ break;
+ }
+ j++;
+ }
+ k = 0;
+ while(k < DEFAULT_KN_FP_OVERLAYS2_COUNT)
+ {
+ if(WildCompareW(wszMirVerUp, def_kn_fp_overlays2_mask[k].szMask)) break;
+ k++;
+ }
+ n = 0;
+ while(n < DEFAULT_KN_FP_OVERLAYS3_COUNT)
+ {
+ if(WildCompareW(wszMirVerUp, def_kn_fp_overlays3_mask[n].szMask)) break;
+ n++;
+ }
+ }
+ *base = (i < DEFAULT_KN_FP_MASK_COUNT) ? i : -1;
+ *overlay = (j < DEFAULT_KN_FP_OVERLAYS_COUNT) ? j : -1;
+ *overlay2 = (k < DEFAULT_KN_FP_OVERLAYS2_COUNT) ? k : -1;
+ *overlay3 = (n < DEFAULT_KN_FP_OVERLAYS3_COUNT) ? n : -1;
+
+ mir_free(wszMirVerUp);
+}
+#endif // !UNICODE
+
+/*
+* CreateIconFromIndexes
+* returns hIcon of joined icon by given indexes
+*/
+HICON FASTCALL CreateIconFromIndexes(short base, short overlay, short overlay2, short overlay3)
+{
+ HICON hIcon = NULL; // returned HICON
+ HICON hTmp = NULL;
+ HICON icMain = NULL;
+ HICON icOverlay = NULL;
+ HICON icOverlay2 = NULL;
+ HICON icOverlay3 = NULL;
+
+ BOOL needFreeBase = FALSE;
+ BOOL needFreeOverlay = FALSE;
+ BOOL needFreeOverlay2 = FALSE;
+ BOOL needFreeOverlay3 = FALSE;
+
+ KN_FP_MASK* mainMask = &(def_kn_fp_mask[base]);
+ icMain = LoadIconFromExternalFile(mainMask->szIconFileName, LIB_USE, mainMask->szIconName, mainMask->iSectionFlag, mainMask->szClientDescription, mainMask->iIconIndex, &needFreeBase);
+
+ if(icMain)
+ {
+ KN_FP_MASK* overlayMask = (overlay != -1) ? &(def_kn_fp_overlays_mask[overlay]) : NULL;
+ KN_FP_MASK* overlay2Mask = (overlay2 != -1) ? &(def_kn_fp_overlays2_mask[overlay2]) : NULL;
+ KN_FP_MASK* overlay3Mask = (overlay3 != -1) ? &(def_kn_fp_overlays3_mask[overlay3]) : NULL;
+ icOverlay = (overlayMask == NULL) ? NULL : LoadIconFromExternalFile(overlayMask->szIconFileName, LIB_USE, overlayMask->szIconName, overlayMask->iSectionFlag, overlayMask->szClientDescription, overlayMask->iIconIndex, &needFreeOverlay);
+ icOverlay2 = (overlay2Mask == NULL) ? NULL : LoadIconFromExternalFile(overlay2Mask->szIconFileName, LIB_USE, overlay2Mask->szIconName, overlay2Mask->iSectionFlag, overlay2Mask->szClientDescription, overlay2Mask->iIconIndex, &needFreeOverlay2);
+ icOverlay3 = (overlay3Mask == NULL) ? NULL : LoadIconFromExternalFile(overlay3Mask->szIconFileName, LIB_USE, overlay3Mask->szIconName, overlay3Mask->iSectionFlag, overlay3Mask->szClientDescription, overlay3Mask->iIconIndex, &needFreeOverlay3);
+
+ hIcon = icMain;
+
+ if(overlayMask)
+ {
+ hIcon = CreateJoinedIcon(hIcon, icOverlay);
+ hTmp = hIcon;
+ }
+
+ if(overlay2Mask)
+ {
+ hIcon = CreateJoinedIcon(hIcon, icOverlay2);
+ if(hTmp) DestroyIcon(hTmp);
+ hTmp = hIcon;
+ }
+
+ if(overlay3Mask)
+ {
+ hIcon = CreateJoinedIcon(hIcon, icOverlay3);
+ if(hTmp) DestroyIcon(hTmp);
+ }
+ }
+
+ if(hIcon == icMain)
+ hIcon = CopyIcon(icMain);
+
+ FreeIcon(icMain, needFreeBase);
+ FreeIcon(icOverlay, needFreeOverlay);
+ FreeIcon(icOverlay2, needFreeOverlay2);
+ FreeIcon(icOverlay3, needFreeOverlay3);
+
+ return hIcon;
+}
+
+/*
+* ServiceGetClientIconA
+* MS_FP_GETCLIENTICON service implementation.
+* wParam - char * MirVer value to get client for.
+* lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
+* ICON IS ALWAYS COPIED!!!
+*/
+INT_PTR ServiceGetClientIconA(WPARAM wParam, LPARAM lParam)
+{
+ LPSTR szMirVer = (LPSTR)wParam; // MirVer value to get client for.
+/*
+ static HICON hIcon = NULL; // returned HICON
+ if(hIcon)
+ {
+ DestroyIcon(hIcon);
+ hIcon = NULL;
+ }
+*/
+
+ if(szMirVer == NULL) return 0;
+
+ {
+ HICON hIcon = NULL; // returned HICON
+ int NoCopy = (int)lParam; // noCopy
+ short base, overlay, overlay2, overlay3;
+
+ GetIconsIndexesA(szMirVer, &base, &overlay, &overlay2, &overlay3);
+
+ if(base != -1)
+ {
+ hIcon = CreateIconFromIndexes(base, overlay, overlay2, overlay3);
+ }
+/*
+ if(hIcon && !NoCopy)
+ return (INT_PTR)CopyIcon(hIcon);
+*/
+ return (INT_PTR)hIcon;
+ }
+}
+
+/*
+ * ServiceSameClientA
+ * MS_FP_SAMECLIENTS service implementation.
+ * wParam - char * first MirVer value
+ * lParam - char * second MirVer value
+ * return pointer to char string - client desription (do not destroy) if clients are same
+ */
+INT_PTR ServiceSameClientsA(WPARAM wParam, LPARAM lParam)
+{
+ LPSTR szMirVerFirst = (LPSTR)wParam; // MirVer value to get client for.
+ LPSTR szMirVerSecond = (LPSTR)lParam; // MirVer value to get client for.
+ int firstIndex, secondIndex;
+ BOOL Result = FALSE;
+
+ firstIndex = secondIndex = 0;
+ if(!szMirVerFirst || !szMirVerSecond) return (INT_PTR)NULL; //one of its is not null
+
+ {
+ LPTSTR tszMirVerFirstUp, tszMirVerSecondUp;
+ int iMirVerFirstUpLen, iMirVerSecondUpLen;
+#ifdef UNICODE
+ iMirVerFirstUpLen = MultiByteToWideChar(g_LPCodePage, 0, szMirVerFirst, -1, NULL, 0);
+ iMirVerSecondUpLen = MultiByteToWideChar(g_LPCodePage, 0, szMirVerSecond, -1, NULL, 0);
+#else
+ iMirVerFirstUpLen = strlen(szMirVerFirst) + 1;
+ iMirVerSecondUpLen = strlen(szMirVerSecond) + 1;
+#endif // !UNICODE
+ tszMirVerFirstUp = (LPTSTR)mir_alloc(iMirVerFirstUpLen * sizeof(TCHAR));
+ tszMirVerSecondUp = (LPTSTR)mir_alloc(iMirVerSecondUpLen * sizeof(TCHAR));
+#ifdef UNICODE
+ MultiByteToWideChar(g_LPCodePage, 0, szMirVerFirst, -1, tszMirVerFirstUp, iMirVerFirstUpLen);
+ MultiByteToWideChar(g_LPCodePage, 0, szMirVerSecond, -1, tszMirVerSecondUp, iMirVerSecondUpLen);
+#else
+ strcpy_s(tszMirVerFirstUp, iMirVerFirstUpLen, szMirVerFirst);
+ strcpy_s(tszMirVerSecondUp, iMirVerSecondUpLen, szMirVerSecond);
+#endif // !UNICODE
+ _tcsupr_s(tszMirVerFirstUp, iMirVerFirstUpLen);
+ _tcsupr_s(tszMirVerSecondUp, iMirVerSecondUpLen);
+
+ if(_tcscmp(tszMirVerFirstUp, _T("?")) == 0)
+ firstIndex = UNKNOWN_MASK_NUMBER;
+ else
+ while(firstIndex < DEFAULT_KN_FP_MASK_COUNT)
+ {
+ if(WildCompare(tszMirVerFirstUp, def_kn_fp_mask[firstIndex].szMask))
+ break;
+ firstIndex++;
+ }
+ if(_tcscmp(tszMirVerSecondUp, _T("?")) == 0)
+ secondIndex = UNKNOWN_MASK_NUMBER;
+ else
+ while(secondIndex < DEFAULT_KN_FP_MASK_COUNT)
+ {
+ if(WildCompare(tszMirVerSecondUp, def_kn_fp_mask[secondIndex].szMask))
+ break;
+ secondIndex++;
+ }
+
+ mir_free(tszMirVerFirstUp);
+ mir_free(tszMirVerSecondUp);
+
+ if(firstIndex == secondIndex && firstIndex < DEFAULT_KN_FP_MASK_COUNT)
+ {
+#ifdef UNICODE
+ int iClientDescriptionLen = WideCharToMultiByte(g_LPCodePage, 0, def_kn_fp_mask[firstIndex].szClientDescription, -1, NULL, 0, NULL, NULL);
+ if(iClientDescriptionLen > 0)
+ g_szClientDescription = (LPSTR)mir_realloc(g_szClientDescription, iClientDescriptionLen * sizeof(CHAR));
+ else
+ return (INT_PTR)NULL;
+ WideCharToMultiByte(g_LPCodePage, 0, def_kn_fp_mask[firstIndex].szClientDescription, -1, g_szClientDescription, iClientDescriptionLen, NULL, NULL);
+ return (INT_PTR)g_szClientDescription;
+#else
+ return (INT_PTR)def_kn_fp_mask[firstIndex].szClientDescription;
+#endif // !UNICODE
+ }
+ }
+ return (INT_PTR)NULL;
+}
+
+/*
+* ServiceGetClientIconW
+* MS_FP_GETCLIENTICONW service implementation.
+* wParam - LPWSTR MirVer value to get client for.
+* lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
+* ICON IS ALWAYS COPIED!!!
+*/
+#ifdef UNICODE
+INT_PTR ServiceGetClientIconW(WPARAM wParam, LPARAM lParam)
+{
+ LPWSTR wszMirVer = (LPWSTR)wParam; // MirVer value to get client for.
+/*
+ static HICON hIcon = NULL; // returned HICON
+ if(hIcon)
+ {
+ DestroyIcon(hIcon);
+ hIcon = NULL;
+ }
+*/
+
+ if(wszMirVer == NULL) return 0;
+
+ {
+ HICON hIcon = NULL; // returned HICON
+ int NoCopy = (int)lParam; // noCopy
+ short base, overlay, overlay2, overlay3;
+
+ GetIconsIndexesW(wszMirVer, &base, &overlay, &overlay2, &overlay3);
+
+ if(base != -1)
+ {
+ hIcon = CreateIconFromIndexes(base, overlay, overlay2, overlay3);
+ }
+/*
+ if(hIcon && !NoCopy)
+ return (INT_PTR)CopyIcon(hIcon);
+*/
+ return (INT_PTR)hIcon;
+ }
+}
+
+/*
+ * ServiceSameClientW
+ * MS_FP_SAMECLIENTSW service implementation.
+ * wParam - LPWSTR first MirVer value
+ * lParam - LPWSTR second MirVer value
+ * return pointer to char string - client desription (do not destroy) if clients are same
+ */
+INT_PTR ServiceSameClientsW(WPARAM wParam, LPARAM lParam)
+{
+ LPWSTR wszMirVerFirst = (LPWSTR)wParam; // MirVer value to get client for.
+ LPWSTR wszMirVerSecond = (LPWSTR)lParam; // MirVer value to get client for.
+ int firstIndex, secondIndex;
+ BOOL Result = FALSE;
+
+ firstIndex = secondIndex = 0;
+ if(!wszMirVerFirst || !wszMirVerSecond) return (INT_PTR)NULL; //one of its is not null
+
+ {
+ LPWSTR wszMirVerFirstUp, wszMirVerSecondUp;
+ size_t iMirVerFirstUpLen, iMirVerSecondUpLen;
+
+ iMirVerFirstUpLen = wcslen(wszMirVerFirst) + 1;
+ iMirVerSecondUpLen = wcslen(wszMirVerSecond) + 1;
+
+ wszMirVerFirstUp = (LPWSTR)mir_alloc(iMirVerFirstUpLen * sizeof(WCHAR));
+ wszMirVerSecondUp = (LPWSTR)mir_alloc(iMirVerSecondUpLen * sizeof(WCHAR));
+
+ wcscpy_s(wszMirVerFirstUp, iMirVerFirstUpLen, wszMirVerFirst);
+ wcscpy_s(wszMirVerSecondUp, iMirVerSecondUpLen, wszMirVerSecond);
+
+ _wcsupr_s(wszMirVerFirstUp, iMirVerFirstUpLen);
+ _wcsupr_s(wszMirVerSecondUp, iMirVerSecondUpLen);
+
+ if(wcscmp(wszMirVerFirstUp, L"?") == 0)
+ firstIndex = UNKNOWN_MASK_NUMBER;
+ else
+ while(firstIndex < DEFAULT_KN_FP_MASK_COUNT)
+ {
+ if(WildCompareW(wszMirVerFirstUp, def_kn_fp_mask[firstIndex].szMask))
+ break;
+ firstIndex++;
+ }
+ if(wcscmp(wszMirVerSecondUp, L"?") == 0)
+ secondIndex = UNKNOWN_MASK_NUMBER;
+ else
+ while(secondIndex < DEFAULT_KN_FP_MASK_COUNT)
+ {
+ if(WildCompareW(wszMirVerSecondUp, def_kn_fp_mask[secondIndex].szMask))
+ break;
+ secondIndex++;
+ }
+
+ mir_free(wszMirVerFirstUp);
+ mir_free(wszMirVerSecondUp);
+
+ if(firstIndex == secondIndex && firstIndex < DEFAULT_KN_FP_MASK_COUNT)
+ {
+ return (INT_PTR)def_kn_fp_mask[firstIndex].szClientDescription;
+ }
+ }
+ return (INT_PTR)NULL;
+}
+#endif // !UNICODE
+
+/******************************************************************************
+ * Futher routines is for creating joined 'overlay' icons.
+ ******************************************************************************/
+
+ /*
+ * CreateBitmap32 - Create DIB 32 bitmap with sizes cx*cy
+ */
+
+HBITMAP __inline CreateBitmap32(int cx, int cy)
+{
+ return CreateBitmap32Point(cx, cy, NULL);
+}
+
+ /*
+ * CreateBitmap32 - Create DIB 32 bitmap with sizes cx*cy and put reference
+ * to new bitmap pixel image memory area to void ** bits
+ */
+HBITMAP FASTCALL CreateBitmap32Point(int cx, int cy, LPVOID* bits)
+{
+ BITMAPINFO bmpi = { 0 };
+ LPVOID ptPixels = NULL;
+ HBITMAP DirectBitmap;
+
+ if(cx < 0 || cy < 0) return NULL;
+
+ bmpi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bmpi.bmiHeader.biWidth = cx;
+ bmpi.bmiHeader.biHeight = cy;
+ bmpi.bmiHeader.biPlanes = 1;
+// bmpi.bmiHeader.biCompression = BI_RGB;
+ bmpi.bmiHeader.biBitCount = 32;
+
+ DirectBitmap = CreateDIBSection(NULL,
+ &bmpi,
+ DIB_RGB_COLORS,
+ &ptPixels,
+ NULL, 0);
+ GdiFlush();
+ if(ptPixels) memset(ptPixels, 0, cx * cy * 4);
+ if(bits != NULL) *bits = ptPixels;
+
+ return DirectBitmap;
+}
+
+/*
+* checkHasAlfa - checks if image has at least one BYTE in alpha channel
+* that is not a 0. (is image real 32 bit or just 24 bit)
+*/
+BOOL FASTCALL checkHasAlfa(LPBYTE from, int width, int height)
+{
+ LPDWORD pt = (LPDWORD)from;
+ LPDWORD lim = pt + width * height;
+ while(pt < lim)
+ {
+ if(*pt & 0xFF000000)
+ return TRUE;
+ pt++;
+ }
+
+ return FALSE;
+}
+
+/*
+* checkMaskUsed - checks if mask image has at least one that is not a 0.
+* Not sure is it required or not
+*/
+BOOL FASTCALL checkMaskUsed(LPBYTE from)
+{
+ int i;
+ for(i = 0; i < 16 * 16 / 8; i++)
+ {
+ if(from[i] != 0) return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+* GetMaskBit - return value of apropriate mask bit in line at x position
+*/
+BOOL __inline GetMaskBit(LPBYTE line, int x)
+{
+ return ((*(line + (x >> 3))) & (0x01 << (7 - (x & 0x07)))) != 0;
+}
+
+/*
+* blend - alpha blend ARGB values of 2 pixels. X1 - underlaying,
+* X2 - overlaying points.
+*/
+DWORD FASTCALL blend(DWORD X1,DWORD X2)
+{
+ RGBA* q1 = (RGBA*)&X1;
+ RGBA* q2 = (RGBA*)&X2;
+ BYTE a_1 = ~q1->a;
+ BYTE a_2 = ~q2->a;
+ WORD am = q1->a * a_2;
+
+ WORD ar = q1->a + ((a_1 * q2->a) / 255);
+ // if a2 more than 0 than result should be more
+ // or equal (if a1==0) to a2, else in combination
+ // with mask we can get here black points
+
+ ar = (q2->a > ar) ? q2->a : ar;
+
+ if(ar == 0) return 0;
+
+ {
+ WORD arm = ar * 255;
+ WORD rr = ((q1->r * am + q2->r * q2->a * 255)) / arm;
+ WORD gr = ((q1->g * am + q2->g * q2->a * 255)) / arm;
+ WORD br = ((q1->b * am + q2->b * q2->a * 255)) / arm;
+ return (ar << 24) | (rr << 16) | (gr << 8) | br;
+ }
+}
+
+/*
+* CreateJoinedIcon - creates new icon by drawing hTop over hBottom.
+*/
+HICON FASTCALL CreateJoinedIcon(HICON hBottom, HICON hTop)
+{
+ BOOL drawn = FALSE;
+ HDC tempDC, tempDC2, tempDC3;
+ HICON res = NULL;
+ HBITMAP oImage,nImage;
+ HBITMAP nMask, hbm, obmp, obmp2;
+ LPBYTE ptPixels = NULL;
+ ICONINFO iNew = { 0 };
+ BYTE p[32] = { 0 };
+
+ tempDC = CreateCompatibleDC(NULL);
+ nImage = CreateBitmap32Point(16, 16, (LPVOID*)&ptPixels);
+ oImage = (HBITMAP)SelectObject(tempDC, nImage);
+
+// if(ptPixels) memset(ptPixels, 0, 16 * 16 * 4);
+
+ if(IsWinVerXPPlus())
+ {
+ ICONINFO iciBottom = { 0 };
+ ICONINFO iciTop = { 0 };
+
+ BITMAP bmp_top = { 0 };
+ BITMAP bmp_top_mask = { 0 };
+
+ BITMAP bmp_bottom = { 0 };
+ BITMAP bmp_bottom_mask = { 0 };
+
+ GetIconInfo(hBottom, &iciBottom);
+ GetObject(iciBottom.hbmColor, sizeof(BITMAP), &bmp_bottom);
+ GetObject(iciBottom.hbmMask, sizeof(BITMAP), &bmp_bottom_mask);
+
+ GetIconInfo(hTop, &iciTop);
+ GetObject(iciTop.hbmColor, sizeof(BITMAP), &bmp_top);
+ GetObject(iciTop.hbmMask, sizeof(BITMAP), &bmp_top_mask);
+
+ if(bmp_bottom.bmBitsPixel == 32 && bmp_top.bmBitsPixel == 32)
+ {
+ LPBYTE BottomBuffer, TopBuffer, BottomMaskBuffer, TopMaskBuffer;
+ LPBYTE bb, tb, bmb, tmb;
+ LPBYTE db = ptPixels;
+ int vstep_d = 16 * 4;
+ int vstep_b = bmp_bottom.bmWidthBytes;
+ int vstep_t = bmp_top.bmWidthBytes;
+ int vstep_bm = bmp_bottom_mask.bmWidthBytes;
+ int vstep_tm = bmp_top_mask.bmWidthBytes;
+
+ if(bmp_bottom.bmBits)
+ bb = BottomBuffer = (LPBYTE)bmp_bottom.bmBits;
+ else
+ {
+ BottomBuffer = (LPBYTE)_alloca(bmp_bottom.bmHeight * bmp_bottom.bmWidthBytes);
+ GetBitmapBits(iciBottom.hbmColor, bmp_bottom.bmHeight * bmp_bottom.bmWidthBytes, BottomBuffer);
+ bb = BottomBuffer + vstep_b * (bmp_bottom.bmHeight - 1);
+ vstep_b = -vstep_b;
+ }
+ if(bmp_top.bmBits)
+ tb = TopBuffer = (LPBYTE)bmp_top.bmBits;
+ else
+ {
+ TopBuffer = (LPBYTE)_alloca(bmp_top.bmHeight * bmp_top.bmWidthBytes);
+ GetBitmapBits(iciTop.hbmColor, bmp_top.bmHeight * bmp_top.bmWidthBytes, TopBuffer);
+ tb = TopBuffer + vstep_t * (bmp_top.bmHeight - 1);
+ vstep_t = -vstep_t;
+ }
+ if(bmp_bottom_mask.bmBits)
+ bmb = BottomMaskBuffer = (LPBYTE)bmp_bottom_mask.bmBits;
+ else
+ {
+ BottomMaskBuffer = (LPBYTE)_alloca(bmp_bottom_mask.bmHeight * bmp_bottom_mask.bmWidthBytes);
+ GetBitmapBits(iciBottom.hbmMask, bmp_bottom_mask.bmHeight * bmp_bottom_mask.bmWidthBytes, BottomMaskBuffer);
+ bmb = BottomMaskBuffer + vstep_bm * (bmp_bottom_mask.bmHeight - 1);
+ vstep_bm = -vstep_bm;
+ }
+ if(bmp_top_mask.bmBits)
+ tmb = TopMaskBuffer = (LPBYTE)bmp_top_mask.bmBits;
+ else
+ {
+ TopMaskBuffer = (LPBYTE)_alloca(bmp_top_mask.bmHeight * bmp_top_mask.bmWidthBytes);
+ GetBitmapBits(iciTop.hbmMask, bmp_top_mask.bmHeight * bmp_top_mask.bmWidthBytes, TopMaskBuffer);
+ tmb = TopMaskBuffer + vstep_tm * (bmp_top_mask.bmHeight - 1);
+ vstep_tm = -vstep_tm;
+ }
+ {
+ int x; int y;
+ BOOL topHasAlpha = checkHasAlfa(TopBuffer, bmp_top.bmWidth, bmp_top.bmHeight);
+ BOOL bottomHasAlpha = checkHasAlfa(BottomBuffer, bmp_bottom.bmWidth, bmp_bottom.bmHeight);
+ BOOL topMaskUsed = !topHasAlpha && checkMaskUsed(TopMaskBuffer);
+ BOOL bottomMaskUsed = !bottomHasAlpha && checkMaskUsed(BottomMaskBuffer);
+
+ for(y = 0; y < 16; y++)
+ {
+ for(x = 0; x < 16; x++)
+ {
+ DWORD bottom_d = ((LPDWORD)bb)[x];
+ DWORD top_d = ((LPDWORD)tb)[x];
+
+ if(topMaskUsed)
+ {
+ if(GetMaskBit(tmb, x))
+ top_d &= 0x00FFFFFF;
+ else
+ top_d |= 0xFF000000;
+ }
+ else if(!topHasAlpha)
+ top_d |= 0xFF000000;
+
+ if(bottomMaskUsed)
+ {
+ if(GetMaskBit(bmb, x))
+ bottom_d &= 0x00FFFFFF;
+ else
+ bottom_d |= 0xFF000000;
+ }
+ else if(!bottomHasAlpha)
+ bottom_d |= 0xFF000000;
+
+ ((LPDWORD)db)[x] = blend(bottom_d, top_d);
+ }
+ bb += vstep_b;
+ tb += vstep_t;
+ bmb += vstep_bm;
+ tmb += vstep_tm;
+ db += vstep_d;
+ }
+ }
+
+ drawn = TRUE;
+ }
+
+ DeleteObject(iciBottom.hbmColor);
+ DeleteObject(iciTop.hbmColor);
+ DeleteObject(iciBottom.hbmMask);
+ DeleteObject(iciTop.hbmMask);
+ }
+
+ if(!drawn)
+ {
+ DrawIconEx(tempDC, 0, 0, hBottom, 16, 16, 0, NULL, DI_NORMAL);
+ DrawIconEx(tempDC, 0, 0, hTop, 16, 16, 0, NULL, DI_NORMAL);
+ }
+
+ nMask = CreateBitmap(16, 16, 1, 1, p);
+ tempDC2 = CreateCompatibleDC(NULL);
+ tempDC3 = CreateCompatibleDC(NULL);
+ hbm = CreateCompatibleBitmap(tempDC3, 16, 16);
+ obmp = (HBITMAP)SelectObject(tempDC2, nMask);
+ obmp2 = (HBITMAP)SelectObject(tempDC3, hbm);
+ DrawIconEx(tempDC2, 0, 0, hBottom, 16, 16, 0, NULL, DI_MASK);
+ DrawIconEx(tempDC3, 0, 0, hTop, 16, 16, 0, NULL, DI_MASK);
+ BitBlt(tempDC2, 0, 0, 16, 16, tempDC3, 0, 0, SRCAND);
+
+ GdiFlush();
+
+ SelectObject(tempDC2, obmp);
+ DeleteDC(tempDC2);
+
+ SelectObject(tempDC3, obmp2);
+ DeleteDC(tempDC3);
+
+ SelectObject(tempDC, oImage);
+ DeleteDC(tempDC);
+
+ DeleteObject(hbm);
+
+ iNew.fIcon = TRUE;
+ iNew.hbmColor = nImage;
+ iNew.hbmMask = nMask;
+ res = CreateIconIndirect(&iNew);
+
+ DeleteObject(nImage);
+ DeleteObject(nMask);
+
+ return res;
+}
+
+HANDLE FASTCALL GetIconIndexFromFI(LPTSTR szMirVer)
+{
+ int i;
+ DWORD val;
+ HANDLE hFoundImage = INVALID_HANDLE_VALUE;
+ short base, overlay, overlay2, overlay3;
+
+ GetIconsIndexes(szMirVer, &base, &overlay, &overlay2, &overlay3);
+
+ if(base == -1 || nFICount == 0xFF) return hFoundImage;
+
+ // MAX: 1024 + 256 + 128 + 128
+ val = (base << 22) | ((overlay & 0xFF) << 14) | ((overlay2 & 0x7F) << 7) | (overlay3 & 0x7F);
+
+ for(i = 0; i < nFICount; i++)
+ {
+ if(fiList[i].dwArray == val)
+ {
+ hFoundImage = fiList[i].hRegisteredImage;
+ break;
+ }
+ }
+
+ if(hFoundImage == INVALID_HANDLE_VALUE && i == nFICount) //not found - then add
+ {
+
+ HICON hIcon = CreateIconFromIndexes(base, overlay, overlay2, overlay3);
+
+ fiList = (FOUNDINFO*)mir_realloc(fiList, sizeof(FOUNDINFO) * (nFICount + 1));
+ fiList[nFICount].dwArray = val;
+
+ if(hIcon != NULL)
+ {
+ fiList[nFICount].hRegisteredImage = (hIcon) ? (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)hIcon, 0) : INVALID_HANDLE_VALUE;
+
+ hFoundImage = fiList[nFICount].hRegisteredImage;
+
+ DestroyIcon(hIcon);
+ }
+ else
+ {
+ fiList[nFICount].hRegisteredImage = INVALID_HANDLE_VALUE;
+ }
+ nFICount++;
+ }
+
+ return hFoundImage;
+}
+
+VOID FASTCALL ClearFI()
+{
+ if(fiList != NULL)
+ mir_free(fiList);
+ fiList = NULL;
+ nFICount = 0;
+ return;
+}
diff --git a/plugins/FingerPrintModPlus/src/fingerprints.h b/plugins/FingerPrintModPlus/src/fingerprints.h
new file mode 100644
index 0000000000..9950d9dd7e
--- /dev/null
+++ b/plugins/FingerPrintModPlus/src/fingerprints.h
@@ -0,0 +1,748 @@
+/*
+Fingerprint Mod+ (client version) icons module for Miranda IM
+
+Copyright © 2006-2007 Artem Shpynov aka FYR, Bio, Faith Healer. 2009-2010 HierOS
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+/************************************************************************/
+/* This file contains data about appropriate MirVer values */
+/************************************************************************/
+
+/*
+* NOTE: Masks can contain '*' or '?' wild symbols
+* Asterics '*' symbol covers 'empty' symbol too e.g WildCompare("Tst","T*st*"), returns TRUE
+* In order to handle situation 'at least one any sybol' use '?*' combination:
+* e.g WildCompare("Tst","T?*st*"), returns FALSE, but both WildCompare("Test","T?*st*") and
+* WildCompare("Teeest","T?*st*") return TRUE.
+*
+* Function is 'dirt' case insensitive (it is ignore 5th bit (0x20) so it is no difference
+* beetween some symbols. But it is faster than valid converting to uppercase.
+*
+* Mask can contain several submasks. In this case each submask (including first)
+* should start from '|' e.g: "|first*submask|second*mask".
+*
+* ORDER OF RECORDS IS IMPORTANT: system search first suitable mask and returns it.
+* e.g. if MirVer is "Miranda IM" and first mask is "*im*" and second is "Miranda *" the
+* result will be client associated with first mask, not second!
+* So in order to avoid such situation, place most generalised masks to latest place.
+*
+* In order to get "Unknown" client, last mask should be "?*".
+*/
+
+KN_FP_MASK def_kn_fp_mask[] =
+{// IconName Mask Icon caption NULL ICON_RESOURCE_ID
+//#########################################################################################################################################
+//######################################################### MirandaIM clients #############################################################
+//#########################################################################################################################################
+ { "client_Miranda_666", _T("Miranda*6.6.6*"), _T("Miranda evil"), _T("ClientIcons_General"), IDI_MIRANDA_666, MIRANDA_CASE },
+ { "client_Miranda_010U", _T("|Miranda IM*0.10*Unicode*")
+ _T("|Miranda IM*Unicode*0.10*"), _T("Miranda v0.10 Unicode"), _T("ClientIcons_General"), IDI_MIRANDA_010U, MIRANDA_CASE },
+ { "client_Miranda_09U", _T("|Miranda IM*0.9*Unicode*")
+ _T("|Miranda IM*Unicode*0.9*"), _T("Miranda v0.9 Unicode"), _T("ClientIcons_General"), IDI_MIRANDA_09U, MIRANDA_CASE },
+ { "client_Miranda_08U", _T("|Miranda IM*0.8*Unicode*")
+ _T("|Miranda IM*Unicode*0.8*"), _T("Miranda v0.8 Unicode"), _T("ClientIcons_General"), IDI_MIRANDA_08U, MIRANDA_CASE },
+ { "client_Miranda_07U", _T("|Miranda IM*0.7*Unicode*")
+ _T("|Miranda IM*Unicode*0.7*"), _T("Miranda v0.7 Unicode"), _T("ClientIcons_General"), IDI_MIRANDA_07U, MIRANDA_CASE },
+ { "client_Miranda_06U", _T("|Miranda IM*0.6*Unicode*")
+ _T("|Miranda IM*Unicode*0.6*"), _T("Miranda v0.6 Unicode"), _T("ClientIcons_General"), IDI_MIRANDA_06U, MIRANDA_CASE },
+ { "client_Miranda_05U", _T("|Miranda IM*0.5*Unicode*")
+ _T("|Miranda IM*Unicode*0.5*"), _T("Miranda v0.5 Unicode"), _T("ClientIcons_General"), IDI_MIRANDA_05U, MIRANDA_CASE },
+ { "client_Miranda_U", _T("*Miranda IM*Unicode*"), _T("Miranda Unicode"), _T("ClientIcons_General"), IDI_MIRANDA_U, MIRANDA_CASE },
+ { "client_Miranda_010", _T("*Miranda IM*0.10*"), _T("Miranda v0.10"), _T("ClientIcons_General"), IDI_MIRANDA_010, MIRANDA_CASE },
+ { "client_Miranda_09", _T("*Miranda IM*0.9*"), _T("Miranda v0.9"), _T("ClientIcons_General"), IDI_MIRANDA_09, MIRANDA_CASE },
+ { "client_Miranda_08", _T("*Miranda IM*0.8*"), _T("Miranda v0.8"), _T("ClientIcons_General"), IDI_MIRANDA_08, MIRANDA_CASE },
+ { "client_Miranda_07", _T("*Miranda IM*0.7*"), _T("Miranda v0.7"), _T("ClientIcons_General"), IDI_MIRANDA_07, MIRANDA_CASE },
+ { "client_Miranda_06", _T("*Miranda IM*0.6*"), _T("Miranda v0.6"), _T("ClientIcons_General"), IDI_MIRANDA_06, MIRANDA_CASE },
+ { "client_Miranda_05", _T("*Miranda IM*0.5*"), _T("Miranda v0.5"), _T("ClientIcons_General"), IDI_MIRANDA_05, MIRANDA_CASE },
+ { "client_Miranda_04", _T("*Miranda IM*0.4*"), _T("Miranda v0.4"), _T("ClientIcons_General"), IDI_MIRANDA_04, MIRANDA_CASE },
+ { "client_Miranda_Unknown", _T("|*Miranda*|*Mira*"), _T("Miranda IM"), _T("ClientIcons_General"), IDI_MIRANDA_UNKNOWN, MIRANDA_CASE },
+
+//#########################################################################################################################################
+//###################################################### Multi-protocol clients ###########################################################
+//#########################################################################################################################################
+ { "client_SIM_Win32_old", _T("|^*SIM*0.9.4*|^*SIM*0.9.5*")
+ _T("|^*SIM*0.9.6*|^*SIM*0.9.7*")
+ _T("|*SIM*Win32"), _T("SIM (Win32) old"), _T("ClientIcons_Multiprotocols"), IDI_SIM_WIN_OLD, MULTIPROTOCOL_CASE },
+ { "client_SIM_MacOS_old", _T("|^*SIM*0.9.4*|^*SIM*0.9.5*")
+ _T("|^*SIM*0.9.6*|^*SIM*0.9.7*")
+ _T("|*SIM*MacOS"), _T("SIM (MacOS) old"), _T("ClientIcons_Multiprotocols"), IDI_SIM_MACOSX_OLD, MULTIPROTOCOL_CASE },
+ { "client_SIM_Linux_old", _T("SIM*?.8.?"), _T("SIM (Linux) old"), _T("ClientIcons_Multiprotocols"), IDI_SIM_LINUX_OLD, MULTIPROTOCOL_CASE },
+ { "client_SIM_old", _T("|^*SIM*0.9.4*|^*SIM*0.9.5*")
+ _T("|^*SIM*0.9.6*|^*SIM*0.9.7*|^SIM")
+ _T("|*SIM*Simp*|^*Simp*|*SIM*"), _T("SIM (others) old"), _T("ClientIcons_Multiprotocols"), IDI_SIM_OLD, MULTIPROTOCOL_CASE },
+
+ { "client_SIM_Win32", _T("|*SIM*Win32"), _T("SIM (Win32)"), _T("ClientIcons_Multiprotocols"), IDI_SIM_WIN, MULTIPROTOCOL_CASE },
+ { "client_SIM_MacOSX", _T("|*SIM*MacOS"), _T("SIM (MacOS)"), _T("ClientIcons_Multiprotocols"), IDI_SIM_MACOSX, MULTIPROTOCOL_CASE },
+ { "client_SIM_Linux", _T("SIM*?.9.?"), _T("SIM (Linux)"), _T("ClientIcons_Multiprotocols"), IDI_SIM_LINUX, MULTIPROTOCOL_CASE },
+ { "client_SIM", _T("|*SIM*"), _T("SIM (others)"), _T("ClientIcons_Multiprotocols"), IDI_SIM, MULTIPROTOCOL_CASE },
+
+ { "client_BayanICQ", _T("|*BayanICQ*|*barobin*"), _T("BayanICQ"), _T("ClientIcons_Multiprotocols"), IDI_BAYANICQ, MULTIPROTOCOL_CASE },
+
+ { "client_Adium", _T("Adium*"), _T("Adium"), _T("ClientIcons_Multiprotocols"), IDI_ADIUM, MULTIPROTOCOL_CASE },
+ { "client_Trillian_Astra", _T("Trillian*Astra*"), _T("Trillian Astra"), _T("ClientIcons_Multiprotocols"), IDI_TRILLIAN_ASTRA, MULTIPROTOCOL_CASE },
+ { "client_Trillian_Pro", _T("Trillian*Pro*"), _T("Trillian Pro"), _T("ClientIcons_Multiprotocols"), IDI_TRILLIAN_PRO, MULTIPROTOCOL_CASE },
+ { "client_Trillian", _T("|Trillian*|http://trillian.im/*"), _T("Trillian"), _T("ClientIcons_Multiprotocols"), IDI_TRILLIAN, MULTIPROTOCOL_CASE },
+ { "client_Gaim", _T("*gaim*"), _T("Gaim (libgaim)"), _T("ClientIcons_Multiprotocols"), IDI_GAIM, MULTIPROTOCOL_CASE },
+ { "client_Pidgin", _T("|*Pidgin*|libpurple*|Purple*"), _T("Pidgin (libpurple) (ex-Gaim)"), _T("ClientIcons_Multiprotocols"), IDI_PIDGIN, MULTIPROTOCOL_CASE },
+ { "client_Pigeon", _T("*PIGEON*"), _T("PIGEON!"), _T("ClientIcons_Multiprotocols"), IDI_PIGEON, MULTIPROTOCOL_CASE },
+ { "client_Kopete", _T("|Kopete*|http://kopete.kde.org*"), _T("Kopete"), _T("ClientIcons_Multiprotocols"), IDI_KOPETE, MULTIPROTOCOL_CASE },
+ { "client_IM2", _T("IM2*"), _T("IM2"), _T("ClientIcons_Multiprotocols"), IDI_IM2, MULTIPROTOCOL_CASE },
+
+ { "client_CenterICQ", _T("Centericq*"), _T("Centericq"), _T("ClientIcons_Multiprotocols"), IDI_CENTERICQ, MULTIPROTOCOL_CASE },
+ { "client_Meebo", _T("Meebo*"), _T("Meebo"), _T("ClientIcons_Multiprotocols"), IDI_MEEBO, MULTIPROTOCOL_CASE },
+
+ { "client_AgileMessenger", _T("*Agile Messenger*"), _T("Agile Messenger"), _T("ClientIcons_Multiprotocols"), IDI_AGILE, MULTIPROTOCOL_CASE },
+ { "client_Prelude", _T("Prelude*"), _T("Prelude"), _T("ClientIcons_Multiprotocols"), IDI_PRELUDE, MULTIPROTOCOL_CASE },
+ { "client_IMPlus", _T("|IM+*|IMPLUS*|IM *"), _T("IM+"), _T("ClientIcons_Multiprotocols"), IDI_IMPLUS, MULTIPROTOCOL_CASE },
+ { "client_uIM", _T("uIM*"), _T("uIM"), _T("ClientIcons_Multiprotocols"), IDI_UIM, MULTIPROTOCOL_CASE },
+ { "client_Inlux", _T("*Inlux*"), _T("Inlux Messenger"), _T("ClientIcons_Multiprotocols"), IDI_INLUX, MULTIPROTOCOL_CASE },
+ { "client_Qnext", _T("QNext*"), _T("Qnext"), _T("ClientIcons_Multiprotocols"), IDI_QNEXT, MULTIPROTOCOL_CASE },
+ { "client_mChat", _T("|mChat*|gsICQ*|http://mchat.mgslab.com*"), _T("mChat"), _T("ClientIcons_Multiprotocols"), IDI_MCHAT, MULTIPROTOCOL_CASE },
+ { "client_natSiemens", _T("|SieJC*|NatICQ*|Siemens*Client*"), _T("Siemens Native ICQ/Jabber Client"), _T("ClientIcons_Multiprotocols"), IDI_NATSIEMENS, MULTIPROTOCOL_CASE },
+ { "client_Fring", _T("*fring*"), _T("Fring"), _T("ClientIcons_Multiprotocols"), IDI_FRING, MULTIPROTOCOL_CASE },
+ { "client_eBuddy", _T("|*eBuddy*|*eMessenger*"), _T("eBuddy"), _T("ClientIcons_Multiprotocols"), IDI_EBUDDY, MULTIPROTOCOL_CASE },
+ { "client_Meetro", _T("Meetro*"), _T("Meetro"), _T("ClientIcons_Multiprotocols"), IDI_MEETRO, MULTIPROTOCOL_CASE },
+ { "client_EasyMessage", _T("Easy*Message*"), _T("Easy Message"), _T("ClientIcons_Multiprotocols"), IDI_EASYMESSAGE, MULTIPROTOCOL_CASE },
+ { "client_BitlBee", _T("BitlBee*"), _T("BitlBee"), _T("ClientIcons_Multiprotocols"), IDI_BITLBEE, MULTIPROTOCOL_CASE },
+ { "client_Proteus", _T("*Proteus*"), _T("Proteus"), _T("ClientIcons_Multiprotocols"), IDI_PROTEUS, MULTIPROTOCOL_CASE },
+ { "client_iChat", _T("|iChat*")
+ _T("|http://www.apple.com/ichat/caps*"), _T("iChat"), _T("ClientIcons_Multiprotocols"), IDI_ICHAT, MULTIPROTOCOL_CASE },
+ { "client_EKG2", _T("*ekg*2*"), _T("EKG2"), _T("ClientIcons_Multiprotocols"), IDI_EKG2, MULTIPROTOCOL_CASE },
+ { "client_Ayttm", _T("*Ayttm*"), _T("Ayttm"), _T("ClientIcons_Multiprotocols"), IDI_AYTTM, MULTIPROTOCOL_CASE },
+ { "client_qutIM", _T("*qutIM*"), _T("qutIM"), _T("ClientIcons_Multiprotocols"), IDI_QUTIM, MULTIPROTOCOL_CASE },
+ { "client_YamiGo", _T("YamiGo*"), _T("YamiGo"), _T("ClientIcons_Multiprotocols"), IDI_YAMIGO, MULTIPROTOCOL_CASE },
+ { "client_QIP_2012", _T("|QIP 2012*|http://qip.ru/caps*"), _T("QIP 2012"), _T("ClientIcons_Multiprotocols"), IDI_QIP_INFIUM, MULTIPROTOCOL_CASE },
+ { "client_QIP_Infium", _T("|QIP Infium*|http://qip*"), _T("QIP Infium"), _T("ClientIcons_Multiprotocols"), IDI_QIP_INFIUM, MULTIPROTOCOL_CASE },
+ { "client_QIP_2010", _T("|QIP 2010*|http://2010.qip.ru*"), _T("QIP 2010"), _T("ClientIcons_Multiprotocols"), IDI_QIP_2010, MULTIPROTOCOL_CASE },
+ { "client_QIP_PDA", _T("|QIP PDA*|http://pda.qip.ru/caps*")
+ _T("|*QIP Mobile*"), _T("QIP Mobile"), _T("ClientIcons_Multiprotocols"), IDI_QIP_PDA, MULTIPROTOCOL_CASE },
+ { "client_CitronIM", _T("*Citron IM*"), _T("Citron IM"), _T("ClientIcons_Multiprotocols"), IDI_CITRON, MULTIPROTOCOL_CASE },
+ { "client_Palringo", _T("|*Palringo*|http://palringo.com/caps*"), _T("Palringo"), _T("ClientIcons_Multiprotocols"), IDI_PALRINGO, MULTIPROTOCOL_CASE },
+ { "client_ImoIm", _T("|*imo.im*"), _T("Imo.im"), _T("ClientIcons_Multiprotocols"), IDI_IMOIM, MULTIPROTOCOL_CASE },
+ { "client_OneTeam", _T("*OneTeam*"), _T("OneTeam"), _T("ClientIcons_Multiprotocols"), IDI_ONETEAM, MULTIPROTOCOL_CASE },
+ { "client_Python", _T("Py*t"), _T("Python transport clients"), _T("ClientIcons_Multiprotocols"), IDI_PYTHON, MULTIPROTOCOL_CASE },
+ { "client_Instantbird", _T("*Instantbird*"), _T("Instantbird"), _T("ClientIcons_Multiprotocols"), IDI_INSTANTBIRD, MULTIPROTOCOL_CASE },
+ { "client_Jimm", _T("|*Jimm*|mobicq*"), _T("Jimm"), _T("ClientIcons_Multiprotocols"), IDI_JIMM, MULTIPROTOCOL_CASE },
+ { "client_Digsby", _T("*Digsby*"), _T("Digsby"), _T("ClientIcons_Multiprotocols"), IDI_DIGSBY, MULTIPROTOCOL_CASE },
+ { "client_Jasmine_IM", _T("|Jasmine IM*|http://jasmineicq.ru/caps*"), _T("Jasmine IM"), _T("ClientIcons_Multiprotocols"), IDI_JASMINEIM, MULTIPROTOCOL_CASE },
+
+//#########################################################################################################################################
+//########################################################### Other ICQ clients ###########################################################
+//#########################################################################################################################################
+ { "client_QIP", _T("QIP*"), _T("QIP"), _T("ClientIcons_ICQ"), IDI_QIP, ICQ_UNOFF_CASE },
+ { "client_&RQ", _T("&RQ*"), _T("&RQ"), _T("ClientIcons_ICQ"), IDI_ANDRQ, ICQ_UNOFF_CASE },
+ { "client_R&Q", _T("R&Q*"), _T("R&Q"), _T("ClientIcons_ICQ"), IDI_RANDQ_NEW, ICQ_UNOFF_CASE },
+ { "client_TICQ", _T("*TICQ*Client*"), _T("TICQ (Delphi lib)"), _T("ClientIcons_ICQ"), IDI_DELPHI, ICQ_UNOFF_CASE },
+ { "client_ICAT", _T("IC@*"), _T("IC@"), _T("ClientIcons_ICQ"), IDI_ICAT, ICQ_UNOFF_CASE },
+ { "client_StrICQ", _T("StrICQ*"), _T("StrICQ"), _T("ClientIcons_ICQ"), IDI_STRICQ, ICQ_UNOFF_CASE },
+ { "client_mICQ", _T("mICQ*"), _T("mICQ"), _T("ClientIcons_ICQ"), IDI_MICQ, ICQ_UNOFF_CASE },
+ { "client_VmICQ", _T("VmICQ*"), _T("VmICQ"), _T("ClientIcons_ICQ"), IDI_VMICQ, ICQ_UNOFF_CASE },
+ { "client_vICQ", _T("vICQ*"), _T("vICQ"), _T("ClientIcons_ICQ"), IDI_VICQ, ICQ_UNOFF_CASE },
+ { "client_YSM", _T("YSM*"), _T("YSM"), _T("ClientIcons_ICQ"), IDI_YSM, ICQ_UNOFF_CASE },
+ { "client_MIP", _T("*MIP*"), _T("MIP"), _T("ClientIcons_ICQ"), IDI_MIP, ICQ_UNOFF_CASE },
+ { "client_D[i]Chat", _T("D[i]Chat*"), _T("D[i]Chat"), _T("ClientIcons_ICQ"), IDI_DICHAT, ICQ_UNOFF_CASE },
+ { "client_Corepager", _T("Core*Pager*"), _T("Core Pager"), _T("ClientIcons_ICQ"), IDI_COREPAGER, ICQ_UNOFF_CASE },
+ { "client_LocID", _T("LocID*"), _T("LocID"), _T("ClientIcons_ICQ"), IDI_LOCID, ICQ_UNOFF_CASE },
+ { "client_Slick", _T("Slick*"), _T("Slick"), _T("ClientIcons_ICQ"), IDI_SLICK, ICQ_UNOFF_CASE },
+ { "client_Smaper", _T("*SmapeR*"), _T("SmapeR"), _T("ClientIcons_ICQ"), IDI_SMAPER, ICQ_UNOFF_CASE },
+ { "client_Anastasia", _T("Anastasia*"), _T("Anastasia"), _T("ClientIcons_ICQ"), IDI_ANASTASIA, ICQ_UNOFF_CASE },
+ { "client_JICQ", _T("*JICQ*"), _T("JICQ"), _T("ClientIcons_ICQ"), IDI_JICQ, ICQ_UNOFF_CASE },
+ { "client_ICQ_2X", _T("ICQ*2.x*"), _T("ICQ 2.x"), _T("ClientIcons_ICQ"), IDI_ICQ2X, ICQ_UNOFF_CASE },
+ { "client_nICQ", _T("nICQ*"), _T("nICQ"), _T("ClientIcons_ICQ"), IDI_NICQ, ICQ_UNOFF_CASE },
+ { "client_kxICQ", _T("kxICQ*"), _T("KxICQ2"), _T("ClientIcons_ICQ"), IDI_KXICQ, ICQ_UNOFF_CASE },
+ { "client_NanoICQ", _T("*Nano*ICQ*"), _T("NanoICQ"), _T("ClientIcons_ICQ"), IDI_NANOICQ, ICQ_UNOFF_CASE },
+ { "client_Yeemp", _T("Yeemp*"), _T("Yeemp"), _T("ClientIcons_ICQ"), IDI_YEEMP, ICQ_UNOFF_CASE },
+ { "client_KM_Aska", _T("*KM*Aska*"), _T("KM Aska"), _T("ClientIcons_ICQ"), IDI_KMASKA, ICQ_UNOFF_CASE },
+ { "client_1und1", _T("|*Pocket*Web*|*1&1*|*1*und*1")
+ _T("|*1*and*1"), _T("1&1"), _T("ClientIcons_ICQ"), IDI_1UND1, ICQ_UNOFF_CASE },
+ { "client_WebICQ", _T("WebICQ*"), _T("WebICQ"), _T("ClientIcons_ICQ"), IDI_WEBICQ, ICQ_UNOFF_CASE },
+ { "client_alicq", _T("alicq*"), _T("Alicq"), _T("ClientIcons_ICQ"), IDI_ALICQ, ICQ_UNOFF_CASE },
+ { "client_Licq", _T("Licq*"), _T("Licq"), _T("ClientIcons_ICQ"), IDI_LICQ, ICQ_UNOFF_CASE },
+ { "client_GnomeICU", _T("GnomeICU*"), _T("GnomeICU"), _T("ClientIcons_ICQ"), IDI_GNOMEICU, ICQ_UNOFF_CASE },
+ { "client_SmartICQ", _T("SmartICQ*"), _T("SmartICQ (via mIRC)"), _T("ClientIcons_ICQ"), IDI_SMARTICQ, ICQ_UNOFF_CASE },
+ { "client_Sticq", _T("stICQ*"), _T("stICQ"), _T("ClientIcons_ICQ"), IDI_STICQ, ICQ_UNOFF_CASE },
+ { "client_GlICQ", _T("GlICQ*"), _T("GlICQ"), _T("ClientIcons_ICQ"), IDI_GLICQ, ICQ_UNOFF_CASE },
+ { "client_libicq2k", _T("libicq2*"), _T("LibICQ/JIT"), _T("ClientIcons_ICQ"), IDI_LIBICQ2000, ICQ_UNOFF_CASE },
+ { "client_IMadering", _T("*IMadering*"), _T("IMadering"), _T("ClientIcons_ICQ"), IDI_IMADERING, ICQ_UNOFF_CASE },
+ { "client_SpamBot", _T("*Spam*Bot*"), _T("Spam Bot"), _T("ClientIcons_ICQ"), IDI_SPAMBOT, ICQ_UNOFF_CASE },
+ { "client_Virus", _T("*Virus*"), _T("Virus (Stration worm)"), _T("ClientIcons_ICQ"), IDI_VIRUS, ICQ_UNOFF_CASE },
+
+//#########################################################################################################################################
+//############################################## Official ICQ clients #####################################################################
+//#########################################################################################################################################
+ { "client_ICQ_Rambler", _T("ICQ*5*Rambler*"), _T("ICQ Rambler (Lite v5)"), _T("ClientIcons_ICQ"), IDI_ICQ_RAMBLER, ICQ_OFF_CASE, TRUE },
+ { "client_ICQ_BigMir", _T("ICQ*bigmir*"), _T("ICQ bigmir.net (Lite v5)"), _T("ClientIcons_ICQ"), IDI_ICQ_BIGMIR, ICQ_OFF_CASE },
+ { "client_ICQ_NetVigator", _T("ICQ*5*Netvigator*"), _T("ICQ Netvigator (Lite v5)"), _T("ClientIcons_ICQ"), IDI_ICQ_NETVIGATOR, ICQ_OFF_CASE, TRUE },
+ { "client_ICQ_Pro7", _T("ICQ*Pro7*"), _T("ICQ ProSieben aka Pro7 (Lite v5)"), _T("ClientIcons_ICQ"), IDI_ICQ_PRO7, ICQ_OFF_CASE, TRUE },
+ { "client_ICQ_Abv", _T("ICQ*Abv*"), _T("ICQ ABV (Lite v5)"), _T("ClientIcons_ICQ"), IDI_ICQ_ABV, ICQ_OFF_CASE },
+ { "client_ICQ_Lite4", _T("ICQ Lite v4*"), _T("ICQ Lite v4"), _T("ClientIcons_ICQ"), IDI_ICQ_LITE4, ICQ_OFF_CASE, TRUE },
+ { "client_ICQ_Lite7", _T("ICQ Lite v7*"), _T("ICQ Lite v7"), _T("ClientIcons_ICQ"), IDI_ICQ_LITE7, ICQ_OFF_CASE, TRUE },
+ { "client_ICQ_6", _T("|ICQ*6*|ICQ*7*"), _T("ICQ v6,ICQ v7"), _T("ClientIcons_ICQ"), IDI_ICQ_6, ICQ_OFF_CASE },
+ { "client_ICQ_98-99", _T("|^*Transport*|ICQ*98*|ICQ*99*|ICQ*2000*")
+ _T("|ICQ*2001*|ICQ*2002*|ICQ*200?a*")
+ _T("|ICQ*2003b*|ICQ*5*|ICQ Lite*|ICQ2Go!*"), _T("ICQ/ICQ2Go!"), _T("ClientIcons_ICQ"), IDI_ICQ, ICQ_OFF_CASE },
+ { "client_ComPad", _T("*ComPad*"), _T("ICQ ComPad"), _T("ClientIcons_ICQ"), IDI_ICQ_COMPAD, ICQ_OFF_CASE },
+ { "client_ICQ4Mac", _T("ICQ for Mac"), _T("ICQ for Mac"), _T("ClientIcons_ICQ"), IDI_ICQ4MAC, ICQ_OFF_CASE, TRUE },
+ { "client_PocketPC", _T("ICQ*Pocket*PC*"), _T("ICQ for PocketPC"), _T("ClientIcons_ICQ"), IDI_ICQ_POCKETPC, ICQ_OFF_CASE },
+
+//#########################################################################################################################################
+//#########################################################¹¹#### Jabber BOTS #¹###########################################################
+//#########################################################################################################################################
+ { "client_juick", _T("*juick*"), _T("Juick"), _T("ClientIcons_Jabber"), IDI_JUICK, JABBER_CASE },
+ { "client_jrudevels", _T("*jrudevels*"), _T("Jrudevels"), _T("ClientIcons_Jabber"), IDI_JRUDEVELS, JABBER_CASE },
+ { "client_whoisbot", _T("whoisbot"), _T("Swissjabber Whois Bot"), _T("ClientIcons_Jabber"), IDI_WHOISBOT, JABBER_CASE },
+ { "client_pjc", _T("|*PJC*|http://pjc.googlecode.com/*"), _T("PHP Jabber Client"), _T("ClientIcons_Jabber"), IDI_PJC, JABBER_CASE },
+ { "client_jdisk", _T("|*jdisk*|JabberDisk*"), _T("Jabber disk"), _T("ClientIcons_Jabber"), IDI_JDISK, JABBER_CASE },
+ { "client_Teabot", _T("|*teabot*|http://teabot.org/bot*|bot"), _T("Teabot"), _T("ClientIcons_Jabber"), IDI_TEABOT, JABBER_CASE },
+ { "client_Psto", _T("*Psto*"), _T("Psto.net"), _T("ClientIcons_Jabber"), IDI_PSTO, JABBER_CASE },
+
+//#########################################################################################################################################
+//############################################################# Jabber clients ############################################################
+//#########################################################################################################################################
+ { "client_Psi", _T("*Psi*"), _T("PSI"), _T("ClientIcons_Jabber"), IDI_PSI, JABBER_CASE },
+ { "client_GTalk_Gadget", _T("*TalkGadget*"), _T("GTalk Gadget"), _T("ClientIcons_Jabber"), IDI_GTALK_GADGET, JABBER_CASE },
+ { "client_orkut", _T("orkut*"), _T("orkut"), _T("ClientIcons_Jabber"), IDI_ORKUT, JABBER_CASE },
+ { "client_iGoogle", _T("iGoogle*"), _T("iGoogle"), _T("ClientIcons_Jabber"), IDI_IGOOGLE, JABBER_CASE },
+ { "client_GMail", _T("|*gmail.*|GMail*"), _T("GMail"), _T("ClientIcons_Jabber"), IDI_GMAIL, JABBER_CASE },
+ { "client_GTalk", _T("|*Talk.v*|*Google*Talk*|*Gtalk*|*-iPhon*"), _T("GoogleTalk aka GTalk"), _T("ClientIcons_Jabber"), IDI_GTALK, JABBER_CASE },
+ { "client_Talkonaut", _T("*Talkonaut*"), _T("Talkonaut"), _T("ClientIcons_Jabber"), IDI_TALKONAUT, JABBER_CASE },
+ { "client_Jajc", _T("|*Jajc*|Just Another Jabber Client"), _T("JAJC"), _T("ClientIcons_Jabber"), IDI_JAJC, JABBER_CASE },
+ { "client_Tkabber", _T("|*Tkabber*|http://tkabber*"), _T("Tkabber"), _T("ClientIcons_Jabber"), IDI_TKABBER, JABBER_CASE },
+ { "client_Exodus", _T("*Exodus*"), _T("Exodus"), _T("ClientIcons_Jabber"), IDI_EXODUS, JABBER_CASE },
+ { "client_Pandion", _T("|*Pandion*|*Ïàíäèîí*"), _T("Pandion"), _T("ClientIcons_Jabber"), IDI_PANDION, JABBER_CASE },
+ { "client_Gush", _T("*Gush*"), _T("Gush"), _T("ClientIcons_Jabber"), IDI_GUSH, JABBER_CASE },
+ { "client_Gabber", _T("*Gabber*"), _T("Gabber"), _T("ClientIcons_Jabber"), IDI_GABBER, JABBER_CASE },
+ { "client_Gajim", _T("*Gajim*"), _T("Gajim"), _T("ClientIcons_Jabber"), IDI_GAJIM, JABBER_CASE },
+ { "client_Spark", _T("*Spark*"), _T("Spark"), _T("ClientIcons_Jabber"), IDI_SPARK, JABBER_CASE },
+ { "client_Beejive", _T("*Beejive*"), _T("Beejive"), _T("ClientIcons_Jabber"), IDI_BEEJIVE, JABBER_CASE },
+
+ { "client_Jabbin", _T("*Jabbin*"), _T("Jabbin"), _T("ClientIcons_Jabber"), IDI_JABBIN, JABBER_CASE },
+ { "client_Papla", _T("*Papla*"), _T("Papla"), _T("ClientIcons_Jabber"), IDI_PAPLA, JABBER_CASE },
+ { "client_JabberZilla", _T("*Zilla*"), _T("JabberZilla"), _T("ClientIcons_Jabber"), IDI_JABBERZILLA, JABBER_CASE },
+ { "client_BombusQD", _T("|*Bombusmod-qd*|*bombusqd*"), _T("BombusQD"), _T("ClientIcons_Jabber"), IDI_BOMBUSQD, JABBER_CASE },
+ { "client_BombusMod", _T("|*Bombus*mod*|*bombusmod*"), _T("BombusMod"), _T("ClientIcons_Jabber"), IDI_BOMBUSMOD, JABBER_CASE },
+ { "client_Bombus", _T("*Bombus*"), _T("Bombus"), _T("ClientIcons_Jabber"), IDI_BOMBUS, JABBER_CASE },
+ { "client_Wildfire", _T("Wildfire*"), _T("Wildfire"), _T("ClientIcons_Jabber"), IDI_WILDFIRE, JABBER_CASE },
+ { "client_M8Jabber", _T("*M8Jabber*"), _T("M8Jabber"), _T("ClientIcons_Jabber"), IDI_M8JABBER, JABBER_CASE },
+ { "client_EMess", _T("*EMess*"), _T("EMess"), _T("ClientIcons_Jabber"), IDI_EMESS, JABBER_CASE },
+
+ { "client_Colibry", _T("Colibry*"), _T("Colibry"), _T("ClientIcons_Jabber"), IDI_COLIBRY, JABBER_CASE },
+
+ { "client_GoTalkMobile", _T("*Go*Talk*Mobile*"), _T("GoTalkMobile"), _T("ClientIcons_Jabber"), IDI_GOTALKMOBILE, JABBER_CASE },
+ { "client_MGTalk", _T("Mobile?\?\?\?\?\?\?\?"), _T("MGTalk"), _T("ClientIcons_Jabber"), IDI_MGTALK, JABBER_CASE },
+ { "client_Colloquy", _T("Colloquy*"), _T("Colloquy"), _T("ClientIcons_Jabber"), IDI_COLLOQUY, JABBER_CASE },
+ { "client_WTW", _T("|http://wtw.k2t.eu*|wtw*"), _T("WTW"), _T("ClientIcons_Jabber"), IDI_WTW, JABBER_CASE },
+ { "client_Spik", _T("Spik*"), _T("Spik"), _T("ClientIcons_Jabber"), IDI_SPIK, JABBER_CASE },
+ { "client_Konnekt", _T("Konnekt*"), _T("Konnekt"), _T("ClientIcons_Jabber"), IDI_KONNEKT, JABBER_CASE },
+ { "client_Vacuum", _T("*Vacuum*"), _T("Vacuum IM"), _T("ClientIcons_Jabber"), IDI_VACUUM, JABBER_CASE },
+
+ { "client_Neos", _T("Neos*"), _T("Neos"), _T("ClientIcons_Jabber"), IDI_NEOS, JABBER_CASE },
+ { "client_GOIM", _T("*GOIM*"), _T("GOIM"), _T("ClientIcons_Jabber"), IDI_GOIM, JABBER_CASE },
+
+ { "client_SoapBox", _T("SoapBox*"), _T("SoapBox"), _T("ClientIcons_Jabber"), IDI_SOAPBOX, JABBER_CASE },
+
+ { "client_MozillaChat", _T("*Mozilla*Chat*"), _T("MozillaChat"), _T("ClientIcons_Jabber"), IDI_MOZILLACHAT, JABBER_CASE },
+ { "client_WannaChat", _T("Wanna*Chat*"), _T("WannaChat"), _T("ClientIcons_Jabber"), IDI_WANNACHAT, JABBER_CASE },
+ { "client_Nitro", _T("Nitro*"), _T("Nitro"), _T("ClientIcons_Jabber"), IDI_NITRO, JABBER_CASE },
+
+ { "client_JBother", _T("*JBother*"), _T("JBother"), _T("ClientIcons_Jabber"), IDI_JBOTHER, JABBER_CASE },
+ { "client_gYaber", _T("gYaber*"), _T("gYaber"), _T("ClientIcons_Jabber"), IDI_GYABER, JABBER_CASE },
+
+ { "client_myJabber", _T("myJabber*"), _T("myJabber"), _T("ClientIcons_Jabber"), IDI_MYJABBER, JABBER_CASE },
+
+ { "client_JabberMSNGR", _T("Jabber Messenger*"), _T("Jabber Messenger"), _T("ClientIcons_Jabber"), IDI_JABBER_MESSENGER, JABBER_CASE },
+ { "client_Jabberwocky", _T("Jabberwocky*"), _T("Jabberwocky (Amiga)"), _T("ClientIcons_Jabber"), IDI_JABBERWOCKY, JABBER_CASE },
+ { "client_TipicIM", _T("Tipic*"), _T("TipicIM"), _T("ClientIcons_Jabber"), IDI_TIPICIM, JABBER_CASE },
+ { "client_Triple", _T("Triple*"), _T("TripleSoftwareIM (TSIM)"), _T("ClientIcons_Jabber"), IDI_TRIPLE_SOFTWARE, JABBER_CASE },
+ { "client_Leaf", _T("*Leaf*"), _T("Leaf Messenger"), _T("ClientIcons_Jabber"), IDI_LEAF, JABBER_CASE },
+
+ { "client_Chatopus", _T("*Chatopus*"), _T("Chatopus"), _T("ClientIcons_Jabber"), IDI_CHATOPUS, JABBER_CASE },
+ { "client_Akeni", _T("*Akeni*"), _T("Akeni"), _T("ClientIcons_Jabber"), IDI_AKENI, JABBER_CASE },
+ { "client_Coccinella", _T("*Coccinella*"), _T("Coccinella"), _T("ClientIcons_Jabber"), IDI_COCCINELLA, JABBER_CASE },
+ { "client_WhisperIM", _T("*Whisper*"), _T("WhisperIM"), _T("ClientIcons_Jabber"), IDI_WHISPERIM, JABBER_CASE },
+ { "client_Wija", _T("*wija*"), _T("Wija"), _T("ClientIcons_Jabber"), IDI_WIJA, JABBER_CASE },
+
+ { "client_JabberFoX", _T("*fox*"), _T("JabberFoX"), _T("ClientIcons_Jabber"), IDI_JABBERFOX, JABBER_CASE },
+
+ { "client_Gossip", _T("*Gossip*"), _T("Gossip"), _T("ClientIcons_Jabber"), IDI_GOSSIP, JABBER_CASE },
+ { "client_Fire", _T("*Fire*"), _T("Fire"), _T("ClientIcons_Jabber"), IDI_FIRE, JABBER_CASE },
+ { "client_Mercury", _T("*Mercury*"), _T("Mercury Messenger"), _T("ClientIcons_Jabber"), IDI_MERCURY_MESSENGER, JABBER_CASE },
+ { "client_BitWise", _T("*BitWise*"), _T("BitWise"), _T("ClientIcons_Jabber"), IDI_BITWISE, JABBER_CASE },
+ { "client_Iruka", _T("*Iruka*"), _T("Iruka"), _T("ClientIcons_Jabber"), IDI_IRUKA, JABBER_CASE },
+
+ { "client_Importal", _T("*Importal*"), _T("Importal"), _T("ClientIcons_Jabber"), IDI_IMPORTAL, JABBER_CASE },
+ { "client_kf", _T("*kf*"), _T("kf jabber"), _T("ClientIcons_Jabber"), IDI_KF, JABBER_CASE },
+ { "client_JClaim", _T("*JClaim*"), _T("JClaim"), _T("ClientIcons_Jabber"), IDI_JCLAIM, JABBER_CASE },
+
+ { "client_Nostromo", _T("*USCSS*Nostromo*"), _T("USCSS Nostromo"), _T("ClientIcons_Jabber"), IDI_NOSTROMO, JABBER_CASE },
+ { "client_LLuna", _T("LLuna*"), _T("LLuna"), _T("ClientIcons_Jabber"), IDI_LLUNA, JABBER_CASE },
+
+ { "client_ChitChat", _T("*Chit*Chat*"), _T("ChitChat"), _T("ClientIcons_Jabber"), IDI_CHITCHAT, JABBER_CASE },
+ { "client_WinJab", _T("WinJab*"), _T("WinJab"), _T("ClientIcons_Jabber"), IDI_WINJAB, JABBER_CASE },
+
+ { "client_JMC", _T("JMC*"), _T("JMC (Jabber Mix Client)"), _T("ClientIcons_Jabber"), IDI_JMC, JABBER_CASE },
+ { "client_BlackBerry", _T("|*Berry*|*ICS?\?\?\?\?\?\?\?"), _T("BlackBerry"), _T("ClientIcons_Jabber"), IDI_BLACKBERRY, JABBER_CASE },
+ { "client_mobber", _T("*mobber*"), _T("mobber"), _T("ClientIcons_Jabber"), IDI_MOBBER, JABBER_CASE },
+ { "client_MCabber", _T("*mcabber*"), _T("MCabber"), _T("ClientIcons_Jabber"), IDI_MCABBER, JABBER_CASE },
+ { "client_Jeti", _T("*Jeti*"), _T("Jeti"), _T("ClientIcons_Jabber"), IDI_JETI, JABBER_CASE },
+ { "client_Gnome", _T("*Gnome*"), _T("Gnome"), _T("ClientIcons_Jabber"), IDI_GNOME, JABBER_CASE },
+ { "client_JabberBeOS", _T("Jabber*BeOS*"), _T("Jabber (BeOS)"), _T("ClientIcons_Jabber"), IDI_JABBER_BEOS, JABBER_CASE },
+
+ { "client_JabberApplet", _T("Jabber*Applet*"), _T("JabberApplet"), _T("ClientIcons_Jabber"), IDI_JABBER_APPLET, JABBER_CASE },
+ { "client_JabberNaut", _T("*Jabber*Naut*"), _T("JabberNaut"), _T("ClientIcons_Jabber"), IDI_JABBERNAUT, JABBER_CASE },
+
+ { "client_moJab", _T("moJab*"), _T("moJab"), _T("ClientIcons_Jabber"), IDI_MOJAB, JABBER_CASE },
+ { "client_Chikka", _T("*Chikka*"), _T("Chikka"), _T("ClientIcons_Jabber"), IDI_CHIKKA, JABBER_CASE },
+
+ { "client_GreenThumb", _T("gReeNtHumB*"), _T("GreenThumb"), _T("ClientIcons_Jabber"), IDI_GREENTHUMB, JABBER_CASE },
+
+ { "client_BellSouth", _T("*BellSouth*"), _T("BellSouth"), _T("ClientIcons_Jabber"), IDI_BELLSOUTH, JABBER_CASE },
+
+ { "client_IMCom", _T("*IMCom*"), _T("IMCom"), _T("ClientIcons_Jabber"), IDI_IMCOM, JABBER_CASE },
+ { "client_BuddySpace", _T("Buddy*Space*"), _T("BuddySpace"), _T("ClientIcons_Jabber"), IDI_BUDDYSPACE, JABBER_CASE },
+ { "client_Kadu", _T("*Kadu*"), _T("Kadu"), _T("ClientIcons_Jabber"), IDI_KADU, JABBER_CASE },
+
+ { "client_Xiffian", _T("Xiffian*"), _T("Xiffian"), _T("ClientIcons_Jabber"), IDI_XIFFIAN, JABBER_CASE },
+ { "client_Mango", _T("Mango*"), _T("Mango"), _T("ClientIcons_Jabber"), IDI_MANGO, JABBER_CASE },
+ { "client_Sky_Messager", _T("Sky*Mess*"), _T("Sky Messager"), _T("ClientIcons_Jabber"), IDI_SKYMESSAGER, JABBER_CASE },
+ { "client_QTJim", _T("*QTJim*"), _T("QTJim"), _T("ClientIcons_Jabber"), IDI_QTJIM, JABBER_CASE },
+ { "client_Tapioca", _T("*Tapioca*"), _T("Tapioca"), _T("ClientIcons_Jabber"), IDI_TAPIOCA, JABBER_CASE },
+ { "client_Telepathy", _T("*Telepathy*"), _T("Telepathy"), _T("ClientIcons_Jabber"), IDI_TELEPATHY, JABBER_CASE },
+ { "client_Landell", _T("*Landell*"), _T("Landell"), _T("ClientIcons_Jabber"), IDI_LANDELL, JABBER_CASE },
+
+ { "client_Octro", _T("*Octro*"), _T("Octro"), _T("ClientIcons_Jabber"), IDI_OCTRO, JABBER_CASE },
+ { "client_Desyr", _T("*Desyr*"), _T("Desyr Messenger"), _T("ClientIcons_Jabber"), IDI_DESYR, JABBER_CASE },
+ { "client_LinQ", _T("*LinQ*"), _T("LinQ"), _T("ClientIcons_Jabber"), IDI_LINQ, JABBER_CASE },
+ { "client_Xeus", _T("*Xeus*"), _T("Xeus"), _T("ClientIcons_Jabber"), IDI_XEUS, JABBER_CASE },
+ { "client_OM", _T("OM*"), _T("OM aka Online Messenger"), _T("ClientIcons_Jabber"), IDI_OM, JABBER_CASE },
+
+ { "client_Interaction", _T("*Interaction*"), _T("Interaction"), _T("ClientIcons_Jabber"), IDI_INTERACTION, JABBER_CASE },
+ { "client_JWGC", _T("|*JWGC*|Jabber *Gram*"), _T("JWGC (Jabber WindowGram Client)"), _T("ClientIcons_Jabber"), IDI_JWGC, JABBER_CASE },
+ { "client_SIP_Comm", _T("*SIP*Communicator*"), _T("SIP Communicator"), _T("ClientIcons_Jabber"), IDI_SIP_COMM, JABBER_CASE },
+ { "client_Bowline", _T("*Bow*line*"), _T("Bowline"), _T("ClientIcons_Jabber"), IDI_BOWLINE, JABBER_CASE },
+ { "client_Vayusphere", _T("*Vayusphere*"), _T("Vayusphere"), _T("ClientIcons_Jabber"), IDI_VAYUSPHERE, JABBER_CASE },
+ { "client_TransactIM", _T("*Transact*"), _T("TransactIM"), _T("ClientIcons_Jabber"), IDI_TRANSACTIM, JABBER_CASE },
+ { "client_laffer", _T("*laffer*"), _T("Laffer"), _T("ClientIcons_Jabber"), IDI_LAFFER, JABBER_CASE },
+
+ { "client_InstanT", _T("*Instan-t*"), _T("Instan-t"), _T("ClientIcons_Jabber"), IDI_INSTANT, JABBER_CASE },
+ { "client_GCN", _T("*GCN*"), _T("GCN"), _T("ClientIcons_Jabber"), IDI_GCN, JABBER_CASE },
+
+ { "client_Conference", _T("Conference*"), _T("Conference Bot (GMail)"), _T("ClientIcons_Jabber"), IDI_CONFERENCE, JABBER_CASE, TRUE },
+
+ { "client_Paltalk", _T("*Paltalk*"), _T("Paltalk"), _T("ClientIcons_Jabber"), IDI_PALTALK, JABBER_CASE },
+ { "client_Twitter", _T("*Twitter*"), _T("Twitter"), _T("ClientIcons_Jabber"), IDI_TWITTER, JABBER_CASE },
+ { "client_SMTPTransport", _T("smtp*transport*"), _T("SMTP Transport"), _T("ClientIcons_Jabber"), IDI_SMTP_TRANSPORT, JABBER_CASE },
+ { "client_studivz", _T("*studivz*"), _T("StudiVZ"), _T("ClientIcons_Jabber"), IDI_STUDIVZ, JABBER_CASE },
+ { "client_schuelervz", _T("*schuelervz*"), _T("SchulerVZ"), _T("ClientIcons_Jabber"), IDI_SCHULERVZ, JABBER_CASE },
+ { "client_meinvz", _T("*meinvz*"), _T("MeinVZ"), _T("ClientIcons_Jabber"), IDI_MEINVZ, JABBER_CASE },
+ { "client_jabbim", _T("*jabbim*"), _T("Jabbim"), _T("ClientIcons_Jabber"), IDI_JABBIM, JABBER_CASE },
+ { "client_yaonline", _T("|*yandex*|*ß.Îíëàéí*|*ßíäåêñ*|*yaonline*"), _T("YA online"), _T("ClientIcons_Jabber"), IDI_YAONLINE, JABBER_CASE },
+ { "client_jabiru", _T("|*Jabiru*|http://jabiru*"), _T("Jabiru"), _T("ClientIcons_Jabber"), IDI_JABIRU, JABBER_CASE },
+ { "client_SworIM", _T("*SworIM*"), _T("SworIM"), _T("ClientIcons_Jabber"), IDI_SWORIM, JABBER_CASE },
+ { "client_Yambi", _T("*Yambi*"), _T("Yambi"), _T("ClientIcons_Jabber"), IDI_YAMBI, JABBER_CASE },
+ { "client_Glu", _T("|*glu*|http://glu.net/*"), _T("Glu"), _T("ClientIcons_Jabber"), IDI_GLU, JABBER_CASE },
+ { "client_Facebook", _T("*Facebook*"), _T("Facebook"), _T("ClientIcons_Jabber"), IDI_FACEBOOK, JABBER_CASE },
+ { "client_WebEx", _T("|http://webex.com/connect /*"), _T("Cisco WebEx Connect"), _T("ClientIcons_Jabber"), IDI_WEBEX, JABBER_CASE },
+ { "client_JWChat", _T("|jwchat*"), _T("JWChat"), _T("ClientIcons_Jabber"), IDI_JWCHAT, JABBER_CASE },
+ { "client_Smack", _T("|http://www.igniterealtime.org/projects/smack/*|*smack*"), _T("Smack"), _T("ClientIcons_Jabber"), IDI_SMACK, JABBER_CASE },
+ { "client_Android", _T("Android *"), _T("Android"), _T("ClientIcons_Jabber"), IDI_ANDROID, JABBER_CASE },
+ { "client_PyICQ-t", _T("|*PyICQ-t*|*pyICQ*|ICQ*Transport*"), _T("PyICQ-t Jabber Transport"), _T("ClientIcons_Jabber"), IDI_PYICQT, JABBER_CASE },
+ { "client_PyAIM-t", _T("|*PyAIM-t*|*pyAIM*"), _T("PyAIM-t Jabber Transport"), _T("ClientIcons_Jabber"), IDI_PYAIMT, JABBER_CASE },
+ { "client_PyMRA-t", _T("|*PyMRA-t*|*pyMRA*|*DRQZ00fz5WP*")
+ _T("|http://svn.xmpp.ru/repos/mrim*|Mrim*"), _T("PyMRA-t Jabber Transport"), _T("ClientIcons_Jabber"), IDI_PYMRAT, JABBER_CASE },
+ { "client_PyMSN-t", _T("|*PyMSN-t*|*pyMSN*"), _T("PyMSN-t Jabber Transport"), _T("ClientIcons_Jabber"), IDI_PYMSNT, JABBER_CASE },
+ { "client_PyIRC-t", _T("|*PyIRC-t*|*pyIRC*"), _T("PyIRC-t Jabber Transport"), _T("ClientIcons_Jabber"), IDI_PYIRCT, JABBER_CASE },
+ { "client_PyYIM-t", _T("|*PyYIM-t*|*pyYIM*"), _T("PyYahoo-t Jabber Transport"), _T("ClientIcons_Jabber"), IDI_PYYAHOOT, JABBER_CASE },
+ { "client_GnuGadu", _T("Gnu Gadu*"), _T("GNU Gadu"), _T("ClientIcons_Jabber"), IDI_GNUGADU, JABBER_CASE },
+ { "client_Eyeball", _T("*Eye*ball*"), _T("Eyeball Chat"), _T("ClientIcons_Jabber"), IDI_EYEBALL_CHAT, JABBER_CASE },
+ { "client_iMov", _T("*imov*"), _T("iMov"), _T("ClientIcons_Jabber"), IDI_IMOV, JABBER_CASE },
+ { "client_iMeem", _T("iMeem*"), _T("iMeem"), _T("ClientIcons_Jabber"), IDI_IMEEM, JABBER_CASE },
+ { "client_AnothRSSBot", _T("|*Anothrbot*|*Anothr Rss Bot*"), _T("Anothr Rss Bot"), _T("ClientIcons_Jabber"), IDI_ANOTHRSSBOT, JABBER_CASE },
+ { "client_Imified", _T("*someresource*"), _T("Imified"), _T("ClientIcons_Jabber"), IDI_IMIFIED, JABBER_CASE },
+ { "client_RenRen", _T("|*WTalkProxy0_0*|*http://talk.xiaonei.com*"), _T("RenRen"), _T("ClientIcons_Jabber"), IDI_RENREN, JABBER_CASE },
+ { "client_Aqq", _T("|http://aqq.eu*|aqq*"), _T("Aqq"), _T("ClientIcons_Jabber"), IDI_AQQ, JABBER_CASE },
+ { "client_LeechCraft", _T("|http://leechcraft.org*|LeechCraft*"), _T("LeechCraft"), _T("ClientIcons_Jabber"), IDI_LEECHCRAFT, JABBER_CASE },
+ { "client_Emas", _T("*.el*"), _T("Emacs"), _T("ClientIcons_Jabber"), IDI_EMACS, JABBER_CASE },
+ { "client_jTalk", _T("|http://jtalk*|jTalk*"), _T("jTalk"), _T("ClientIcons_Jabber"), IDI_JTALK, JABBER_CASE },
+
+//#########################################################################################################################################
+//############################################################### VoIP ####################################################################
+//#########################################################################################################################################
+ { "client_Gizmo", _T("*Gizmo*"), _T("Gizmo"), _T("ClientIcons_VoIP"), IDI_GIZMO, VOIP_CASE },
+ { "client_Zoep", _T("*Zoep*"), _T("Zoep"), _T("ClientIcons_VoIP"), IDI_ZOEP, VOIP_CASE },
+ { "client_WengoPhone", _T("*Wengo*"), _T("WengoPhone"), _T("ClientIcons_VoIP"), IDI_WENGOPHONE, VOIP_CASE },
+
+//#########################################################################################################################################
+//################################################################## Tlen ##################################################################
+//#########################################################################################################################################
+ { "client_Tlen", _T("*Tlen*"), _T("Tlen.pl"), _T("ClientIcons_Tlen"), IDI_TLEN, TLEN_CASE },
+
+//#########################################################################################################################################
+//################################################################## IRC ##################################################################
+//#########################################################################################################################################
+ { "client_KVIrc", _T("*KVIrc*"), _T("KVIrc"), _T("ClientIcons_IRC"), IDI_KVIRC, IRC_CASE },
+ { "client_mIRC", _T("*mIRC*"), _T("mIRC"), _T("ClientIcons_IRC"), IDI_MIRC, IRC_CASE },
+ { "client_Opera", _T("*Opera*"), _T("Opera"), _T("ClientIcons_IRC"), IDI_OPERA, IRC_CASE },
+ { "client_ChatZilla", _T("*ChatZilla*"), _T("ChatZilla"), _T("ClientIcons_IRC"), IDI_CHATZILLA, IRC_CASE },
+ { "client_KSirc", _T("*ksirk*"), _T("KSirc"), _T("ClientIcons_IRC"), IDI_KSIRC, IRC_CASE },
+
+ { "client_xBitch", _T("*xBitch*"), _T("xBitch"), _T("ClientIcons_IRC"), IDI_XBITCH, IRC_CASE },
+ { "client_xChat", _T("*xChat*"), _T("xChat"), _T("ClientIcons_IRC"), IDI_XCHAT, IRC_CASE },
+ { "client_Pirch", _T("*Pirch*"), _T("Pirch"), _T("ClientIcons_IRC"), IDI_PIRCH, IRC_CASE },
+ { "client_pIRC", _T("*pIRC*"), _T("pIRC"), _T("ClientIcons_IRC"), IDI_PIRC, IRC_CASE },
+ { "client_psyBNC", _T("*psyBNC*"), _T("psyBNC"), _T("ClientIcons_IRC"), IDI_PSYBNC, IRC_CASE },
+
+ { "client_SysReset", _T("*Sys*Reset*"), _T("SysReset"), _T("ClientIcons_IRC"), IDI_SYSRESET, IRC_CASE },
+ { "client_FChat", _T("*FChat*"), _T("FChat"), _T("ClientIcons_IRC"), IDI_FCHAT, IRC_CASE },
+
+ { "client_Konversation", _T("*Konversation*"), _T("Konversation"), _T("ClientIcons_IRC"), IDI_KONVERSATION, IRC_CASE },
+ { "client_Conversation", _T("*Conversation*"), _T("Conversation"), _T("ClientIcons_IRC"), IDI_CONVERSATION, IRC_CASE },
+
+ { "client_aMule", _T("*aMule*"), _T("aMule"), _T("ClientIcons_IRC"), IDI_AMULE, IRC_CASE },
+ { "client_eMuleMorphXT", _T("eMule*MorphXT*"), _T("eMule MorphXT"), _T("ClientIcons_IRC"), IDI_EMULE_MORPHXT, IRC_CASE },
+ { "client_eMuleNeo", _T("eMule*Neo*"), _T("eMule Neo"), _T("ClientIcons_IRC"), IDI_EMULE_NEO, IRC_CASE },
+ { "client_eMuleXtreme", _T("eMule*Xtreme*"), _T("eMule Xtreme"), _T("ClientIcons_IRC"), IDI_EMULE_XTREME, IRC_CASE },
+ { "client_eMulePlus", _T("|eMule*plus*|eMule*+*"), _T("eMule+"), _T("ClientIcons_IRC"), IDI_EMULE_PLUS, IRC_CASE },
+ { "client_eMule", _T("*eMule*"), _T("eMule"), _T("ClientIcons_IRC"), IDI_EMULE, IRC_CASE },
+
+ { "client_EggdropRacBot", _T("*Eggdrop*RacBot*"), _T("Eggdrop RacBot"), _T("ClientIcons_IRC"), IDI_EGGDROP_RACBOT, IRC_CASE },
+ { "client_Eggdrop", _T("*Eggdrop*"), _T("Eggdrop"), _T("ClientIcons_IRC"), IDI_EGGDROP, IRC_CASE },
+
+ { "client_AmIRC", _T("*AmIRC*"), _T("AmIRC"), _T("ClientIcons_IRC"), IDI_AMIRC, IRC_CASE },
+ { "client_BersIRC", _T("*BersIRC*"), _T("BersIRC"), _T("ClientIcons_IRC"), IDI_BERSIRC, IRC_CASE },
+ { "client_cbirc", _T("*cbirc*"), _T("cbirc"), _T("ClientIcons_IRC"), IDI_CBIRC, IRC_CASE },
+ { "client_dIRC", _T("*dIRC*"), _T("dIRC"), _T("ClientIcons_IRC"), IDI_DIRC, IRC_CASE },
+
+ { "client_GDPChat", _T("*GDPChat*"), _T("GDP Web Chat"), _T("ClientIcons_IRC"), IDI_GDPCHAT, IRC_CASE },
+ { "client_IceChat7", _T("*Ice*Chat*7*"), _T("IceChat 7"), _T("ClientIcons_IRC"), IDI_ICECHAT7, IRC_CASE },
+ { "client_IceChat5", _T("*Ice*Chat*5*"), _T("IceChat 5"), _T("ClientIcons_IRC"), IDI_ICECHAT5, IRC_CASE },
+ { "client_IceChat", _T("*Ice*Chat*"), _T("IceChat"), _T("ClientIcons_IRC"), IDI_ICECHAT, IRC_CASE },
+
+ { "client_piorun", _T("*piorun*"), _T("Piorun"), _T("ClientIcons_IRC"), IDI_PIORUN, IRC_CASE },
+
+ { "client_ProChat", _T("*Pro*Chat*"), _T("ProChat"), _T("ClientIcons_IRC"), IDI_PROCHAT, IRC_CASE },
+ { "client_SmartIRC", _T("*Smart*IRC*"), _T("SmartIRC"), _T("ClientIcons_IRC"), IDI_SMART_IRC, IRC_CASE },
+
+ { "client_GoPowerTools", _T("*Go*PowerTools*"), _T("GoPowerTools"), _T("ClientIcons_IRC"), IDI_GOPOWERTOOLS, IRC_CASE },
+ { "client_HydraIRC", _T("*Hydra*IRC*"), _T("HydraIRC"), _T("ClientIcons_IRC"), IDI_HYDRA_IRC, IRC_CASE },
+
+ { "client_ircle", _T("*ircle*"), _T("ircle"), _T("ClientIcons_IRC"), IDI_IRCLE, IRC_CASE },
+ { "client_IRCXpro", _T("*IRCXpro*"), _T("IRCXpro"), _T("ClientIcons_IRC"), IDI_IRCXPRO, IRC_CASE },
+ { "client_irssi", _T("*irssi*"), _T("irssi"), _T("ClientIcons_IRC"), IDI_IRSSI, IRC_CASE },
+ { "client_jircii", _T("*jircii*"), _T("jircii"), _T("ClientIcons_IRC"), IDI_JIRCII, IRC_CASE },
+ { "client_jmIrc", _T("*jmIrc*"), _T("jmIrc"), _T("ClientIcons_IRC"), IDI_JMIRC, IRC_CASE },
+ { "client_Klient", _T("*Klient*"), _T("Klient"), _T("ClientIcons_IRC"), IDI_KLIENT, IRC_CASE },
+
+ { "client_zsIRC", _T("*zsIRC*"), _T("zsIRC"), _T("ClientIcons_IRC"), IDI_ZSIRC, IRC_CASE },
+
+ { "client_NeoRaTrion", _T("*NeoRa*Trion*"), _T("NeoRa Trion"), _T("ClientIcons_IRC"), IDI_NEORATRION, IRC_CASE },
+ { "client_Nettalk", _T("*Nettalk*"), _T("Nettalk"), _T("ClientIcons_IRC"), IDI_NETTALK, IRC_CASE },
+ { "client_NoNameScript", _T("*NoName*Script*"), _T("NoNameScript"), _T("ClientIcons_IRC"), IDI_NONAME_SCRIPT, IRC_CASE },
+ { "client_PJIRC", _T("*PJIRC*"), _T("PJIRC"), _T("ClientIcons_IRC"), IDI_PJIRC, IRC_CASE },
+ { "client_Snak", _T("*Snak*"), _T("Snak"), _T("ClientIcons_IRC"), IDI_SNAK, IRC_CASE },
+
+ { "client_VircaIRC", _T("*VircaIRC*"), _T("VircaIRC"), _T("ClientIcons_IRC"), IDI_VIRCAIRC, IRC_CASE },
+ { "client_VisionIRC", _T("*VisionIRC*"), _T("VisionIRC"), _T("ClientIcons_IRC"), IDI_VISIONIRC, IRC_CASE },
+ { "client_VisualIRC", _T("*VisualIRC*"), _T("VisualIRC"), _T("ClientIcons_IRC"), IDI_VISUALIRC, IRC_CASE },
+ { "client_VortecIRC", _T("*VortecIRC*"), _T("VortecIRC"), _T("ClientIcons_IRC"), IDI_VORTECIRC, IRC_CASE },
+
+ { "client_WeeChat", _T("*WeeChat*"), _T("WeeChat"), _T("ClientIcons_IRC"), IDI_WEECHAT, IRC_CASE },
+ { "client_WLIrc", _T("*WLIrc*"), _T("WLIrc"), _T("ClientIcons_IRC"), IDI_WLIRC, IRC_CASE },
+ { "client_wmIRC", _T("*wmIRC*"), _T("wmIRC"), _T("ClientIcons_IRC"), IDI_WMIRC, IRC_CASE },
+
+ { "client_XChatAqua", _T("*X*Chat*Aqua*"), _T("X-Chat Aqua"), _T("ClientIcons_IRC"), IDI_XCHATAQUA, IRC_CASE },
+
+ { "client_ZipTorrent", _T("*ZipTorrent*"), _T("ZipTorrent"), _T("ClientIcons_IRC"), IDI_ZIPTORRENT, IRC_CASE },
+
+ { "client_Babbel", _T("*Babbel*"), _T("Babbel"), _T("ClientIcons_IRC"), IDI_BABBEL, IRC_CASE },
+ { "client_Xirc", _T("*Xirc*"), _T("Xirc"), _T("ClientIcons_IRC"), IDI_XIRC, IRC_CASE },
+ { "client_savIRC", _T("*savIRC*"), _T("savIRC"), _T("ClientIcons_IRC"), IDI_SAVIRC, IRC_CASE },
+ { "client_XiRCON", _T("*XiRCON*"), _T("XiRCON"), _T("ClientIcons_IRC"), IDI_XIRCON, IRC_CASE },
+
+ { "client_MP3Script", _T("*MP3*Script*"), _T("MP3 Script for mIRC"), _T("ClientIcons_IRC"), IDI_MP3_SCRIPT, IRC_CASE },
+ { "client_IRCUnknown", _T("*IRC*"), _T("Unknown IRC client"), _T("ClientIcons_IRC"), IDI_IRC_UNKNOWN, IRC_CASE },
+
+//#########################################################################################################################################
+//################################################################## MSN ##################################################################
+//#########################################################################################################################################
+ { "client_WLM11", _T("WLM*2011*"), _T("Windows Live 11"), _T("ClientIcons_MSN"), IDI_WLM_10, MSN_CASE },
+ { "client_WLM10", _T("WLM*2010*"), _T("Windows Live 10"), _T("ClientIcons_MSN"), IDI_WLM_10, MSN_CASE },
+ { "client_WLM9", _T("WLM*9*"), _T("Windows Live v9.x"), _T("ClientIcons_MSN"), IDI_WLM_9, MSN_CASE },
+ { "client_MSN8", _T("|WLM*8.*|MSN*8.*"), _T("Windows Live v8.x"), _T("ClientIcons_MSN"), IDI_MSN_8, MSN_CASE },
+ { "client_MSN7x", _T("MSN*7.*"), _T("MSN Messenger v7.x"), _T("ClientIcons_MSN"), IDI_MSN_7, MSN_CASE },
+ { "client_MSN6x", _T("MSN*6.*"), _T("MSN Messenger v6.x"), _T("ClientIcons_MSN"), IDI_MSN_6, MSN_CASE },
+ { "client_MSN45", _T("MSN*4.x-5.x"), _T("MSN Messenger v4.x-5.x"), _T("ClientIcons_MSN"), IDI_MSN_45, MSN_CASE },
+ { "client_MSN4Mac", _T("MSN*Mac*"), _T("MSN for Mac"), _T("ClientIcons_MSN"), IDI_MSN_MAC, MSN_CASE },
+ { "client_aMSN", _T("*aMSN*"), _T("aMSN"), _T("ClientIcons_MSN"), IDI_AMSN, MSN_CASE },
+ { "client_WebMessenger", _T("WebMessenger*"), _T("WebMessenger"), _T("ClientIcons_MSN"), IDI_WEBMESSENGER, MSN_CASE },
+ { "client_MSN", _T("|WLM*|MSN*|Windows Live*"), _T("MSN"), _T("ClientIcons_MSN"), IDI_MSN, MSN_CASE, TRUE },
+
+//#########################################################################################################################################
+//################################################################## AIM ##################################################################
+//#########################################################################################################################################
+ { "client_AIM_Triton", _T("*AIM*Triton*"), _T("AIM Triton"), _T("ClientIcons_AIM"), IDI_AIM_TRITON, AIM_CASE },
+ { "client_Aim4", _T("AIM*4.*"), _T("AIM v4.x"), _T("ClientIcons_AIM"), IDI_AIM_4, AIM_CASE },
+ { "client_Aim5", _T("AIM*5.*"), _T("AIM v5.x"), _T("ClientIcons_AIM"), IDI_AIM_5, AIM_CASE },
+ { "client_AimMac", _T("AIM*Mac*"), _T("AIM for MacOS"), _T("ClientIcons_AIM"), IDI_AIM_MAC, AIM_CASE },
+
+ { "client_AimMobile", _T("|AIM*Mobile*|AIM*gprs*|Aim*sms*"), _T("AIM Mobile"), _T("ClientIcons_AIM"), IDI_AIM_MOBILE, AIM_CASE },
+ { "client_Naim", _T("*naim*"), _T("Naim"), _T("ClientIcons_AIM"), IDI_NAIM, AIM_CASE },
+ { "client_miniaim", _T("*miniaim*"), _T("miniaim"), _T("ClientIcons_AIM"), IDI_MINIAIM, AIM_CASE },
+ { "client_TerraIM", _T("*Terra*"), _T("TerraIM"), _T("ClientIcons_AIM"), IDI_TERRAIM, AIM_CASE },
+ { "client_Aim", _T("AIM*"), _T("AIM"), _T("ClientIcons_AIM"), IDI_AIM, AIM_CASE },
+
+//#########################################################################################################################################
+//################################################################# Yahoo #################################################################
+//#########################################################################################################################################
+ { "client_libyahoo2", _T("*libyahoo*"), _T("libyahoo2"), _T("ClientIcons_Yahoo"), IDI_LIBYAHOO2, YAHOO_CASE },
+ { "client_Yahoo5", _T("*Yahoo*5*"), _T("Yahoo v5.x"), _T("ClientIcons_Yahoo"), IDI_YAHOO5, YAHOO_CASE },
+ { "client_Yahoo6", _T("*Yahoo*6*"), _T("Yahoo v6.x"), _T("ClientIcons_Yahoo"), IDI_YAHOO6, YAHOO_CASE },
+ { "client_Yahoo7", _T("*Yahoo*7*"), _T("Yahoo v7.x"), _T("ClientIcons_Yahoo"), IDI_YAHOO7, YAHOO_CASE },
+ { "client_Yahoo8", _T("*Yahoo*8*"), _T("Yahoo v8.x"), _T("ClientIcons_Yahoo"), IDI_YAHOO8, YAHOO_CASE },
+ { "client_Yahoo9", _T("*Yahoo*9*"), _T("Yahoo v9.x"), _T("ClientIcons_Yahoo"), IDI_YAHOO8, YAHOO_CASE },
+ { "client_Yahoo10", _T("*Yahoo*10*"), _T("Yahoo v10.x"), _T("ClientIcons_Yahoo"), IDI_YAHOO10, YAHOO_CASE },
+ { "client_YahooGoMobile", _T("|Yahoo*Go*|Yahoo*Mobile*"), _T("Yahoo! Go Mobile"), _T("ClientIcons_Yahoo"), IDI_YAHOO_GO_MOBILE, YAHOO_CASE },
+ { "client_PingBox", _T("*Yahoo*PingBox*"), _T("Yahoo PingBox"), _T("ClientIcons_Yahoo"), IDI_PINGBOX, YAHOO_CASE },
+ { "client_YahooWebMessenger", _T("*Yahoo*Web*Messenger"), _T("Yahoo Web Messenger"), _T("ClientIcons_Yahoo"), IDI_YAHOO10, YAHOO_CASE },
+ { "client_Yahoo", _T("*Yahoo*"), _T("Yahoo"), _T("ClientIcons_Yahoo"), IDI_YAHOO, YAHOO_CASE },
+
+//#########################################################################################################################################
+//##################################################### Gadu-Gadu clients #################################################################
+//#########################################################################################################################################
+ { "client_Gadu_Gadu_7", _T("Gadu-Gadu*7*"), _T("Gadu-Gadu v7.x"), _T("ClientIcons_Gadu"), IDI_GADU_GADU_7, GADU_CASE },
+ { "client_Gadu_Gadu_6", _T("Gadu-Gadu*6*"), _T("Gadu-Gadu v6.x"), _T("ClientIcons_Gadu"), IDI_GADU_GADU_6, GADU_CASE },
+
+//#########################################################################################################################################
+//###################################################### Mail.Ru clients ##################################################################
+//#########################################################################################################################################
+ { "client_MailRu_official", _T("|magent*|Mail.ru Agent*official*|Mail.ru Agent*PC*")
+ _T("|http://agent.mail.ru*"), _T("Mail.Ru Agent (official client)"), _T("ClientIcons_MRA"), IDI_MAIL_RU_OFFICIAL, 14 },
+ { "client_MailRu_Mobile", _T("|wmagent*|MobileAgent*|sagent*|Mail.ru Agent*Symbian*")
+ _T("|jagent*"), _T("Mail.Ru Mobile Agent"), _T("ClientIcons_MRA"), IDI_MAIL_RU_MOBILE, 14 },
+ { "client_MailRu_web_official", _T("Web Agent*"), _T("Mail.Ru Web Agent"), _T("ClientIcons_MRA"), IDI_MAIL_RU_WEBAGENT, 14 },
+ { "client_MailRu_unknown", _T("Mail.ru Agent*"), _T("Mail.Ru (unknown client)"), _T("ClientIcons_MRA"), IDI_MAIL_RU_UNKNOWN, 14 },
+
+//#########################################################################################################################################
+//####################################################### Skype clients ###################################################################
+//#########################################################################################################################################
+ { "client_Skype3", _T("*Skype*3.*"), _T("Skype v3.x"), _T("ClientIcons_Skype"), IDI_SKYPE3, SKYPE_CASE },
+ { "client_Skype2", _T("*Skype*2.*"), _T("Skype v2.x"), _T("ClientIcons_Skype"), IDI_SKYPE2, SKYPE_CASE },
+ { "client_Skype1", _T("*Skype*"), _T("Skype v1.x"), _T("ClientIcons_Skype"), IDI_SKYPE1, SKYPE_CASE },
+
+//#########################################################################################################################################
+//###################################################### Weather clients ##################################################################
+//#########################################################################################################################################
+ { "client_accu", _T("*accuweather*"), _T("AccuWeather"), _T("ClientIcons_Weather"), IDI_ACCU, WEATHER_CASE, TRUE },
+ { "client_gismeteo", _T("*gismeteo*"), _T("GisMeteo"), _T("ClientIcons_Weather"), IDI_GISMETEO, WEATHER_CASE, TRUE },
+ { "client_intelli", _T("*intellicast*"), _T("Intellicast"), _T("ClientIcons_Weather"), IDI_INTELLI, WEATHER_CASE, TRUE },
+ { "client_meteogid", _T("|*meteo-gid*|*meteogid*|*MeteoGid*"), _T("Meteo-Gid"), _T("ClientIcons_Weather"), IDI_METEOGID, WEATHER_CASE, TRUE },
+ { "client_meteonovosti", _T("*meteonovosti*"), _T("Meteonovosti"), _T("ClientIcons_Weather"), IDI_METEONOVOSTI, WEATHER_CASE, TRUE },
+ { "client_noaa", _T("*noaa*"), _T("NOAA Weather"), _T("ClientIcons_Weather"), IDI_NOAA, WEATHER_CASE, TRUE },
+ { "client_real", _T("*realmeteo*"), _T("RealMeteo"), _T("ClientIcons_Weather"), IDI_REALMETEO, WEATHER_CASE, TRUE },
+ { "client_under", _T("Weather Underground*"), _T("Weather Underground"), _T("ClientIcons_Weather"), IDI_UNDERGROUND, WEATHER_CASE, TRUE },
+ { "client_weatherxml", _T("*WeatherXML*"), _T("WeatherXML"), _T("ClientIcons_Weather"), IDI_WEATHERXML, WEATHER_CASE, TRUE },
+ { "client_wetter", _T("*wetter*"), _T("Wetter"), _T("ClientIcons_Weather"), IDI_WETTER, WEATHER_CASE, TRUE },
+ { "client_yweather", _T("*Yahoo Weather*"), _T("Yahoo Weather"), _T("ClientIcons_Weather"), IDI_YWEATHER, WEATHER_CASE, TRUE },
+ { "client_weather_cn", _T("*weather.com.cn*"), _T("Weather CN"), _T("ClientIcons_Weather"), IDI_WEATHER_CN, WEATHER_CASE, TRUE },
+ { "client_weather", _T("*weather*"), _T("Weather"), _T("ClientIcons_Weather"), IDI_WEATHER, WEATHER_CASE, TRUE },
+
+//#########################################################################################################################################
+//############################################################ RSS ########################################################################
+//#########################################################################################################################################
+ { "client_rss09x", _T("*RSS*0.9*"), _T("RSS 0.9x"), _T("ClientIcons_RSS"), IDI_RSS09, RSS_CASE },
+ { "client_rss1", _T("*RSS*1.*"), _T("RSS 1"), _T("ClientIcons_RSS"), IDI_RSS1, RSS_CASE },
+ { "client_rss2", _T("*RSS*2.*"), _T("RSS 2"), _T("ClientIcons_RSS"), IDI_RSS2, RSS_CASE },
+ { "client_atom1", _T("*Atom*1.*"), _T("Atom 1"), _T("ClientIcons_RSS"), IDI_ATOM1, RSS_CASE },
+ { "client_atom3", _T("*Atom*3.*"), _T("Atom 3"), _T("ClientIcons_RSS"), IDI_ATOM3, RSS_CASE },
+
+//#########################################################################################################################################
+//############################################################ QQ #########################################################################
+//#########################################################################################################################################
+ { "client_MobileQQ", _T("|Mobile*QQ*|iPhone*QQ*|QQ WAP*"), _T("Mobile QQ"), _T("ClientIcons_QQ"), IDI_MOBILEQQ, QQ_CASE },
+ { "client_QQConcept", _T("QQ*Concept*"), _T("QQ Concept"), _T("ClientIcons_QQ"), IDI_QQCONCEPT, QQ_CASE },
+ { "client_QQCRM", _T("QQ*CRM*"), _T("QQ CRM"), _T("ClientIcons_QQ"), IDI_QQCRM, QQ_CASE },
+ { "client_QQSilver", _T("QQ*Silverlight*"), _T("QQ Silverlight"), _T("ClientIcons_QQ"), IDI_QQSILVER, QQ_CASE },
+ { "client_TM2008", _T("|TM2008*|TM2009*|TM2010*"), _T("TM 2008 and >"), _T("ClientIcons_QQ"), IDI_TM2008, QQ_CASE },
+ { "client_TM", _T("TM*"), _T("TM"), _T("ClientIcons_QQ"), IDI_TM, QQ_CASE },
+ { "client_QQInt", _T("QQ*International*"), _T("QQ International"), _T("ClientIcons_QQ"), IDI_QQINT, QQ_CASE },
+ { "client_YamQQ", _T("YamQQ*"), _T("Yam QQ"), _T("ClientIcons_QQ"), IDI_YAMQQ, QQ_CASE },
+ { "client_WebQQ", _T("WebQQ*"), _T("WebQQ"), _T("ClientIcons_QQ"), IDI_WEBQQ, QQ_CASE },
+ { "client_QQ", _T("QQ*"), _T("QQ"), _T("ClientIcons_QQ"), IDI_QQ, QQ_CASE },
+
+ { "client_Notfound", _T("Notfound"), _T("Not founded icon"), _T(""), IDI_NOTFOUND, OTHER_CASE, TRUE },
+ { "client_Unknown", _T("|*Unknown*|..."), _T("Unknown client"), _T(""), IDI_UNKNOWN, OTHER_CASE, TRUE },
+ { "client_Undetected", _T("?*"), _T("Undetected client"), _T(""), IDI_UNDETECTED, OTHER_CASE, TRUE },
+};
+
+#define DEFAULT_KN_FP_MASK_COUNT SIZEOF(def_kn_fp_mask) // should contain the count of records above
+#define UNKNOWN_MASK_NUMBER (DEFAULT_KN_FP_MASK_COUNT - 2) // second from end
+#define NOTFOUND_MASK_NUMBER (DEFAULT_KN_FP_MASK_COUNT - 3) // third from end
+
+//#########################################################################################################################################
+//######################################################### Overlays, layer #1 ############################################################
+//#########################################################################################################################################
+KN_FP_MASK def_kn_fp_overlays_mask[] =
+{// IconName Mask Icon caption NULL ICON_RESOURCE_ID
+//#########################################################################################################################################
+//#################################################### Miranda Packs ######################################################################
+//#########################################################################################################################################
+ { "client_HIEROS_", _T("*HierOS*"), _T("HierOS"), _T("ClientIcons_Packs"), IDI_MIRANDA_HIEROS, PACKS_CASE },
+ { "client_YAOL_", _T("*yaol*"), _T("YAOL"), _T("ClientIcons_Packs"), IDI_MIRANDA_YAOL, PACKS_CASE },
+ { "client_KDL_", _T("|*KDL*|*ÊÄË*"), _T("KDL"), _T("ClientIcons_Packs"), IDI_MIRANDA_KDL, PACKS_CASE },
+ { "client_ValeraVi_", _T("*Valera*Vi*"), _T("ValeraVi"), _T("ClientIcons_Packs"), IDI_MIRANDA_VALERAVI, PACKS_CASE },
+ { "client_Stalker_", _T("*Stalker*"), _T("Stalker"), _T("ClientIcons_Packs"), IDI_MIRANDA_STALKER, PACKS_CASE },
+ { "client_Kuzzman_", _T("*kuzzman*"), _T("Kuzzman"), _T("ClientIcons_Packs"), IDI_MIRANDA_KUZZMAN, PACKS_CASE },
+ { "client_AF_", _T("*AF*Pack*"), _T("AF"), _T("ClientIcons_Packs"), IDI_MIRANDA_AF, PACKS_CASE },
+ { "client_Kolich_", _T("*Kolich*"), _T("Kolich"), _T("ClientIcons_Packs"), IDI_MIRANDA_KOLICH, PACKS_CASE },
+ { "client_Umedon_", _T("*Miranda*Umedon*"), _T("Umedon"), _T("ClientIcons_Packs"), IDI_MIRANDA_UMEDON, PACKS_CASE },
+ { "client_Se7ven_", _T("|^*sss*|*[S7*pack]*|*[S7]*"), _T("Se7ven"), _T("ClientIcons_Packs"), IDI_MIRANDA_SE7VEN, PACKS_CASE },
+ { "client_SSS_", _T("*sss*pack*"), _T("SSS build"), _T("ClientIcons_Packs"), IDI_MIRANDA_SSS_MOD, PACKS_CASE },
+ { "client_Faith_", _T("*Faith*Pack*"), _T("Faith"), _T("ClientIcons_Packs"), IDI_MIRANDA_FAITH, PACKS_CASE },
+ { "client_LexSys_", _T("|*MirandaLS*|*LexSys*"), _T("LexSys"), _T("ClientIcons_Packs"), IDI_MIRANDA_LEXSYS, PACKS_CASE },
+ { "client_dmikos_", _T("*dmikos*"), _T("Dmikos"), _T("ClientIcons_Packs"), IDI_MIRANDA_DMIKOS, PACKS_CASE },
+ { "client_Tweety_", _T("*tweety*"), _T("Tweety"), _T("ClientIcons_Packs"), IDI_MIRANDA_TWEETY, PACKS_CASE },
+ { "client_ME_", _T("*[Miranda ME]*"), _T("Miranda ME"), _T("ClientIcons_Packs"), IDI_MIRANDA_ME, PACKS_CASE },
+ { "client_BRI_", _T("*bri*edition*"), _T("Bri edition"), _T("ClientIcons_Packs"), IDI_MIRANDA_BRI, PACKS_CASE },
+ { "client_ALFAMAR_", _T("*AlfaMaR*"), _T("AlfaMaR"), _T("ClientIcons_Packs"), IDI_MIRANDA_ALFAMAR, PACKS_CASE },
+ { "client_ZELEBOBA_", _T("*zeleboba's*"), _T("zeleboba's"), _T("ClientIcons_Packs"), IDI_MIRANDA_ZELEBOBA, PACKS_CASE },
+ { "client_MD_", _T("*MDpack*"), _T("MDpack"), _T("ClientIcons_Packs"), IDI_MIRANDA_MD, PACKS_CASE },
+ { "client_PILOT_", _T("*Pilot*"), _T("Pilot"), _T("ClientIcons_Packs"), IDI_MIRANDA_PILOT, PACKS_CASE },
+ { "client_AMATORY_", _T("*Amatory*"), _T("Amatory"), _T("ClientIcons_Packs"), IDI_MIRANDA_AMATORY, PACKS_CASE },
+ { "client_RAZUNTER_", _T("*Razunter's*"), _T("Razunter's Pk"), _T("ClientIcons_Packs"), IDI_MIRANDA_RAZUNTER, PACKS_CASE },
+ { "client_GHOST_", _T("*Ghost's*"), _T("Ghost's Pack"), _T("ClientIcons_Packs"), IDI_MIRANDA_GHOST, PACKS_CASE },
+ { "client_DAR_", _T("*Dar_veter*"), _T("Dar_veter Pack"), _T("ClientIcons_Packs"), IDI_MIRANDA_DAR, PACKS_CASE },
+ { "client_MATAES_", _T("*Mataes*"), _T("Mataes Pack"), _T("ClientIcons_Packs"), IDI_MIRANDA_MATAES, PACKS_CASE },
+ { "client_FREIZE_", _T("*Freize*"), _T("Freize"), _T("ClientIcons_Packs"), IDI_MIRANDA_FREIZE, PACKS_CASE },
+ { "client_FR_", _T("*FR*Pack*"), _T("Miranda FR"), _T("ClientIcons_Packs"), IDI_MIRANDA_FR, PACKS_CASE },
+ { "client_Native_", _T("*Native*"), _T("Native"), _T("ClientIcons_Packs"), IDI_MIRANDA_NATIVE, PACKS_CASE },
+ { "client_E33_", _T("*[E33]*"), _T("E33"), _T("ClientIcons_Packs"), IDI_MIRANDA_E33, PACKS_CASE },
+ { "client_ROBYER_", _T("*RobyerPack*"), _T("Robyer Pack"), _T("ClientIcons_Packs"), IDI_MIRANDA_ROBYER, PACKS_CASE },
+ { "client_New Style_", _T("*New Style*"), _T("New Style"), _T("ClientIcons_Packs"), IDI_MIRANDA_NEW_STYLE, PACKS_CASE },
+ { "client_SPELLHOWLER_", _T("*Spellhowler*"), _T("xSpellhowleRx Pack"), _T("ClientIcons_Packs"), IDI_MIRANDA_SPELLHOWLER, PACKS_CASE },
+ { "client_LESTAT_", _T("*[Lpack]*"), _T("Lestat Pack"), _T("ClientIcons_Packs"), IDI_MIRANDA_LESTAT, PACKS_CASE },
+ { "client_DEVILSUITE_", _T("*6.6.6*"), _T("Devil Suite"), _T("ClientIcons_Packs"), IDI_MIRANDA_DEVIL, PACKS_CASE },
+ { "client_FINAL", _T("*[FinalPack]*"), _T("Final Pack"), _T("ClientIcons_Packs"), IDI_MIRANDA_FINAL, PACKS_CASE },
+ { "client_CAPPUCCINO", _T("*[HotCoffee]*"), _T("HotCoffee"), _T("ClientIcons_Packs"), IDI_MIRANDA_CAPPUCCINO, PACKS_CASE },
+ { "client_WATCHER", _T("*[WatcherPack]*"), _T("Watcher Pack"), _T("ClientIcons_Packs"), IDI_MIRANDA_WATCHER, PACKS_CASE },
+ { "client_LENINPACK", _T("*[Lenin Pack]*"), _T("Lenin Pack"), _T("ClientIcons_Packs"), IDI_MIRANDA_LENINPACK, PACKS_CASE },
+//#########################################################################################################################################
+//#########################################################################################################################################
+ { "client_AimOscar_over", _T("Miranda*AIM*"), _T("AIM"), _T("ClientIcons_General"), IDI_AIMOSCAR_OVERLAY, OVER1_CASE }, //FIX
+ { "client_ICQJ_Plus_over", _T("*ICQ*Plus*"), _T("ICQJ Plus Mod"), _T("ClientIcons_General"), IDI_ICQJ_PLUS_MOD_OVERLAY, OVER1_CASE },
+ { "client_ICQJ_SIN_over", _T("*ICQ*S!N*"), _T("ICQ S!N"), _T("ClientIcons_General"), IDI_ICQJ_SIN_MOD_OVERLAY, OVER1_CASE },
+ { "client_ICQJ_over", _T("*IM*ICQ*0.*"), _T("ICQJ"), _T("ClientIcons_General"), IDI_ICQJ_OVERLAY, OVER1_CASE },
+ { "client_ICQ_Unknown_over", _T("Miranda*ICQ*"), _T("ICQ unknown"), _T("ClientIcons_General"), IDI_ICQJM_OVERLAY, OVER1_CASE },
+ { "client_IRC_over", _T("Miranda*IRC*"), _T("IRC"), _T("ClientIcons_General"), IDI_IRC_OVERLAY, OVER1_CASE },
+ { "client_JGmail_over", _T("*IM*JGmail*"), _T("JGmail"), _T("ClientIcons_General"), IDI_GMAIL_OVERLAY, OVER1_CASE },
+ { "client_JGTalk_over", _T("*IM*JGTalk*"), _T("JGTalk"), _T("ClientIcons_General"), IDI_JGTALK_OVERLAY, OVER1_CASE },
+ { "client_JMeebo_over", _T("*IM*JMeebo*"), _T("JMeebo"), _T("ClientIcons_General"), IDI_JMEEBO_OVERLAY, OVER1_CASE },
+ { "client_Jabber_over", _T("|*IM*jabber*|*t Jabber*"), _T("Jabber"), _T("ClientIcons_General"), IDI_JABBER_OVERLAY, OVER1_CASE },
+ { "client_MailRu_over", _T("|*Mail.ru*IM*|*MRA*"), _T("MailRu Agent"), _T("ClientIcons_General"), IDI_MAILRU_OVERLAY, OVER1_CASE },
+ { "client_MSN_over", _T("Miranda*MSN*"), _T("MSN"), _T("ClientIcons_General"), IDI_MSN_OVERLAY, OVER1_CASE },
+ { "client_QQ_over", _T("|Miranda*QQ*|MIMQQ*"), _T("QQ"), _T("ClientIcons_General"), IDI_QQ_OVERLAY, OVER1_CASE },
+ { "client_Tlen_over", _T("*tlen.pl"), _T("Tlen.pl"), _T("ClientIcons_General"), IDI_TLEN_OVERLAY, OVER1_CASE },
+
+ { "client_Mira_010_over", _T("*Miranda*0.10*"), _T("Miranda v0.10"), _T("ClientIcons_General"), IDI_MIRANDA_10, OVER1_CASE },
+ { "client_Mira_09_over", _T("*Miranda*0.9*"), _T("Miranda v0.9"), _T("ClientIcons_General"), IDI_MIRANDA_9, OVER1_CASE },
+ { "client_Mira_08_over", _T("*Miranda*0.8*"), _T("Miranda v0.8"), _T("ClientIcons_General"), IDI_MIRANDA_8, OVER1_CASE },
+ { "client_Mira_07_over", _T("*Miranda*0.7*"), _T("Miranda v0.7"), _T("ClientIcons_General"), IDI_MIRANDA_7, OVER1_CASE },
+ { "client_Mira_06_over", _T("*Miranda*0.6*"), _T("Miranda v0.6"), _T("ClientIcons_General"), IDI_MIRANDA_6, OVER1_CASE },
+ { "client_Mira_05_over", _T("*Miranda*0.5*"), _T("Miranda v0.5"), _T("ClientIcons_General"), IDI_MIRANDA_5, OVER1_CASE },
+ { "client_Mira_04_over", _T("*Miranda*0.4*"), _T("Miranda v0.4"), _T("ClientIcons_General"), IDI_MIRANDA_4, OVER1_CASE },
+
+ { "client_ICQ 2000", _T("ICQ*2000*"), _T("ICQ 2000"), _T("ClientIcons_ICQ"), IDI_CLIENTICQ2000, ICQ_OFF_CASE },
+ { "client_ICQ 2001b", _T("ICQ*2001*"), _T("ICQ 2001"), _T("ClientIcons_ICQ"), IDI_CLIENTICQ2001, ICQ_OFF_CASE },
+ { "client_ICQ 2002", _T("ICQ*2002*"), _T("ICQ 2002/2003a"), _T("ClientIcons_ICQ"), IDI_CLIENTICQ2002, ICQ_OFF_CASE },
+ { "client_ICQ 2003", _T("ICQ*2003*"), _T("ICQ 2003b"), _T("ClientIcons_ICQ"), IDI_CLIENTICQ2003, ICQ_OFF_CASE },
+ { "client_ICQ v4", _T("ICQ*4*"), _T("ICQ Lite v4"), _T("ClientIcons_ICQ"), IDI_CLIENTICQLITE4, ICQ_OFF_CASE },
+ { "client_ICQ v5.1", _T("ICQ*5.1*"), _T("ICQ v5.1"), _T("ClientIcons_ICQ"), IDI_CLIENTICQLITE51, ICQ_OFF_CASE },
+ { "client_ICQ v5", _T("|^*Transport*|ICQ*5*"), _T("ICQ v5"), _T("ClientIcons_ICQ"), IDI_CLIENTICQLITE5, ICQ_OFF_CASE },
+ { "client_ICQ v6", _T("ICQ*6*"), _T("ICQ v6"), _T("ClientIcons_ICQ"), IDI_CLIENTICQ6, ICQ_OFF_CASE },
+ { "client_ICQ v7", _T("ICQ*7*"), _T("ICQ v7"), _T("ClientIcons_ICQ"), IDI_CLIENTICQ7, ICQ_OFF_CASE },
+
+ { "client_Yahoo v5.x", _T("*Yahoo 5*"), _T("Yahoo 5.x"), _T("ClientIcons_Yahoo"), IDI_CLIENT_YAHOO5, YAHOO_CASE },
+ { "client_Yahoo v6.x", _T("*Yahoo 6*"), _T("Yahoo 6.x"), _T("ClientIcons_Yahoo"), IDI_CLIENT_YAHOO6, YAHOO_CASE },
+ { "client_Yahoo v7.x", _T("*Yahoo 7*"), _T("Yahoo 7.x"), _T("ClientIcons_Yahoo"), IDI_CLIENT_YAHOO7, YAHOO_CASE },
+ { "client_Yahoo v8.x", _T("*Yahoo 8*"), _T("Yahoo 8.x"), _T("ClientIcons_Yahoo"), IDI_CLIENT_YAHOO8, YAHOO_CASE },
+ { "client_Yahoo v9.x", _T("*Yahoo 9*"), _T("Yahoo 9.x"), _T("ClientIcons_Yahoo"), IDI_CLIENT_YAHOO9, YAHOO_CASE },
+ { "client_Yahoo v10.x", _T("*Yahoo 10*"), _T("Yahoo 10.x"), _T("ClientIcons_Yahoo"), IDI_CLIENT_YAHOO10, YAHOO_CASE },
+
+ { "client_QQ 2000", _T("QQ2000*"), _T("QQ 2000"), _T("ClientIcons_QQ"), IDI_CLIENT_QQ2000, QQ_CASE },
+ { "client_TM 1", _T("TM 1.*"), _T("TM 1.x"), _T("ClientIcons_QQ"), IDI_CLIENT_TM1, QQ_CASE },
+ { "client_TM 2", _T("TM 2.*"), _T("TM 2.x"), _T("ClientIcons_QQ"), IDI_CLIENT_TM2, QQ_CASE },
+ { "client_TMQQ 2003", _T("|QQ2003*|TM 3.*"), _T("TM 3.x, QQ 2003"), _T("ClientIcons_QQ"), IDI_CLIENT_TM_QQ2003, QQ_CASE },
+ { "client_QQ 2004", _T("QQ2004*"), _T("QQ 2004"), _T("ClientIcons_QQ"), IDI_CLIENT_QQ2004, QQ_CASE },
+ { "client_TM_QQ 2005", _T("|QQ2005*|TM2005*"), _T("TM/QQ 2005"), _T("ClientIcons_QQ"), IDI_CLIENT_TM_QQ2005, QQ_CASE },
+ { "client_TM_QQ 2006", _T("|QQ2006*|TM2006*"), _T("TM/QQ 2006"), _T("ClientIcons_QQ"), IDI_CLIENT_TM_QQ2006, QQ_CASE },
+ { "client_TM_QQ 2007", _T("|QQ2007*|TM2007*"), _T("TM/QQ 2007"), _T("ClientIcons_QQ"), IDI_CLIENT_TM_QQ2007, QQ_CASE },
+ { "client_TM_QQ 2008", _T("|QQ2008*|TM2008*"), _T("TM/QQ 2008"), _T("ClientIcons_QQ"), IDI_CLIENT_TM_QQ2008, QQ_CASE },
+ { "client_TM_QQ 2009", _T("|QQ2009*|TM2009*"), _T("TM/QQ 2009"), _T("ClientIcons_QQ"), IDI_CLIENT_TM_QQ2009, QQ_CASE },
+ { "client_TM_QQ 2010", _T("|QQ2010*|TM2010*"), _T("TM/QQ 2010"), _T("ClientIcons_QQ"), IDI_CLIENT_TM_QQ2010, QQ_CASE },
+ { "client_TM_QQ 2011", _T("|QQ2011*|TM2011*"), _T("TM/QQ 2011"), _T("ClientIcons_QQ"), IDI_CLIENT_TM_QQ2011, QQ_CASE },
+
+ { "client_Tlen 5", _T("Tlen Protocol 7"), _T("Tlen 5.x"), _T("ClientIcons_Tlen"), IDI_CLIENT_TLEN5, TLEN_CASE },
+ { "client_Tlen 6", _T("Tlen Protocol 10"), _T("Tlen 6.x"), _T("ClientIcons_Tlen"), IDI_CLIENT_TLEN6, TLEN_CASE },
+ { "client_Tlen 7", _T("Tlen Protocol 16"), _T("Tlen 7.x"), _T("ClientIcons_Tlen"), IDI_CLIENT_TLEN7, TLEN_CASE },
+
+ { "client_weather_over", _T("*Weather*"), _T("Weather"), _T("ClientIcons_Weather"), IDI_CLIENT_WEATHER, WEATHER_CASE },
+
+ { "client_on Win32", _T("|*Win32*|*windows*|* WM *|wmagent*|*Vista*"), _T("on Windows"), _T("ClientIcons_General"), IDI_CLIENTWIN, PLATFORM_CASE },
+ { "client_on Mac", _T("|* Mac *|*IPhone*"), _T("on MacOS"), _T("ClientIcons_General"), IDI_CLIENTMAC, PLATFORM_CASE },
+ { "client_on Linux", _T("*Linux*"), _T("on Linux"), _T("ClientIcons_General"), IDI_CLIENTLINUX, PLATFORM_CASE },
+ { "client_on Flash", _T("*Flash*"), _T("on Flash"), _T("ClientIcons_General"), IDI_CLIENTFLASH, PLATFORM_CASE },
+ { "client_on Java", _T("|*Java*|jagent*|ICQ2Go!*"), _T("on Java"), _T("ClientIcons_General"), IDI_CLIENTJAVA, PLATFORM_CASE },
+ { "client_on Symbian", _T("|*Symbian*|sagent*"), _T("on Symbian"), _T("ClientIcons_General"), IDI_CLIENTSYMBIAN, PLATFORM_CASE },
+ { "client_on Android", _T("|* Android*|*/Android*"), _T("on Android"), _T("ClientIcons_General"), IDI_CLIENTANDROID, PLATFORM_CASE },
+};
+
+#define DEFAULT_KN_FP_OVERLAYS_COUNT SIZEOF(def_kn_fp_overlays_mask) //should contain the count of records above
+
+//#########################################################################################################################################
+//######################################################### Overlays, layer #2 ############################################################
+//#########################################################################################################################################
+KN_FP_MASK def_kn_fp_overlays2_mask[] =
+{// IconName Mask Icon caption NULL ICON_RESOURCE_ID
+ { "client_debug_overlay", _T("*[*debug*]*"), _T("[Debug]"), _T("ClientIcons_Jabber"), IDI_DEBUG_OVERLAY, OVER2_CASE },
+ { "client_home_overlay", _T("|*[*home*]*|*[*äîì*]*"), _T("[Home]"), _T("ClientIcons_Jabber"), IDI_HOME_OVERLAY, OVER2_CASE },
+ { "client_work_overlay", _T("|*[*work*]*|*[*ðàáîòà*]*"), _T("[Work]"), _T("ClientIcons_Jabber"), IDI_WORK_OVERLAY, OVER2_CASE },
+ { "client_office_overlay", _T("|*[*office*]*|*[*îôèñ*]*"), _T("[Office]"), _T("ClientIcons_Jabber"), IDI_OFFICE_OVERLAY, OVER2_CASE },
+ { "client_mobile_overlay", _T("|*[*mobile*]*|*[*pda*]*"), _T("[Mobile]"), _T("ClientIcons_Jabber"), IDI_MOBILE_OVERLAY, OVER2_CASE },
+ { "client_notebook_overlay", _T("|*[*note*]*|*[*portable*]*|*[*usb*]*")
+ _T("|*[*laptop*]*|*[*flash*]*"), _T("[Portable]"), _T("ClientIcons_Jabber"), IDI_NOTEBOOK_OVERLAY, OVER2_CASE },
+ { "client_Miranda_010_overlay", _T("*Miranda*0.10*"), _T("Miranda v0.10"), _T("ClientIcons_General"), IDI_MIRANDA_10s, OVER2_CASE },
+ { "client_Miranda_09_overlay", _T("*Miranda*0.9*"), _T("Miranda v0.9"), _T("ClientIcons_General"), IDI_MIRANDA_9s, OVER2_CASE },
+ { "client_Miranda_08_overlay", _T("*Miranda*0.8*"), _T("Miranda v0.8"), _T("ClientIcons_General"), IDI_MIRANDA_8s, OVER2_CASE },
+ { "client_Miranda_07_overlay", _T("*Miranda*0.7*"), _T("Miranda v0.7"), _T("ClientIcons_General"), IDI_MIRANDA_7s, OVER2_CASE },
+ { "client_Miranda_06_overlay", _T("*Miranda*0.6*"), _T("Miranda v0.6"), _T("ClientIcons_General"), IDI_MIRANDA_6s, OVER2_CASE },
+ { "client_Miranda_05_overlay", _T("*Miranda*0.5*"), _T("Miranda v0.5"), _T("ClientIcons_General"), IDI_MIRANDA_5s, OVER2_CASE },
+ { "client_Miranda_04_overlay", _T("*Miranda*0.4*"), _T("Miranda v0.4"), _T("ClientIcons_General"), IDI_MIRANDA_4s, OVER2_CASE },
+};
+
+#define DEFAULT_KN_FP_OVERLAYS2_COUNT SIZEOF(def_kn_fp_overlays2_mask) //should contain the count of records above
+#define DEFAULT_KN_FP_OVERLAYS2_NO_VER_COUNT DEFAULT_KN_FP_OVERLAYS2_COUNT - 7
+//#########################################################################################################################################
+//######################################################### Overlays, layer #3 ############################################################
+//#########################################################################################################################################
+KN_FP_MASK def_kn_fp_overlays3_mask[] =
+{// IconName Mask Icon caption NULL ICON_RESOURCE_ID
+ { "client_SecureIM_overlay", _T("*Secure*IM*"), _T("+SecureIM"), _T("ClientIcons_General"), IDI_SECUREIM_OVERLAY, SECURITY_CASE },
+ { "client_SimpPro_overlay", _T("*SimpPro*"), _T("+SimpPro"), _T("ClientIcons_General"), IDI_SIMPPRO_OVERLAY, SECURITY_CASE },
+ { "client_SimpLite_overlay", _T("*SimpLite*"), _T("+SimpLite"), _T("ClientIcons_General"), IDI_SIMPLITE_OVERLAY, SECURITY_CASE },
+ { "client_IMSecure_overlay", _T("*IMSecure*"), _T("+IMSecure"), _T("ClientIcons_General"), IDI_IMSECURE_OVERLAY, SECURITY_CASE },
+};
+
+#define DEFAULT_KN_FP_OVERLAYS3_COUNT SIZEOF(def_kn_fp_overlays3_mask) //should contain the count of records above
diff --git a/plugins/FingerPrintModPlus/src/global.h b/plugins/FingerPrintModPlus/src/global.h
new file mode 100644
index 0000000000..59da0a8511
--- /dev/null
+++ b/plugins/FingerPrintModPlus/src/global.h
@@ -0,0 +1,165 @@
+/*
+Fingerprint Mod+ (client version) icons module for Miranda IM
+
+Copyright © 2006-2007 Artem Shpynov aka FYR, Bio, Faith Healer. 2009-2010 HierOS
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#define MIRANDA_CUSTOM_LP
+// Modify the following defines if you have to target a platform prior to the ones specified below.
+// Refer to MSDN for the latest info on corresponding values for different platforms.
+#ifndef WINVER // Allow use of features specific to Windows XP or later.
+#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
+#endif
+
+#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
+#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
+#endif
+
+#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
+#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
+#endif
+
+#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
+#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
+#endif
+
+#define _CRT_SECURE_NO_DEPRECATE
+
+//Start of header
+// Native include
+#include <windows.h>
+#include <windowsx.h>
+#include <malloc.h>
+
+// Miranda IM SDK includes
+#include <newpluginapi.h>
+#include <win2k.h>
+#include <m_cluiframes.h>
+#include <m_database.h>
+#include <m_options.h>
+#include <m_langpack.h>
+#include <m_icolib.h>
+#include <m_protocols.h>
+#include <m_userinfo.h>
+
+// plugins SDK
+#include <m_extraicons.h>
+#include <m_folders.h>
+#include <m_updater.h>
+
+//plugins header
+#include "version.h"
+#include "m_fingerprint.h"
+#include "resource.h"
+#include "utilities.h"
+
+#if defined(__GNUC__)
+#define _alloca alloca
+//#define FASTCALL
+#else
+#define FASTCALL __fastcall
+#endif
+
+typedef struct {
+ BYTE b;
+ BYTE g;
+ BYTE r;
+ BYTE a;
+} RGBA;
+
+typedef struct _knfpMask
+{
+ LPSTR szIconName;
+ LPTSTR szMask;
+ LPTSTR szClientDescription;
+ LPTSTR szIconFileName;
+ int iIconIndex;
+ int iSectionFlag;
+ BOOL fNotUseOverlay;
+} KN_FP_MASK;
+
+typedef struct _foundInfo
+{
+ DWORD dwArray;
+ HANDLE hRegisteredImage;
+} FOUNDINFO;
+
+#define MIRANDA_CASE 1
+#define MULTIPROTOCOL_CASE 2
+#define ICQ_OFF_CASE 3
+#define ICQ_UNOFF_CASE 4
+#define JABBER_CASE 5
+#define MSN_CASE 6
+#define AIM_CASE 7
+#define YAHOO_CASE 8
+#define IRC_CASE 9
+#define VOIP_CASE 10
+#define SKYPE_CASE 11
+#define GADU_CASE 12
+#define PACKS_CASE 13
+#define MRA_CASE 14
+#define OVER1_CASE 15
+#define SECURITY_CASE 16
+#define OTHER_CASE 17
+#define OVER2_CASE 18
+#define PLATFORM_CASE 19
+#define WEATHER_CASE 20
+#define RSS_CASE 21
+#define QQ_CASE 22
+#define TLEN_CASE 23
+
+typedef struct _settingsInfo
+{
+ int idCtrl;
+ LPCSTR szSetName;
+} SETTINGS_INFO;
+
+SETTINGS_INFO settings [] =
+{
+ {IDC_OVERLAY1, "Overlay1"},
+ {IDC_OVERLAY2, "Overlay2"},
+ {IDC_OVERLAY3, "Overlay3"},
+ {IDC_VERSION, "ShowVersion"},
+
+ {IDC_GROUPMIRANDA, "GroupMiranda"},
+ {IDC_GROUPMULTI, "GroupMulti"},
+ {IDC_GROUPPACKS, "GroupPacks"},
+ {IDC_GROUPOTHERS, "GroupOtherProtos"},
+
+ {IDC_GROUPAIM, "GroupAim"},
+ {IDC_GROUPGADU, "GroupGadu"},
+ {IDC_GROUPICQ, "GroupIcq"},
+ {IDC_GROUPIRC, "GroupIrc"},
+ {IDC_GROUPJABBER, "GroupJabber"},
+ {IDC_GROUPMAIL, "GroupMail"},
+ {IDC_GROUPMSN, "GroupMsn"},
+ {IDC_GROUPQQ, "GroupQQ"},
+ {IDC_GROUPRSS, "GroupRSS"},
+ {IDC_GROUPSKYPE, "GroupSkype"},
+ {IDC_GROUPTLEN, "GroupTlen"},
+ {IDC_GROUPVOIP, "GroupVoIP"},
+ {IDC_GROUPWEATHER, "GroupWeather"},
+ {IDC_GROUPYAHOO, "GroupYahoo"}
+};
+#define DEFAULT_SETTINGS_COUNT SIZEOF(settings)
+
+#define PtrIsValid(p) (((p)!=0)&&(((HANDLE)(p))!=INVALID_HANDLE_VALUE))
+#define SAFE_FREE(p) {if (PtrIsValid(p)){free((VOID*)p);(p)=NULL;}}
+
+#define DEFAULT_SKIN_FOLDER _T("Icons\\Fp_ClientIcons")
+
+extern BYTE gbUnicodeAPI;
diff --git a/plugins/FingerPrintModPlus/src/utilities.cpp b/plugins/FingerPrintModPlus/src/utilities.cpp
new file mode 100644
index 0000000000..9998d056d1
--- /dev/null
+++ b/plugins/FingerPrintModPlus/src/utilities.cpp
@@ -0,0 +1,333 @@
+/*
+Fingerprint Mod+ (client version) icons module for Miranda IM
+
+Copyright © 2006-2007 Artem Shpynov aka FYR, Bio, Faith Healer. 2009-2010 HierOS
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+//Start of header
+#include "global.h"
+
+LPWSTR make_unicode_string(LPCSTR utf8);
+LPWSTR make_unicode_string_static(LPCSTR utf8, LPWSTR unicode, size_t unicode_len);
+LPSTR make_utf8_string(LPCWSTR unicode);
+LPSTR make_utf8_string_static(LPCWSTR unicode, LPSTR utf8, size_t utf_size);
+
+LPVOID __fastcall SAFE_MALLOC(size_t size)
+{
+ LPVOID p = NULL;
+
+ if(size)
+ {
+ p = malloc(size);
+
+ if(p)
+ ZeroMemory(p, size);
+ }
+ return p;
+}
+
+size_t __fastcall strlennull(LPCSTR string)
+{
+ if(string)
+ return strlen(string);
+
+ return 0;
+}
+
+int null_snprintf(LPSTR buffer, size_t count, LPCSTR fmt, ...)
+{
+ va_list va;
+ int len;
+
+ ZeroMemory(buffer, count);
+ va_start(va, fmt);
+ len = _vsnprintf(buffer, count-1, fmt, va);
+ va_end(va);
+ return len;
+}
+
+LPSTR __fastcall TranslateUtfStatic(LPCSTR src, LPSTR buf, size_t bufsize)
+{ // this takes UTF-8 strings only!!!
+ if(strlennull(src))
+ { // we can use unicode translate (0.5+)
+ LPWSTR usrc = make_unicode_string(src);
+
+ make_utf8_string_static(TranslateW(usrc), buf, bufsize);
+
+ SAFE_FREE(usrc);
+ }
+ else
+ buf[0] = '\0';
+
+ return buf;
+}
+
+//unsigned char *make_utf8_string_static(LPCWSTR unicode, unsigned char *utf8, size_t utf_size)
+LPSTR make_utf8_string_static(LPCWSTR unicode, LPSTR utf8, size_t utf_size)
+{
+ size_t index = 0;
+ size_t out_index = 0;
+ WORD c;
+
+ c = (WORD)unicode[index++];
+ while(c)
+ {
+ if(c < 0x080)
+ {
+ if(out_index + 1 >= utf_size) break;
+ utf8[out_index++] = (CHAR)c;
+ }
+ else if(c < 0x800)
+ {
+ if(out_index + 2 >= utf_size) break;
+ utf8[out_index++] = 0xc0 | (c >> 6);
+ utf8[out_index++] = 0x80 | (c & 0x3f);
+ }
+ else
+ {
+ if(out_index + 3 >= utf_size) break;
+ utf8[out_index++] = 0xe0 | (c >> 12);
+ utf8[out_index++] = 0x80 | ((c >> 6) & 0x3f);
+ utf8[out_index++] = 0x80 | (c & 0x3f);
+ }
+ c = (WORD)unicode[index++];
+ }
+ utf8[out_index] = 0x00;
+
+ return utf8;
+}
+
+LPSTR make_utf8_string(LPCWSTR unicode)
+{
+ size_t size = 0;
+ size_t index = 0;
+ LPSTR out;
+ WORD c;
+
+ if(!unicode) return NULL;
+
+ /* first calculate the size of the target string */
+ c = (WORD)unicode[index++];
+ while(c)
+ {
+ if(c < 0x0080)
+ size++;
+ else if(c < 0x0800)
+ size += 2;
+ else
+ size += 3;
+ c = (WORD)unicode[index++];
+ }
+
+ //out = (unsigned char*)SAFE_MALLOC(size + 1);
+ out = (LPSTR)SAFE_MALLOC(size + 1);
+ if(out == NULL)
+ return NULL;
+ else
+ return make_utf8_string_static(unicode, out, size + 1);
+}
+
+LPWSTR make_unicode_string_static(LPCSTR utf8, LPWSTR unicode, size_t unicode_len)
+{
+ size_t index = 0;
+ size_t out_index = 0;
+ BYTE c;
+
+ c = (BYTE)utf8[index++];
+ while(c)
+ {
+ if(out_index + 1 >= unicode_len) break;
+ if((c & 0x80) == 0)
+ {
+ unicode[out_index++] = c;
+ }
+ else if((c & 0xe0) == 0xe0)
+ {
+ unicode[out_index] = (c & 0x1F) << 12;
+ c = (BYTE)utf8[index++];
+ unicode[out_index] |= (c & 0x3F) << 6;
+ c = (BYTE)utf8[index++];
+ unicode[out_index++] |= (c & 0x3F);
+ }
+ else
+ {
+ unicode[out_index] = (c & 0x3F) << 6;
+ c = (BYTE)utf8[index++];
+ unicode[out_index++] |= (c & 0x3F);
+ }
+ c = (BYTE)utf8[index++];
+ }
+ unicode[out_index] = 0;
+
+ return unicode;
+}
+
+LPWSTR make_unicode_string(LPCSTR utf8)
+{
+ size_t size = 0, index = 0;
+ LPWSTR out;
+ BYTE c;
+
+ if(!utf8) return NULL;
+
+ /* first calculate the size of the target string */
+ c = (BYTE)utf8[index++];
+ while(c)
+ {
+ if((c & 0x80) == 0)
+ {
+ index += 0;
+ }
+ else if((c & 0xe0) == 0xe0)
+ {
+ index += 2;
+ }
+ else
+ {
+ index++;
+ }
+ size++;
+ c = (BYTE)utf8[index++];
+ }
+
+ out = (LPWSTR)SAFE_MALLOC((size + 1) * sizeof(WCHAR));
+ if(out == NULL)
+ return NULL;
+ else
+ return make_unicode_string_static(utf8, out, size + 1);
+}
+
+int UTF8_IsValid(LPCSTR pszInput)
+{
+ int nb, i;
+ LPCSTR c = pszInput;
+
+ if(!pszInput) return 0;
+
+ for(c = pszInput; *c; c += (nb + 1))
+ {
+ if(!(*c & 0x80)) nb = 0;
+ else if((*c & 0xc0) == 0x80) return 0;
+ else if((*c & 0xe0) == 0xc0) nb = 1;
+ else if((*c & 0xf0) == 0xe0) nb = 2;
+ else if ((*c & 0xf8) == 0xf0) nb = 3;
+ else if ((*c & 0xfc) == 0xf8) nb = 4;
+ else if ((*c & 0xfe) == 0xfc) nb = 5;
+
+ for(i = 1; i <= nb; i++) // we this forward, do not cross end of string
+ if((*(c + i) & 0xc0) != 0x80)
+ return 0;
+ }
+
+ return 1;
+}
+
+static BOOL bHasCP_UTF8 = FALSE;
+int utf8_decode_static(LPCSTR from, LPSTR to, int to_size)
+{
+ int nResult = 0;
+ // Validate the string
+ if(!UTF8_IsValid(from))
+ return 0;
+
+ // Use the native conversion routines when available
+ if(bHasCP_UTF8)
+ {
+ LPWSTR wszTemp = NULL;
+ size_t inlen = strlennull(from);
+
+ wszTemp = (LPWSTR)_alloca((inlen + 1) * sizeof(WCHAR));
+
+ // Convert the UTF-8 string to UCS
+ if(MultiByteToWideChar(CP_UTF8, 0, from, -1, wszTemp, (int)inlen + 1))
+ {
+ // Convert the UCS string to local ANSI codepage
+ if(WideCharToMultiByte(CP_ACP, 0, wszTemp, -1, to, to_size, NULL, NULL))
+ {
+ nResult = 1;
+ }
+ }
+ }
+ else
+ {
+ size_t chars = strlennull(from) + 1;
+ LPWSTR unicode = (LPWSTR)_alloca(chars * sizeof(WCHAR));
+
+ make_unicode_string_static(from, unicode, chars);
+
+ WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, unicode, -1, to, to_size, NULL, NULL);
+
+ nResult = 1;
+ }
+
+ return nResult;
+}
+
+static LRESULT ControlAddStringUtf(HWND ctrl, DWORD msg, LPCSTR szString)
+{
+ char str[MAX_PATH];
+ LPSTR szItem = TranslateUtfStatic(szString, str, MAX_PATH);
+ LRESULT item = -1;
+
+ if(gbUnicodeAPI)
+ {
+ LPWSTR wItem = make_unicode_string(szItem);
+
+ item = SendMessageW(ctrl, msg, 0, (LPARAM)wItem);
+ SAFE_FREE(wItem);
+ }
+ else
+ {
+ size_t size = strlennull(szItem) + 2;
+ LPSTR aItem = (LPSTR)_alloca(size);
+
+ if(utf8_decode_static(szItem, aItem, (int)size))
+ item = SendMessageA(ctrl, msg, 0, (LPARAM)aItem);
+ }
+ return item;
+}
+
+static LRESULT ControlAddStringW(HWND ctrl, DWORD msg, LPCWSTR wszString)
+{
+ return SendMessageW(ctrl, msg, 0, (LPARAM)TranslateW(wszString));
+}
+
+LRESULT ComboBoxAddStringUtf(HWND hCombo, LPCSTR szString, DWORD data)
+{
+ LRESULT item = ControlAddStringUtf(hCombo, CB_ADDSTRING, szString);
+ SendMessage(hCombo, CB_SETITEMDATA, item, data);
+
+ return item;
+}
+
+LRESULT ComboBoxAddStringW(HWND hCombo, LPCWSTR wszString, DWORD data)
+{
+ LRESULT item = ControlAddStringW(hCombo, CB_ADDSTRING, wszString);
+ SendMessageW(hCombo, CB_SETITEMDATA, item, data);
+
+ return item;
+}
+
+LRESULT ListBoxAddStringUtf(HWND hList, LPCSTR szString)
+{
+ return ControlAddStringUtf(hList, LB_ADDSTRING, szString);
+}
+
+LRESULT ListBoxAddStringW(HWND hList, LPCWSTR wszString)
+{
+ return ControlAddStringW(hList, LB_ADDSTRING, wszString);
+}
diff --git a/plugins/FingerPrintModPlus/src/utilities.h b/plugins/FingerPrintModPlus/src/utilities.h
new file mode 100644
index 0000000000..945fbab7d9
--- /dev/null
+++ b/plugins/FingerPrintModPlus/src/utilities.h
@@ -0,0 +1,46 @@
+/*
+Fingerprint Mod+ (client version) icons module for Miranda IM
+
+Copyright © 2006-2007 Artem Shpynov aka FYR, Bio, Faith Healer. 2009-2010 HierOS
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+static LRESULT ControlAddStringUtf(HWND ctrl, DWORD msg, const char* szString);
+static LRESULT ControlAddStringW(HWND ctrl, DWORD msg, LPCWSTR szString);
+
+LRESULT ComboBoxAddStringUtf(HWND hCombo, const char* szString, DWORD data);
+LRESULT ComboBoxAddStringW(HWND hCombo, LPCWSTR szString, DWORD data);
+
+LRESULT ListBoxAddStringUtf(HWND hList, const char* szString);
+LRESULT ListBoxAddStringW(HWND hList, LPCWSTR szString);
+
+#ifdef UNICODE
+#define ControlAddString ControlAddStringW
+#else
+#define ControlAddString ControlAddStringUtf
+#endif // !UNICODE
+
+#ifdef UNICODE
+#define ComboBoxAddString ComboBoxAddStringW
+#else
+#define ComboBoxAddString ComboBoxAddStringUtf
+#endif // !UNICODE
+
+#ifdef UNICODE
+#define ListBoxAddString ListBoxAddStringW
+#else
+#define ListBoxAddString ListBoxAddStringUtf
+#endif // !UNICODE