summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AVS/src/options.cpp4
-rw-r--r--plugins/AssocMgr/src/test.cpp12
-rw-r--r--plugins/AuthState/src/main.cpp4
-rw-r--r--plugins/AuthState/src/options.cpp8
-rw-r--r--plugins/AutoShutdown/src/watcher.cpp4
-rw-r--r--plugins/AvatarHistory/src/options.cpp2
-rw-r--r--plugins/BasicHistory/src/HistoryWindow.cpp24
-rw-r--r--plugins/BasicHistory/src/Options.cpp16
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp8
-rw-r--r--plugins/BuddyExpectator/src/options.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_extraimage.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp16
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/extraimage.cpp8
-rw-r--r--plugins/Clist_mw/src/clc.cpp6
-rw-r--r--plugins/Clist_mw/src/clcitems.cpp4
-rw-r--r--plugins/Clist_mw/src/clistmod.cpp4
-rw-r--r--plugins/Clist_mw/src/clistsettings.cpp4
-rw-r--r--plugins/Clist_mw/src/contact.cpp4
-rw-r--r--plugins/Clist_nicer/src/clcitems.cpp4
-rw-r--r--plugins/Clist_nicer/src/contact.cpp8
-rw-r--r--plugins/Clist_nicer/src/extBackg.cpp4
-rw-r--r--plugins/Clist_nicer/src/viewmodes.cpp20
-rw-r--r--plugins/CmdLine/src/mimcmd_handlers.cpp16
-rw-r--r--plugins/CmdLine/src/utils.cpp4
-rw-r--r--plugins/ContactsPlus/src/utils.cpp4
-rw-r--r--plugins/CountryFlags/src/extraimg.cpp12
-rw-r--r--plugins/CyrTranslit/src/MirandaContact.cpp7
-rw-r--r--plugins/DbEditorPP/src/copymodule.cpp10
-rw-r--r--plugins/DbEditorPP/src/deletemodule.cpp6
-rw-r--r--plugins/DbEditorPP/src/exportimport.cpp10
-rw-r--r--plugins/DbEditorPP/src/findwindow.cpp4
-rw-r--r--plugins/DbEditorPP/src/modules.cpp4
-rw-r--r--plugins/DbEditorPP/src/moduletree.cpp12
-rw-r--r--plugins/Dbx_mmap_SA/src/security.cpp6
-rw-r--r--plugins/ExtraIcons/src/DefaultExtraIcons.cpp4
-rw-r--r--plugins/ExtraIcons/src/ExtraIcon.cpp4
-rw-r--r--plugins/ExtraIcons/src/options.cpp4
-rw-r--r--plugins/FavContacts/src/contact_cache.cpp4
-rw-r--r--plugins/FavContacts/src/favlist.h4
-rw-r--r--plugins/FavContacts/src/main.cpp22
-rw-r--r--plugins/FloatingContacts/src/main.cpp4
-rw-r--r--plugins/Gender/src/main.cpp4
-rw-r--r--plugins/Gender/src/options.cpp8
-rw-r--r--plugins/HistorySweeperLight/src/historysweeperlight.cpp4
-rw-r--r--plugins/HistorySweeperLight/src/main.cpp4
-rw-r--r--plugins/HistorySweeperLight/src/options.cpp8
-rw-r--r--plugins/IgnoreState/src/main.cpp4
-rw-r--r--plugins/IgnoreState/src/options.cpp8
-rw-r--r--plugins/KeyboardNotify/src/ignore.cpp8
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp4
-rw-r--r--plugins/ListeningTo/src/players/mradio.cpp4
-rw-r--r--plugins/MetaContacts/src/addto.cpp7
-rw-r--r--plugins/MetaContacts/src/meta_main.cpp4
-rw-r--r--plugins/MetaContacts/src/meta_menu.cpp4
-rw-r--r--plugins/MetaContacts/src/meta_services.cpp8
-rw-r--r--plugins/MetaContacts/src/meta_utils.cpp54
-rw-r--r--plugins/MirOTR/MirOTR/dllmain.cpp4
-rw-r--r--plugins/MirOTR/MirOTR/options.cpp4
-rw-r--r--plugins/MirOTR/MirOTR/utils.cpp4
-rw-r--r--plugins/ModernOpt/src/mopt_ignore.cpp4
-rwxr-xr-xplugins/Msg_Export/src/options.cpp4
-rwxr-xr-xplugins/Msg_Export/src/utils.cpp8
-rw-r--r--plugins/NewXstatusNotify/src/indsnd.cpp8
-rwxr-xr-xplugins/New_GPG/src/icons.cpp4
-rwxr-xr-xplugins/New_GPG/src/init.cpp2
-rwxr-xr-xplugins/New_GPG/src/options.cpp4
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp4
-rw-r--r--plugins/Nudge/src/main.cpp2
-rw-r--r--plugins/Popup/src/config.cpp4
-rw-r--r--plugins/Popup/src/opt_contacts.cpp8
-rw-r--r--plugins/Popup/src/srmm_menu.cpp4
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp4
-rw-r--r--plugins/Rate/src/main.cpp4
-rw-r--r--plugins/Rate/src/options.cpp8
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp4
-rw-r--r--plugins/Scriver/src/chat/clist.cpp8
-rw-r--r--plugins/Scriver/src/msgoptions.cpp8
-rw-r--r--plugins/Scriver/src/msgs.cpp4
-rw-r--r--plugins/SecureIM/src/crypt_icons.cpp8
-rw-r--r--plugins/SecureIM/src/crypt_lists.cpp4
-rw-r--r--plugins/SecureIM/src/options.cpp16
-rw-r--r--plugins/SeenPlugin/src/missed.cpp8
-rw-r--r--plugins/SeenPlugin/src/utils.cpp48
-rw-r--r--plugins/Sessions/Src/Main.cpp24
-rw-r--r--plugins/Sessions/Src/Options.cpp16
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp4
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp8
-rwxr-xr-xplugins/StopSpamMod/src/utilities.cpp12
-rw-r--r--plugins/StopSpamPlus/src/services.cpp4
-rw-r--r--plugins/TabSRMM/chat/clist.cpp8
-rw-r--r--plugins/TabSRMM/src/container.cpp8
-rw-r--r--plugins/TabSRMM/src/globals.cpp8
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp8
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp8
-rw-r--r--plugins/TabSRMM/src/templates.cpp4
-rw-r--r--plugins/TabSRMM/src/trayicon.cpp4
-rw-r--r--plugins/TabSRMM/src/typingnotify.cpp4
-rw-r--r--plugins/TipperYM/src/options.cpp8
-rw-r--r--plugins/TipperYM/src/popwin.cpp8
-rw-r--r--plugins/TipperYM/src/subst.cpp4
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.cpp8
-rw-r--r--plugins/UserInfoEx/src/mir_db.cpp4
-rw-r--r--plugins/Variables/src/contact.cpp6
-rw-r--r--plugins/Variables/src/parse_miranda.cpp16
-rw-r--r--plugins/WhenWasIt/src/dlg_handlers.cpp6
-rw-r--r--plugins/WhenWasIt/src/notifiers.cpp4
-rw-r--r--plugins/WhenWasIt/src/services.cpp8
-rw-r--r--plugins/WhenWasIt/src/utils.cpp4
-rw-r--r--plugins/YAPP/src/options.cpp4
-rw-r--r--plugins/YAPP/src/yapp_history_dlg.cpp2
111 files changed, 403 insertions, 445 deletions
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp
index 58502a9655..54858c99c3 100644
--- a/plugins/AVS/src/options.cpp
+++ b/plugins/AVS/src/options.cpp
@@ -434,14 +434,14 @@ INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
if (oldVal && !newVal)
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
char* szContactProto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if (szContactProto != NULL && !strcmp(szContactProto, szProto))
DeleteAvatarFromCache(hContact, TRUE);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp
index 73112af5a5..3c6169a11d 100644
--- a/plugins/AssocMgr/src/test.cpp
+++ b/plugins/AssocMgr/src/test.cpp
@@ -74,7 +74,7 @@ static int __inline AssocMgr_AddNewUrlType(const char *prefix,const char *desc,H
#define AIM_KEY_NL "NotOnList"
struct oscar_data { HINSTANCE hInstance; } static conn;
static __inline HANDLE find_contact(const char *nick) { nick; return NULL; }
-static __inline HANDLE add_contact(const char *nick) { nick; return (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); }
+static __inline HANDLE add_contact(const char *nick) { nick; return db_find_first(); }
static __inline void aim_gchat_joinrequest(const char *room, int exchange) { room; exchange; MessageBoxA(NULL,"Join group chat!",room,MB_OK); return; }
#include <m_protosvc.h>
#include <m_addcontact.h>
@@ -205,7 +205,7 @@ void aim_links_destroy()
#define gpszICQProtoName "ICQ"
#define IDI_ICQ 101
#define hInst GetModuleHandleA("ICQ")
-static __inline HANDLE HContactFromUIN(DWORD dwUIN,int *Added) { dwUIN; Added; return (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); }
+static __inline HANDLE HContactFromUIN(DWORD dwUIN,int *Added) { dwUIN; Added; return db_find_first(); }
static __inline HANDLE ICQFindFirstContact(void) { return NULL; }
static __inline HANDLE ICQFindNextContact(HANDLE hContact) { hContact; return NULL; }
static __inline void AddToCache(HANDLE hContact,DWORD dwUin) { hContact; dwUin; }
@@ -402,7 +402,7 @@ void UninitIcqFiles(void)
#define IDI_YAHOO 10101
#define hinstance GetModuleHandleA("YAHOO")
static __inline HANDLE getbuddyH(const char *yahoo_id) { yahoo_id; return NULL; }
-static __inline HANDLE add_buddy(const char *yahoo_id,const char *yahoo_name,DWORD flags) { yahoo_id; yahoo_name; flags; return (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); }
+static __inline HANDLE add_buddy(const char *yahoo_id,const char *yahoo_name,DWORD flags) { yahoo_id; yahoo_name; flags; return db_find_first(); }
#include <m_protosvc.h>
#include <m_addcontact.h>
#include <m_message.h>
@@ -513,7 +513,7 @@ void YmsgrLinksUninit(void)
#define IDI_MSN 101
#define hInst GetModuleHandleA("MSN")
static __inline HANDLE MSN_HContactFromEmailT(const char *msnEmail) { msnEmail; return NULL; }
-static __inline HANDLE MSN_HContactFromEmail(const char *msnEmail,const char *msnNick,int addIfNeeded,int temporary) { msnEmail; msnNick; addIfNeeded; temporary; return (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); }
+static __inline HANDLE MSN_HContactFromEmail(const char *msnEmail,const char *msnNick,int addIfNeeded,int temporary) { msnEmail; msnNick; addIfNeeded; temporary; return db_find_first(); }
#include <m_protosvc.h>
#include <m_addcontact.h>
#include <m_message.h>
@@ -622,7 +622,7 @@ void UnloadMsnLinks(void)
#define IDI_GG 251
#define hInstance GetModuleHandleA("GG")
typedef DWORD uin_t;
-static __inline HANDLE gg_getcontact(uin_t uin,int create,int inlist,char *szNick) { uin; create; inlist; szNick; return (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); }
+static __inline HANDLE gg_getcontact(uin_t uin,int create,int inlist,char *szNick) { uin; create; inlist; szNick; return db_find_first(); }
#include <m_protosvc.h>
#include <m_addcontact.h>
#include <m_message.h>
@@ -687,7 +687,7 @@ void gg_unregisterlinks(void)
#define IDI_JABBER 102
#define hInst GetModuleHandleA("JABBER")
static __inline HANDLE JabberHContactFromJID(const char *jid) { jid; return NULL; }
-static __inline HANDLE JabberDBCreateContact(char *jid,char *nick,BOOL temporary,BOOL stripResource) { jid; nick; temporary; stripResource; return (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); }
+static __inline HANDLE JabberDBCreateContact(char *jid,char *nick,BOOL temporary,BOOL stripResource) { jid; nick; temporary; stripResource; return db_find_first(); }
#include <m_protosvc.h>
#include <m_addcontact.h>
#include <m_message.h>
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp
index 29224bd3d3..6e8bcdb99a 100644
--- a/plugins/AuthState/src/main.cpp
+++ b/plugins/AuthState/src/main.cpp
@@ -248,10 +248,10 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
hExtraIcon = ExtraIcon_Register("authstate", "Auth State", "authgrant_icon");
if (hExtraIcon != NULL) {
// Set initial value for all contacts
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL) {
onExtraImageApplying((WPARAM)hContact, 1);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
else {
diff --git a/plugins/AuthState/src/options.cpp b/plugins/AuthState/src/options.cpp
index d2248d9e44..cef1db78b8 100644
--- a/plugins/AuthState/src/options.cpp
+++ b/plugins/AuthState/src/options.cpp
@@ -100,21 +100,21 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
clistIcon = SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_GETCURSEL, 0, 0);
clistIcon++;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact)
{
CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&g_IECClear);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
g_IECClear.ColumnType = clistIcon;
onExtraImageListRebuild(0,0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact)
{
onExtraImageApplying((WPARAM)hContact,0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
//Store options values to DB
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp
index 3121248cba..99c3d524c5 100644
--- a/plugins/AutoShutdown/src/watcher.cpp
+++ b/plugins/AutoShutdown/src/watcher.cpp
@@ -180,7 +180,7 @@ static BOOL CheckAllContactsOffline(void)
HANDLE hContact;
char *pszProto;
fSmartCheck=DBGetContactSettingByte(NULL,"AutoShutdown","SmartOfflineCheck",SETTING_SMARTOFFLINECHECK_DEFAULT);
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact=db_find_first();
while(hContact!=NULL) {
pszProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
if(pszProto!=NULL && CallProtoService(pszProto,PS_GETSTATUS,0,0)!=ID_STATUS_OFFLINE)
@@ -193,7 +193,7 @@ static BOOL CheckAllContactsOffline(void)
fAllOffline=FALSE;
break;
}
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ hContact=db_find_next(hContact);
}
return fAllOffline;
}
diff --git a/plugins/AvatarHistory/src/options.cpp b/plugins/AvatarHistory/src/options.cpp
index bd4da44d7f..fbf7f8312f 100644
--- a/plugins/AvatarHistory/src/options.cpp
+++ b/plugins/AvatarHistory/src/options.cpp
@@ -220,7 +220,7 @@ static INT_PTR CALLBACK PopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
op.popup_use_win_colors = IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS) != 0;
op.popup_use_default_colors = IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS) != 0;
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ HANDLE hContact = db_find_first();
ShowTestPopup(hContact,TranslateT("Test Contact"), TranslateT("Test description"), &op);
break;
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp
index a518914278..a8dfcefd14 100644
--- a/plugins/BasicHistory/src/HistoryWindow.cpp
+++ b/plugins/BasicHistory/src/HistoryWindow.cpp
@@ -1799,7 +1799,7 @@ void HistoryWindow::ReloadContacts()
}
}
- HANDLE _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE _hContact = db_find_first();
while(_hContact)
{
if(EventList::GetContactMessageNumber(_hContact) && (metaContactProto == NULL || DBGetContactSettingByte(_hContact, metaContactProto, "IsSubcontact", 0) == 0))
@@ -1819,7 +1819,7 @@ void HistoryWindow::ReloadContacts()
}
}
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)_hContact, 0);
+ _hContact = db_find_next(_hContact);
}
if(hContact != NULL)
@@ -1970,7 +1970,7 @@ void HistoryWindow::SavePos(bool all)
HANDLE contactToSave = hContact;
if(all)
{
- HANDLE _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE _hContact = db_find_first();
while(_hContact)
{
DBDeleteContactSetting(_hContact, MODULE, "history_x");
@@ -1980,7 +1980,7 @@ void HistoryWindow::SavePos(bool all)
DBDeleteContactSetting(_hContact, MODULE, "history_ismax");
DBDeleteContactSetting(_hContact, MODULE, "history_splitterv");
DBDeleteContactSetting(_hContact, MODULE, "history_splitter");
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)_hContact, 0);
+ _hContact = db_find_next(_hContact);
}
contactToSave = NULL;
@@ -2460,7 +2460,7 @@ HANDLE HistoryWindow::GetNextContact(HANDLE hContact, int adder)
{
if(hContact != NULL)
{
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ _hContact = db_find_next(hContact);
while(_hContact)
{
HANDLE hItem = (HANDLE)SendMessage(contactList, CLM_FINDCONTACT, (WPARAM)_hContact, 0);
@@ -2470,7 +2470,7 @@ HANDLE HistoryWindow::GetNextContact(HANDLE hContact, int adder)
break;
}
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)_hContact, 0);
+ _hContact = db_find_next(_hContact);
}
if(!find && EventList::GetContactMessageNumber(NULL))
@@ -2482,7 +2482,7 @@ HANDLE HistoryWindow::GetNextContact(HANDLE hContact, int adder)
if(!find)
{
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ _hContact = db_find_first();
while(_hContact && _hContact != hContact)
{
HANDLE hItem = (HANDLE)SendMessage(contactList, CLM_FINDCONTACT, (WPARAM)_hContact, 0);
@@ -2492,14 +2492,14 @@ HANDLE HistoryWindow::GetNextContact(HANDLE hContact, int adder)
break;
}
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)_hContact, 0);
+ _hContact = db_find_next(_hContact);
}
}
}
else
{
HANDLE lastContact = NULL;
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ _hContact = db_find_first();
while(_hContact && _hContact != hContact)
{
HANDLE hItem = (HANDLE)SendMessage(contactList, CLM_FINDCONTACT, (WPARAM)_hContact, 0);
@@ -2508,14 +2508,14 @@ HANDLE HistoryWindow::GetNextContact(HANDLE hContact, int adder)
lastContact = _hContact;
}
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)_hContact, 0);
+ _hContact = db_find_next(_hContact);
}
if(hContact != NULL)
{
if(lastContact == NULL && !EventList::GetContactMessageNumber(NULL))
{
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ _hContact = db_find_next(hContact);
while(_hContact)
{
HANDLE hItem = (HANDLE)SendMessage(contactList, CLM_FINDCONTACT, (WPARAM)_hContact, 0);
@@ -2524,7 +2524,7 @@ HANDLE HistoryWindow::GetNextContact(HANDLE hContact, int adder)
lastContact = _hContact;
}
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)_hContact, 0);
+ _hContact = db_find_next(_hContact);
}
}
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp
index 67610e7724..4d8b759d7e 100644
--- a/plugins/BasicHistory/src/Options.cpp
+++ b/plugins/BasicHistory/src/Options.cpp
@@ -598,12 +598,12 @@ void Options::SaveTasks(std::list<TaskOptions>* tasks)
sprintf_s(buf, "Task_zipPassword_%d", i);
DBWriteContactSettingString(0, MODULE, buf, it->zipPassword.c_str());
- HANDLE _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE _hContact = db_find_first();
sprintf_s(buf, "IsInTask_%d", i);
while(_hContact)
{
DBDeleteContactSetting(_hContact, MODULE, buf);
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)_hContact, 0);
+ _hContact = db_find_next(_hContact);
}
for(size_t j = 0; j < it->contacts.size(); ++j)
@@ -660,12 +660,12 @@ void Options::SaveTasks(std::list<TaskOptions>* tasks)
sprintf_s(buf, "Task_taskName_%d", i);
DBDeleteContactSetting(NULL, MODULE, buf);
- HANDLE _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE _hContact = db_find_first();
sprintf_s(buf, "IsInTask_%d", i);
while(_hContact)
{
DBDeleteContactSetting(_hContact, MODULE, buf);
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)_hContact, 0);
+ _hContact = db_find_next(_hContact);
}
}
@@ -758,7 +758,7 @@ void Options::LoadTasks()
DBFreeVariant(&var);
}
- HANDLE _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE _hContact = db_find_first();
sprintf_s(buf, "IsInTask_%d", i);
while(_hContact)
{
@@ -767,7 +767,7 @@ void Options::LoadTasks()
to.contacts.push_back(_hContact);
}
- _hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)_hContact, 0);
+ _hContact = db_find_next(_hContact);
}
to.orderNr = i;
@@ -1770,14 +1770,14 @@ void SaveList(HWND hwnd, HANDLE hSystem, TaskOptions* to)
to->contacts.clear();
if (hSystem)
to->isSystem = SendMessage(hwnd, CLM_GETCHECKMARK, (WPARAM) hSystem, 0) != 0;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
do
{
hItem = (HANDLE) SendMessage(hwnd, CLM_FINDCONTACT, (WPARAM) hContact, 0);
if (hItem && SendMessage(hwnd, CLM_GETCHECKMARK, (WPARAM) hItem, 0))
to->contacts.push_back(hContact);
}
- while (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0));
+ while (hContact = db_find_next(hContact));
}
bool IsValidTask(TaskOptions& to, std::list<TaskOptions>* top = NULL, std::wstring* err = NULL, std::wstring* errDescr = NULL);
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index 5f9e37e266..8a5093564f 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -672,7 +672,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam)
void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
char *proto;
while (hContact != 0)
{
@@ -704,7 +704,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
GoneNotify(hContact, message);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
/**
@@ -873,7 +873,7 @@ extern "C" int __declspec(dllexport) Load(void)
// ensure all contacts are timestamped
DBVARIANT dbv;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
DWORD current_time = (DWORD)time(0);
while (hContact != 0) {
if ( !DBGetContactSetting(hContact, MODULE_NAME, "CreationTime", &dbv))
@@ -881,7 +881,7 @@ extern "C" int __declspec(dllexport) Load(void)
else
DBWriteContactSettingDword(hContact, MODULE_NAME, "CreationTime", current_time);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
return 0;
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp
index e8f9de8e8c..f0a8e8cf7e 100644
--- a/plugins/BuddyExpectator/src/options.cpp
+++ b/plugins/BuddyExpectator/src/options.cpp
@@ -267,13 +267,13 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
SaveOptions();
// clear all notified settings
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != 0)
{
if(DBGetContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0))
DBWriteContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
// restart timer & run check
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 7550a420d5..7c1ec84dda 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -392,7 +392,7 @@ void cliRebuildEntireList(HWND hwnd,struct ClcData *dat)
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact = db_find_first();
while(hContact)
{
pdisplayNameCacheEntry cacheEntry = NULL;
@@ -436,7 +436,7 @@ void cliRebuildEntireList(HWND hwnd,struct ClcData *dat)
if (cont->proto && g_szMetaModuleName && dat->IsMetaContactsEnabled && strcmp(cont->proto,g_szMetaModuleName) == 0)
AddSubcontacts(dat,cont,CLCItems_IsShowOfflineGroup(group));
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ hContact = db_find_next(hContact);
}
if (style&CLS_HIDEEMPTYGROUPS) {
diff --git a/plugins/Clist_modern/src/modern_extraimage.cpp b/plugins/Clist_modern/src/modern_extraimage.cpp
index 5a9cc7bcbc..8cfec7f76c 100644
--- a/plugins/Clist_modern/src/modern_extraimage.cpp
+++ b/plugins/Clist_modern/src/modern_extraimage.cpp
@@ -243,7 +243,7 @@ void ClearExtraIcons()
{
SetNewExtraColumnCount();
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ HANDLE hContact = db_find_first();
do {
HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)hContact,0);
if (hItem == 0)
@@ -252,7 +252,7 @@ void ClearExtraIcons()
for (int i=0;i < EnabledColumnCount;i++)
SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0xFF));
}
- while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ while(hContact = db_find_next(hContact));
};
void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact)
@@ -301,7 +301,7 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact)
if (hContact == NULL)
{
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact = db_find_first();
}
do {
@@ -416,7 +416,7 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact)
NotifyEventHooks(g_CluiData.hEventExtraImageApplying,(WPARAM)hContact,0);
if (hcontgiven) break;
Sleep(0);
- } while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ } while(hContact = db_find_next(hContact));
tick = GetTickCount()-tick;
g_mutex_bSetAllExtraIconsCycle = 0;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index ed156c8496..788ef91564 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -190,7 +190,7 @@ static void UpdateStickies()
int i;
HANDLE hItem;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while(hContact)
{
hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
@@ -198,7 +198,7 @@ static void UpdateStickies()
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, (BYTE)db_get_dw(hContact, CLVM_MODULE, g_szModename, 0) ? 1 : 0);
localMask = HIWORD(db_get_dw(hContact, CLVM_MODULE, g_szModename, 0));
UpdateClistItem(hItem, (localMask == 0 || localMask == stickyStatusMask) ? stickyStatusMask : localMask);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
@@ -479,7 +479,7 @@ void SaveState()
}
dwGlobalMask = GetMaskForItem(hInfoItem);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while(hContact)
{
hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
@@ -497,7 +497,7 @@ void SaveState()
db_set_dw(hContact, CLVM_MODULE, szModeName, 0);
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
operators |= ((SendDlgItemMessage(clvmHwnd, IDC_PROTOGROUPOP, CB_GETCURSEL, 0, 0) == 1 ? CLVM_PROTOGROUP_OP : 0) |
(SendDlgItemMessage(clvmHwnd, IDC_GROUPSTATUSOP, CB_GETCURSEL, 0, 0) == 1 ? CLVM_GROUPSTATUS_OP : 0) |
@@ -690,12 +690,12 @@ void DeleteViewMode( char * szName )
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
SetWindowText(hwndSelector, TranslateT("All contacts"));
}
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while(hContact)
{
if (db_get_dw(hContact, CLVM_MODULE, szName, -1) != -1)
db_set_dw(hContact, CLVM_MODULE, szName, 0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
@@ -893,14 +893,14 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case IDC_CLEARALL:
{
HANDLE hItem;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while(hContact)
{
hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem)
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
case IDOK:
diff --git a/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp b/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp
index 4cec640ebb..ca993eb818 100644
--- a/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp
@@ -247,7 +247,7 @@ void ClearExtraIcons()
//SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS,EnabledColumnCount,0);
SetNewExtraColumnCount();
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact = db_find_first();
do {
hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)hContact,0);
@@ -257,7 +257,7 @@ void ClearExtraIcons()
SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0xFF));
};
- } while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ } while(hContact = db_find_next(hContact));
};
void SetAllExtraIcons(HWND hwndList,HANDLE hContact)
@@ -304,7 +304,7 @@ void SetAllExtraIcons(HWND hwndList,HANDLE hContact)
}
if ( hContact == NULL )
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact = db_find_first();
do {
szProto = NULL;
@@ -385,7 +385,7 @@ void SetAllExtraIcons(HWND hwndList,HANDLE hContact)
if (hcontgiven) break;
Sleep(0);
}
- while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ while(hContact = db_find_next(hContact));
tick = GetTickCount()-tick;
InvalidateRect(hwndList,NULL,FALSE);
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp
index 305a9a9ded..386fa06f11 100644
--- a/plugins/Clist_mw/src/clc.cpp
+++ b/plugins/Clist_mw/src/clc.cpp
@@ -49,7 +49,7 @@ static int stopStatusUpdater = 0;
void StatusUpdaterThread(void*)
{
int i,curdelay,lastcheck = 0;
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_LOWEST);
@@ -67,10 +67,10 @@ void StatusUpdaterThread(void*)
if (pdnce && !pdnce->protoNotExists && pdnce->szProto)
CallContactService(hContact, PSS_GETAWAYMSG, 0, 0);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
if (hContact == NULL) {
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
if (hContact == NULL)
break;
}
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp
index 788cc8f3fd..cf3909024f 100644
--- a/plugins/Clist_mw/src/clcitems.cpp
+++ b/plugins/Clist_mw/src/clcitems.cpp
@@ -354,7 +354,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat)
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact = db_find_first();
while(hContact) {
pdisplayNameCacheEntry cacheEntry;
@@ -393,7 +393,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat)
if (strcmp(cont->proto,"MetaContacts") == 0)
AddSubcontacts(cont);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ hContact = db_find_next(hContact);
}
if (style&CLS_HIDEEMPTYGROUPS) {
diff --git a/plugins/Clist_mw/src/clistmod.cpp b/plugins/Clist_mw/src/clistmod.cpp
index 5f769427f8..2c0561fd7c 100644
--- a/plugins/Clist_mw/src/clistmod.cpp
+++ b/plugins/Clist_mw/src/clistmod.cpp
@@ -129,10 +129,10 @@ static int ContactListShutdownProc(WPARAM wParam,LPARAM lParam)
int LoadContactListModule(void)
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL) {
DBWriteContactSettingString(hContact, "CList", "StatusMsg", "");
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
hCListImages = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
diff --git a/plugins/Clist_mw/src/clistsettings.cpp b/plugins/Clist_mw/src/clistsettings.cpp
index f18a4452f2..d3a9be197a 100644
--- a/plugins/Clist_mw/src/clistsettings.cpp
+++ b/plugins/Clist_mw/src/clistsettings.cpp
@@ -46,7 +46,7 @@ void InitDisplayNameCache(SortedList *list)
list->sortFunc = (FSortFunc)handleCompare;
list->increment = CallService(MS_DB_CONTACT_GETCOUNT,0,0)+1;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact = db_find_first();
i = 0;
while (hContact != 0)
{
@@ -55,7 +55,7 @@ void InitDisplayNameCache(SortedList *list)
InvalidateDisplayNameCacheEntryByPDNE(hContact,pdnce,0);
List_GetIndex(list,pdnce,&idx);
List_Insert(list,pdnce,idx);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ hContact = db_find_next(hContact);
i++;
} }
diff --git a/plugins/Clist_mw/src/contact.cpp b/plugins/Clist_mw/src/contact.cpp
index d8cf0f37d4..c3c75ec8f4 100644
--- a/plugins/Clist_mw/src/contact.cpp
+++ b/plugins/Clist_mw/src/contact.cpp
@@ -89,7 +89,7 @@ void LoadContactTree(void)
}
hideOffline = DBGetContactSettingByte(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact = db_find_first();
while(hContact != NULL) {
cacheEntry = GetContactFullCacheEntry(hContact);
@@ -101,7 +101,7 @@ void LoadContactTree(void)
status = cacheEntry->status;
if ((!hideOffline || status != ID_STATUS_OFFLINE) && !cacheEntry->bIsHidden)
ChangeContactIcon(hContact,ExtIconFromStatusMode(hContact,(char*)cacheEntry->szProto,status),1);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ hContact = db_find_next(hContact);
}
sortByStatus = DBGetContactSettingByte(NULL,"CList","SortByStatus",SETTING_SORTBYSTATUS_DEFAULT);
sortByProto = DBGetContactSettingByte(NULL,"CList","SortByProto",SETTING_SORTBYPROTO_DEFAULT);
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp
index fb2ac94c3f..7bc8154533 100644
--- a/plugins/Clist_nicer/src/clcitems.cpp
+++ b/plugins/Clist_nicer/src/clcitems.cpp
@@ -201,7 +201,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat)
}
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact) {
if (style & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus(hContact, NULL, dat)) {
ZeroMemory((void *)&dbv, sizeof(dbv));
@@ -225,7 +225,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat)
AddContactToGroup(dat, group, hContact);
}
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
if (style & CLS_HIDEEMPTYGROUPS) {
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp
index 25ac81aaec..ef614af287 100644
--- a/plugins/Clist_nicer/src/contact.cpp
+++ b/plugins/Clist_nicer/src/contact.cpp
@@ -123,13 +123,13 @@ DWORD WINAPI MF_UpdateThread(LPVOID p)
ResetEvent(hEvent);
while(mf_updatethread_running) {
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact != NULL && mf_updatethread_running) {
MF_CalcFrequency(hContact, 50, 1);
if (mf_updatethread_running)
WaitForSingleObject(hEvent, 5000);
ResetEvent(hEvent);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
if (mf_updatethread_running)
WaitForSingleObject(hEvent, 1000000);
@@ -157,7 +157,7 @@ void LoadContactTree(void)
}
hideOffline = cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact != NULL) {
status = GetContactStatus(hContact);
if ((!hideOffline || status != ID_STATUS_OFFLINE) && !CLVM_GetContactHiddenStatus(hContact, NULL, NULL))
@@ -175,7 +175,7 @@ void LoadContactTree(void)
if (!bMsgFrequency)
MF_CalcFrequency(hContact, 100, 0);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
cfg::writeByte("CList", "fhistdata", 1);
mc_hgh_removed = TRUE;
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp
index 3b5eda0220..42767f9ad6 100644
--- a/plugins/Clist_nicer/src/extBackg.cpp
+++ b/plugins/Clist_nicer/src/extBackg.cpp
@@ -1324,7 +1324,7 @@ void LoadPerContactSkins(TCHAR *tszFileName)
}
if (items) {
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while(hContact) {
char UIN[40];
int j;
@@ -1380,7 +1380,7 @@ void LoadPerContactSkins(TCHAR *tszFileName)
}
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
free(szSections);
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp
index 68608b67c3..17ee84f07a 100644
--- a/plugins/Clist_nicer/src/viewmodes.cpp
+++ b/plugins/Clist_nicer/src/viewmodes.cpp
@@ -150,7 +150,7 @@ static DWORD GetMaskForItem(HANDLE hItem)
static void UpdateStickies()
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
HANDLE hItem;
DWORD localMask;
int i;
@@ -161,7 +161,7 @@ static void UpdateStickies()
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, cfg::getByte(hContact, "CLVM", g_szModename, 0) ? 1 : 0);
localMask = HIWORD(cfg::getDword(hContact, "CLVM", g_szModename, 0));
UpdateClistItem(hItem, (localMask == 0 || localMask == stickyStatusMask) ? stickyStatusMask : localMask);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
{
@@ -424,7 +424,7 @@ void SaveState()
// GetDlgItemTextA(clvmHwnd, IDC_VARIABLES, vastring, len);
SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szModeName);
dwGlobalMask = GetMaskForItem(hInfoItem);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while(hContact) {
hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
@@ -438,7 +438,7 @@ void SaveState()
cfg::writeDword(hContact, "CLVM", szModeName, 0);
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
operators |= ((SendDlgItemMessage(clvmHwnd, IDC_PROTOGROUPOP, CB_GETCURSEL, 0, 0) == 1 ? CLVM_PROTOGROUP_OP : 0) |
(SendDlgItemMessage(clvmHwnd, IDC_GROUPSTATUSOP, CB_GETCURSEL, 0, 0) == 1 ? CLVM_GROUPSTATUS_OP : 0) |
@@ -708,11 +708,11 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
SetWindowTextA(hwndSelector, Translate("No view mode"));
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while(hContact) {
if (cfg::getDword(hContact, "CLVM", szBuf, -1) != -1)
cfg::writeDword(hContact, "CLVM", szBuf, 0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_DELETESTRING, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
if (SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, 0, 0) != LB_ERR) {
@@ -757,13 +757,13 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case IDC_CLEARALL:
{
HANDLE hItem;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while(hContact) {
hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem)
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
case IDOK:
@@ -1147,7 +1147,7 @@ void ApplyViewMode(const char *name)
g_CluiData.bFilterEffective |= CLVM_FILTER_VARIABLES;
mir_free(dbv.ptszVal);
if (g_CluiData.bFilterEffective & CLVM_FILTER_VARIABLES) {
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
char UIN[256];
char *id, *szProto;
const char *varstring;
@@ -1180,7 +1180,7 @@ void ApplyViewMode(const char *name)
}
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
}*/
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp
index 05994188ae..061edf07b2 100644
--- a/plugins/CmdLine/src/mimcmd_handlers.cpp
+++ b/plugins/CmdLine/src/mimcmd_handlers.cpp
@@ -1841,7 +1841,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r
char buffer[1024];
char protocol[128];
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
int count = 0;
reply->code = MIMRES_SUCCESS;
@@ -1878,7 +1878,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r
free(contact);
free(id);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
else{
@@ -1888,7 +1888,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r
{
HANDLE hContact = NULL;
char protocol[128];
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
reply->code = MIMRES_SUCCESS;
*reply->message = 0;
@@ -1907,14 +1907,14 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r
free(contact);
free(id);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
else{
if (argc == 3)
{
HANDLE hContact = NULL;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
reply->code = MIMRES_SUCCESS;
*reply->message = 0;
@@ -1928,7 +1928,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r
HANDLE thread = CreateThread(NULL, NULL, OpenMessageWindowThread, hContact, NULL, &threadID);
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
else {
@@ -1998,7 +1998,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re
{
if (_stricmp(cmd, "unread") == 0)
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
char buffer[4096];
int count;
int contacts = 0;
@@ -2047,7 +2047,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re
free(contact);
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
else{
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp
index 7d1136602f..70e86085cc 100644
--- a/plugins/CmdLine/src/utils.cpp
+++ b/plugins/CmdLine/src/utils.cpp
@@ -337,7 +337,7 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto)
#pragma warning (disable: 4312)
HANDLE GetContactFromID(TCHAR *szID, char *szProto)
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
TCHAR *szHandle;
TCHAR dispName[1024];
char cProtocol[256];
@@ -359,7 +359,7 @@ HANDLE GetContactFromID(TCHAR *szID, char *szProto)
if (szHandle) { free(szHandle); }
if (found) { break; }
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
return hContact;
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp
index 1838b3bea8..f0971a37ae 100644
--- a/plugins/ContactsPlus/src/utils.cpp
+++ b/plugins/ContactsPlus/src/utils.cpp
@@ -125,12 +125,12 @@ TCHAR* MirandaStatusToStringT(int mirandaStatus)
HANDLE __fastcall SRCFindFirstContact()
{
- return (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ return db_find_first();
}
HANDLE __fastcall SRCFindNextContact(HANDLE hContact)
{
- return (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ return db_find_next(hContact);
}
int DBGetContactSettingT(HANDLE hContact, const char *szModule, const char* szSetting, DBVARIANT *dbv)
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp
index f019827e21..ccf26b517e 100644
--- a/plugins/CountryFlags/src/extraimg.cpp
+++ b/plugins/CountryFlags/src/extraimg.cpp
@@ -97,11 +97,11 @@ static void RemoveExtraImages(void)
iec.ColumnType=idExtraColumn;
iec.hImage=INVALID_HANDLE_VALUE;
/* enum all contacts */
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact=db_find_first();
while(hContact!=NULL) {
/* invalidate icon */
CallService(MS_CLIST_EXTRA_SET_ICON,(WPARAM)hContact,(LPARAM)&iec);
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ hContact=db_find_next(hContact);
}
}
@@ -119,10 +119,10 @@ static void EnsureExtraImages(void)
if(idExtraColumnNew!=idExtraColumn) RemoveExtraImages();
idExtraColumn=idExtraColumnNew;
/* enum all contacts */
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact=db_find_first();
while(hContact!=NULL) {
CallFunctionBuffered(SetExtraImage,(LPARAM)hContact,TRUE,EXTRAIMAGE_REFRESHDELAY);
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ hContact=db_find_next(hContact);
}
}
@@ -250,7 +250,7 @@ static void CALLBACK UpdateStatusIcons(LPARAM lParam)
msgwi.uFlags=MSG_WINDOW_UFLAG_MSG_BOTH;
/* enum all opened message windows */
fShow=DBGetContactSettingByte(NULL,"Flags","ShowStatusIconFlag",SETTING_SHOWSTATUSICONFLAG_DEFAULT);
- msgwi.hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ msgwi.hContact=db_find_first();
while(msgwi.hContact!=NULL) {
/* is a message window opened for this contact? */
if (!CallService(MS_MSG_GETWINDOWDATA,(WPARAM)&msgwi,(LPARAM)&msgw) && msgw.uState&MSG_WINDOW_STATE_EXISTS) {
@@ -258,7 +258,7 @@ static void CALLBACK UpdateStatusIcons(LPARAM lParam)
if(fShow) SetStatusIcon(msgwi.hContact,countryNumber);
else UnsetStatusIcon(msgwi.hContact,countryNumber);
}
- msgwi.hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)msgw.hContact,0);
+ msgwi.hContact = db_find_next(msgw.hContact);
}
}
diff --git a/plugins/CyrTranslit/src/MirandaContact.cpp b/plugins/CyrTranslit/src/MirandaContact.cpp
index 1a0f149ef8..0f5df412b2 100644
--- a/plugins/CyrTranslit/src/MirandaContact.cpp
+++ b/plugins/CyrTranslit/src/MirandaContact.cpp
@@ -127,8 +127,9 @@ void MirandaContact::generateMenuItemsForAllContacts()
void MirandaContact::activateTransliterationProtocolForSubscribedContacts()
{
- int hContact = CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- if(!hContact) return;
+ HANDLE hContact = db_find_first();
+ if(!hContact)
+ return;
do
{
@@ -138,7 +139,7 @@ void MirandaContact::activateTransliterationProtocolForSubscribedContacts()
{
TransliterationProtocol::activateForContact(mc.handle);
}
- } while(hContact = CallService(MS_DB_CONTACT_FINDNEXT, hContact, 0));
+ } while(hContact = db_find_next(hContact));
}
//------------------------------------------------------------------------------
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp
index 25489a7f52..7dad7a6934 100644
--- a/plugins/DbEditorPP/src/copymodule.cpp
+++ b/plugins/DbEditorPP/src/copymodule.cpp
@@ -48,7 +48,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
{
int index, loaded;
char szProto[256];
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact)
{
@@ -60,7 +60,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
// filter
if ((loaded && Mode == MODE_UNLOADED) || (!loaded && Mode == MODE_LOADED))
{
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
continue;
}
@@ -127,7 +127,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_SETITEMDATA, index, (LPARAM)hContact);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)(HANDLE)hContact, 0);
+ hContact = db_find_next(hContact);
}
index = (int)SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_INSERTSTRING, 0, (LPARAM)(char*)Translate("Settings"));
@@ -157,12 +157,12 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
else
{
SetCursor(LoadCursor(NULL,IDC_WAIT));
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact)
{
copyModule(mac->module, mac->hContact, hContact);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)(HANDLE)hContact, 0);
+ hContact = db_find_next(hContact);
}
SetCursor(LoadCursor(NULL,IDC_ARROW));
diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp
index a0eddf73a1..c4a3fba820 100644
--- a/plugins/DbEditorPP/src/deletemodule.cpp
+++ b/plugins/DbEditorPP/src/deletemodule.cpp
@@ -53,7 +53,7 @@ void __cdecl PopulateModuleDropListThreadFunc(LPVOID di)
module = (struct ModSetLinkLinkItem *)module->next;
continue;
}
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);moduleEmpty && hContact;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first();moduleEmpty && hContact;hContact = db_find_next(hContact))
{
if (!IsModuleEmpty(hContact,module->name))
{
@@ -103,13 +103,13 @@ INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDOK:
{
char text[128];
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
GetDlgItemText(hwnd,IDC_CONTACTS,text,128);
SetCursor(LoadCursor(NULL,IDC_WAIT));
while (hContact)
{
deleteModule(text,hContact,1);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
// do the null
deleteModule(text,NULL,1);
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp
index ad9f508a21..ee5f6762f8 100644
--- a/plugins/DbEditorPP/src/exportimport.cpp
+++ b/plugins/DbEditorPP/src/exportimport.cpp
@@ -243,7 +243,7 @@ void exportDB(HANDLE hContact, char* module) // hContact == -1 export entire db.
if (module == "") module = NULL; // reset module for all contacts export
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact)
{
@@ -260,7 +260,7 @@ void exportDB(HANDLE hContact, char* module) // hContact == -1 export entire db.
if ((loaded && Mode == MODE_UNLOADED) || (!loaded && Mode == MODE_LOADED))
{
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
continue;
}
}
@@ -287,7 +287,7 @@ void exportDB(HANDLE hContact, char* module) // hContact == -1 export entire db.
{
exportModule(hContact, module, file);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)(HANDLE)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
// exporting a contact
@@ -337,7 +337,7 @@ HANDLE CheckNewContact(char *myProto, char *uid, char *myName)
{
char szProto[256], szName[256];
HANDLE resultHandle = INVALID_HANDLE_VALUE;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact)
{
@@ -358,7 +358,7 @@ HANDLE CheckNewContact(char *myProto, char *uid, char *myName)
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
return resultHandle;
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp
index b9957cd246..e8fd22aa70 100644
--- a/plugins/DbEditorPP/src/findwindow.cpp
+++ b/plugins/DbEditorPP/src/findwindow.cpp
@@ -563,10 +563,10 @@ void __cdecl FindSettings(LPVOID di)
else
{
NULLContactDone = 1;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
}
}
- else hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ else hContact = db_find_next(hContact);
module = ModuleList.first;
while (module)
diff --git a/plugins/DbEditorPP/src/modules.cpp b/plugins/DbEditorPP/src/modules.cpp
index 4053180038..2e650b2fe4 100644
--- a/plugins/DbEditorPP/src/modules.cpp
+++ b/plugins/DbEditorPP/src/modules.cpp
@@ -63,13 +63,13 @@ INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
GetDlgItemText(hwnd, IDC_MODNAME, modulename, 256);
if (IsDlgButtonChecked(hwnd,CHK_ADD2ALL))
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
// null contact
DBWriteContactSettingByte(NULL, modulename, "(Default)", 0);
while (hContact)
{
DBWriteContactSettingByte(hContact, modulename, "(Default)", 0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)(HANDLE)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
else
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp
index b5554cabc5..292e3a6af6 100644
--- a/plugins/DbEditorPP/src/moduletree.cpp
+++ b/plugins/DbEditorPP/src/moduletree.cpp
@@ -24,7 +24,7 @@ int doContacts(HWND hwnd2Tree,HTREEITEM contactsRoot,ModuleSettingLL *modlist, H
// mir_snprintf(title, sizeof(title),Translate("Loading contacts..."));
SetWindowText(hwnd2mainWindow, Translate("Loading contacts..."));
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
tvi.hInsertAfter = TVI_SORT;
tvi.item.cChildren = 1;
@@ -48,7 +48,7 @@ int doContacts(HWND hwnd2Tree,HTREEITEM contactsRoot,ModuleSettingLL *modlist, H
// filter
if ((loaded && Mode == MODE_UNLOADED) || (!loaded && Mode == MODE_LOADED))
{
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
continue;
}
@@ -177,7 +177,7 @@ int doContacts(HWND hwnd2Tree,HTREEITEM contactsRoot,ModuleSettingLL *modlist, H
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
@@ -795,7 +795,7 @@ void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd
if (mtis->type == CONTACT_ROOT_ITEM && !hContact)
{
multi = 1;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
}
while(hContact && hwnd2mainWindow)
@@ -810,7 +810,7 @@ void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd
if ((loaded && Mode == MODE_UNLOADED) || (!loaded && Mode == MODE_LOADED))
{
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
continue;
}
}
@@ -831,7 +831,7 @@ void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd
if (!multi) break;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/Dbx_mmap_SA/src/security.cpp b/plugins/Dbx_mmap_SA/src/security.cpp
index 260ab11727..172c1ff2f6 100644
--- a/plugins/Dbx_mmap_SA/src/security.cpp
+++ b/plugins/Dbx_mmap_SA/src/security.cpp
@@ -201,7 +201,7 @@ void CDdxMmapSA::EncodeAll()
{
HANDLE hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
if (hContact){
do {
EncodeContactEvents(hContact);
@@ -218,12 +218,12 @@ void CDdxMmapSA::DecodeAll()
{
HANDLE hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
if (hContact){
do{
DecodeContactEvents(hContact);
DecodeContactSettings(hContact);
- }while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ }while(hContact = db_find_next(hContact));
}
DecodeContactEvents(NULL);
DecodeContactSettings(NULL);
diff --git a/plugins/ExtraIcons/src/DefaultExtraIcons.cpp b/plugins/ExtraIcons/src/DefaultExtraIcons.cpp
index 8da08d6b4b..05d1f9eed6 100644
--- a/plugins/ExtraIcons/src/DefaultExtraIcons.cpp
+++ b/plugins/ExtraIcons/src/DefaultExtraIcons.cpp
@@ -298,14 +298,14 @@ static void DBExtraIconsInit()
info.hExtraIcon = ExtraIcon_Register(info.name, info.desc, info.icon);
}
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
SetExtraIcons(hContact);
SetVisibility(hContact, -1, FALSE);
SetGender(hContact, -1, FALSE);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged);
diff --git a/plugins/ExtraIcons/src/ExtraIcon.cpp b/plugins/ExtraIcons/src/ExtraIcon.cpp
index e681e3139d..4ace1dee02 100644
--- a/plugins/ExtraIcons/src/ExtraIcon.cpp
+++ b/plugins/ExtraIcons/src/ExtraIcon.cpp
@@ -63,7 +63,7 @@ void ExtraIcon::applyIcons()
if (!isEnabled())
return;
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
// Clear to assert that it will be cleared
@@ -71,7 +71,7 @@ void ExtraIcon::applyIcons()
applyIcon(hContact);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/ExtraIcons/src/options.cpp b/plugins/ExtraIcons/src/options.cpp
index f1f1371403..18d7b361a6 100644
--- a/plugins/ExtraIcons/src/options.cpp
+++ b/plugins/ExtraIcons/src/options.cpp
@@ -56,12 +56,12 @@ BOOL ScreenToClient(HWND hWnd, LPRECT lpRect)
static void RemoveExtraIcons(int slot)
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
Clist_SetExtraIcon(hContact, slot, INVALID_HANDLE_VALUE);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp
index 9464c22a77..19d3c42d82 100644
--- a/plugins/FavContacts/src/contact_cache.cpp
+++ b/plugins/FavContacts/src/contact_cache.cpp
@@ -84,7 +84,7 @@ void CContactCache::Rebuild()
unsigned long timestamp = time(NULL);
m_lastUpdate = time(NULL);
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact)
{
TContactInfo *info = new TContactInfo;
@@ -111,7 +111,7 @@ void CContactCache::Rebuild()
}
m_cache.insert(info);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h
index 6201126b44..0b793b2185 100644
--- a/plugins/FavContacts/src/favlist.h
+++ b/plugins/FavContacts/src/favlist.h
@@ -103,8 +103,8 @@ public:
nGroups = 1;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for ( ; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for ( ; hContact; hContact = db_find_next(hContact))
if (DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0))
{
TCHAR *group = addContact(hContact, true)->getGroup();
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp
index c359462267..f49df5b5c5 100644
--- a/plugins/FavContacts/src/main.cpp
+++ b/plugins/FavContacts/src/main.cpp
@@ -257,8 +257,8 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam)
Hotkey_Register(&hotkey);
if (ServiceExists(MS_AV_GETAVATARBITMAP)) {
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for ( ; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for ( ; hContact; hContact = db_find_next(hContact))
if (DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0))
CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
}
@@ -1211,10 +1211,10 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
SendMessage(GetDlgItem(hwnd, IDC_CLIST), CLM_SETEXSTYLE, CLS_EX_DISABLEDRAGDROP|CLS_EX_TRACKSELECT, 0);
sttResetListOptions(GetDlgItem(hwnd, IDC_CLIST));
- hSelectedContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hSelectedContact = db_find_first();
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for ( ; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for ( ; hContact; hContact = db_find_next(hContact))
{
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_SETCHECKMARK,
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0),
@@ -1343,8 +1343,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
sttSaveOptions();
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for ( ; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for ( ; hContact; hContact = db_find_next(hContact))
{
BYTE fav = SendDlgItemMessage(hwnd, IDC_CLIST, CLM_GETCHECKMARK,
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0), 0);
@@ -1366,8 +1366,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
case CLN_NEWCONTACT:
{
int iSelection = (int)((NMCLISTCONTROL *)lParam)->hItem;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for ( ; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for ( ; hContact; hContact = db_find_next(hContact))
if (SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0) == iSelection)
{
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_SETCHECKMARK, iSelection,
@@ -1380,8 +1380,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
case CLN_CHECKCHANGED:
{
int iSelection = (int)((NMCLISTCONTROL *)lParam)->hItem;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for ( ; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for ( ; hContact; hContact = db_find_next(hContact))
if (SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0) == iSelection)
break;
if (hContact)
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp
index f51e1f6d34..e7b8c054bb 100644
--- a/plugins/FloatingContacts/src/main.cpp
+++ b/plugins/FloatingContacts/src/main.cpp
@@ -1045,10 +1045,10 @@ void SaveContactsPos()
static void LoadContacts()
{
- HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0) ;
+ HANDLE hContact = db_find_first() ;
while( hContact != NULL ) {
LoadContact( hContact );
- hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 );
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/Gender/src/main.cpp b/plugins/Gender/src/main.cpp
index fad396db26..f778fa11f6 100644
--- a/plugins/Gender/src/main.cpp
+++ b/plugins/Gender/src/main.cpp
@@ -288,12 +288,12 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
g_hExtraIcon = ExtraIcon_Register("gender", "Gender", "menu_icon");
if (g_hExtraIcon != NULL)
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
onExtraImageApplying((WPARAM) hContact, 0);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
else
diff --git a/plugins/Gender/src/options.cpp b/plugins/Gender/src/options.cpp
index 4d4875c0af..c6537e4ca2 100644
--- a/plugins/Gender/src/options.cpp
+++ b/plugins/Gender/src/options.cpp
@@ -108,11 +108,11 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (bEnableClistIcon)
{
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact)
{
CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&g_IECClear);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
@@ -127,11 +127,11 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (g_hExtraIcon != NULL || bEnableClistIcon)
{
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact)
{
onExtraImageApplying((WPARAM)hContact,0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.cpp b/plugins/HistorySweeperLight/src/historysweeperlight.cpp
index 50e37ddc34..ce59001dda 100644
--- a/plugins/HistorySweeperLight/src/historysweeperlight.cpp
+++ b/plugins/HistorySweeperLight/src/historysweeperlight.cpp
@@ -215,7 +215,7 @@ void SweepHistoryFromContact(HANDLE hContact, CriteriaStruct Criteria, BOOL keep
void ShutdownAction(void)
{
CriteriaStruct Criteria;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
Criteria.keep = KeepCriteria(DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownKeep", 0));
Criteria.time = BuildCriteria(DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownOlder", 0));
@@ -226,7 +226,7 @@ void ShutdownAction(void)
{
SweepHistoryFromContact(hContact, Criteria, TRUE); // sweep contact history, keepunread==1
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); // go to next contact
+ hContact = db_find_next(hContact); // go to next contact
}
}
diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp
index fdbb6f3cd3..64fcc8a4f3 100644
--- a/plugins/HistorySweeperLight/src/main.cpp
+++ b/plugins/HistorySweeperLight/src/main.cpp
@@ -78,7 +78,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
StatusIconData sid = {0};
int i, sweep = DBGetContactSettingByte(NULL, ModuleName, "SweepHistory", 0);
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
sid.cbSize = sizeof(sid);
sid.szModule = ModuleName;
@@ -136,7 +136,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
hHooks[2] = HookEvent(ME_MSG_WINDOWEVENT, OnWindowEvent);
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp
index 2963f8bb2b..a49cf77684 100644
--- a/plugins/HistorySweeperLight/src/options.cpp
+++ b/plugins/HistorySweeperLight/src/options.cpp
@@ -133,8 +133,8 @@ static void ShowAllContactIcons(HWND hwndList)
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hSystemHistory,
MAKELPARAM(0, DBGetContactSettingByte(NULL, ModuleName, "SweepSHistory", 0)));
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); hContact;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ for (hContact=db_find_first(); hContact;
+ hContact=db_find_next(hContact))
{
hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem,
@@ -201,8 +201,8 @@ void SaveSettings(HWND hwndDlg)
DBWriteContactSettingByte(NULL, ModuleName, "SweepSHistory",
(BYTE)SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hSystemHistory, 0));
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); hContact;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ for (hContact=db_find_first(); hContact;
+ hContact=db_find_next(hContact))
{
hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
diff --git a/plugins/IgnoreState/src/main.cpp b/plugins/IgnoreState/src/main.cpp
index c68e6f6d2d..2cea928f09 100644
--- a/plugins/IgnoreState/src/main.cpp
+++ b/plugins/IgnoreState/src/main.cpp
@@ -229,11 +229,11 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
if (hExtraIcon != NULL)
{
// Set initial value for all contacts
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
onExtraImageApplying((WPARAM)hContact, NULL);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
else
diff --git a/plugins/IgnoreState/src/options.cpp b/plugins/IgnoreState/src/options.cpp
index eda6b6ffea..ba1f01488e 100644
--- a/plugins/IgnoreState/src/options.cpp
+++ b/plugins/IgnoreState/src/options.cpp
@@ -230,20 +230,20 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
//Store options values to DB
DBWriteContactSettingByte(NULL, MODULENAME, "AdvancedIcon", clistIcon);
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact)
{
CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&g_IECClear);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
g_IECClear.ColumnType = clistIcon;
if (hExtraIcon == NULL)
onExtraImageListRebuild(0,0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact)
{
onExtraImageApplying((WPARAM)hContact,0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
}
diff --git a/plugins/KeyboardNotify/src/ignore.cpp b/plugins/KeyboardNotify/src/ignore.cpp
index 4ad9e593f2..d27907efcc 100644
--- a/plugins/KeyboardNotify/src/ignore.cpp
+++ b/plugins/KeyboardNotify/src/ignore.cpp
@@ -192,7 +192,7 @@ static void SetAllContactIcons(HWND hwndList)
DWORD protoCaps;
char *szProto;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact=db_find_first();
do {
hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if(hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == 0xFF) {
@@ -203,7 +203,7 @@ static void SetAllContactIcons(HWND hwndList)
protoCaps = CallProtoService(szProto, PS_GETCAPS,PFLAGNUM_1, 0);
InitialiseItem(hwndList, hContact, hItem, protoCaps);
}
- } while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ } while(hContact = db_find_next(hContact));
}
INT_PTR CALLBACK DlgProcIgnoreOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -318,12 +318,12 @@ INT_PTR CALLBACK DlgProcIgnoreOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
case PSN_APPLY:
{ HANDLE hContact, hItem;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
do {
hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if(hItem)
SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), hContact, hItem, "Mask1");
- } while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ } while(hContact = db_find_next(hContact));
SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemAll, "Default1");
SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemUnknown, "Mask1");
return TRUE;
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 1aa54ba0af..f8fa9e701c 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -317,7 +317,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
hExtraIcon = ExtraIcon_Register(MODULE_NAME, "Listening to music", "listening_to_icon");
if (hExtraIcon != NULL)
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
char *proto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
@@ -333,7 +333,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
}
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
else if (hExtraIcon == NULL && ServiceExists(MS_CLIST_EXTRA_ADD_ICON))
diff --git a/plugins/ListeningTo/src/players/mradio.cpp b/plugins/ListeningTo/src/players/mradio.cpp
index 27b4685cb7..84fdd61b95 100644
--- a/plugins/ListeningTo/src/players/mradio.cpp
+++ b/plugins/ListeningTo/src/players/mradio.cpp
@@ -38,7 +38,7 @@ int MRadio::GetData()
{
HANDLE hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact != NULL)
{
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
@@ -52,7 +52,7 @@ int MRadio::GetData()
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
if (hContact)
diff --git a/plugins/MetaContacts/src/addto.cpp b/plugins/MetaContacts/src/addto.cpp
index b92e97b978..efde87e05f 100644
--- a/plugins/MetaContacts/src/addto.cpp
+++ b/plugins/MetaContacts/src/addto.cpp
@@ -54,7 +54,7 @@ typedef struct {
int FillList(HWND list, BOOL sort)
{
DWORD metaID;
- HANDLE hMetaUser = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ HANDLE hMetaUser = db_find_first();
int i=0;
int index;
//BOOL mbs = FALSE;
@@ -64,11 +64,10 @@ int FillList(HWND list, BOOL sort)
if ((metaID=DBGetContactSettingDword(hMetaUser,META_PROTO,META_ID,(DWORD)-1))==(DWORD)-1)
{
// This isn't a MetaContact, go to the next
- hMetaUser = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hMetaUser,0);
+ hMetaUser = db_find_next(hMetaUser);
continue;
}
-
{
// get contact display name from clist
char *szCDN = (char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hMetaUser, 0);
@@ -128,7 +127,7 @@ int FillList(HWND list, BOOL sort)
i++;
- hMetaUser = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hMetaUser,0);
+ hMetaUser = db_find_next(hMetaUser);
}
return i;
}
diff --git a/plugins/MetaContacts/src/meta_main.cpp b/plugins/MetaContacts/src/meta_main.cpp
index 5aae726ace..8a05fe1f7b 100644
--- a/plugins/MetaContacts/src/meta_main.cpp
+++ b/plugins/MetaContacts/src/meta_main.cpp
@@ -168,7 +168,7 @@ extern "C" __declspec(dllexport) int Load(void)
//set all contacts to 'offline', and initialize subcontact counter for db consistency check
{
- HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
char *proto;
while(hContact != NULL) {
//proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
@@ -189,7 +189,7 @@ extern "C" __declspec(dllexport) int Load(void)
DBFreeVariant(&dbv);
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/MetaContacts/src/meta_menu.cpp b/plugins/MetaContacts/src/meta_menu.cpp
index e71e9357a5..9cb430f8d5 100644
--- a/plugins/MetaContacts/src/meta_menu.cpp
+++ b/plugins/MetaContacts/src/meta_menu.cpp
@@ -260,7 +260,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam)
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact = db_find_first();
while(hContact)
{ // Scans the database to get all the contacts that have been previously linked to this MetaContact
if (DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1)==metaID)
@@ -278,7 +278,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam)
if (options.suppress_status)
CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ hContact = db_find_next(hContact);
}
//DBDeleteContactSetting((HANDLE)wParam, META_PROTO, META_ID);
//DBDeleteContactSetting((HANDLE)wParam, META_PROTO, "NumContacts");
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp
index d4c5ea8a1b..26609d23be 100644
--- a/plugins/MetaContacts/src/meta_services.cpp
+++ b/plugins/MetaContacts/src/meta_services.cpp
@@ -711,13 +711,13 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
// import process has just been run...call startup routines...
Meta_SetHandles();
{
- HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ HANDLE hContact = db_find_first();
int meta_id;
while ( hContact != NULL ) {
if ((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1) {
Meta_CopyData(hContact);
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
}
@@ -1257,13 +1257,13 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam)
// loop and copy data from subcontacts
if (options.copydata) {
- HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ HANDLE hContact = db_find_first();
int meta_id;
while ( hContact != NULL ) {
if ((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1) {
Meta_CopyData(hContact);
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/MetaContacts/src/meta_utils.cpp b/plugins/MetaContacts/src/meta_utils.cpp
index 0ed0abf9c8..0b9c6a24e1 100644
--- a/plugins/MetaContacts/src/meta_utils.cpp
+++ b/plugins/MetaContacts/src/meta_utils.cpp
@@ -114,7 +114,7 @@ HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id)
return NULL;
field = (char *)CallProtoService(protocol,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,0);
- hUser = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hUser = db_find_first();
while(hUser)
{ // Scan the database and retrieve the field for each contact
if (!DBGetContactSetting(hUser,protocol,field,&dbv))
@@ -179,7 +179,7 @@ HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id)
DBFreeVariant(&dbv);
} // end if (!DBGetContactSetting(hUser,protocol,field,&dbv))
// This contact wasn't the good one, go to the next.
- hUser = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hUser,0);
+ hUser = db_find_next(hUser);
} // end while
return NULL;
}
@@ -762,7 +762,7 @@ HANDLE Meta_GetContactHandle(HANDLE hMeta, int contact_number) {
int Meta_SetHandles(void) {
DWORD meta_id, num_contacts, contact_number;
- HANDLE hContact2, hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ), hNextContact;
+ HANDLE hContact2, hContact = db_find_first(), hNextContact;
char buffer[512], buffer2[512];
char nick_buffer[128];
BOOL found;
@@ -783,7 +783,7 @@ int Meta_SetHandles(void) {
// problem!
MessageBox(0, Translate("Subcontact contact number < 0 - deleting MetaContact"), nick_buffer, MB_OK | MB_ICONERROR);
//CallService(MS_DB_CONTACT_DELETE, (WPARMA)hContact, 0);
- hNextContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hNextContact = db_find_next(hContact);
Meta_Delete((WPARAM)hContact, (LPARAM)1);
hContact = hNextContact;
continue;
@@ -796,7 +796,7 @@ int Meta_SetHandles(void) {
// find metacontact
found = FALSE;
- hContact2 = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ hContact2 = db_find_first();
while ( hContact2 != NULL ) {
if (DBGetContactSettingDword(hContact2,META_PROTO,META_ID,(DWORD)-1) == meta_id) {
@@ -821,7 +821,7 @@ int Meta_SetHandles(void) {
sprintf(buff, Translate("Subcontact contact number (%d) > meta num contacts (%d) - deleting MetaContact"), (int)contact_number, (int)num_contacts);
MessageBox(0, buff, nick_buffer, MB_OK | MB_ICONERROR);
//CallService(MS_DB_CONTACT_DELETE, (WPARMA)hContact, 0);
- hNextContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hNextContact = db_find_next(hContact);
Meta_Delete((WPARAM)hContact, (LPARAM)1);
hContact = hNextContact;
continue;
@@ -829,7 +829,7 @@ int Meta_SetHandles(void) {
}
}
- hContact2 = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact2, 0 );
+ hContact2 = db_find_next(hContact2);
}
if (!found) {
@@ -875,7 +875,7 @@ int Meta_SetHandles(void) {
// problem
MessageBox(0, Translate("MetaContact number of contacts < 0 - deleting MetaContact"), nick_buffer, MB_OK | MB_ICONERROR);
//CallService(MS_DB_CONTACT_DELETE, (WPARMA)hContact, 0);
- hNextContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hNextContact = db_find_next(hContact);
Meta_Delete((WPARAM)hContact, (LPARAM)1);
hContact = hNextContact;
continue;
@@ -885,7 +885,7 @@ int Meta_SetHandles(void) {
if (contact_number < 0 || contact_number >= num_contacts) {
// problem
MessageBox(0, Translate("MetaContact default contact number out of range - deleting MetaContact"), nick_buffer, MB_OK | MB_ICONERROR);
- hNextContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hNextContact = db_find_next(hContact);
Meta_Delete((WPARAM)hContact, (LPARAM)1);
hContact = hNextContact;
//CallService(MS_DB_CONTACT_DELETE, (WPARMA)hContact, 0);
@@ -894,11 +894,11 @@ int Meta_SetHandles(void) {
}
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
// loop through one more time - check contact counts match
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ hContact = db_find_first();
while ( hContact != NULL ) {
if ((meta_id = DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1))!=(DWORD)-1) {
// get nick for debug messages
@@ -912,14 +912,14 @@ int Meta_SetHandles(void) {
// Meta_Delete((WPARAM)hContact, (LPARAM)1); // second param prevents confirm dialog
//} else
// return 1;
- hNextContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hNextContact = db_find_next(hContact);
MessageBox(0, Translate("MetaContact corrupted - the number of subcontacts is incorrect.\nDeleting MetaContact."), nick_buffer, MB_OK | MB_ICONERROR);
Meta_Delete((WPARAM)hContact, (LPARAM)1);
hContact = hNextContact;
continue;
}
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
return 0;
@@ -939,7 +939,7 @@ int Meta_HideLinkedContacts(void) {
char *proto, *group_name;
int hGroup = 1;
- HANDLE hContact2, hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ HANDLE hContact2, hContact = db_find_first();
// ensure the hidden group does not exist (how this occurs i wonder but there have been reports!)
// (sometimes protocol server side groups are to blame - msn and icq)
@@ -980,7 +980,7 @@ int Meta_HideLinkedContacts(void) {
Meta_SetGroup(hContact);
// find metacontact
- hContact2 = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ hContact2 = db_find_first();
while ( hContact2 != NULL ) {
if (DBGetContactSettingDword(hContact2,META_PROTO,META_ID,(DWORD)-1) == meta_id) {
@@ -1024,18 +1024,18 @@ int Meta_HideLinkedContacts(void) {
}
}
- hContact2 = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact2, 0 );
+ hContact2 = db_find_next(hContact2);
}
if (options.suppress_status)
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
// do metacontacts after handles set properly above
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ hContact = db_find_first();
while ( hContact != NULL ) {
if (DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1)!=(DWORD)-1) {
// is a meta contact
@@ -1046,7 +1046,7 @@ int Meta_HideLinkedContacts(void) {
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
CallService(MS_CLUI_SORTLIST, 0, 0);
@@ -1057,7 +1057,7 @@ int Meta_HideLinkedContacts(void) {
*
*/
int Meta_UnhideLinkedContacts(void) {
- HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ HANDLE hContact = db_find_first();
while ( hContact != NULL ) {
if (DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1) {
@@ -1066,7 +1066,7 @@ int Meta_UnhideLinkedContacts(void) {
Meta_RestoreGroup(hContact);
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
if (!CallService(MS_SYSTEM_TERMINATED, 0, 0))
@@ -1075,7 +1075,7 @@ int Meta_UnhideLinkedContacts(void) {
}
int Meta_HideMetaContacts(int hide) {
- HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ HANDLE hContact = db_find_first();
// set status suppression
if (hide) Meta_SuppressStatus(FALSE);
@@ -1099,7 +1099,7 @@ int Meta_HideMetaContacts(int hide) {
}
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
if (!CallService(MS_SYSTEM_TERMINATED, 0, 0))
@@ -1253,7 +1253,7 @@ void Meta_GetStatusString(int status, char *buf, size_t size) {
}
int Meta_SuppressStatus(BOOL suppress) {
- HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ HANDLE hContact = db_find_first();
while ( hContact != NULL ) {
if (DBGetContactSettingDword(hContact,META_PROTO,META_LINK,(DWORD)-1)!=(DWORD)-1) {
@@ -1264,7 +1264,7 @@ int Meta_SuppressStatus(BOOL suppress) {
CallService(MS_IGNORE_UNIGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
return 0;
@@ -1319,7 +1319,7 @@ int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact) {
}
int Meta_SetAllNicks() {
- HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ), most_online;
+ HANDLE hContact = db_find_first(), most_online;
while ( hContact != NULL ) {
if (DBGetContactSettingDword(hContact,META_PROTO,META_ID,(DWORD)-1)!=(DWORD)-1) {
@@ -1329,7 +1329,7 @@ int Meta_SetAllNicks() {
Meta_CopyData(hContact);
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
return 0;
}
diff --git a/plugins/MirOTR/MirOTR/dllmain.cpp b/plugins/MirOTR/MirOTR/dllmain.cpp
index 59841d4e1d..80833c9b2e 100644
--- a/plugins/MirOTR/MirOTR/dllmain.cpp
+++ b/plugins/MirOTR/MirOTR/dllmain.cpp
@@ -110,10 +110,10 @@ DLLFUNC int Load(void)
// remove us as a filter to all contacts - fix filter type problem
if(DBGetContactSettingByte(0, MODULENAME, "FilterOrderFix", 0) != 2) {
- HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ HANDLE hContact = db_find_first();
while ( hContact != NULL ) {
CallService( MS_PROTO_REMOVEFROMCONTACT, ( WPARAM )hContact, ( LPARAM )MODULENAME );
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
DBWriteContactSettingByte(0, MODULENAME, "FilterOrderFix", 2);
}
diff --git a/plugins/MirOTR/MirOTR/options.cpp b/plugins/MirOTR/MirOTR/options.cpp
index 91a3cd34df..8af221d5da 100644
--- a/plugins/MirOTR/MirOTR/options.cpp
+++ b/plugins/MirOTR/MirOTR/options.cpp
@@ -578,7 +578,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM
const char *proto;
TCHAR *proto_t;
- HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ HANDLE hContact = db_find_first();
while ( hContact != NULL )
{
proto = contact_get_proto(hContact);
@@ -600,7 +600,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
}
return TRUE;
diff --git a/plugins/MirOTR/MirOTR/utils.cpp b/plugins/MirOTR/MirOTR/utils.cpp
index 2b592742d4..ce2bbc5b9a 100644
--- a/plugins/MirOTR/MirOTR/utils.cpp
+++ b/plugins/MirOTR/MirOTR/utils.cpp
@@ -19,7 +19,7 @@ void lib_cs_unlock() {
}
HANDLE find_contact(const char* userid, const char* protocol) {
- HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ HANDLE hContact = db_find_first();
while ( hContact != NULL )
{
const char *proto = contact_get_proto(hContact);
@@ -31,7 +31,7 @@ HANDLE find_contact(const char* userid, const char* protocol) {
}
mir_free(name);
}
- hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 );
+ hContact = db_find_next(hContact);
}
return 0;
diff --git a/plugins/ModernOpt/src/mopt_ignore.cpp b/plugins/ModernOpt/src/mopt_ignore.cpp
index 74f8b1524d..1d2ed1a202 100644
--- a/plugins/ModernOpt/src/mopt_ignore.cpp
+++ b/plugins/ModernOpt/src/mopt_ignore.cpp
@@ -49,7 +49,7 @@ static void ResetListOptions(HWND hwndList)
static void SetAllContactIcons(HWND hwndList, int count)
{
- HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ HANDLE hContact=db_find_first();
do {
DWORD hItem = SendMessage(hwndList,CLM_FINDCONTACT,(WPARAM)hContact,0);
for (int i = 0; i < count; ++i)
@@ -57,5 +57,5 @@ static void SetAllContactIcons(HWND hwndList, int count)
if (!DBGetContactSettingByte(hContact,"CList","Hidden",0))
SendMessage(hwndList,CLM_SETCHECKMARK,hItem,1);
}
- while(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ while(hContact=db_find_next(hContact));
}
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp
index 9bfe4a054a..d413961f26 100755
--- a/plugins/Msg_Export/src/options.cpp
+++ b/plugins/Msg_Export/src/options.cpp
@@ -733,7 +733,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
{
tstring sTmp;
LVITEM sItem = { 0 };
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
for( int nUser = 0; /*hContact*/ ; nUser++ )
{
sItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
@@ -771,7 +771,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar
if( ! hContact ) // written like this to add the current user ( handle = 0 )
break;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
ListView_SortItems( hMapUser , CompareFunc , 1 );
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp
index cc53a06555..ae45d82bad 100755
--- a/plugins/Msg_Export/src/utils.cpp
+++ b/plugins/Msg_Export/src/utils.cpp
@@ -910,7 +910,7 @@ void UpdateFileToColWidth()
{
clFileTo1ColWidth.clear();
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
for(;;)
{
tstring sNick = NickFromHandle( hContact );
@@ -921,7 +921,7 @@ void UpdateFileToColWidth()
if( ! hContact )
break;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
@@ -1626,7 +1626,7 @@ int nContactDeleted(WPARAM wparam,LPARAM /*lparam*/)
tstring sFilePath = GetFilePathFromUser( hContact );
{ // Test if there is another user using this file
- HANDLE hOtherContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hOtherContact = db_find_first();
for(;;)
{
if( hContact != hOtherContact && sFilePath == GetFilePathFromUser( hOtherContact ) )
@@ -1636,7 +1636,7 @@ int nContactDeleted(WPARAM wparam,LPARAM /*lparam*/)
if( ! hOtherContact )
break;
- hOtherContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hOtherContact, 0);
+ hOtherContact = db_find_next(hOtherContact);
}
}
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp
index 27a8b9a02a..5516fc945d 100644
--- a/plugins/NewXstatusNotify/src/indsnd.cpp
+++ b/plugins/NewXstatusNotify/src/indsnd.cpp
@@ -371,7 +371,7 @@ __inline void SetExtraImage(HWND hwndList, HANDLE hItem, int column, int imageID
void SetAllContactsIcons(HWND hwndList)
{
BYTE EnableSounds, EnablePopups, EnableXStatus, EnableLogging;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact)
{
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
@@ -396,7 +396,7 @@ void SetAllContactsIcons(HWND hwndList)
SetExtraImage(hwndList, hItem, EXTRA_IMAGE_ENABLEALL, EXTRA_IMAGE_ENABLEALL);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
@@ -631,7 +631,7 @@ INT_PTR CALLBACK DlgProcFiltering(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
{
case PSN_APPLY:
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
do
{
HANDLE hItem = (HANDLE)SendMessage(hList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
@@ -658,7 +658,7 @@ INT_PTR CALLBACK DlgProcFiltering(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
DBWriteContactSettingByte(hContact, MODULE, "EnableLogging", 0);
}
- } while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ } while(hContact = db_find_next(hContact));
return TRUE;
}
diff --git a/plugins/New_GPG/src/icons.cpp b/plugins/New_GPG/src/icons.cpp
index a1d02df1b6..3f89da2e53 100755
--- a/plugins/New_GPG/src/icons.cpp
+++ b/plugins/New_GPG/src/icons.cpp
@@ -141,11 +141,11 @@ void RefreshContactListIcons()
{
extern HANDLE g_hCLIcon;
CallService(MS_CLUI_LISTBEGINREBUILD,0,0);
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact)
{
setClistIcon(hContact);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
CallService(MS_CLUI_LISTENDREBUILD,0,0);
}
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp
index c091612d24..6d8956b219 100755
--- a/plugins/New_GPG/src/init.cpp
+++ b/plugins/New_GPG/src/init.cpp
@@ -252,7 +252,7 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
extern list<wstring> transfers;
extern "C" int __declspec(dllexport) Unload(void)
{
-// for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+// for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
// DBDeleteContactSetting(hContact, szGPGModuleName, "KeyID_Prescense");
if(!transfers.empty())
{
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp
index 88b46459f3..e6e194c864 100755
--- a/plugins/New_GPG/src/options.cpp
+++ b/plugins/New_GPG/src/options.cpp
@@ -145,7 +145,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
ListView_SetExtendedListViewStyleEx(hwndList, 0, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
int i = 1, iRow = 0;
bool isContactHaveKey(HANDLE);
- for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact != NULL; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for(HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
{
if(isContactHaveKey(hContact))
{
@@ -241,7 +241,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
ismetacontact = true;
}
tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", "");
- for(HANDLE hcnttmp = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hcnttmp != NULL; hcnttmp = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hcnttmp, 0))
+ for(HANDLE hcnttmp = db_find_first(); hcnttmp != NULL; hcnttmp = db_find_next(hcnttmp))
{
if(hcnttmp != hContact)
{
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index 8175917d05..e2841d6c85 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -1305,7 +1305,7 @@ INT_PTR ExportGpGKeys(WPARAM w, LPARAM l)
int exported_keys = 0;
if(!file.is_open())
return 1; //TODO: handle error
- for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for(HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
{
char *k = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", "");
if(!k[0])
@@ -1573,7 +1573,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l)
if(acc.length())
{
const char * uid = (const char*)CallProtoService(acc.c_str(), PS_GETCAPS, (WPARAM)PFLAG_UNIQUEIDSETTING, 0);
- for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, (LPARAM)acc.c_str()); hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, (LPARAM)acc.c_str()))
+ for(HANDLE hContact = db_find_first(acc.c_str()); hContact; hContact = db_find_next(hContact, acc.c_str()))
{
DBVARIANT dbv = {0};
DBCONTACTGETSETTING dbcgs = {0};
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp
index 1bf81f87c3..932e462333 100644
--- a/plugins/Nudge/src/main.cpp
+++ b/plugins/Nudge/src/main.cpp
@@ -569,7 +569,7 @@ void LoadPopupClass()
int Preview()
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ HANDLE hContact = db_find_first();
if ( GlobalNudge.useByProtocol )
{
for(NudgeElementList *n = NudgeList;n != NULL; n = n->next)
diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp
index e7908f1099..2ecf985d1f 100644
--- a/plugins/Popup/src/config.cpp
+++ b/plugins/Popup/src/config.cpp
@@ -122,8 +122,8 @@ void PopUpPreview()
#if defined(_DEBUG)
// test per-contact popups
- for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (HANDLE hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
if (DBGetContactSettingDword(hContact, "ICQ", "UIN", 0) == 256771455)
{
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp
index 16a1963e14..3aaf0b3520 100644
--- a/plugins/Popup/src/opt_contacts.cpp
+++ b/plugins/Popup/src/opt_contacts.cpp
@@ -122,8 +122,8 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case PSN_APPLY:
{
HWND hwndList = GetDlgItem(hwnd, IDC_LIST);
- for (HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); hContact;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ for (HANDLE hContact=db_find_first(); hContact;
+ hContact=db_find_next(hContact))
{
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
for (int i = 0; i < 4 /*SIZEOF(sttIcons)*/; ++i)
@@ -162,8 +162,8 @@ static void sttResetListOptions(HWND hwndList)
static void sttSetAllContactIcons(HWND hwndList)
{
- for (HANDLE hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0); hContact;
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ for (HANDLE hContact=db_find_first(); hContact;
+ hContact=db_find_next(hContact))
{
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
DWORD dwMode = DBGetContactSettingByte(hContact, MODULNAME, "ShowMode", 0);
diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp
index 398d500e81..005cdf5765 100644
--- a/plugins/Popup/src/srmm_menu.cpp
+++ b/plugins/Popup/src/srmm_menu.cpp
@@ -77,11 +77,11 @@ void SrmmMenu_Load()
hIconPressed = HookEvent(ME_MSG_ICONPRESSED, SrmmMenu_ProcessIconClick);
hWindowEvent = HookEvent(ME_MSG_WINDOWEVENT, SrmmMenu_ProcessEvent);
/*
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact)
{
SrmmMenu_UpdateIcon(hContact);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
*/
}
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index 697a64674e..94fef144c4 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -376,9 +376,9 @@ void LoadContacts(HWND hwndDlg, BOOL show_all)
// enumerate all contacts and write them to the array
// item data of listbox-strings is the array position
FreeContacts();
- for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ for(HANDLE hContact = db_find_first();
hContact != NULL;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0))
+ hContact = db_find_next(hContact))
{
char *pszProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if(pszProto != NULL)
diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp
index 8fe42060f1..10a6ca24bd 100644
--- a/plugins/Rate/src/main.cpp
+++ b/plugins/Rate/src/main.cpp
@@ -196,11 +196,11 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
if (hExtraIcon != NULL)
{
// Set initial value for all contacts
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
setExtaIcon(hContact, -1, FALSE);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
else
diff --git a/plugins/Rate/src/options.cpp b/plugins/Rate/src/options.cpp
index bd8c3a228e..e435e4b215 100644
--- a/plugins/Rate/src/options.cpp
+++ b/plugins/Rate/src/options.cpp
@@ -178,19 +178,19 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (usedClist == clist_modern )
clistIcon++;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact)
{
CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&g_IECClear);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
g_IECClear.ColumnType = clistIcon;
onExtraImageListRebuild(0,0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact)
{
onExtraImageApplying((WPARAM)hContact,0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
//Store options values to DB
DBWriteContactSettingByte(NULL, MODULENAME, "AdvancedIcon", clistIcon);
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index dea6b69b88..797129a385 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -384,8 +384,8 @@ INT_PTR OnMenuCommandShowList(WPARAM wParam, LPARAM lParam)
BYTE buf[1];
dbe.pBlob = buf;
HANDLE curEvent;
- HANDLE curContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for (; curContact != NULL; curContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)curContact, 0))
+ HANDLE curContact = db_find_first();
+ for (; curContact != NULL; curContact = db_find_next(curContact))
{
// if (IsMessageAPI)
{
diff --git a/plugins/Scriver/src/chat/clist.cpp b/plugins/Scriver/src/chat/clist.cpp
index cdffbd30c6..7cbe58c572 100644
--- a/plugins/Scriver/src/chat/clist.cpp
+++ b/plugins/Scriver/src/chat/clist.cpp
@@ -102,7 +102,7 @@ BOOL CList_SetOffline(HANDLE hContact, BOOL bHide)
BOOL CList_SetAllOffline(BOOL bHide, const char *pszModule)
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while ( hContact ) {
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if ( MM_FindModule( szProto )) {
@@ -114,7 +114,7 @@ BOOL CList_SetAllOffline(BOOL bHide, const char *pszModule)
}
}
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
return TRUE;
}
@@ -294,7 +294,7 @@ BOOL CList_AddEvent(HANDLE hContact, HICON Icon, HANDLE event, int type, TCHAR*
HANDLE CList_FindRoom ( const char* pszModule, const TCHAR* pszRoom)
{
- HANDLE hContact = ( HANDLE )CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact) {
char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0 );
if ( szProto && !lstrcmpiA( szProto, pszModule )) {
@@ -308,7 +308,7 @@ HANDLE CList_FindRoom ( const char* pszModule, const TCHAR* pszRoom)
DBFreeVariant(&dbv);
} } }
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
return 0;
}
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp
index ea103245bd..c323e6bb39 100644
--- a/plugins/Scriver/src/msgoptions.cpp
+++ b/plugins/Scriver/src/msgoptions.cpp
@@ -964,13 +964,13 @@ static void RebuildList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
if (hItemUnknown && DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN)) {
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItemUnknown, 1);
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
do {
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM) hContact, 0);
if (hItem && DBGetContactSettingByte(hContact, SRMMMOD, SRMSGSET_TYPING, defType)) {
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItem, 1);
}
- } while ((hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0)));
+ } while ((hContact = db_find_next(hContact)));
}
static void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
@@ -983,13 +983,13 @@ static void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
if (hItemUnknown) {
DBWriteContactSettingByte(NULL, SRMMMOD, SRMSGSET_TYPINGUNKNOWN, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItemUnknown, 0) ? 1 : 0));
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
do {
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM) hContact, 0);
if (hItem) {
DBWriteContactSettingByte(hContact, SRMMMOD, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItem, 0) ? 1 : 0));
}
- } while ((hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0)));
+ } while ((hContact = db_find_next(hContact)));
}
static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 0971cfa0eb..972ea864ca 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -318,7 +318,7 @@ static void RestoreUnreadMessageAlerts(void)
cle.flags = CLEF_TCHAR;
cle.ptszTooltip = toolTip;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact) {
hDbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM) hContact, 0);
while (hDbEvent) {
@@ -347,7 +347,7 @@ static void RestoreUnreadMessageAlerts(void)
}
hDbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDNEXT, (WPARAM) hDbEvent, 0);
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp
index 6c5984c345..34263addc8 100644
--- a/plugins/SecureIM/src/crypt_icons.cpp
+++ b/plugins/SecureIM/src/crypt_icons.cpp
@@ -128,21 +128,21 @@ void RefreshContactListIcons(void) {
HANDLE hContact;
// CallService(MS_CLUI_LISTBEGINREBUILD,0,0);
if ( !g_hCLIcon ) {
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact) { // ñíà÷àëà âñå âûêëþ÷àåì
ShowStatusIcon(hContact,-1);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
// ìåíåì ìåñòîïîëîæåíèå èêîíêè
for(int i=0;i<1+MODE_CNT*IEC_CNT;i++) {
g_IEC[i].ColumnType = bADV;
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact) { // è ñíîâà çàæèãàåì èêîíêó
if ( isSecureProtocol(hContact))
ShowStatusIcon(hContact);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
// CallService(MS_CLUI_LISTENDREBUILD,0,0);
}
diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp
index 7b1225d2a2..177d5756e6 100644
--- a/plugins/SecureIM/src/crypt_lists.cpp
+++ b/plugins/SecureIM/src/crypt_lists.cpp
@@ -135,10 +135,10 @@ void loadContactList() {
freeContactList();
loadSupportedProtocols();
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact) {
addContact(hContact);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp
index 171fcc28cb..6e698a7dae 100644
--- a/plugins/SecureIM/src/options.cpp
+++ b/plugins/SecureIM/src/options.cpp
@@ -1148,7 +1148,7 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) {
LVITEM lvi; memset(&lvi,0,sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
char tmp[NAMSIZE];
while (hContact) {
@@ -1178,7 +1178,7 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) {
else setListViewPUB(hLV, itemNum, hasKey(ptr));
setListViewIcon(hLV, itemNum, ptr);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
ListView_Sort(hLV,(LPARAM)0);
}
@@ -1252,7 +1252,7 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit) {
LVITEM lvi; memset(&lvi,0,sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
char tmp[NAMSIZE];
while (hContact) {
@@ -1276,7 +1276,7 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit) {
LV_SetItemTextA(hLV, itemNum, 2, (szKeyID)?szKeyID:Translate(sim221));
SAFE_FREE(szKeyID);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
ListView_Sort(hLV,(LPARAM)0x10);
}
@@ -1322,7 +1322,7 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit) {
LVITEM lvi; memset(&lvi,0,sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
char tmp[NAMSIZE];
while (hContact) {
@@ -1351,7 +1351,7 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit) {
LV_SetItemTextA(hLV, itemNum, 3, (ptr->tgpgMode)?Translate(sim228):Translate(sim229));
SAFE_FREE(szKeyID);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
ListView_Sort(hLV,(LPARAM)0x20);
}
@@ -1387,7 +1387,7 @@ void ResetGeneralDlg(HWND hDlg) {
LVITEM lvi; memset(&lvi,0,sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
char tmp[NAMSIZE];
while (hContact) {
@@ -1417,7 +1417,7 @@ void ResetGeneralDlg(HWND hDlg) {
else setListViewPUB(hLV, itemNum, 0);
setListViewIcon(hLV, itemNum, ptr);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp
index 179dd8ee4d..bb1568a88b 100644
--- a/plugins/SeenPlugin/src/missed.cpp
+++ b/plugins/SeenPlugin/src/missed.cpp
@@ -67,11 +67,11 @@ int ResetMissed(void)
{
HANDLE hcontact=NULL;
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hcontact=db_find_first();
while(hcontact!=NULL)
{
DBWriteContactSettingByte(hcontact,S_MOD,"Missed",0);
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hcontact,0);
+ hcontact = db_find_next(hcontact);
}
ZeroMemory(&mcs,sizeof(mcs));
@@ -86,7 +86,7 @@ int CheckIfOnline(void)
// char *szProto;
// WORD status;
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hcontact=db_find_first();
while(hcontact!=NULL)
{
/* szProto=(char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hcontact,0);
@@ -96,7 +96,7 @@ int CheckIfOnline(void)
if(CallService(MS_CLIST_GETCONTACTICON,(WPARAM)hcontact,0)!=ICON_OFFLINE)
DBWriteContactSettingByte(hcontact,S_MOD,"Missed",2);
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hcontact,0);
+ hcontact = db_find_next(hcontact);
}
return 0;
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp
index d297f37689..5d64f0e7a9 100644
--- a/plugins/SeenPlugin/src/utils.cpp
+++ b/plugins/SeenPlugin/src/utils.cpp
@@ -713,7 +713,7 @@ static DWORD __stdcall cleanThread(logthread_info* infoParam)
{
Sleep(10000); // I hope in 10 secons all logged-in contacts will be listed
- HANDLE hcontact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ HANDLE hcontact = db_find_first();
while(hcontact != NULL) {
char *contactProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hcontact,0);
if (contactProto) {
@@ -728,7 +728,7 @@ static DWORD __stdcall cleanThread(logthread_info* infoParam)
}
}
}
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hcontact,0);
+ hcontact = db_find_next(hcontact);
}
char *str = (char *)malloc(MAXMODULELABELLENGTH+9);
@@ -825,6 +825,7 @@ WCHAR *any_to_IdleNotidleUnknown(HANDLE hContact, const char *module_name, const
buff[bufflen - 1] = 0;
return buff;
}
+
WCHAR *any_to_Idle(HANDLE hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen) {
if(isDbZero(hContact, module_name, setting_name)==0) { //DB setting is NOT zero and exists
buff[0] = L'/';
@@ -833,46 +834,3 @@ WCHAR *any_to_Idle(HANDLE hContact, const char *module_name, const char *setting
buff[bufflen - 1] = 0;
return buff;
}
-
-
-/*int GetInfoAck(WPARAM wparam,LPARAM lparam)
-{
- ACKDATA *ack;
- DWORD dwsetting=0;
-
- ack=(ACKDATA *)lparam;
-
- if(ack->type!=ACKTYPE_GETINFO || ack->hContact==NULL) return 0;
- if (((int)ack->hProcess-1)!=(int)ack->lParam) return 0;
-
- dwsetting=DBGetContactSettingDword(ack->hContact,ack->szModule,"IP",0);
- if(dwsetting)
- DBWriteContactSettingDword(ack->hContact,S_MOD,"IP",dwsetting);
-
- dwsetting=DBGetContactSettingDword(ack->hContact,ack->szModule,"RealIP",0);
- if(dwsetting)
- DBWriteContactSettingDword(ack->hContact,S_MOD,"RealIP",dwsetting);
-
- return 0;
-}*/
-
-
-
-/*void SetOffline(void)
-{
- HANDLE hcontact=NULL;
- char * szProto;
-
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
- while(hcontact!=NULL)
- {
- szProto=(char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hcontact,0);
- if (szProto != NULL && IsWatchedProtocol(szProto)) {
- DBWriteContactSettingByte(hcontact,S_MOD,"Offline",1);
- }
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hcontact,0);
- }
-}*/
-
-
-
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index 23636235ae..2aaa3384fb 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -226,8 +226,8 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar
szUserSessionName[lenght+1]='\0';
if(IsDlgButtonChecked(hdlg,IDC_SELCONTACTS)&&bSC)
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for (i=0; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for (i=0; hContact; hContact = db_find_next(hContact))
{
BYTE res =(BYTE)SendMessage(hClistControl, CLM_GETCHECKMARK, SendMessage(hClistControl, CLM_FINDCONTACT, (WPARAM)hContact, 0), 0);
if (res)
@@ -471,8 +471,8 @@ int SaveSessionHandles(WPARAM wparam,LPARAM lparam)
if(session_list[0]!=0)
{
- for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (HANDLE hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
if ((k=CheckForDuplicate(session_list,(DWORD)hContact))!=-1
&&!(g_bExclHidden&&!CheckContactVisibility(hContact)))
@@ -621,8 +621,8 @@ int LoadSession(WPARAM wparam,LPARAM lparam)
if(session_list_recovered[0]&&lparam==256&&mode==0)
memcpy(session_list_t,session_list_recovered,SIZEOF(session_list_t));
else
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
if(LoadContactsFromMask(hContact,mode,lparam))
{
@@ -691,8 +691,8 @@ int DelUserDefSession(int ses_count)
char szSessionName[256]={0};
TCHAR *szSessionNameBuf=NULL;
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
RemoveSessionMark(hContact,1,ses_count);
SetInSessionOrder(hContact,1,ses_count,0);
@@ -738,8 +738,8 @@ int DeleteAutoSession(int ses_count)
TCHAR *szSessionNameBuf=NULL;
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
RemoveSessionMark(hContact,0,ses_count);
SetInSessionOrder(hContact,0,ses_count,0);
@@ -913,8 +913,8 @@ static int PluginInit(WPARAM wparam,LPARAM lparam)
HANDLE hContact;
ZeroMemory(session_list_recovered,255);
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
if(DBGetContactSettingByte(hContact, __INTERNAL_NAME, "wasInLastSession", 0))
session_list_recovered[i++]=(DWORD)hContact;
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp
index 4502f2f863..c9c9c9eeba 100644
--- a/plugins/Sessions/Src/Options.cpp
+++ b/plugins/Sessions/Src/Options.cpp
@@ -51,8 +51,8 @@ int OpLoadSessionContacts(WPARAM wparam,LPARAM lparam)
int i=0;
ZeroMemory(session_list_t,SIZEOF(session_list_t));
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
if(LoadContactsFromMask(hContact,1,lparam))
{
@@ -300,8 +300,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
if (((LPNMHDR)lparam)->idFrom ==IDC_EMCLIST)
{
int iSelection = (int)((NMCLISTCONTROL *)lparam)->hItem;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for ( ; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for ( ; hContact; hContact = db_find_next(hContact))
if (SendDlgItemMessage(hdlg, IDC_EMCLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0) == iSelection)
break;
if (hContact)
@@ -350,9 +350,9 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
else
{
int i;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
- for ( ; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for ( ; hContact; hContact = db_find_next(hContact))
SendMessage(hOpClistControl, CLM_SETCHECKMARK, (WPARAM)hContact,0);
for (i=0 ; session_list_t[i]>0; i++)
{
@@ -407,8 +407,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
case IDC_SAVE:
{
int i;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for (i=0 ; hContact;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for (i=0 ; hContact;hContact = db_find_next(hContact))
{
BYTE res =(BYTE)SendMessage(GetDlgItem(hdlg,IDC_EMCLIST), CLM_GETCHECKMARK,
SendMessage(GetDlgItem(hdlg,IDC_EMCLIST), CLM_FINDCONTACT, (WPARAM)hContact, 0), 0);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index acd9fc9060..35a618008f 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -1897,7 +1897,7 @@ static int OnICQStatusMsgRequest(WPARAM wParam, LPARAM lParam, LPARAM lMirParam)
char *szProto;
BOOL bContactFound = FALSE;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact)
{
szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
@@ -1906,7 +1906,7 @@ static int OnICQStatusMsgRequest(WPARAM wParam, LPARAM lParam, LPARAM lMirParam)
bContactFound = TRUE;
break;
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
if (!bContactFound)
return 0;
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index 2cc8039052..bc085120e5 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -902,7 +902,7 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc)
{
bkstring tname(A2T_SM(acc->szModuleName));
- HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
char* proto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
@@ -916,7 +916,7 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc)
if (found) return;
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
for (int i = 0; i < m_SmileyCategories.getCount(); i++)
@@ -1000,11 +1000,11 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void)
for (int i = 0; i < protoCount; i++)
AddAccountAsCategory(accList[i], defaultFile);
- HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
AddContactTransportAsCategory(hContact, defaultFile);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
bkstring cats;
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp
index 6d60d22106..ae1d8ab939 100755
--- a/plugins/StopSpamMod/src/utilities.cpp
+++ b/plugins/StopSpamMod/src/utilities.cpp
@@ -113,7 +113,7 @@ void RemoveExcludedUsers()
{
HANDLE hContact;
hContact_entry *first, *plist, *tmp;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
first = new hContact_entry;
plist = first;
plist->hContact = INVALID_HANDLE_VALUE;
@@ -127,7 +127,7 @@ void RemoveExcludedUsers()
plist = plist->next;
plist->hContact = INVALID_HANDLE_VALUE;
}
- }while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0));
+ }while(hContact = db_find_next(hContact));
plist = first;
while(plist->hContact != INVALID_HANDLE_VALUE)
@@ -154,7 +154,7 @@ void RemoveTemporaryUsers()
{
HANDLE hContact;
hContact_entry *first, *plist, *tmp;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
first = new hContact_entry;
plist = first;
plist->hContact = INVALID_HANDLE_VALUE;
@@ -170,7 +170,7 @@ void RemoveTemporaryUsers()
plist = plist->next;
plist->hContact = INVALID_HANDLE_VALUE;
}
- }while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0));
+ }while(hContact = db_find_next(hContact));
plist = first;
while(plist->hContact != INVALID_HANDLE_VALUE)
@@ -407,7 +407,7 @@ void CleanProtocolTmpThread(std::string proto)
boost::this_thread::sleep(boost::posix_time::seconds(2));
}
std::list<HANDLE> contacts;
- for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for(HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
{
char *proto_tmp = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if(proto_tmp)
@@ -437,7 +437,7 @@ void CleanProtocolExclThread(std::string proto)
boost::this_thread::sleep(boost::posix_time::seconds(2));
}
std::list<HANDLE> contacts;
- for(HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for(HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
{
char *proto_tmp = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if(proto_tmp)
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp
index ff19540a63..bc54f5485d 100644
--- a/plugins/StopSpamPlus/src/services.cpp
+++ b/plugins/StopSpamPlus/src/services.cpp
@@ -22,9 +22,9 @@ INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/)
INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
+ HANDLE hContact = db_find_first();
while ( hContact ) {
- HANDLE hNext = (HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM )hContact, 0 );
+ HANDLE hNext = db_find_next(hContact);
DBVARIANT dbv = { 0 };
if ( DBGetContactSettingTString( hContact, "CList", "Group", &dbv ))
diff --git a/plugins/TabSRMM/chat/clist.cpp b/plugins/TabSRMM/chat/clist.cpp
index c210294575..a3c5b75d24 100644
--- a/plugins/TabSRMM/chat/clist.cpp
+++ b/plugins/TabSRMM/chat/clist.cpp
@@ -119,7 +119,7 @@ BOOL CList_SetAllOffline(BOOL bHide, const char *pszModule)
HANDLE hContact;
char* szProto;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact) {
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if (MM_FindModule(szProto)) {
@@ -132,7 +132,7 @@ BOOL CList_SetAllOffline(BOOL bHide, const char *pszModule)
}
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
return TRUE;
}
@@ -303,7 +303,7 @@ BOOL CList_AddEvent(HANDLE hContact, HICON Icon, HANDLE event, int type, const T
HANDLE CList_FindRoom(const char* pszModule, const TCHAR* pszRoom)
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact) {
char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if (szProto && !lstrcmpiA(szProto, pszModule)) {
@@ -319,7 +319,7 @@ HANDLE CList_FindRoom(const char* pszModule, const TCHAR* pszRoom)
}
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
return 0;
}
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index a359a1379e..afe5c85fd6 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -2476,7 +2476,7 @@ void TSAPI DeleteContainer(int iIndex) {
TCHAR *wszContainerName = dbv.ptszVal;
M->WriteTString(NULL, szKey, szIndex, _T("**free**"));
- hhContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hhContact = db_find_first();
while (hhContact) {
DBVARIANT dbv_c;
if (!M->GetTString(hhContact, SRMSGMOD_T, szSubKey, &dbv_c)) {
@@ -2485,7 +2485,7 @@ void TSAPI DeleteContainer(int iIndex) {
DBDeleteContactSetting(hhContact, SRMSGMOD_T, "containerW");
DBFreeVariant(&dbv_c);
}
- hhContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hhContact, 0);
+ hhContact = db_find_next(hhContact);
}
_snprintf(szSetting, CONTAINER_NAMELEN + 15, "%s%d_Flags", szSettingP, iIndex);
DBDeleteContactSetting(NULL, SRMSGMOD_T, szSetting);
@@ -2518,7 +2518,7 @@ void TSAPI RenameContainer(int iIndex, const TCHAR *szNew) {
if (lstrlen(szNew) != 0)
M->WriteTString(NULL, szKey, szIndex, szNew);
}
- hhContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hhContact = db_find_first();
while (hhContact) {
DBVARIANT dbv_c;
if (!M->GetTString(hhContact, SRMSGMOD_T, szSubKey, &dbv_c)) {
@@ -2530,7 +2530,7 @@ void TSAPI RenameContainer(int iIndex, const TCHAR *szNew) {
}
DBFreeVariant(&dbv_c);
}
- hhContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hhContact, 0);
+ hhContact = db_find_next(hhContact);
}
DBFreeVariant(&dbv);
}
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 07c5819064..548068794d 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -612,10 +612,10 @@ int CGlobals::PreshutdownSendRecv(WPARAM wParam, LPARAM lParam)
::SendMessage(pFirstContainer->hwnd, WM_CLOSE, 0, 1);
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact) {
M->WriteDword(hContact, SRMSGMOD_T, "messagecount", 0);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
for (i=0; i < SERVICE_LAST; i++) {
@@ -722,7 +722,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
cle.pszService = "SRMsg/ReadMessage";
cle.flags = CLEF_TCHAR;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact) {
if (M->GetDword(hContact, "SendLater", "count", 0))
@@ -746,7 +746,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
}
hDbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDNEXT, (WPARAM) hDbEvent, 0);
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index 8617a138d7..ceb8d2fa33 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -865,13 +865,13 @@ static void RebuildList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
if (hItemUnknown && M->GetByte(SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN)) {
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItemUnknown, 1);
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
do {
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM) hContact, 0);
if (hItem && M->GetByte(hContact, SRMSGMOD, SRMSGSET_TYPING, defType)) {
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItem, 1);
}
- } while (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0));
+ } while (hContact = db_find_next(hContact));
}
static void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
@@ -884,13 +884,13 @@ static void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
if (hItemUnknown) {
M->WriteByte(SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItemUnknown, 0) ? 1 : 0));
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
do {
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM) hContact, 0);
if (hItem) {
DBWriteContactSettingByte(hContact, SRMSGMOD, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItem, 0) ? 1 : 0));
}
- } while (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0));
+ } while (hContact = db_find_next(hContact));
}
static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index 8dffa1f622..a00b5a9445 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -385,7 +385,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry)
int iMinLength = 0;
CContactCache* c = 0;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
m_jobs[iEntry].hOwner = dat->hContact;
m_jobs[iEntry].iStatus = SQ_INPROGRESS;
@@ -400,7 +400,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry)
if (c)
iMinLength = (iMinLength == 0 ? c->getMaxMessageLength() : min(c->getMaxMessageLength(), iMinLength));
}
- } while (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0));
+ } while (hContact = db_find_next(hContact));
if (iSendLength >= iMinLength) {
TCHAR tszError[256];
@@ -411,14 +411,14 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry)
return 0;
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
do {
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM) hContact, 0);
if (hItem && SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItem, 0)) {
doSendLater(iEntry, 0, hContact, false);
iJobs++;
}
- } while (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0));
+ } while (hContact = db_find_next(hContact));
sendQueue->clearJob(iEntry);
if (iJobs)
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp
index 8924f58013..d71a99dc60 100644
--- a/plugins/TabSRMM/src/templates.cpp
+++ b/plugins/TabSRMM/src/templates.cpp
@@ -163,10 +163,10 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_SETEDITSTYLE, SES_EXTENDBACKCOLOR, SES_EXTENDBACKCOLOR);
SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_EXLIMITTEXT, 0, 0x80000000);
- dat->hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ dat->hContact = db_find_first();
dat->szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
while(dat->szProto == 0 && dat->hContact != 0) {
- dat->hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)dat->hContact, 0);
+ dat->hContact = db_find_next(dat->hContact);
dat->szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)dat->hContact, 0);
}
dat->dwFlags = dat->pContainer->theme.dwFlags;
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp
index b7a7aa4dc4..9da43b2472 100644
--- a/plugins/TabSRMM/src/trayicon.cpp
+++ b/plugins/TabSRMM/src/trayicon.cpp
@@ -339,7 +339,7 @@ void TSAPI LoadFavoritesAndRecent()
RCENTRY *recentEntries, rceTemp;
DWORD dwRecent;
int iIndex = 0, i, j;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
recentEntries = new RCENTRY[nen_options.wMaxRecent + 1];
if (recentEntries != NULL) {
while (hContact != 0) {
@@ -349,7 +349,7 @@ void TSAPI LoadFavoritesAndRecent()
recentEntries[iIndex].dwTimestamp = dwRecent;
recentEntries[iIndex++].hContact = hContact;
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
if (iIndex == 0) {
free(recentEntries);
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp
index 1d2fcd573e..adfdbfee5c 100644
--- a/plugins/TabSRMM/src/typingnotify.cpp
+++ b/plugins/TabSRMM/src/typingnotify.cpp
@@ -283,7 +283,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
char *szProto = NULL;
int i, notyping;
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
if (!PopupService)
break;
@@ -292,7 +292,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto != NULL)
break;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
for (i=0; i < 2; i++) {
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp
index b106d76fac..0dfb831bc9 100644
--- a/plugins/TipperYM/src/options.cpp
+++ b/plugins/TipperYM/src/options.cpp
@@ -2104,14 +2104,14 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam,
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETLEFTMARGIN, 2, 0);
HANDLE hContact, hItem;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact)
{
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem && DBGetContactSettingByte(hContact, MODULE, "FavouriteContact", 0))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
CheckDlgButton(hwndDlg, IDC_CHK_HIDEOFFLINE, opt.iFavoriteContFlags & FAVCONT_HIDE_OFFLINE);
@@ -2129,7 +2129,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam,
BYTE isChecked;
int count = 0;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact)
{
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
@@ -2140,7 +2140,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (isChecked) count++;
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
DBWriteContactSettingDword(0, MODULE, "FavouriteContactsCount", count);
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp
index 964069ce2d..bf673f2da3 100644
--- a/plugins/TipperYM/src/popwin.cpp
+++ b/plugins/TipperYM/src/popwin.cpp
@@ -1769,7 +1769,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (dwItems & TRAYTIP_NUMCONTACTS)
{
int iCount = 0, iCountOnline = 0;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact)
{
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
@@ -1779,7 +1779,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
iCountOnline++;
iCount++;
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
mir_sntprintf(buff, 64, _T("(%d/%d)"), iCountOnline, iCount);
}
@@ -1927,7 +1927,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
bool bTitlePainted = false;
int iCount = 0, iCountOnline = 0;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact)
{
if (DBGetContactSettingByte(hContact, MODULE, "FavouriteContact", 0))
@@ -1968,7 +1968,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
int index = pwd->iRowCount - 1;
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index 1d8c8837d9..83d2408d74 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -915,11 +915,11 @@ TCHAR *GetProtoExtraStatusMessage(char *szProto)
if (ServiceExists(MS_VARS_FORMATSTRING))
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
char *proto = ( char* )CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
while(!proto)
{
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
if (hContact)
{
proto = ( char* )CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp
index ab80715591..0029da7b93 100644
--- a/plugins/TooltipNotify/src/TooltipNotify.cpp
+++ b/plugins/TooltipNotify/src/TooltipNotify.cpp
@@ -821,7 +821,7 @@ void CTooltipNotify::LoadList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItemUnknown, 1);
}
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
do
{
HANDLE hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM) hContact, 0);
@@ -830,7 +830,7 @@ void CTooltipNotify::LoadList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItem, 1);
}
}
- while (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0));
+ while (hContact = db_find_next(hContact));
}
void CTooltipNotify::SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
@@ -844,7 +844,7 @@ void CTooltipNotify::SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown
m_sOptions.bIgnoreUnknown = (BYTE) (SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItemUnknown, 0) ? 0 : 1);
}
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
do
{
HANDLE hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM) hContact, 0);
@@ -854,7 +854,7 @@ void CTooltipNotify::SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown
DBWriteContactSettingByte(hContact, s_szModuleName, CONTACT_IGNORE_TTNOTIFY, bChecked ? 0 : 1);
}
}
- while (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0));
+ while (hContact = db_find_next(hContact));
}
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp
index 005495939c..c65d9dc951 100644
--- a/plugins/UserInfoEx/src/mir_db.cpp
+++ b/plugins/UserInfoEx/src/mir_db.cpp
@@ -150,7 +150,7 @@ INT_PTR GetCount()
**/
HANDLE FindFirst()
{
- return (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ return db_find_first();
}
/**
@@ -161,7 +161,7 @@ HANDLE FindFirst()
**/
HANDLE FindNext(HANDLE hContact)
{
- return (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ return db_find_next(hContact);
}
/**
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp
index 9e2f08c83e..bdc4b9af60 100644
--- a/plugins/Variables/src/contact.cpp
+++ b/plugins/Variables/src/contact.cpp
@@ -276,14 +276,14 @@ int getContactFromString( CONTACTSINFO* ci )
LeaveCriticalSection(&csContactCache);
/* contact was not in cache, do a search */
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact != NULL) {
szFind = NULL;
bMatch = FALSE;
ZeroMemory(&dbv, sizeof(DBVARIANT));
szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if (szProto == NULL) {
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
continue;
}
// <proto:id> (exact)
@@ -406,7 +406,7 @@ int getContactFromString( CONTACTSINFO* ci )
ci->hContacts[count] = hContact;
count += 1;
}
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ hContact=db_find_next(hContact);
}
if (count == 1) { /* cache the found result */
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp
index 926f7fb67b..f5492eea77 100644
--- a/plugins/Variables/src/parse_miranda.cpp
+++ b/plugins/Variables/src/parse_miranda.cpp
@@ -554,7 +554,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags)
hMatchEvent = hSearchEvent = hSearchContact = NULL;
matchTimestamp = priorTimestamp = 0;
if (flags & DBE_FIRST) {
- hSearchContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hSearchContact = db_find_first();
do {
hSearchEvent = findDbEvent(hSearchContact, NULL, flags);
dbe.cbBlob = 0;
@@ -564,12 +564,12 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags)
matchTimestamp = dbe.timestamp;
}
}
- hSearchContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hSearchContact, 0);
+ hSearchContact = db_find_next(hSearchContact);
} while (hSearchContact);
hDbEvent = hMatchEvent;
}
else if (flags&DBE_LAST) {
- hSearchContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hSearchContact = db_find_first();
do {
hSearchEvent = findDbEvent(hSearchContact, NULL, flags);
dbe.cbBlob = 0;
@@ -579,7 +579,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags)
matchTimestamp = dbe.timestamp;
}
}
- hSearchContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hSearchContact, 0);
+ hSearchContact = db_find_next(hSearchContact);
} while (hSearchContact);
hDbEvent = hMatchEvent;
}
@@ -587,7 +587,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags)
dbe.cbBlob = 0;
if (!CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbe)) {
priorTimestamp = dbe.timestamp;
- hSearchContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hSearchContact = db_find_first();
do {
hSearchEvent = findDbEvent(hSearchContact, hDbEvent, flags);
dbe.cbBlob = 0;
@@ -597,7 +597,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags)
matchTimestamp = dbe.timestamp;
}
}
- hSearchContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hSearchContact, 0);
+ hSearchContact = db_find_next(hSearchContact);
} while (hSearchContact);
hDbEvent = hMatchEvent;
}
@@ -605,7 +605,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags)
else if (flags&DBE_PREV) {
if (!CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbe)) {
priorTimestamp = dbe.timestamp;
- hSearchContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hSearchContact = db_find_first();
do {
hSearchEvent = findDbEvent(hSearchContact, hDbEvent, flags);
dbe.cbBlob = 0;
@@ -615,7 +615,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags)
matchTimestamp = dbe.timestamp;
}
}
- hSearchContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hSearchContact, 0);
+ hSearchContact = db_find_next(hSearchContact);
} while (hSearchContact);
hDbEvent = hMatchEvent;
}
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp
index 37160995e2..db617c4d4f 100644
--- a/plugins/WhenWasIt/src/dlg_handlers.cpp
+++ b/plugins/WhenWasIt/src/dlg_handlers.cpp
@@ -325,7 +325,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
case IDC_PREVIEW:
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
int dtb, age;
dtb = rand() % 11; //0..10
age = rand() % 50 + 1; //1..50
@@ -902,7 +902,7 @@ void SetBirthdaysCount(HWND hWnd)
int LoadBirthdays(HWND hWnd, int bShowAll)
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
HWND hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
//int bShowCurrentAge = DBGetContactSettingByte(NULL, ModuleName, "ShowCurrentAge", 0);
@@ -913,7 +913,7 @@ int LoadBirthdays(HWND hWnd, int bShowAll)
{
count = UpdateBirthdayEntry(hList, hContact, count, bShowAll, commonData.cShowAgeMode, 1);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
SetBirthdaysCount(hWnd);
diff --git a/plugins/WhenWasIt/src/notifiers.cpp b/plugins/WhenWasIt/src/notifiers.cpp
index 102511cfaa..5b1e569ea2 100644
--- a/plugins/WhenWasIt/src/notifiers.cpp
+++ b/plugins/WhenWasIt/src/notifiers.cpp
@@ -329,7 +329,7 @@ int RefreshContactListIcons(HANDLE hContact)
//called with oldClistIcon != -1 from dlg_handlers whtn the extra icon slot changes.
int RefreshAllContactListIcons(int oldClistIcon)
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
if (oldClistIcon != -1)
@@ -337,7 +337,7 @@ int RefreshAllContactListIcons(int oldClistIcon)
ClearClistIcon(hContact, oldClistIcon);
}
RefreshContactListIcons(hContact); //will change bBirthdayFound if needed
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
return 0;
} \ No newline at end of file
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp
index adc06de7b5..7fc5d22d52 100644
--- a/plugins/WhenWasIt/src/services.cpp
+++ b/plugins/WhenWasIt/src/services.cpp
@@ -221,12 +221,12 @@ DWORD WINAPI RefreshUserDetailsWorkerThread(LPVOID param)
//PUAddPopUp(&pd);
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Starting to refresh user details"), hiRefreshUserDetails);
int delay = DBGetContactSettingWord(NULL, ModuleName, "UpdateDelay", REFRESH_DETAILS_DELAY);
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
int res;
while (hContact != NULL)
{
res = CallContactService(hContact, PSS_GETINFO, 0, 0);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
if (hContact)
{
Sleep(delay); //sleep for a few seconds between requests
@@ -391,7 +391,7 @@ int DoExport(TCHAR *fileName)
_ftprintf(fout, _T("%c%s"), _T(COMMENT_CHAR), _T("This file was exported with a Unicode version of WhenWasIt. Please only use a Unicode version of the plugin to import the birthdays.\n"));
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
int year, month, day;
TCHAR *szHandle;
char szProto[256];
@@ -413,7 +413,7 @@ int DoExport(TCHAR *fileName)
if (szHandle) free(szHandle);
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
fclose(fout);
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp
index 6bfbcd326e..96a86ee8be 100644
--- a/plugins/WhenWasIt/src/utils.cpp
+++ b/plugins/WhenWasIt/src/utils.cpp
@@ -281,7 +281,7 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto)
#pragma warning (disable: 4312)
HANDLE GetContactFromID(TCHAR *szID, char *szProto)
{
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
TCHAR *szHandle;
char cProtocol[256];
@@ -300,7 +300,7 @@ HANDLE GetContactFromID(TCHAR *szID, char *szProto)
{
break;
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
return hContact;
}
diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp
index c6b9e05110..fe231b18b2 100644
--- a/plugins/YAPP/src/options.cpp
+++ b/plugins/YAPP/src/options.cpp
@@ -102,7 +102,7 @@ void ShowExamplePopups() {
pd.ptzText = TranslateT("Thequickbrownfoxjumpedoverthelazydog.");
ShowPopup(pd);
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while(hContact) {
if (options.av_layout != PAV_NONE && ServiceExists(MS_AV_DRAWAVATAR)) {
AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
@@ -114,7 +114,7 @@ void ShowExamplePopups() {
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp
index 534af1fe0c..89bf9604a6 100644
--- a/plugins/YAPP/src/yapp_history_dlg.cpp
+++ b/plugins/YAPP/src/yapp_history_dlg.cpp
@@ -358,7 +358,7 @@ void AddEventsCustomControl(HWND hWnd, int renderer, TCHAR *filter, SIG_MATCHESF
ieEvent.hwnd = pwData->hIEView;
ieEvent.codepage = CP_ACP;
ieEvent.iType = IEE_LOG_MEM_EVENTS;
- ieEvent.hContact = NULL;//(HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); IEVIEW needs a contact handle !!
+ ieEvent.hContact = NULL;//db_find_first(); IEVIEW needs a contact handle !!
IEVIEWEVENTDATA *eventData = NULL;
IEVIEWEVENTDATA *cED = NULL;