From ddba4ede6b451d0cfcd0d32b5180fbd0689966bf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 08:04:30 +0000 Subject: - HANDLE hContact => HCONTACT - GCF_* prefix was added to chat constants to avoid name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/miranda.h | 6 +-- src/core/stdauth/auth.cpp | 2 +- src/core/stdauth/authdialogs.cpp | 8 +-- src/core/stdaway/awaymsg.cpp | 14 ++--- src/core/stdchat/src/window.cpp | 2 +- src/core/stdclist/src/clistopts.cpp | 23 +++++---- src/core/stdemail/email.cpp | 12 ++--- src/core/stdfile/file.cpp | 22 ++++---- src/core/stdfile/file.h | 8 +-- src/core/stdfile/filerecvdlg.cpp | 2 +- src/core/stdmsg/src/cmdlist.cpp | 4 +- src/core/stdmsg/src/cmdlist.h | 6 +-- src/core/stdmsg/src/globals.cpp | 4 +- src/core/stdmsg/src/msgdialog.cpp | 8 +-- src/core/stdmsg/src/msglog.cpp | 4 +- src/core/stdmsg/src/msgoptions.cpp | 4 +- src/core/stdmsg/src/msgs.cpp | 34 ++++++------- src/core/stdmsg/src/msgs.h | 6 +-- src/core/stdmsg/src/msgtimedout.cpp | 6 +-- src/core/stdmsg/src/statusicon.cpp | 8 +-- src/core/stdmsg/src/statusicon.h | 6 +-- src/core/stduihist/history.cpp | 12 ++--- src/core/stdurl/url.cpp | 12 ++--- src/core/stdurl/url.h | 4 +- src/core/stdurl/urldialogs.cpp | 4 +- src/core/stduserinfo/contactinfo.cpp | 4 +- src/core/stduserinfo/stdinfo.cpp | 61 +++++++++++----------- src/core/stduserinfo/userinfo.cpp | 8 +-- src/core/stduseronline/useronline.cpp | 14 ++--- src/mir_core/db.cpp | 64 +++++++++++------------ src/mir_core/protos.cpp | 2 +- src/modules/addcontact/addcontact.cpp | 14 ++--- src/modules/chat/chat.h | 26 +++++----- src/modules/chat/chat_svc.cpp | 16 +++--- src/modules/chat/clist.cpp | 24 ++++----- src/modules/chat/tools.cpp | 2 +- src/modules/clist/clc.cpp | 76 ++++++++++++++-------------- src/modules/clist/clc.h | 40 +++++++-------- src/modules/clist/clcfiledrop.cpp | 7 ++- src/modules/clist/clcidents.cpp | 12 ++--- src/modules/clist/clcitems.cpp | 20 ++++---- src/modules/clist/clcmsgs.cpp | 44 ++++++++-------- src/modules/clist/clcutils.cpp | 2 +- src/modules/clist/clistevents.cpp | 21 ++++---- src/modules/clist/clistmenus.cpp | 2 +- src/modules/clist/clistmod.cpp | 26 +++++----- src/modules/clist/clistsettings.cpp | 20 ++++---- src/modules/clist/clui.cpp | 12 ++--- src/modules/clist/contact.cpp | 26 +++++----- src/modules/clist/genmenu.cpp | 2 +- src/modules/clist/groups.cpp | 4 +- src/modules/clist/movetogroup.cpp | 2 +- src/modules/database/dbintf.cpp | 2 +- src/modules/database/dbutils.cpp | 2 +- src/modules/extraicons/BaseExtraIcon.cpp | 4 +- src/modules/extraicons/CallbackExtraIcon.cpp | 6 +-- src/modules/extraicons/DefaultExtraIcons.cpp | 14 ++--- src/modules/extraicons/ExtraIcon.cpp | 2 +- src/modules/extraicons/ExtraIcon.h | 44 ++++++++-------- src/modules/extraicons/ExtraIconGroup.cpp | 14 ++--- src/modules/extraicons/IcolibExtraIcon.cpp | 8 +-- src/modules/extraicons/extraicons.cpp | 8 +-- src/modules/extraicons/extraicons.h | 4 +- src/modules/extraicons/options_ei.cpp | 2 +- src/modules/findadd/searchresults.cpp | 6 +-- src/modules/ignore/ignore.cpp | 22 ++++---- src/modules/protocols/protoaccs.cpp | 10 ++-- src/modules/protocols/protochains.cpp | 14 ++--- src/modules/protocols/protocols.cpp | 38 +++++++------- src/modules/protocols/protoint.cpp | 46 ++++++++--------- src/modules/srmm/statusicon.cpp | 4 +- src/modules/utils/path.cpp | 14 ++--- src/modules/utils/timezones.cpp | 10 ++-- src/modules/utils/windowlist.cpp | 4 +- src/modules/visibility/visibility.cpp | 4 +- 75 files changed, 523 insertions(+), 531 deletions(-) (limited to 'src') diff --git a/src/core/miranda.h b/src/core/miranda.h index af34963011..4af88c8984 100644 --- a/src/core/miranda.h +++ b/src/core/miranda.h @@ -130,7 +130,7 @@ extern const int statusModeList[ MAX_STATUS_COUNT ]; extern const int skinIconStatusList[ MAX_STATUS_COUNT ]; extern const int skinIconStatusFlags[ MAX_STATUS_COUNT ]; -int TryProcessDoubleClick(HANDLE hContact); +int TryProcessDoubleClick(HCONTACT hContact); void KillModuleMenus(int hLangpack); @@ -144,7 +144,7 @@ void KillModuleMenus(int hLangpack); extern LIST accounts; PROTOACCOUNT* __fastcall Proto_GetAccount(const char* accName); -PROTOACCOUNT* __fastcall Proto_GetAccount(HANDLE hContact); +PROTOACCOUNT* __fastcall Proto_GetAccount(HCONTACT hContact); PROTOCOLDESCRIPTOR* __fastcall Proto_IsProtocolLoaded(const char* szProtoName); bool __fastcall Proto_IsAccountEnabled(PROTOACCOUNT* pa); @@ -162,7 +162,7 @@ void OpenAccountOptions(PROTOACCOUNT* pa); void LoadDbAccounts(void); void WriteDbAccounts(void); -INT_PTR CallProtoServiceInt(HANDLE hContact, const char* szModule, const char* szService, WPARAM wParam, LPARAM lParam); +INT_PTR CallProtoServiceInt(HCONTACT hContact, const char* szModule, const char* szService, WPARAM wParam, LPARAM lParam); /**** utils.cpp ************************************************************************/ diff --git a/src/core/stdauth/auth.cpp b/src/core/stdauth/auth.cpp index f02278e81b..14f5723124 100644 --- a/src/core/stdauth/auth.cpp +++ b/src/core/stdauth/auth.cpp @@ -57,7 +57,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) dbei.pBlob = (PBYTE)alloca(dbei.cbBlob); db_event_get(hDbEvent, &dbei); - HANDLE hContact = DbGetAuthEventContact(&dbei); + HCONTACT hContact = DbGetAuthEventContact(&dbei); CLISTEVENT cli = {0}; cli.cbSize = sizeof(cli); diff --git a/src/core/stdauth/authdialogs.cpp b/src/core/stdauth/authdialogs.cpp index 900de05b61..7c367b78d1 100644 --- a/src/core/stdauth/authdialogs.cpp +++ b/src/core/stdauth/authdialogs.cpp @@ -45,7 +45,7 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar db_event_get(hDbEvent, &dbei); DWORD uin = *(PDWORD)dbei.pBlob; - HANDLE hContact = DbGetAuthEventContact(&dbei); + HCONTACT hContact = DbGetAuthEventContact(&dbei); char* nick = (char*)dbei.pBlob + sizeof(DWORD)*2; char* first = nick + strlen(nick) + 1; char* last = first + strlen(first) + 1; @@ -111,14 +111,14 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar acs.szProto = ""; CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)&acs); - HANDLE hContact = (HANDLE)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DETAILS), GWLP_USERDATA); + HCONTACT hContact = (HCONTACT)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DETAILS), GWLP_USERDATA); if ((hContact == INVALID_HANDLE_VALUE) || !db_get_b(hContact, "CList", "NotOnList", 0)) ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), FALSE); break; } case IDC_DETAILS: { - HANDLE hContact = (HANDLE)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DETAILS), GWLP_USERDATA); + HCONTACT hContact = (HCONTACT)GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_DETAILS), GWLP_USERDATA); CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); break; } @@ -168,7 +168,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP db_event_get(hDbEvent, &dbei); DWORD uin = *(PDWORD)dbei.pBlob; - HANDLE hContact = DbGetAuthEventContact(&dbei); + HCONTACT hContact = DbGetAuthEventContact(&dbei); char *nick = (char*)dbei.pBlob + sizeof(DWORD)*2; char *first = nick + strlen(nick) + 1; char *last = first + strlen(first) + 1; diff --git a/src/core/stdaway/awaymsg.cpp b/src/core/stdaway/awaymsg.cpp index 119fe411b4..cc8427ec72 100644 --- a/src/core/stdaway/awaymsg.cpp +++ b/src/core/stdaway/awaymsg.cpp @@ -30,7 +30,7 @@ static HGENMENU hAwayMsgMenuItem; static HANDLE hWindowList; struct AwayMsgDlgData { - HANDLE hContact; + HCONTACT hContact; HANDLE hSeq; HANDLE hAwayMsgEvent; }; @@ -46,7 +46,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP dat = (AwayMsgDlgData*)mir_alloc(sizeof(AwayMsgDlgData)); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); - dat->hContact = (HANDLE)lParam; + dat->hContact = (HCONTACT)lParam; dat->hAwayMsgEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_AWAYMSG); dat->hSeq = (HANDLE)CallContactService(dat->hContact, PSS_GETAWAYMSG, 0, 0); WindowList_Add(hWindowList, hwndDlg, dat->hContact); @@ -77,7 +77,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP ack.result = ACKRESULT_SUCCESS; SendMessage(hwndDlg, HM_AWAYMSG, 0, (LPARAM)&ack); } - Utils_RestoreWindowPosition(hwndDlg, (HANDLE)lParam, "SRAway", "AwayMsgDlg"); + Utils_RestoreWindowPosition(hwndDlg, (HCONTACT)lParam, "SRAway", "AwayMsgDlg"); return TRUE; case HM_AWAYMSG: @@ -123,7 +123,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP static INT_PTR GetMessageCommand(WPARAM wParam, LPARAM) { HWND hwnd; - if (hwnd = WindowList_Find(hWindowList, (HANDLE)wParam)) { + if (hwnd = WindowList_Find(hWindowList, (HCONTACT)wParam)) { SetForegroundWindow(hwnd); SetFocus(hwnd); } @@ -134,15 +134,15 @@ static INT_PTR GetMessageCommand(WPARAM wParam, LPARAM) static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM) { TCHAR str[128]; - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN | CMIF_TCHAR; if (szProto != NULL) { - int chatRoom = szProto ? db_get_b((HANDLE)wParam, szProto, "ChatRoom", 0) : 0; + int chatRoom = szProto ? db_get_b((HCONTACT)wParam, szProto, "ChatRoom", 0) : 0; if ( !chatRoom) { - int status = db_get_w((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE); + int status = db_get_w((HCONTACT)wParam, szProto, "Status", ID_STATUS_OFFLINE); mir_sntprintf(str, SIZEOF(str), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(status, 0)); mi.ptszName = str; if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) { diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index 7522e78831..05145007f2 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -1074,7 +1074,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return mir_callNextSubclass(hwnd, NicklistSubclassProc, msg, wParam, lParam); } -static int RestoreWindowPosition(HWND hwnd, HANDLE hContact, char * szModule, char * szNamePrefix, UINT showCmd) +static int RestoreWindowPosition(HWND hwnd, HCONTACT hContact, char * szModule, char * szNamePrefix, UINT showCmd) { WINDOWPLACEMENT wp; wp.length = sizeof(wp); diff --git a/src/core/stdclist/src/clistopts.cpp b/src/core/stdclist/src/clistopts.cpp index e214645b18..6dc2d88deb 100644 --- a/src/core/stdclist/src/clistopts.cpp +++ b/src/core/stdclist/src/clistopts.cpp @@ -28,19 +28,20 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP switch (msg) { case WM_USER + 1: { - HANDLE hContact = (HANDLE) wParam; + HCONTACT hContact = (HCONTACT)wParam; DBCONTACTWRITESETTING *ws = (DBCONTACTWRITESETTING *) lParam; - if (hContact == NULL && ws != NULL && ws->szModule != NULL && ws->szSetting != NULL - && lstrcmpiA(ws->szModule, "CList") == 0 && lstrcmpiA(ws->szSetting, "UseGroups") == 0 && IsWindowVisible(hwndDlg)) { - CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, ws->value.bVal == 0); - } - break; + if (hContact == NULL && ws != NULL && ws->szModule != NULL && ws->szSetting != NULL && + lstrcmpiA(ws->szModule, "CList") == 0 && lstrcmpiA(ws->szSetting, "UseGroups") == 0 && IsWindowVisible(hwndDlg)) + { + CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, ws->value.bVal == 0); + } } + break; + case WM_DESTROY: - { - UnhookEvent((HANDLE) GetWindowLongPtr(hwndDlg, GWLP_USERDATA)); - break; - } + UnhookEvent((HANDLE) GetWindowLongPtr(hwndDlg, GWLP_USERDATA)); + break; + case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED, hwndDlg, WM_USER + 1)); @@ -221,7 +222,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP pcli->pfnTrayIconIconsChanged(); pcli->pfnLoadContactTree(); /* this won't do job properly since it only really works when changes happen */ - pcli->pfnInvalidateDisplayNameCacheEntry( INVALID_HANDLE_VALUE ); /* force reshuffle */ + pcli->pfnInvalidateDisplayNameCacheEntry((HCONTACT)INVALID_HANDLE_VALUE); /* force reshuffle */ return TRUE; } break; diff --git a/src/core/stdemail/email.cpp b/src/core/stdemail/email.cpp index 12296eeda3..537f40e7df 100644 --- a/src/core/stdemail/email.cpp +++ b/src/core/stdemail/email.cpp @@ -35,9 +35,9 @@ void SendEmailThread(void *szUrl) static INT_PTR SendEMailCommand(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv; - char *szProto = GetContactProto((HANDLE)wParam); - if (szProto == NULL || db_get_s((HANDLE)wParam, szProto, "e-mail", &dbv)) { - if (db_get_s((HANDLE)wParam, "UserInfo", "Mye-mail0", &dbv)) { + char *szProto = GetContactProto((HCONTACT)wParam); + if (szProto == NULL || db_get_s((HCONTACT)wParam, szProto, "e-mail", &dbv)) { + if (db_get_s((HCONTACT)wParam, "UserInfo", "Mye-mail0", &dbv)) { MessageBox((HWND)lParam, TranslateT("User has not registered an e-mail address"), TranslateT("Send e-mail"), MB_OK); return 1; } @@ -54,9 +54,9 @@ static int EMailPreBuildMenu(WPARAM wParam, LPARAM) { bool bEnabled = true; DBVARIANT dbv = { 0 }; - char *szProto = GetContactProto((HANDLE)wParam); - if (szProto == NULL || db_get_s((HANDLE)wParam, szProto, "e-mail", & dbv)) - if (db_get_s((HANDLE)wParam, "UserInfo", "Mye-mail0", &dbv)) + char *szProto = GetContactProto((HCONTACT)wParam); + if (szProto == NULL || db_get_s((HCONTACT)wParam, szProto, "e-mail", &dbv)) + if (db_get_s((HCONTACT)wParam, "UserInfo", "Mye-mail0", &dbv)) bEnabled = false; Menu_ShowItem(hEMailMenuItem, bEnabled); diff --git a/src/core/stdfile/file.cpp b/src/core/stdfile/file.cpp index 217605b18f..7cf600a641 100644 --- a/src/core/stdfile/file.cpp +++ b/src/core/stdfile/file.cpp @@ -30,7 +30,7 @@ int PFTS_CompareWithTchar(PROTOFILETRANSFERSTATUS* ft, const PROTOCHAR* s, TCHAR static HGENMENU hSRFileMenuItem; -TCHAR *GetContactID(HANDLE hContact) +TCHAR *GetContactID(HCONTACT hContact) { TCHAR *theValue = {0}; char *szProto = GetContactProto(hContact); @@ -62,7 +62,7 @@ TCHAR *GetContactID(HANDLE hContact) static INT_PTR SendFileCommand(WPARAM wParam, LPARAM) { struct FileSendData fsd; - fsd.hContact = (HANDLE)wParam; + fsd.hContact = (HCONTACT)wParam; fsd.ppFiles = NULL; CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd); return 0; @@ -71,7 +71,7 @@ static INT_PTR SendFileCommand(WPARAM wParam, LPARAM) static INT_PTR SendSpecificFiles(WPARAM wParam, LPARAM lParam) { FileSendData fsd; - fsd.hContact = (HANDLE)wParam; + fsd.hContact = (HCONTACT)wParam; char** ppFiles = (char**)lParam; int count = 0; @@ -92,7 +92,7 @@ static INT_PTR SendSpecificFiles(WPARAM wParam, LPARAM lParam) static INT_PTR SendSpecificFilesT(WPARAM wParam, LPARAM lParam) { FileSendData fsd; - fsd.hContact = (HANDLE)wParam; + fsd.hContact = (HCONTACT)wParam; fsd.ppFiles = (const TCHAR**)lParam; CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd); return 0; @@ -101,7 +101,7 @@ static INT_PTR SendSpecificFilesT(WPARAM wParam, LPARAM lParam) static INT_PTR GetReceivedFilesFolder(WPARAM wParam, LPARAM lParam) { TCHAR buf[MAX_PATH]; - GetContactReceivedFilesDir((HANDLE)wParam, buf, MAX_PATH, TRUE); + GetContactReceivedFilesDir((HCONTACT)wParam, buf, MAX_PATH, TRUE); char* dir = mir_t2a(buf); lstrcpynA((char*)lParam, dir, MAX_PATH); mir_free(dir); @@ -114,7 +114,7 @@ static INT_PTR RecvFileCommand(WPARAM, LPARAM lParam) return 0; } -void PushFileEvent(HANDLE hContact, HANDLE hdbe, LPARAM lParam) +void PushFileEvent(HCONTACT hContact, HANDLE hdbe, LPARAM lParam) { CLISTEVENT cle = {0}; cle.cbSize = sizeof(cle); @@ -148,7 +148,7 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam) if (dbei.flags & (DBEF_SENT|DBEF_READ) || dbei.eventType != EVENTTYPE_FILE || dwSignature == 0) return 0; - PushFileEvent((HANDLE)wParam, (HANDLE)lParam, 0); + PushFileEvent((HCONTACT)wParam, (HANDLE)lParam, 0); return 0; } @@ -288,7 +288,7 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS static void RemoveUnreadFileEvents(void) { - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hDbEvent = db_event_firstUnread(hContact); while (hDbEvent) { DBEVENTINFO dbei = { sizeof(dbei) }; @@ -303,12 +303,12 @@ static void RemoveUnreadFileEvents(void) static int SRFilePreBuildMenu(WPARAM wParam, LPARAM) { bool bEnabled = false; - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); if (szProto != NULL) { if ( CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_FILESEND) { if ( CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_OFFLINEFILES) bEnabled = true; - else if (db_get_w((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) + else if (db_get_w((HCONTACT)wParam, szProto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) bEnabled = true; } } @@ -339,7 +339,7 @@ INT_PTR FtMgrShowCommand(WPARAM, LPARAM) INT_PTR openContRecDir(WPARAM wparam, LPARAM) { TCHAR szContRecDir[MAX_PATH]; - HANDLE hContact = (HANDLE)wparam; + HCONTACT hContact = (HCONTACT)wparam; GetContactReceivedFilesDir(hContact, szContRecDir, SIZEOF(szContRecDir), TRUE); ShellExecute(0, _T("open"), szContRecDir, 0, 0, SW_SHOW); return 0; diff --git a/src/core/stdfile/file.h b/src/core/stdfile/file.h index 80f8b26d2b..aa390a774a 100644 --- a/src/core/stdfile/file.h +++ b/src/core/stdfile/file.h @@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define M_PRESHUTDOWN (WM_USER+201) struct FileSendData { - HANDLE hContact; + HCONTACT hContact; const TCHAR **ppFiles; }; @@ -46,7 +46,7 @@ struct FileSendData { struct FileDlgData { HWND hwndTransfer; HANDLE fs; - HANDLE hContact; + HCONTACT hContact; HANDLE hDbEvent; HANDLE hNotifyEvent; TCHAR **files; @@ -85,7 +85,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); void RemoveInvalidFilenameChars(TCHAR *tszString); void RemoveInvalidPathChars(TCHAR *tszString); -void GetContactReceivedFilesDir(HANDLE hContact, TCHAR *szDir, int cchDir, BOOL substVars); +void GetContactReceivedFilesDir(HCONTACT hContact, TCHAR *szDir, int cchDir, BOOL substVars); void GetReceivedFilesDir(TCHAR *szDir, int cchDir); int BrowseForFolder(HWND hwnd, TCHAR *szPath); //fileexistsdlg.c @@ -113,4 +113,4 @@ HWND FtMgr_AddTransfer(struct FileDlgData *dat); void FreeFileDlgData(FileDlgData* dat); -TCHAR *GetContactID(HANDLE hContact); +TCHAR *GetContactID(HCONTACT hContact); diff --git a/src/core/stdfile/filerecvdlg.cpp b/src/core/stdfile/filerecvdlg.cpp index a5c230cbb2..ca00c0f642 100644 --- a/src/core/stdfile/filerecvdlg.cpp +++ b/src/core/stdfile/filerecvdlg.cpp @@ -131,7 +131,7 @@ static void patchDir(TCHAR *str, size_t strSize) lstrcpy(str+len, _T("\\")); } -void GetContactReceivedFilesDir(HANDLE hContact, TCHAR *szDir, int cchDir, BOOL patchVars) +void GetContactReceivedFilesDir(HCONTACT hContact, TCHAR *szDir, int cchDir, BOOL patchVars) { DBVARIANT dbv; TCHAR szTemp[MAX_PATH]; diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp index ebeb98519f..90be69418b 100644 --- a/src/core/stdmsg/src/cmdlist.cpp +++ b/src/core/stdmsg/src/cmdlist.cpp @@ -89,7 +89,7 @@ static VOID CALLBACK MsgTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTi MessageFailureProcess(tmlst[i], LPGEN("The message send timed out.")); } -void msgQueue_add(HANDLE hContact, int id, const TCHAR* szMsg, HANDLE hDbEvent) +void msgQueue_add(HCONTACT hContact, int id, const TCHAR* szMsg, HANDLE hDbEvent) { TMsgQueue *item = (TMsgQueue*)mir_alloc(sizeof(TMsgQueue)); item->hContact = hContact; @@ -106,7 +106,7 @@ void msgQueue_add(HANDLE hContact, int id, const TCHAR* szMsg, HANDLE hDbEvent) } -void msgQueue_processack(HANDLE hContact, int id, BOOL success, const char* szErr) +void msgQueue_processack(HCONTACT hContact, int id, BOOL success, const char* szErr) { int i; TMsgQueue* item = NULL; diff --git a/src/core/stdmsg/src/cmdlist.h b/src/core/stdmsg/src/cmdlist.h index 5f9db21b50..c82cf41666 100644 --- a/src/core/stdmsg/src/cmdlist.h +++ b/src/core/stdmsg/src/cmdlist.h @@ -38,15 +38,15 @@ __inline TCHAR* tcmdlist_getitem(SortedList *list, int ind) typedef struct _TMsgQueue { int id; - HANDLE hContact; + HCONTACT hContact; TCHAR* szMsg; HANDLE hDbEvent; unsigned ts; } TMsgQueue; -void msgQueue_add(HANDLE hContact, int id, const TCHAR* szMsg, HANDLE hDbEvent); -void msgQueue_processack(HANDLE hContact, int id, BOOL success, const char* szErr); +void msgQueue_add(HCONTACT hContact, int id, const TCHAR* szMsg, HANDLE hDbEvent); +void msgQueue_processack(HCONTACT hContact, int id, BOOL success, const char* szErr); void msgQueue_init(void); void msgQueue_destroy(void); diff --git a/src/core/stdmsg/src/globals.cpp b/src/core/stdmsg/src/globals.cpp index 466001fb5d..15d5bc126a 100644 --- a/src/core/stdmsg/src/globals.cpp +++ b/src/core/stdmsg/src/globals.cpp @@ -121,7 +121,7 @@ void ReloadGlobals() static int dbaddedevent(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact) { HWND h = WindowList_Find(g_dat.hMessageWindowList, hContact); if (h) @@ -144,7 +144,7 @@ static int ackevent(WPARAM wParam, LPARAM lParam) int AvatarChanged(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; HWND h = WindowList_Find(g_dat.hMessageWindowList, hContact); if (h) SendMessage(h, HM_AVATARACK, wParam, lParam); return 0; diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 0e8563f8f2..47b867c439 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -41,7 +41,7 @@ static const UINT infoLineControls[] = { IDC_PROTOCOL, IDC_NAME }; static const UINT buttonLineControls[] = { IDC_ADD, IDC_USERMENU, IDC_DETAILS, IDC_HISTORY }; static const UINT sendControls[] = { IDC_MESSAGE }; -static void NotifyLocalWinEvent(HANDLE hContact, HWND hwnd, unsigned int type) +static void NotifyLocalWinEvent(HCONTACT hContact, HWND hwnd, unsigned int type) { if (hContact == NULL || hwnd == NULL) return; @@ -58,7 +58,7 @@ static void NotifyLocalWinEvent(HANDLE hContact, HWND hwnd, unsigned int type) NotifyEventHooks(hHookWinEvt, 0, (LPARAM)&mwe); } -static BOOL IsUtfSendAvailable(HANDLE hContact) +static BOOL IsUtfSendAvailable(HCONTACT hContact) { char* szProto = GetContactProto(hContact); if ( szProto == NULL ) @@ -80,7 +80,7 @@ static int RTL_Detect(const TCHAR *ptszText) return 0; } -HANDLE SendMessageDirect(const TCHAR *szMsg, HANDLE hContact, char *szProto) +HANDLE SendMessageDirect(const TCHAR *szMsg, HCONTACT hContact, char *szProto) { if (hContact == NULL) return NULL; @@ -1751,7 +1751,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (hFont != NULL && hFont != (HFONT)SendDlgItemMessage(hwndDlg, IDOK, WM_GETFONT, 0, 0)) DeleteObject(hFont); - HANDLE hContact; + HCONTACT hContact; if (db_get_b(NULL, SRMMMOD, SRMSGSET_SAVEPERCONTACT, SRMSGDEFSET_SAVEPERCONTACT)) hContact = dat->hContact; else diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 78229431f3..4775242489 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -37,7 +37,7 @@ static int logIconBmpSize[ SIZEOF(pLogIconBmpBits) ]; struct LogStreamData { int stage; - HANDLE hContact; + HCONTACT hContact; HANDLE hDbEvent, hDbEventLast; char *buffer; int bufferOffset, bufferLen; @@ -263,7 +263,7 @@ int DbEventIsShown(DBEVENTINFO * dbei, SrmmWindowData *dat) } //mir_free() the return value -static char *CreateRTFFromDbEvent(SrmmWindowData *dat, HANDLE hContact, HANDLE hDbEvent, struct LogStreamData *streamData) +static char *CreateRTFFromDbEvent(SrmmWindowData *dat, HCONTACT hContact, HANDLE hDbEvent, struct LogStreamData *streamData) { char *buffer; int bufferAlloced, bufferEnd; diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index 7e6aee4da6..511de0a1f1 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -449,7 +449,7 @@ static void RebuildList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown) if (hItemUnknown && db_get_b(NULL, SRMMMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN)) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItemUnknown, 1); - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM) hContact, 0); if (hItem && db_get_b(hContact, SRMMMOD, SRMSGSET_TYPING, defType)) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItem, 1); @@ -464,7 +464,7 @@ static void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown) if (hItemUnknown) db_set_b(NULL, SRMMMOD, SRMSGSET_TYPINGUNKNOWN, (BYTE) (SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItemUnknown, 0) ? 1 : 0)); - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0); if (hItem) db_set_b(hContact, SRMMMOD, SRMSGSET_TYPING, (BYTE) (SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItem, 0) ? 1 : 0)); diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 53a2314fa8..256790d429 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -59,7 +59,7 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam) CallServiceSync(MS_CLIST_REMOVEEVENT, wParam, (LPARAM) 1); /* does a window for the contact exist? */ - HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam); + HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam); if (hwnd) { if (!db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS)) { ShowWindow(hwnd, SW_RESTORE); @@ -78,10 +78,10 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam) /* new message */ SkinPlaySound("AlertMsg"); - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); if (szProto && (g_dat.openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0)))) { NewMessageWindowLParam newData = { 0 }; - newData.hContact = (HANDLE)wParam; + newData.hContact = (HCONTACT)wParam; newData.noActivate = db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS); CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), NULL, DlgProcMessage, (LPARAM)&newData); return 0; @@ -89,19 +89,19 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam) TCHAR toolTip[256], *contactName; CLISTEVENT cle = { sizeof(cle) }; - cle.hContact = (HANDLE)wParam; + cle.hContact = (HCONTACT)wParam; cle.hDbEvent = (HANDLE)lParam; cle.flags = CLEF_TCHAR; cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE); cle.pszService = "SRMsg/ReadMessage"; - contactName = pcli->pfnGetContactDisplayName((HANDLE)wParam, 0); + contactName = pcli->pfnGetContactDisplayName((HCONTACT)wParam, 0); mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("Message from %s"), contactName); cle.ptszTooltip = toolTip; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); return 0; } -INT_PTR SendMessageCmd(HANDLE hContact, char* msg, int isWchar) +INT_PTR SendMessageCmd(HCONTACT hContact, char* msg, int isWchar) { /* does the HCONTACT's protocol support IM messages? */ char *szProto = GetContactProto(hContact); @@ -135,12 +135,12 @@ INT_PTR SendMessageCmd(HANDLE hContact, char* msg, int isWchar) static INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam) { - return SendMessageCmd((HANDLE)wParam, (char*)lParam, TRUE); + return SendMessageCmd((HCONTACT)wParam, (char*)lParam, TRUE); } static INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam) { - return SendMessageCmd((HANDLE)wParam, (char*)lParam, FALSE); + return SendMessageCmd((HCONTACT)wParam, (char*)lParam, FALSE); } static INT_PTR ReadMessageCommand(WPARAM wParam, LPARAM lParam) @@ -159,12 +159,12 @@ static int TypingMessage(WPARAM wParam, LPARAM lParam) SkinPlaySound((lParam) ? "TNStart" : "TNStop"); - HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam); + HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam); if (hwnd) SendMessage(hwnd, DM_TYPING, 0, lParam); else if (lParam && (g_dat.flags & SMF_SHOWTYPINGTRAY)) { TCHAR szTip[256]; - mir_sntprintf(szTip, SIZEOF(szTip), TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName((HANDLE)wParam, 0)); + mir_sntprintf(szTip, SIZEOF(szTip), TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName((HCONTACT)wParam, 0)); if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags&SMF_SHOWTYPINGCLIST)) { MIRANDASYSTRAYNOTIFY tn = { sizeof(tn) }; @@ -177,7 +177,7 @@ static int TypingMessage(WPARAM wParam, LPARAM lParam) } else { CLISTEVENT cle = { sizeof(cle) }; - cle.hContact = (HANDLE)wParam; + cle.hContact = (HCONTACT)wParam; cle.hDbEvent = (HANDLE)1; cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR; cle.hIcon = LoadSkinnedIcon( SKINICON_OTHER_TYPING ); @@ -194,7 +194,7 @@ static int TypingMessage(WPARAM wParam, LPARAM lParam) static int MessageSettingChanged(WPARAM wParam, LPARAM lParam) { DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam; - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (cws->szModule == NULL) return 0; @@ -204,7 +204,7 @@ static int MessageSettingChanged(WPARAM wParam, LPARAM lParam) if (cws->szSetting && !strcmp(cws->szSetting, "Timezone")) WindowList_Broadcast(g_dat.hMessageWindowList, DM_NEWTIMEZONE, (WPARAM) cws, 0); else { - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); if (szProto && !strcmp(cws->szModule, szProto)) WindowList_Broadcast(g_dat.hMessageWindowList, DM_UPDATETITLE, (WPARAM) cws, 0); } @@ -215,7 +215,7 @@ static int MessageSettingChanged(WPARAM wParam, LPARAM lParam) static int ContactDeleted(WPARAM wParam, LPARAM lParam) { HWND hwnd; - if (hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam)) + if (hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam)) SendMessage(hwnd, WM_CLOSE, 0, 0); return 0; @@ -235,7 +235,7 @@ static void RestoreUnreadMessageAlerts(void) DBEVENTINFO dbei = { sizeof(dbei) }; - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hDbEvent = db_event_firstUnread(hContact); while (hDbEvent) { autoPopup = 0; @@ -315,7 +315,7 @@ static int IconsChanged(WPARAM, LPARAM) static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact) { bool bEnabled = false; char *szProto = GetContactProto(hContact); @@ -346,7 +346,7 @@ static INT_PTR GetWindowClass(WPARAM wParam, LPARAM lParam) static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam) { - HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam); + HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam); if (hwnd == NULL) return 1; diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h index 1a75b19b1b..29cbf7520e 100644 --- a/src/core/stdmsg/src/msgs.h +++ b/src/core/stdmsg/src/msgs.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct NewMessageWindowLParam { - HANDLE hContact; + HCONTACT hContact; const char *szInitialText; int isWchar; int noActivate; @@ -35,7 +35,7 @@ struct NewMessageWindowLParam struct SrmmWindowData { - HANDLE hContact; + HCONTACT hContact; HANDLE hDbEventFirst, hDbEventLast; HBRUSH hBkgBrush; int splitterPos, originalSplitterPos; @@ -117,7 +117,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar int DbEventIsForMsgWindow(DBEVENTINFO *dbei); int DbEventIsShown(DBEVENTINFO * dbei, SrmmWindowData *dat); void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend); -HANDLE SendMessageDirect(const TCHAR *szMsg, HANDLE hContact, char *szProto); +HANDLE SendMessageDirect(const TCHAR *szMsg, HCONTACT hContact, char *szProto); void LoadMsgLogIcons(void); void FreeMsgLogIcons(void); diff --git a/src/core/stdmsg/src/msgtimedout.cpp b/src/core/stdmsg/src/msgtimedout.cpp index 5ecaf6861f..f8c8b82f49 100644 --- a/src/core/stdmsg/src/msgtimedout.cpp +++ b/src/core/stdmsg/src/msgtimedout.cpp @@ -28,7 +28,7 @@ typedef struct TMsgQueue *item; } ErrorDlgParam; -INT_PTR SendMessageCmd(HANDLE hContact, char* msg, int isWchar); +INT_PTR SendMessageCmd(HCONTACT hContact, char* msg, int isWchar); INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -90,10 +90,10 @@ void MessageFailureProcess(TMsgQueue *item, const char* err) { db_event_delete(item->hContact, item->hDbEvent); - HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)item->hContact); + HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, item->hContact); if (hwnd == NULL) { SendMessageCmd(item->hContact, NULL, 0); - hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)item->hContact); + hwnd = WindowList_Find(g_dat.hMessageWindowList, item->hContact); } else SendMessage(hwnd, DM_REMAKELOG, 0, 0); diff --git a/src/core/stdmsg/src/statusicon.cpp b/src/core/stdmsg/src/statusicon.cpp index 1ad1395032..060f950aa0 100644 --- a/src/core/stdmsg/src/statusicon.cpp +++ b/src/core/stdmsg/src/statusicon.cpp @@ -26,7 +26,7 @@ HANDLE hHookIconPressedEvt; static int OnSrmmIconChanged(WPARAM wParam, LPARAM) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact == NULL) WindowList_Broadcast(g_dat.hMessageWindowList, DM_STATUSICONCHANGE, 0, 0); else { @@ -37,7 +37,7 @@ static int OnSrmmIconChanged(WPARAM wParam, LPARAM) return 0; } -void DrawStatusIcons(HANDLE hContact, HDC hDC, RECT r, int gap) +void DrawStatusIcons(HCONTACT hContact, HDC hDC, RECT r, int gap) { HICON hIcon; int x = r.left; @@ -55,7 +55,7 @@ void DrawStatusIcons(HANDLE hContact, HDC hDC, RECT r, int gap) } } -void CheckIconClick(HANDLE hContact, HWND hwndFrom, POINT pt, RECT r, int gap, int click_flags) +void CheckIconClick(HCONTACT hContact, HWND hwndFrom, POINT pt, RECT r, int gap, int click_flags) { int iconNum = (pt.x - r.left) / (GetSystemMetrics(SM_CXSMICON) + gap); StatusIconData *sid = Srmm_GetNthIcon(hContact, iconNum); @@ -88,7 +88,7 @@ int DeinitStatusIcons() return 0; } -int GetStatusIconsCount(HANDLE hContact) +int GetStatusIconsCount(HCONTACT hContact) { int nIcon = 0; while ( Srmm_GetNthIcon(hContact, nIcon) != NULL) diff --git a/src/core/stdmsg/src/statusicon.h b/src/core/stdmsg/src/statusicon.h index 314ac9ec1e..2da94eab1a 100644 --- a/src/core/stdmsg/src/statusicon.h +++ b/src/core/stdmsg/src/statusicon.h @@ -7,8 +7,8 @@ extern int status_icon_list_size; int InitStatusIcons(); int DeinitStatusIcons(); -int GetStatusIconsCount(HANDLE hContact); -void DrawStatusIcons(HANDLE hContact, HDC hdc, RECT r, int gap); -void CheckIconClick(HANDLE hContact, HWND hwndFrom, POINT pt, RECT r, int gap, int flags); +int GetStatusIconsCount(HCONTACT hContact); +void DrawStatusIcons(HCONTACT hContact, HDC hdc, RECT r, int gap); +void CheckIconClick(HCONTACT hContact, HWND hwndFrom, POINT pt, RECT r, int gap, int flags); #endif diff --git a/src/core/stduihist/history.cpp b/src/core/stduihist/history.cpp index 55795e62bc..0978f94731 100644 --- a/src/core/stduihist/history.cpp +++ b/src/core/stduihist/history.cpp @@ -135,7 +135,7 @@ static void GetObjectSummary(DBEVENTINFO *dbei, TCHAR* str, int cbStr) } typedef struct { - HANDLE hContact; + HCONTACT hContact; HWND hwnd; } THistoryThread; @@ -201,14 +201,12 @@ static int HistoryDlgResizer(HWND, LPARAM, UTILRESIZECONTROL *urc) static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - HANDLE hContact; - - hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); - hContact = (HANDLE)lParam; + hContact = (HCONTACT)lParam; WindowList_Add(hWindowList, hwndDlg, hContact); Utils_RestoreWindowPosition(hwndDlg, hContact, "History", ""); { @@ -378,7 +376,7 @@ static INT_PTR CALLBACK DlgProcHistoryFind(HWND hwndDlg, UINT msg, WPARAM wParam static INT_PTR UserHistoryCommand(WPARAM wParam, LPARAM) { - HWND hwnd = WindowList_Find(hWindowList, (HANDLE)wParam); + HWND hwnd = WindowList_Find(hWindowList, (HCONTACT)wParam); if (hwnd) { SetForegroundWindow(hwnd); SetFocus(hwnd); @@ -390,7 +388,7 @@ static INT_PTR UserHistoryCommand(WPARAM wParam, LPARAM) static int HistoryContactDelete(WPARAM wParam, LPARAM) { - HWND hwnd = WindowList_Find(hWindowList, (HANDLE)wParam); + HWND hwnd = WindowList_Find(hWindowList, (HCONTACT)wParam); if (hwnd != NULL) DestroyWindow(hwnd); return 0; diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp index ee096ac8df..12e7137c67 100644 --- a/src/core/stdurl/url.cpp +++ b/src/core/stdurl/url.cpp @@ -49,11 +49,11 @@ static int UrlEventAdded(WPARAM wParam, LPARAM lParam) SkinPlaySound("RecvUrl"); TCHAR szTooltip[256]; - mir_sntprintf(szTooltip, SIZEOF(szTooltip), TranslateT("URL from %s"), pcli->pfnGetContactDisplayName((HANDLE)wParam, 0)); + mir_sntprintf(szTooltip, SIZEOF(szTooltip), TranslateT("URL from %s"), pcli->pfnGetContactDisplayName((HCONTACT)wParam, 0)); CLISTEVENT cle = { sizeof(cle) }; cle.flags = CLEF_TCHAR; - cle.hContact = (HANDLE)wParam; + cle.hContact = (HCONTACT)wParam; cle.hDbEvent = (HANDLE)lParam; cle.hIcon = LoadSkinIcon(SKINICON_EVENT_URL); cle.pszService = "SRUrl/ReadUrl"; @@ -75,7 +75,7 @@ static void RestoreUnreadUrlAlerts(void) cle.pszService = "SRUrl/ReadUrl"; cle.flags = CLEF_TCHAR; - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hDbEvent = db_event_firstUnread(hContact); while (hDbEvent) { DBEVENTINFO dbei = { sizeof(dbei) }; @@ -97,7 +97,7 @@ static void RestoreUnreadUrlAlerts(void) static int ContactSettingChanged(WPARAM wParam, LPARAM lParam) { DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam; - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto))) return 0; @@ -108,7 +108,7 @@ static int ContactSettingChanged(WPARAM wParam, LPARAM lParam) static int SRUrlPreBuildMenu(WPARAM wParam, LPARAM) { bool bEnabled = false; - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); if (szProto != NULL) if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_URLSEND) bEnabled = true; @@ -147,7 +147,7 @@ static int SRUrlShutdown(WPARAM, LPARAM) int UrlContactDeleted(WPARAM wParam, LPARAM) { - HWND h = WindowList_Find(hUrlWindowList, (HANDLE)wParam); + HWND h = WindowList_Find(hUrlWindowList, (HCONTACT)wParam); if (h) SendMessage(h, WM_CLOSE, 0, 0); diff --git a/src/core/stdurl/url.h b/src/core/stdurl/url.h index 482ddf4a01..075f14ecbb 100644 --- a/src/core/stdurl/url.h +++ b/src/core/stdurl/url.h @@ -29,12 +29,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DDEMESSAGETIMEOUT 1000 struct UrlRcvData { - HANDLE hContact; + HCONTACT hContact; HANDLE hDbEvent; }; struct UrlSendData { - HANDLE hContact; + HCONTACT hContact; HANDLE hSendId; HANDLE hAckEvent; char *sendBuffer; diff --git a/src/core/stdurl/urldialogs.cpp b/src/core/stdurl/urldialogs.cpp index 907720845c..a82ef7510c 100644 --- a/src/core/stdurl/urldialogs.cpp +++ b/src/core/stdurl/urldialogs.cpp @@ -28,7 +28,7 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP extern HANDLE hUrlWindowList; -static void sttUpdateTitle(HWND hwndDlg, HANDLE hContact) +static void sttUpdateTitle(HWND hwndDlg, HCONTACT hContact) { TCHAR newtitle[256], oldtitle[256]; TCHAR *szStatus, *contactName, *pszNewTitleStart = TranslateT("Send URL to"); @@ -469,7 +469,7 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_LIMITTEXT, 450, 0); dat = (struct UrlSendData*)mir_alloc(sizeof(struct UrlSendData)); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); - dat->hContact = (HANDLE)lParam; + dat->hContact = (HCONTACT)lParam; dat->hAckEvent = NULL; dat->hSendId = NULL; dat->sendBuffer = NULL; diff --git a/src/core/stduserinfo/contactinfo.cpp b/src/core/stduserinfo/contactinfo.cpp index f674685200..fd38ad1758 100644 --- a/src/core/stduserinfo/contactinfo.cpp +++ b/src/core/stduserinfo/contactinfo.cpp @@ -252,7 +252,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case M_REMAKELISTS: { - HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); if (hContact != NULL) { char *szProto = GetContactProto(hContact); if (szProto == NULL) @@ -436,7 +436,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP NMLISTVIEW *nm = (NMLISTVIEW*)lParam; LVITEM lvi; TCHAR szEmail[256]; - HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); char *szIdTemplate = (nm->hdr.idFrom == IDC_PHONES) ? "MyPhone%d" : "Mye-mail%d"; LVHITTESTINFO hti; diff --git a/src/core/stduserinfo/stdinfo.cpp b/src/core/stduserinfo/stdinfo.cpp index b807e8f37e..ac02608694 100644 --- a/src/core/stduserinfo/stdinfo.cpp +++ b/src/core/stduserinfo/stdinfo.cpp @@ -35,7 +35,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP #define SVS_SIGNED 6 #define SVS_TIMEZONE 7 -static int Proto_GetContactInfoSetting(HANDLE hContact, const char *szProto, const char *szModule, const char *szSetting, DBVARIANT *dbv, const int nType) +static int Proto_GetContactInfoSetting(HCONTACT hContact, const char *szProto, const char *szModule, const char *szSetting, DBVARIANT *dbv, const int nType) { DBCONTACTGETSETTING cgs = {szModule, szSetting, dbv}; dbv->type = (BYTE)nType; @@ -64,7 +64,7 @@ static void Proto_FreeInfoVariant(DBVARIANT *dbv) dbv->type = 0; } -static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule, char *szSetting, int special) +static void SetValue(HWND hwndDlg, int idCtrl, HCONTACT hContact, char *szModule, char *szSetting, int special) { char str[80], *pstr = NULL; TCHAR* ptstr = NULL; @@ -194,7 +194,7 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP switch (((LPNMHDR)lParam)->idFrom) { case 0: if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED) { - HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam; + HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; if (hContact != NULL) { char *szProto = GetContactProto(hContact); if (szProto == NULL) @@ -244,13 +244,13 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L TranslateDialogDefault(hwndDlg); SetTimer(hwndDlg, 1, 1000, NULL); - tmi.prepareList((HANDLE)lParam, GetDlgItem(hwndDlg, IDC_TIMEZONESELECT), TZF_PLF_CB); + tmi.prepareList((HCONTACT)lParam, GetDlgItem(hwndDlg, IDC_TIMEZONESELECT), TZF_PLF_CB); SendMessage(hwndDlg, WM_TIMER, 0, 0); break; case WM_TIMER: { - HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); if (hContact != NULL) { TCHAR szTime[80]; if (tmi.printDateTimeByContact(hContact, _T("s"), szTime, SIZEOF(szTime), TZF_KNOWNONLY)) { @@ -269,7 +269,7 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L switch (((LPNMHDR)lParam)->idFrom) { case 0: if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED) { - HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam; + HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; if (hContact != NULL) { char *szProto = GetContactProto(hContact); if (szProto == NULL) @@ -297,7 +297,7 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case IDC_TIMEZONESELECT: if (HIWORD(wParam) == CBN_SELCHANGE) { - HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); tmi.storeListResults(hContact, GetDlgItem(hwndDlg, IDC_TIMEZONESELECT), TZF_PLF_CB); @@ -319,7 +319,7 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA switch (((LPNMHDR)lParam)->idFrom) { case 0: if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED) { - HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam; + HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; if (hContact != NULL) { char *szProto = GetContactProto(hContact); if (szProto == NULL) break; @@ -395,7 +395,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, int i; char idstr[33]; DBVARIANT dbv, dbvText; - HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam; + HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; if (hContact != NULL) { char *szProto = GetContactProto(hContact); @@ -522,7 +522,7 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR hFont = CreateFontIndirect(&lf); SendDlgItemMessage(hwndDlg, IDC_ABOUT, WM_SETFONT, (WPARAM) hFont, MAKELPARAM(TRUE, 0)); - if ( !db_get_s((HANDLE)lParam, "UserInfo", "MyNotes", &dbv)) { + if (!db_get_s((HCONTACT)lParam, "UserInfo", "MyNotes", &dbv)) { SetDlgItemTextA(hwndDlg, IDC_MYNOTES, dbv.pszVal); db_free(&dbv); } @@ -531,30 +531,31 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break; case WM_NOTIFY: switch (((LPNMHDR)lParam)->idFrom) { - case 0: - switch (((LPNMHDR)lParam)->code) { - case PSN_INFOCHANGED: - { char *szProto; - HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam; - if (hContact != NULL) { - szProto = GetContactProto(hContact); - if (szProto == NULL) break; + case 0: + switch (((LPNMHDR)lParam)->code) { + case PSN_INFOCHANGED: + { + HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; + if (hContact != NULL) { + char *szProto = GetContactProto(hContact); + if (szProto != NULL) SetValue(hwndDlg, IDC_ABOUT, hContact, szProto, "About", 0); - } - break; } - case PSN_APPLY: - { HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam; - if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MYNOTES))) { - char text[2048]; - GetDlgItemTextA(hwndDlg, IDC_MYNOTES, text, SIZEOF(text)); - db_set_s(hContact, "UserInfo", "MyNotes", text); - } - else db_unset(hContact, "UserInfo", "MyNotes"); - break; + } + break; + case PSN_APPLY: + { + HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam; + if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MYNOTES))) { + char text[2048]; + GetDlgItemTextA(hwndDlg, IDC_MYNOTES, text, SIZEOF(text)); + db_set_s(hContact, "UserInfo", "MyNotes", text); } + else db_unset(hContact, "UserInfo", "MyNotes"); } break; + } + break; } break; case WM_COMMAND: @@ -578,7 +579,7 @@ int DetailsInit(WPARAM wParam, LPARAM lParam) if (lParam == NULL) return 0; - if (GetContactProto((HANDLE)lParam) == 0) + if (GetContactProto((HCONTACT)lParam) == 0) return 0; OPTIONSDIALOGPAGE odp = { sizeof(odp) }; diff --git a/src/core/stduserinfo/userinfo.cpp b/src/core/stduserinfo/userinfo.cpp index adb844c56e..d7312c0134 100644 --- a/src/core/stduserinfo/userinfo.cpp +++ b/src/core/stduserinfo/userinfo.cpp @@ -51,7 +51,7 @@ struct DetailsPageData struct DetailsData { - HANDLE hContact; + HCONTACT hContact; HANDLE hProtoAckEvent; HINSTANCE hInstIcmp; HFONT hBoldFont; @@ -95,7 +95,7 @@ static int PageSortProc(OPTIONSDIALOGPAGE *item1, OPTIONSDIALOGPAGE *item2) static INT_PTR ShowDetailsDialogCommand(WPARAM wParam, LPARAM) { HWND hwnd; - if (hwnd = WindowList_Find(hWindowList, (HANDLE)wParam)) { + if (hwnd = WindowList_Find(hWindowList, (HCONTACT)wParam)) { SetForegroundWindow(hwnd); SetFocus(hwnd); return 0; @@ -222,7 +222,7 @@ static void CreateDetailsPageWindow(HWND hwndDlg, DetailsData *dat, DetailsPageD static int UserInfoContactDelete(WPARAM wParam, LPARAM) { - HWND hwnd = WindowList_Find(hWindowList, (HANDLE)wParam); + HWND hwnd = WindowList_Find(hWindowList, (HCONTACT)wParam); if (hwnd != NULL) DestroyWindow(hwnd); return 0; @@ -245,7 +245,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP PROPSHEETHEADER *psh = (PROPSHEETHEADER*)lParam; dat = (DetailsData*)mir_calloc(sizeof(DetailsData)); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); - dat->hContact = (HANDLE)psh->pszCaption; + dat->hContact = (HCONTACT)psh->pszCaption; dat->hProtoAckEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_PROTOACK); WindowList_Add(hWindowList, hwndDlg, dat->hContact); diff --git a/src/core/stduseronline/useronline.cpp b/src/core/stduseronline/useronline.cpp index 12fcb3c6ed..90881b1e4b 100644 --- a/src/core/stduseronline/useronline.cpp +++ b/src/core/stduseronline/useronline.cpp @@ -38,17 +38,17 @@ static int UserOnlineSettingChanged(WPARAM wParam, LPARAM lParam) return 0; int newStatus = cws->value.wVal; - int oldStatus = db_get_w((HANDLE)wParam, "UserOnline", "OldStatus", ID_STATUS_OFFLINE); - db_set_w((HANDLE)wParam, "UserOnline", "OldStatus", (WORD)newStatus); + int oldStatus = db_get_w((HCONTACT)wParam, "UserOnline", "OldStatus", ID_STATUS_OFFLINE); + db_set_w((HCONTACT)wParam, "UserOnline", "OldStatus", (WORD)newStatus); if (CallService(MS_IGNORE_ISIGNORED, wParam, IGNOREEVENT_USERONLINE)) return 0; - if (db_get_b((HANDLE)wParam, "CList", "Hidden", 0)) return 0; + if (db_get_b((HCONTACT)wParam, "CList", "Hidden", 0)) return 0; if (newStatus == ID_STATUS_OFFLINE && oldStatus != ID_STATUS_OFFLINE) { // Remove the event from the queue if it exists since they are now offline - int lastEvent = (int)db_get_dw((HANDLE)wParam, "UserOnline", "LastEvent", 0); + int lastEvent = (int)db_get_dw((HCONTACT)wParam, "UserOnline", "LastEvent", 0); if (lastEvent) { CallService(MS_CLIST_REMOVEEVENT, wParam, (LPARAM)lastEvent); - db_set_dw((HANDLE)wParam, "UserOnline", "LastEvent", 0); + db_set_dw((HCONTACT)wParam, "UserOnline", "LastEvent", 0); } } if ((newStatus == ID_STATUS_ONLINE || newStatus == ID_STATUS_FREECHAT) && @@ -63,11 +63,11 @@ static int UserOnlineSettingChanged(WPARAM wParam, LPARAM lParam) ZeroMemory(&cle, sizeof(cle)); cle.cbSize = sizeof(cle); cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR; - cle.hContact = (HANDLE)wParam; + cle.hContact = (HCONTACT)wParam; cle.hDbEvent = (HANDLE)(uniqueEventId++); cle.hIcon = LoadSkinIcon(SKINICON_OTHER_USERONLINE, false); cle.pszService = "UserOnline/Description"; - mir_sntprintf(tooltip, SIZEOF(tooltip), TranslateT("%s is online"), pcli->pfnGetContactDisplayName((HANDLE)wParam, 0)); + mir_sntprintf(tooltip, SIZEOF(tooltip), TranslateT("%s is online"), pcli->pfnGetContactDisplayName((HCONTACT)wParam, 0)); cle.ptszTooltip = tooltip; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); IcoLib_ReleaseIcon(cle.hIcon, 0); diff --git a/src/mir_core/db.cpp b/src/mir_core/db.cpp index 5912b5125a..962daff91e 100644 --- a/src/mir_core/db.cpp +++ b/src/mir_core/db.cpp @@ -29,7 +29,7 @@ static MIDatabase* currDb = NULL; ///////////////////////////////////////////////////////////////////////////////////////// // getting data -MIR_CORE_DLL(int) db_get_b(HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) +MIR_CORE_DLL(int) db_get_b(HCONTACT hContact, const char *szModule, const char *szSetting, int errorValue) { if (currDb != NULL) { DBVARIANT dbv; @@ -46,7 +46,7 @@ MIR_CORE_DLL(int) db_get_b(HANDLE hContact, const char *szModule, const char *sz return errorValue; } -MIR_CORE_DLL(int) db_get_w(HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) +MIR_CORE_DLL(int) db_get_w(HCONTACT hContact, const char *szModule, const char *szSetting, int errorValue) { if (currDb != NULL) { DBVARIANT dbv; @@ -62,7 +62,7 @@ MIR_CORE_DLL(int) db_get_w(HANDLE hContact, const char *szModule, const char *sz return errorValue; } -MIR_CORE_DLL(DWORD) db_get_dw(HANDLE hContact, const char *szModule, const char *szSetting, DWORD errorValue) +MIR_CORE_DLL(DWORD) db_get_dw(HCONTACT hContact, const char *szModule, const char *szSetting, DWORD errorValue) { if (currDb != NULL) { DBVARIANT dbv; @@ -80,7 +80,7 @@ MIR_CORE_DLL(DWORD) db_get_dw(HANDLE hContact, const char *szModule, const char return errorValue; } -MIR_CORE_DLL(INT_PTR) db_get(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) +MIR_CORE_DLL(INT_PTR) db_get(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) { if (currDb == NULL) return 1; @@ -88,7 +88,7 @@ MIR_CORE_DLL(INT_PTR) db_get(HANDLE hContact, const char *szModule, const char * return currDb->GetContactSetting((MCONTACT)hContact, szModule, szSetting, dbv); } -MIR_CORE_DLL(INT_PTR) db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv, const int nType) +MIR_CORE_DLL(INT_PTR) db_get_s(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv, const int nType) { if (currDb == NULL) return 1; @@ -97,7 +97,7 @@ MIR_CORE_DLL(INT_PTR) db_get_s(HANDLE hContact, const char *szModule, const char return currDb->GetContactSettingStr((MCONTACT)hContact, szModule, szSetting, dbv); } -MIR_CORE_DLL(char*) db_get_sa(HANDLE hContact, const char *szModule, const char *szSetting) +MIR_CORE_DLL(char*) db_get_sa(HCONTACT hContact, const char *szModule, const char *szSetting) { char *str = NULL; DBVARIANT dbv = {0}; @@ -108,7 +108,7 @@ MIR_CORE_DLL(char*) db_get_sa(HANDLE hContact, const char *szModule, const char return str; } -MIR_CORE_DLL(wchar_t*) db_get_wsa(HANDLE hContact, const char *szModule, const char *szSetting) +MIR_CORE_DLL(wchar_t*) db_get_wsa(HCONTACT hContact, const char *szModule, const char *szSetting) { wchar_t *str = NULL; DBVARIANT dbv={0}; @@ -122,7 +122,7 @@ MIR_CORE_DLL(wchar_t*) db_get_wsa(HANDLE hContact, const char *szModule, const c ///////////////////////////////////////////////////////////////////////////////////////// // getting static data -MIR_CORE_DLL(int) db_get_static(HANDLE hContact, const char *szModule, const char *szSetting, char *pDest, int cbDest) +MIR_CORE_DLL(int) db_get_static(HCONTACT hContact, const char *szModule, const char *szSetting, char *pDest, int cbDest) { if (currDb == NULL) return 1; @@ -134,7 +134,7 @@ MIR_CORE_DLL(int) db_get_static(HANDLE hContact, const char *szModule, const cha return currDb->GetContactSettingStatic((MCONTACT)hContact, szModule, szSetting, &dbv); } -MIR_CORE_DLL(int) db_get_static_utf(HANDLE hContact, const char *szModule, const char *szSetting, char *pDest, int cbDest) +MIR_CORE_DLL(int) db_get_static_utf(HCONTACT hContact, const char *szModule, const char *szSetting, char *pDest, int cbDest) { if (currDb == NULL) return 1; @@ -146,7 +146,7 @@ MIR_CORE_DLL(int) db_get_static_utf(HANDLE hContact, const char *szModule, const return currDb->GetContactSettingStatic((MCONTACT)hContact, szModule, szSetting, &dbv); } -MIR_CORE_DLL(int) db_get_wstatic(HANDLE hContact, const char *szModule, const char *szSetting, WCHAR *pDest, int cbDest) +MIR_CORE_DLL(int) db_get_wstatic(HCONTACT hContact, const char *szModule, const char *szSetting, WCHAR *pDest, int cbDest) { if (currDb == NULL) return 1; @@ -161,7 +161,7 @@ MIR_CORE_DLL(int) db_get_wstatic(HANDLE hContact, const char *szModule, const ch ///////////////////////////////////////////////////////////////////////////////////////// // setting data -MIR_CORE_DLL(INT_PTR) db_set(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) +MIR_CORE_DLL(INT_PTR) db_set(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) { if (currDb == NULL) return 1; @@ -172,7 +172,7 @@ MIR_CORE_DLL(INT_PTR) db_set(HANDLE hContact, const char *szModule, const char * return currDb->WriteContactSetting((MCONTACT)hContact, &cws); } -MIR_CORE_DLL(INT_PTR) db_set_b(HANDLE hContact, const char *szModule, const char *szSetting, BYTE val) +MIR_CORE_DLL(INT_PTR) db_set_b(HCONTACT hContact, const char *szModule, const char *szSetting, BYTE val) { if (currDb == NULL) return 1; @@ -184,7 +184,7 @@ MIR_CORE_DLL(INT_PTR) db_set_b(HANDLE hContact, const char *szModule, const char return currDb->WriteContactSetting((MCONTACT)hContact, &cws); } -MIR_CORE_DLL(INT_PTR) db_set_w(HANDLE hContact, const char *szModule, const char *szSetting, WORD val) +MIR_CORE_DLL(INT_PTR) db_set_w(HCONTACT hContact, const char *szModule, const char *szSetting, WORD val) { if (currDb == NULL) return 1; @@ -196,7 +196,7 @@ MIR_CORE_DLL(INT_PTR) db_set_w(HANDLE hContact, const char *szModule, const char return currDb->WriteContactSetting((MCONTACT)hContact, &cws); } -MIR_CORE_DLL(INT_PTR) db_set_dw(HANDLE hContact, const char *szModule, const char *szSetting, DWORD val) +MIR_CORE_DLL(INT_PTR) db_set_dw(HCONTACT hContact, const char *szModule, const char *szSetting, DWORD val) { if (currDb == NULL) return 1; @@ -208,7 +208,7 @@ MIR_CORE_DLL(INT_PTR) db_set_dw(HANDLE hContact, const char *szModule, const cha return currDb->WriteContactSetting((MCONTACT)hContact, &cws); } -MIR_CORE_DLL(INT_PTR) db_set_s(HANDLE hContact, const char *szModule, const char *szSetting, const char *val) +MIR_CORE_DLL(INT_PTR) db_set_s(HCONTACT hContact, const char *szModule, const char *szSetting, const char *val) { if (currDb == NULL) return 1; @@ -220,7 +220,7 @@ MIR_CORE_DLL(INT_PTR) db_set_s(HANDLE hContact, const char *szModule, const char return currDb->WriteContactSetting((MCONTACT)hContact, &cws); } -MIR_CORE_DLL(INT_PTR) db_set_ws(HANDLE hContact, const char *szModule, const char *szSetting, const WCHAR *val) +MIR_CORE_DLL(INT_PTR) db_set_ws(HCONTACT hContact, const char *szModule, const char *szSetting, const WCHAR *val) { if (currDb == NULL) return 1; @@ -232,7 +232,7 @@ MIR_CORE_DLL(INT_PTR) db_set_ws(HANDLE hContact, const char *szModule, const cha return currDb->WriteContactSetting((MCONTACT)hContact, &cws); } -MIR_CORE_DLL(INT_PTR) db_set_utf(HANDLE hContact, const char *szModule, const char *szSetting, const char *val) +MIR_CORE_DLL(INT_PTR) db_set_utf(HCONTACT hContact, const char *szModule, const char *szSetting, const char *val) { if (currDb == NULL) return 1; @@ -244,7 +244,7 @@ MIR_CORE_DLL(INT_PTR) db_set_utf(HANDLE hContact, const char *szModule, const ch return currDb->WriteContactSetting((MCONTACT)hContact, &cws); } -MIR_CORE_DLL(INT_PTR) db_set_blob(HANDLE hContact, const char *szModule, const char *szSetting, void *val, unsigned len) +MIR_CORE_DLL(INT_PTR) db_set_blob(HCONTACT hContact, const char *szModule, const char *szSetting, void *val, unsigned len) { if (currDb == NULL) return 1; @@ -260,27 +260,27 @@ MIR_CORE_DLL(INT_PTR) db_set_blob(HANDLE hContact, const char *szModule, const c ///////////////////////////////////////////////////////////////////////////////////////// // events -MIR_CORE_DLL(HANDLE) db_event_add(HANDLE hContact, DBEVENTINFO *dbei) +MIR_CORE_DLL(HANDLE) db_event_add(HCONTACT hContact, DBEVENTINFO *dbei) { return (currDb == NULL) ? 0 : currDb->AddEvent((MCONTACT)hContact, dbei); } -MIR_CORE_DLL(int) db_event_count(HANDLE hContact) +MIR_CORE_DLL(int) db_event_count(HCONTACT hContact) { return (currDb == NULL) ? 0 : currDb->GetEventCount((MCONTACT)hContact); } -MIR_CORE_DLL(int) db_event_delete(HANDLE hContact, HANDLE hDbEvent) +MIR_CORE_DLL(int) db_event_delete(HCONTACT hContact, HANDLE hDbEvent) { return (currDb == NULL) ? 0 : currDb->DeleteEvent((MCONTACT)hContact, hDbEvent); } -MIR_CORE_DLL(HANDLE) db_event_first(HANDLE hContact) +MIR_CORE_DLL(HANDLE) db_event_first(HCONTACT hContact) { return (currDb == NULL) ? 0 : currDb->FindFirstEvent((MCONTACT)hContact); } -MIR_CORE_DLL(HANDLE) db_event_firstUnread(HANDLE hContact) +MIR_CORE_DLL(HANDLE) db_event_firstUnread(HCONTACT hContact) { return (currDb == NULL) ? 0 : currDb->FindFirstUnreadEvent((MCONTACT)hContact); } @@ -295,17 +295,17 @@ MIR_CORE_DLL(int) db_event_getBlobSize(HANDLE hDbEvent) return (currDb == NULL) ? 0 : currDb->GetBlobSize(hDbEvent); } -MIR_CORE_DLL(HANDLE) db_event_getContact(HANDLE hDbEvent) +MIR_CORE_DLL(HCONTACT) db_event_getContact(HANDLE hDbEvent) { - return (currDb == NULL) ? 0 : currDb->GetEventContact(hDbEvent); + return (currDb == NULL) ? 0 : (HCONTACT)currDb->GetEventContact(hDbEvent); } -MIR_CORE_DLL(HANDLE) db_event_last(HANDLE hContact) +MIR_CORE_DLL(HANDLE) db_event_last(HCONTACT hContact) { return (currDb == NULL) ? 0 : currDb->FindLastEvent((MCONTACT)hContact); } -MIR_CORE_DLL(int) db_event_markRead(HANDLE hContact, HANDLE hDbEvent) +MIR_CORE_DLL(int) db_event_markRead(HCONTACT hContact, HANDLE hDbEvent) { return (currDb == NULL) ? 0 : currDb->MarkEventRead((MCONTACT)hContact, hDbEvent); } @@ -328,7 +328,7 @@ MIR_CORE_DLL(INT_PTR) db_free(DBVARIANT *dbv) return (currDb == NULL) ? 1 : currDb->FreeVariant(dbv); } -MIR_CORE_DLL(INT_PTR) db_unset(HANDLE hContact, const char *szModule, const char *szSetting) +MIR_CORE_DLL(INT_PTR) db_unset(HCONTACT hContact, const char *szModule, const char *szSetting) { if (currDb == NULL) return 1; @@ -336,14 +336,14 @@ MIR_CORE_DLL(INT_PTR) db_unset(HANDLE hContact, const char *szModule, const char return currDb->DeleteContactSetting((MCONTACT)hContact, szModule, szSetting); } -MIR_CORE_DLL(HANDLE) db_find_first(const char *szProto) +MIR_CORE_DLL(HCONTACT) db_find_first(const char *szProto) { - return (currDb == NULL) ? NULL : (HANDLE)currDb->FindFirstContact(szProto); + return (currDb == NULL) ? NULL : (HCONTACT)currDb->FindFirstContact(szProto); } -MIR_CORE_DLL(HANDLE) db_find_next(HANDLE hContact, const char *szProto) +MIR_CORE_DLL(HCONTACT) db_find_next(HCONTACT hContact, const char *szProto) { - return (currDb == NULL) ? NULL : (HANDLE)currDb->FindNextContact((MCONTACT)hContact, szProto); + return (currDb == NULL) ? NULL : (HCONTACT)currDb->FindNextContact((MCONTACT)hContact, szProto); } extern "C" MIR_CORE_DLL(void) db_setCurrent(MIDatabase* _db) diff --git a/src/mir_core/protos.cpp b/src/mir_core/protos.cpp index eeda5305e6..99db602565 100644 --- a/src/mir_core/protos.cpp +++ b/src/mir_core/protos.cpp @@ -61,7 +61,7 @@ MIR_CORE_DLL(void) ProtoLogW(struct PROTO_INTERFACE *pThis, LPCWSTR wszFormat, v ///////////////////////////////////////////////////////////////////////////////////////// -MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(const char *szModule, HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam) +MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(const char *szModule, HCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam) { if (type == ACKTYPE_AVATAR && hProcess) { PROTO_AVATAR_INFORMATION* ai = (PROTO_AVATAR_INFORMATION*)hProcess; diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp index 513cd00c83..c44183faba 100644 --- a/src/modules/addcontact/addcontact.cpp +++ b/src/modules/addcontact/addcontact.cpp @@ -49,7 +49,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp { TCHAR *szName = NULL, *tmpStr = NULL; if (acs->handleType == HANDLE_CONTACT) - szName = cli.pfnGetContactDisplayName(acs->handle, GCDNF_TCHAR); + szName = cli.pfnGetContactDisplayName((HCONTACT)acs->handle, GCDNF_TCHAR); else { int isSet = 0; @@ -58,7 +58,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp dbei.cbBlob = db_event_getBlobSize(acs->handle); dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob); db_event_get(acs->handle, &dbei); - HANDLE hcontact = *((PHANDLE)(dbei.pBlob+sizeof(DWORD))); + HCONTACT hcontact = *(HCONTACT*)(dbei.pBlob + sizeof(DWORD)); mir_free(dbei.pBlob); if (hcontact != INVALID_HANDLE_VALUE) { szName = cli.pfnGetContactDisplayName(hcontact, 0); @@ -83,7 +83,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp if (acs->handleType == HANDLE_CONTACT && acs->handle) if (acs->szProto == NULL || (acs->szProto != NULL && *acs->szProto == 0)) - acs->szProto = GetContactProto(acs->handle); + acs->szProto = GetContactProto((HCONTACT)acs->handle); { TCHAR *grpName; @@ -147,22 +147,22 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp break; case IDOK: { - HANDLE hContact = INVALID_HANDLE_VALUE; + HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE; switch (acs->handleType) { case HANDLE_EVENT: { DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(acs->handle, &dbei); - hContact = (HANDLE)CallProtoServiceInt(NULL,dbei.szModule, PS_ADDTOLISTBYEVENT, 0, (LPARAM)acs->handle); + hContact = (HCONTACT)CallProtoServiceInt(NULL, dbei.szModule, PS_ADDTOLISTBYEVENT, 0, (LPARAM)acs->handle); } break; case HANDLE_SEARCHRESULT: - hContact = (HANDLE)CallProtoServiceInt(NULL,acs->szProto, PS_ADDTOLIST, 0, (LPARAM)acs->psr); + hContact = (HCONTACT)CallProtoServiceInt(NULL, acs->szProto, PS_ADDTOLIST, 0, (LPARAM)acs->psr); break; case HANDLE_CONTACT: - hContact = acs->handle; + hContact = (HCONTACT)acs->handle; break; } diff --git a/src/modules/chat/chat.h b/src/modules/chat/chat.h index de8dac8906..d79accdc35 100644 --- a/src/modules/chat/chat.h +++ b/src/modules/chat/chat.h @@ -55,18 +55,18 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData); char* Log_SetStyle(int style); // clist.c -BOOL AddEvent(HANDLE hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ...); -HANDLE AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType); -HANDLE FindRoom(const char *pszModule, const TCHAR *pszRoom); -BOOL SetAllOffline(BOOL bHide, const char *pszModule); -BOOL SetOffline(HANDLE hContact, BOOL bHide); - -int RoomDoubleclicked(WPARAM wParam,LPARAM lParam); -INT_PTR EventDoubleclicked(WPARAM wParam,LPARAM lParam); -INT_PTR JoinChat(WPARAM wParam, LPARAM lParam); -INT_PTR LeaveChat(WPARAM wParam, LPARAM lParam); -int PrebuildContactMenu(WPARAM wParam, LPARAM lParam); -INT_PTR PrebuildContactMenuSvc(WPARAM wParam, LPARAM lParam); +BOOL AddEvent(HCONTACT hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ...); +HCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType); +HCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom); +BOOL SetAllOffline(BOOL bHide, const char *pszModule); +BOOL SetOffline(HCONTACT hContact, BOOL bHide); + +int RoomDoubleclicked(WPARAM wParam,LPARAM lParam); +INT_PTR EventDoubleclicked(WPARAM wParam,LPARAM lParam); +INT_PTR JoinChat(WPARAM wParam, LPARAM lParam); +INT_PTR LeaveChat(WPARAM wParam, LPARAM lParam); +int PrebuildContactMenu(WPARAM wParam, LPARAM lParam); +INT_PTR PrebuildContactMenuSvc(WPARAM wParam, LPARAM lParam); // options.c int OptionsInit(void); @@ -99,7 +99,7 @@ BOOL IsEventSupported(int eventType); BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce); BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce); BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce); -int ShowPopup(HANDLE hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...); +int ShowPopup(HCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...); const TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2); diff --git a/src/modules/chat/chat_svc.cpp b/src/modules/chat/chat_svc.cpp index b999172b4d..f69a06b75c 100644 --- a/src/modules/chat/chat_svc.cpp +++ b/src/modules/chat/chat_svc.cpp @@ -133,20 +133,20 @@ static INT_PTR Service_GetInfo(WPARAM wParam, LPARAM lParam) mir_cslock lck(cs); SESSION_INFO *si; - if (gci->Flags & BYINDEX) + if (gci->Flags & GCF_BYINDEX) si = ci.SM_FindSessionByIndex(gci->pszModule, gci->iItem); else si = ci.SM_FindSession(gci->pszID, gci->pszModule); if (si == NULL) return 1; - if (gci->Flags & DATA) gci->dwItemData = si->dwItemData; - if (gci->Flags & HCONTACT) gci->hContact = si->hContact; - if (gci->Flags & TYPE) gci->iType = si->iType; - if (gci->Flags & COUNT) gci->iCount = si->nUsersInNicklist; - if (gci->Flags & USERS) gci->pszUsers = ci.SM_GetUsers(si); - if (gci->Flags & ID) gci->pszID = si->ptszID; - if (gci->Flags & NAME) gci->pszName = si->ptszName; + if (gci->Flags & GCF_DATA) gci->dwItemData = si->dwItemData; + if (gci->Flags & GCF_HCONTACT) gci->hContact = si->hContact; + if (gci->Flags & GCF_TYPE) gci->iType = si->iType; + if (gci->Flags & GCF_COUNT) gci->iCount = si->nUsersInNicklist; + if (gci->Flags & GCF_USERS) gci->pszUsers = ci.SM_GetUsers(si); + if (gci->Flags & GCF_ID) gci->pszID = si->ptszID; + if (gci->Flags & GCF_NAME) gci->pszName = si->ptszName; return 0; } diff --git a/src/modules/chat/clist.cpp b/src/modules/chat/clist.cpp index 90d507a39f..cbd9fbd262 100644 --- a/src/modules/chat/clist.cpp +++ b/src/modules/chat/clist.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "chat.h" -HANDLE AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType) +HCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType) { TCHAR pszGroup[50]; *pszGroup = '\0'; ptrT groupName(db_get_tsa(NULL, CHAT_MODULE, "AddToGroup")); @@ -42,7 +42,7 @@ HANDLE AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisp } } - HANDLE hContact = ci.FindRoom(pszModule, pszRoom); + HCONTACT hContact = ci.FindRoom(pszModule, pszRoom); if (hContact) { //contact exist, make sure it is in the right group if (pszGroup[0]) { ptrT grpName(db_get_tsa(hContact, "CList", "Group")); @@ -56,7 +56,7 @@ HANDLE AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisp } // here we create a new one since no one is to be found - if ((hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0)) == NULL) + if ((hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0)) == NULL) return NULL; CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)pszModule); @@ -71,7 +71,7 @@ HANDLE AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisp return hContact; } -BOOL SetOffline(HANDLE hContact, BOOL bHide) +BOOL SetOffline(HCONTACT hContact, BOOL bHide) { if (hContact) { char *szProto = GetContactProto(hContact); @@ -85,7 +85,7 @@ BOOL SetOffline(HANDLE hContact, BOOL bHide) BOOL SetAllOffline(BOOL bHide, const char *pszModule) { - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { char *szProto = GetContactProto(hContact); if (!ci.MM_FindModule(szProto)) continue; @@ -103,7 +103,7 @@ BOOL SetAllOffline(BOOL bHide, const char *pszModule) int RoomDoubleclicked(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (!hContact) return 0; @@ -141,7 +141,7 @@ INT_PTR EventDoubleclicked(WPARAM wParam,LPARAM lParam) INT_PTR JoinChat(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact) { char *szProto = GetContactProto(hContact); if (szProto) { @@ -157,7 +157,7 @@ INT_PTR JoinChat(WPARAM wParam, LPARAM lParam) INT_PTR LeaveChat(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact) { char *szProto = GetContactProto(hContact); if (szProto) @@ -168,7 +168,7 @@ INT_PTR LeaveChat(WPARAM wParam, LPARAM lParam) int PrebuildContactMenu(WPARAM wParam, LPARAM) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact == NULL) return 0; @@ -201,7 +201,7 @@ INT_PTR PrebuildContactMenuSvc(WPARAM wParam, LPARAM lParam) return PrebuildContactMenu(wParam, lParam); } -BOOL AddEvent(HANDLE hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ... ) +BOOL AddEvent(HCONTACT hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ... ) { TCHAR szBuf[4096]; @@ -233,9 +233,9 @@ BOOL AddEvent(HANDLE hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, return TRUE; } -HANDLE FindRoom(const char *pszModule, const TCHAR *pszRoom) +HCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom) { - for (HANDLE hContact = db_find_first(pszModule); hContact; hContact = db_find_next(hContact, pszModule)) { + for (HCONTACT hContact = db_find_first(pszModule); hContact; hContact = db_find_next(hContact, pszModule)) { if (!db_get_b(hContact, pszModule, "ChatRoom", 0)) continue; diff --git a/src/modules/chat/tools.cpp b/src/modules/chat/tools.cpp index 23980a5e91..9001e5678b 100644 --- a/src/modules/chat/tools.cpp +++ b/src/modules/chat/tools.cpp @@ -166,7 +166,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA return DefWindowProc(hWnd, message, wParam, lParam); } -int ShowPopup(HANDLE hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...) +int ShowPopup(HCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...) { static TCHAR szBuf[4 * 1024]; diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index d223f59307..c07c11441c 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -78,7 +78,7 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) if (!strcmp(cws->szModule, "CList")) { if (!strcmp(cws->szSetting, "MyHandle")) { - cli.pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam); + cli.pfnInvalidateDisplayNameCacheEntry((HCONTACT)wParam); cli.pfnClcBroadcast(INTM_NAMECHANGED, wParam, lParam); } else if (!strcmp(cws->szSetting, "Group")) @@ -93,7 +93,7 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) cli.pfnClcBroadcast(INTM_NAMEORDERCHANGED, 0, 0); } else { - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); if (szProto != NULL) { if (!strcmp(cws->szModule, "Protocol") && !strcmp(cws->szSetting, "p")) cli.pfnClcBroadcast(INTM_PROTOCHANGED, wParam, lParam); @@ -397,7 +397,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, TCHAR szFullName[512]; int i, nameLen, eq; //check name of group and ignore message if just being expanded/collapsed - if (cli.pfnFindItem(hwnd, dat, (HANDLE) (groupId | HCONTACT_ISGROUP), &contact, &group, NULL)) { + if (cli.pfnFindItem(hwnd, dat, (HCONTACT)(groupId | HCONTACT_ISGROUP), &contact, &group, NULL)) { lstrcpy(szFullName, contact->szText); while (group->parent) { for (i=0; i < group->parent->cl.count; i++) @@ -443,13 +443,13 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break; case INTM_CONTACTADDED: - cli.pfnAddContactToTree(hwnd, dat, (HANDLE)wParam, 1, 1); - cli.pfnNotifyNewContact(hwnd, (HANDLE)wParam); + cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1); + cli.pfnNotifyNewContact(hwnd, (HCONTACT)wParam); SortClcByTimer(hwnd); break; case INTM_CONTACTDELETED: - cli.pfnDeleteItemFromTree(hwnd, (HANDLE)wParam); + cli.pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam); SortClcByTimer(hwnd); break; @@ -459,12 +459,12 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN) break; if (dbcws->value.type == DBVT_DELETED || dbcws->value.bVal == 0) { - if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, NULL, NULL, NULL)) + if (cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, NULL, NULL, NULL)) break; - cli.pfnAddContactToTree(hwnd, dat, (HANDLE)wParam, 1, 1); - cli.pfnNotifyNewContact(hwnd, (HANDLE)wParam); + cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1); + cli.pfnNotifyNewContact(hwnd, (HCONTACT)wParam); } - else cli.pfnDeleteItemFromTree(hwnd, (HANDLE)wParam); + else cli.pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam); dat->needsResort = 1; SortClcByTimer(hwnd); @@ -475,17 +475,17 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, { WORD iExtraImage[EXTRA_ICON_COUNT]; BYTE flags = 0; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) memset(iExtraImage, 0xFF, sizeof(iExtraImage)); else { memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage)); flags = contact->flags; } - cli.pfnDeleteItemFromTree(hwnd, (HANDLE)wParam); - if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b((HANDLE)wParam, "CList", "Hidden", 0)) { + cli.pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam); + if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b((HCONTACT)wParam, "CList", "Hidden", 0)) { NMCLISTCONTROL nm; - cli.pfnAddContactToTree(hwnd, dat, (HANDLE)wParam, 1, 1); - if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) { + cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1); + if (cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) { memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage)); if (flags & CONTACTF_CHECKED) contact->flags |= CONTACTF_CHECKED; @@ -506,32 +506,32 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, { int recalcScrollBar = 0, shouldShow; WORD status; - HANDLE hSelItem = NULL; + HCONTACT hSelItem = NULL; ClcContact *selcontact = NULL; - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); if (szProto == NULL) status = ID_STATUS_OFFLINE; else - status = db_get_w((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE); + status = db_get_w((HCONTACT)wParam, szProto, "Status", ID_STATUS_OFFLINE); // this means an offline msg is flashing, so the contact should be shown DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE); - shouldShow = (style & CLS_SHOWHIDDEN || !db_get_b((HANDLE)wParam, "CList", "Hidden", 0)) + shouldShow = (style & CLS_SHOWHIDDEN || !db_get_b((HCONTACT)wParam, "CList", "Hidden", 0)) && (!cli.pfnIsHiddenMode(dat, status) || CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != lParam); contact = NULL; group = NULL; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) { + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL)) { if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) { if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1) - hSelItem = cli.pfnContactToHItem(selcontact); - cli.pfnAddContactToTree(hwnd, dat, (HANDLE)wParam, (style & CLS_CONTACTLIST) == 0, 0); + hSelItem = (HCONTACT)cli.pfnContactToHItem(selcontact); + cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, (style & CLS_CONTACTLIST) == 0, 0); recalcScrollBar = 1; - cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL); + cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL); if (contact) { contact->iImage = (WORD) lParam; - cli.pfnNotifyNewContact(hwnd, (HANDLE)wParam); + cli.pfnNotifyNewContact(hwnd, (HCONTACT)wParam); dat->needsResort = 1; } } @@ -541,7 +541,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break; if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) { if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1) - hSelItem = cli.pfnContactToHItem(selcontact); + hSelItem = (HCONTACT)cli.pfnContactToHItem(selcontact); cli.pfnRemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0); recalcScrollBar = 1; } @@ -566,26 +566,26 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break; case INTM_NAMECHANGED: - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) break; - lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HANDLE)wParam, 0), SIZEOF(contact->szText)); + lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HCONTACT)wParam, 0), SIZEOF(contact->szText)); dat->needsResort = 1; SortClcByTimer(hwnd); break; case INTM_PROTOCHANGED: - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) break; - contact->proto = GetContactProto((HANDLE)wParam); - cli.pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam); - lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HANDLE)wParam, 0), SIZEOF(contact->szText)); + contact->proto = GetContactProto((HCONTACT)wParam); + cli.pfnInvalidateDisplayNameCacheEntry((HCONTACT)wParam); + lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HCONTACT)wParam, 0), SIZEOF(contact->szText)); SortClcByTimer(hwnd); break; case INTM_NOTONLISTCHANGED: - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) break; if (contact->type == CLCIT_CONTACT) { @@ -603,12 +603,12 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break; case INTM_APPARENTMODECHANGED: - if ( cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) { - char *szProto = GetContactProto((HANDLE)wParam); + if (cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) { + char *szProto = GetContactProto((HCONTACT)wParam); if (szProto == NULL) break; - WORD apparentMode = db_get_w((HANDLE)wParam, szProto, "ApparentMode", 0); + WORD apparentMode = db_get_w((HCONTACT)wParam, szProto, "ApparentMode", 0); contact->flags &= ~(CONTACTF_INVISTO | CONTACTF_VISTO); if (apparentMode == ID_STATUS_OFFLINE) contact->flags |= CONTACTF_INVISTO; @@ -625,12 +625,12 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, break; case INTM_IDLECHANGED: - if ( cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) { - char *szProto = GetContactProto((HANDLE)wParam); + if (cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) { + char *szProto = GetContactProto((HCONTACT)wParam); if (szProto == NULL) break; contact->flags &= ~CONTACTF_IDLE; - if (db_get_dw((HANDLE)wParam, szProto, "IdleTS", 0)) + if (db_get_dw((HCONTACT)wParam, szProto, "IdleTS", 0)) contact->flags |= CONTACTF_IDLE; cli.pfnInvalidateRect(hwnd, NULL, FALSE); diff --git a/src/modules/clist/clc.h b/src/modules/clist/clc.h index 4732800a42..b95e072656 100644 --- a/src/modules/clist/clc.h +++ b/src/modules/clist/clc.h @@ -44,11 +44,11 @@ HMENU fnBuildGroupPopupMenu(ClcGroup* group); LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); /* clcidents.c */ -int fnGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex); -int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible); -int fnGetRowByIndex(struct ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup); -HANDLE fnContactToHItem(ClcContact* contact); -HANDLE fnContactToItemHandle(ClcContact * contact, DWORD * nmFlags); +int fnGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex); +int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible); +int fnGetRowByIndex(struct ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup); +HANDLE fnContactToHItem(ClcContact *contact); +HANDLE fnContactToItemHandle(ClcContact *contact, DWORD *nmFlags); /* clcitems.c */ ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers); @@ -58,9 +58,9 @@ void fnFreeContact(ClcContact *p); void fnFreeGroup(ClcGroup *group); int fnAddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText); int fnAddItemToGroup(ClcGroup *group, int iAboveItem); -void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HANDLE hContact, int updateTotalCount, int checkHideOffline); -int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact); -void fnDeleteItemFromTree(HWND hwnd, HANDLE hItem); +void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HCONTACT hContact, int updateTotalCount, int checkHideOffline); +int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HCONTACT hContact); +void fnDeleteItemFromTree(HWND hwnd, HCONTACT hItem); void fnRebuildEntireList(HWND hwnd, struct ClcData *dat); int fnGetGroupContentsCount(ClcGroup *group, int visibleOnly); void fnSortCLC(HWND hwnd, struct ClcData *dat, int useInsertionSort); @@ -86,7 +86,7 @@ int fnGetDropTargetInformation(HWND hwnd, struct ClcData *dat, POINT pt); int fnClcStatusToPf2(int status); int fnIsHiddenMode(struct ClcData *dat, int status); void fnHideInfoTip(HWND hwnd, struct ClcData *dat); -void fnNotifyNewContact(HWND hwnd, HANDLE hContact); +void fnNotifyNewContact(HWND hwnd, HCONTACT hContact); DWORD fnGetDefaultExStyle(void); void fnGetSetting(int i, LOGFONT* lf, COLORREF* colour); void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF* colour); @@ -120,12 +120,12 @@ void RebuildMenuOrder(void); INT_PTR MenuProcessCommand(WPARAM wParam, LPARAM lParam); /* clistsettings.c */ -TCHAR* fnGetContactDisplayName(HANDLE hContact, int mode); +TCHAR* fnGetContactDisplayName(HCONTACT hContact, int mode); void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF * colour); -void fnInvalidateDisplayNameCacheEntry(HANDLE hContact); +void fnInvalidateDisplayNameCacheEntry(HCONTACT hContact); -ClcCacheEntry* fnGetCacheEntry(HANDLE hContact); -ClcCacheEntry* fnCreateCacheItem (HANDLE hContact); +ClcCacheEntry* fnGetCacheEntry(HCONTACT hContact); +ClcCacheEntry* fnCreateCacheItem (HCONTACT hContact); void fnCheckCacheItem(ClcCacheEntry *p); void fnFreeCacheItem(ClcCacheEntry *p); @@ -137,21 +137,21 @@ void fnUnregisterFileDropping (HWND hwnd); /* clistevents.c */ struct CListEvent* fnAddEvent(CLISTEVENT *cle); -CLISTEVENT* fnGetEvent(HANDLE hContact, int idx); +CLISTEVENT* fnGetEvent(HCONTACT hContact, int idx); struct CListEvent* fnCreateEvent(void); void fnFreeEvent(struct CListEvent* p); -int fnEventsProcessContactDoubleClick(HANDLE hContact); +int fnEventsProcessContactDoubleClick(HCONTACT hContact); int fnEventsProcessTrayDoubleClick(int); int fnGetImlIconIndex(HICON hIcon); -int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent); +int fnRemoveEvent(HCONTACT hContact, HANDLE dbEvent); /* clistmod.c */ -int fnGetContactIcon(HANDLE hContact); -int fnIconFromStatusMode(const char *szProto, int status, HANDLE hContact); +int fnGetContactIcon(HCONTACT hContact); +int fnIconFromStatusMode(const char *szProto, int status, HCONTACT hContact); int fnShowHide(WPARAM wParam, LPARAM lParam); -HICON fnGetIconFromStatusMode(HANDLE hContact, const char *szProto, int status); +HICON fnGetIconFromStatusMode(HCONTACT hContact, const char *szProto, int status); TCHAR* fnGetStatusModeDescription(int wParam, int lParam); int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY); @@ -186,7 +186,7 @@ void fnCluiProtocolStatusChanged(int, const char*); void fnDrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, HICON eventIcon); /* contact.c */ -void fnChangeContactIcon (HANDLE hContact, int iIcon, int add); +void fnChangeContactIcon (HCONTACT hContact, int iIcon, int add); void fnLoadContactTree (void); int fnCompareContacts (const ClcContact *contact1, const ClcContact *contact2); void fnSortContacts (void); diff --git a/src/modules/clist/clcfiledrop.cpp b/src/modules/clist/clcfiledrop.cpp index 7f610710fd..2c79cafb7e 100644 --- a/src/modules/clist/clcfiledrop.cpp +++ b/src/modules/clist/clcfiledrop.cpp @@ -70,7 +70,7 @@ ULONG CDropTarget::Release(void) return InterlockedDecrement(&refCount); } -static HANDLE HContactFromPoint(HWND hwnd, struct ClcData *dat, int x, int y, int *hitLine) +static HCONTACT HContactFromPoint(HWND hwnd, struct ClcData *dat, int x, int y, int *hitLine) { DWORD hitFlags; ClcContact *contact; @@ -98,7 +98,7 @@ HRESULT CDropTarget::DragOver(DWORD /*grfKeyState*/, POINTL pt, DWORD * pdwEffec struct ClcData *dat; RECT clRect; int hit; - HANDLE hContact; + HCONTACT hContact; if (pDropTargetHelper && hwndCurrentDrag) pDropTargetHelper->DragOver((POINT*)&pt, *pdwEffect); @@ -207,7 +207,6 @@ HRESULT CDropTarget::Drop(IDataObject * pDataObj, DWORD /*fKeyState*/, POINTL pt HDROP hDrop; POINT shortPt; struct ClcData *dat; - HANDLE hContact; if (pDropTargetHelper && hwndCurrentDrag) pDropTargetHelper->Drop(pDataObj, (POINT*)&pt, *pdwEffect); @@ -221,7 +220,7 @@ HRESULT CDropTarget::Drop(IDataObject * pDataObj, DWORD /*fKeyState*/, POINTL pt shortPt.x = pt.x; shortPt.y = pt.y; ScreenToClient(hwndCurrentDrag, &shortPt); - hContact = HContactFromPoint(hwndCurrentDrag, dat, shortPt.x, shortPt.y, NULL); + HCONTACT hContact = HContactFromPoint(hwndCurrentDrag, dat, shortPt.x, shortPt.y, NULL); if (hContact != NULL) { TCHAR **ppFiles = NULL; TCHAR szFilename[MAX_PATH]; diff --git a/src/modules/clist/clcidents.cpp b/src/modules/clist/clcidents.cpp index 72279117ab..5ec0b48600 100644 --- a/src/modules/clist/clcidents.cpp +++ b/src/modules/clist/clcidents.cpp @@ -176,20 +176,20 @@ int fnGetRowByIndex(struct ClcData *dat, int testindex, ClcContact **contact, Cl return -1; } -HANDLE fnContactToHItem(ClcContact * contact) +HANDLE fnContactToHItem(ClcContact *contact) { switch (contact->type) { case CLCIT_CONTACT: return contact->hContact; case CLCIT_GROUP: - return (HANDLE) (contact->groupId | HCONTACT_ISGROUP); + return (HCONTACT)(contact->groupId | HCONTACT_ISGROUP); case CLCIT_INFO: - return (HANDLE) ((UINT_PTR) contact->hContact | HCONTACT_ISINFO); + return (HCONTACT)((UINT_PTR)contact->hContact | HCONTACT_ISINFO); } return NULL; } -HANDLE fnContactToItemHandle(ClcContact * contact, DWORD * nmFlags) +HANDLE fnContactToItemHandle(ClcContact *contact, DWORD *nmFlags) { switch (contact->type) { case CLCIT_CONTACT: @@ -197,11 +197,11 @@ HANDLE fnContactToItemHandle(ClcContact * contact, DWORD * nmFlags) case CLCIT_GROUP: if (nmFlags) *nmFlags |= CLNF_ISGROUP; - return (HANDLE) contact->groupId; + return (HCONTACT)contact->groupId; case CLCIT_INFO: if (nmFlags) *nmFlags |= CLNF_ISINFO; - return (HANDLE) ((UINT_PTR) contact->hContact | HCONTACT_ISINFO); + return (HCONTACT)((UINT_PTR)contact->hContact | HCONTACT_ISINFO); } return NULL; } diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index 8e4eb13939..0a66b5933e 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -108,7 +108,7 @@ ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD group->totalMembers = 0; if (flags != (DWORD) - 1 && pNextField == NULL && calcTotalMembers) { DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE); - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact); if (!lstrcmp(cache->tszGroup, szName) && (style & CLS_SHOWHIDDEN || !cache->bIsHidden)) group->totalMembers++; @@ -164,12 +164,12 @@ int fnAddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText) ++iInfoItemUniqueHandle; group->cl.items[i]->type = CLCIT_INFO; group->cl.items[i]->flags = (BYTE) flags; - group->cl.items[i]->hContact = (HANDLE)++ iInfoItemUniqueHandle; + group->cl.items[i]->hContact = (HCONTACT)++iInfoItemUniqueHandle; lstrcpyn(group->cl.items[i]->szText, pszText, SIZEOF(group->cl.items[i]->szText)); return i; } -int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact) +int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HCONTACT hContact) { int i, index = -1; @@ -212,7 +212,7 @@ int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact) return i; } -void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HANDLE hContact, int updateTotalCount, int checkHideOffline) +void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HCONTACT hContact, int updateTotalCount, int checkHideOffline) { ClcGroup *group; DBVARIANT dbv; @@ -309,7 +309,7 @@ ClcGroup* fnRemoveItemFromGroup(HWND hwnd, ClcGroup *group, ClcContact *contact, return group; } -void fnDeleteItemFromTree(HWND hwnd, HANDLE hItem) +void fnDeleteItemFromTree(HWND hwnd, HCONTACT hItem) { ClcContact *contact; ClcGroup *group; @@ -363,7 +363,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat) cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 0); } - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { if (style & CLS_SHOWHIDDEN || !db_get_b(hContact, "CList", "Hidden", 0)) { DBVARIANT dbv; if (db_get_ts(hContact, "CList", "Group", &dbv)) @@ -545,13 +545,13 @@ void fnSortCLC(HWND hwnd, struct ClcData *dat, int useInsertionSort) { ClcContact *selcontact; ClcGroup *group = &dat->list, *selgroup; - HANDLE hSelItem; + HCONTACT hSelItem; if (dat->needsResort) { if (cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) == -1) hSelItem = NULL; else - hSelItem = cli.pfnContactToHItem(selcontact); + hSelItem = (HCONTACT)cli.pfnContactToHItem(selcontact); group->scanIndex = 0; SortGroup(dat, group, useInsertionSort); for (;;) { @@ -580,7 +580,7 @@ void fnSortCLC(HWND hwnd, struct ClcData *dat, int useInsertionSort) struct SavedContactState_t { - HANDLE hContact; + HCONTACT hContact; WORD iExtraImage[EXTRA_ICON_COUNT]; int checked; }; @@ -685,7 +685,7 @@ void fnSaveStateAndRebuildList(HWND hwnd, struct ClcData *dat) if (saveInfo[i].parentId == -1) group = &dat->list; else { - if (!cli.pfnFindItem(hwnd, dat, (HANDLE) (saveInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)(saveInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) continue; group = contact->group; } diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp index 6845cd02e1..f1cc63ed18 100644 --- a/src/modules/clist/clcmsgs.cpp +++ b/src/modules/clist/clcmsgs.cpp @@ -31,7 +31,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR { switch (msg) { case CLM_ADDCONTACT: - cli.pfnAddContactToTree(hwnd, dat, (HANDLE)wParam, 1, 0); + cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 0); cli.pfnRecalcScrollBar(hwnd, dat); cli.pfnSortCLC(hwnd, dat, 1); break; @@ -55,12 +55,12 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR ClcGroup *group; CLCINFOITEM *cii = (CLCINFOITEM *) lParam; if (cii == NULL || cii->cbSize != sizeof(CLCINFOITEM)) - return (LRESULT)(HANDLE) NULL; + return NULL; if (cii->hParentGroup == NULL) group = &dat->list; else { - if (!cli.pfnFindItem(hwnd, dat, (HANDLE) ((UINT_PTR) cii->hParentGroup | HCONTACT_ISGROUP), &groupContact, NULL, NULL)) - return (LRESULT)(HANDLE) NULL; + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)((UINT_PTR)cii->hParentGroup | HCONTACT_ISGROUP), &groupContact, NULL, NULL)) + return NULL; group = groupContact->group; } if (msg == CLM_ADDINFOITEMA) @@ -79,7 +79,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR break; case CLM_DELETEITEM: - cli.pfnDeleteItemFromTree(hwnd, (HANDLE)wParam); + cli.pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam); cli.pfnSortCLC(hwnd, dat, 1); cli.pfnRecalcScrollBar(hwnd, dat); break; @@ -97,7 +97,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR { ClcContact *contact; ClcGroup *group, *tgroup; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL)) break; for (tgroup = group; tgroup; tgroup = tgroup->parent) cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1); @@ -108,7 +108,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_EXPAND: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) break; if (contact->type != CLCIT_GROUP) break; @@ -117,13 +117,13 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR } case CLM_FINDCONTACT: - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, NULL, NULL, NULL)) - return (LRESULT)(HANDLE) NULL; + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, NULL, NULL, NULL)) + return NULL; return wParam; case CLM_FINDGROUP: - if (!cli.pfnFindItem(hwnd, dat, (HANDLE) (wParam | HCONTACT_ISGROUP), NULL, NULL, NULL)) - return (LRESULT)(HANDLE) NULL; + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)(wParam | HCONTACT_ISGROUP), NULL, NULL, NULL)) + return NULL; return wParam | HCONTACT_ISGROUP; case CLM_GETBKCOLOR: @@ -132,7 +132,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETCHECKMARK: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) return 0; return (contact->flags & CONTACTF_CHECKED) != 0; } @@ -146,7 +146,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETEXPAND: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) return CLE_INVALID; if (contact->type != CLCIT_GROUP) return CLE_INVALID; @@ -164,7 +164,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETEXTRAIMAGE: if (LOWORD(lParam) < dat->extraColumnsCount) { ClcContact *contact; - if ( cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) return contact->iExtraImage[LOWORD(lParam)]; } return EMPTY_EXTRA_ICON; @@ -190,7 +190,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETITEMTEXT: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) return 0; lstrcpy((TCHAR*) lParam, contact->szText); return lstrlen(contact->szText); @@ -199,7 +199,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_GETITEMTYPE: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) return CLCIT_INVALID; return contact->type; } @@ -217,14 +217,14 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR ClcContact *contact; ClcGroup *group; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE) lParam, &contact, &group, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)lParam, &contact, &group, NULL)) return NULL; int i = List_IndexOf((SortedList*)&group->cl, contact); switch (wParam) { case CLGN_CHILD: if (contact->type != CLCIT_GROUP) - return (LRESULT)(HANDLE) NULL; + return NULL; group = contact->group; if (group->cl.count == 0) return NULL; @@ -320,7 +320,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR { ClcContact *contact; ClcGroup *group, *tgroup; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL)) break; for (tgroup = group; tgroup; tgroup = tgroup->parent) cli.pfnSetGroupExpand(hwnd, dat, tgroup, 1); @@ -353,7 +353,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_SETCHECKMARK: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) return 0; if (lParam) contact->flags |= CONTACTF_CHECKED; @@ -375,7 +375,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_SETEXTRAIMAGE: if ( LOWORD(lParam) < dat->extraColumnsCount) { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) return 0; contact->iExtraImage[LOWORD(lParam)] = HIWORD(lParam); @@ -433,7 +433,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR case CLM_SETITEMTEXT: { ClcContact *contact; - if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) + if (!cli.pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) break; lstrcpyn(contact->szText, (TCHAR*)lParam, SIZEOF(contact->szText)); cli.pfnSortCLC(hwnd, dat, 1); diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index b87fc9cfa5..49946868c7 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -633,7 +633,7 @@ void fnHideInfoTip(HWND, struct ClcData *dat) NotifyEventHooks(hHideInfoTipEvent, 0, (LPARAM) & it); } -void fnNotifyNewContact(HWND hwnd, HANDLE hContact) +void fnNotifyNewContact(HWND hwnd, HCONTACT hContact) { NMCLISTCONTROL nm; nm.hdr.code = CLN_NEWCONTACT; diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp index 3407be16df..2347021133 100644 --- a/src/modules/clist/clistevents.cpp +++ b/src/modules/clist/clistevents.cpp @@ -200,7 +200,7 @@ struct CListEvent* fnAddEvent(CLISTEVENT *cle) // Removes an event from the contact list's queue // Returns 0 if the event was successfully removed, or nonzero if the event was not found -int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent) +int fnRemoveEvent(HCONTACT hContact, HANDLE dbEvent) { int i; char *szProto; @@ -257,7 +257,7 @@ int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent) return 0; } -CLISTEVENT* fnGetEvent(HANDLE hContact, int idx) +CLISTEVENT* fnGetEvent(HCONTACT hContact, int idx) { if (hContact == INVALID_HANDLE_VALUE) { if (idx >= cli.events.count) @@ -272,7 +272,7 @@ CLISTEVENT* fnGetEvent(HANDLE hContact, int idx) return NULL; } -int fnEventsProcessContactDoubleClick(HANDLE hContact) +int fnEventsProcessContactDoubleClick(HCONTACT hContact) { for (int i=0; i < cli.events.count; i++) { if (cli.events.items[i]->cle.hContact == hContact) { @@ -290,7 +290,8 @@ int fnEventsProcessTrayDoubleClick(int index) { BOOL click_in_first_icon = FALSE; if (cli.events.count) { - HANDLE hContact, hDbEvent; + HCONTACT hContact; + HANDLE hDbEvent; int eventIndex = 0; cli.pfnLockTray(); if (cli.trayIconCount>1 && index>0) { @@ -369,8 +370,8 @@ static int RemoveEventsForContact(WPARAM wParam, LPARAM) for (; cli.events.count > 0;) { for (hit = 0, j = 0; j < cli.events.count; j++) { - if (cli.events.items[j]->cle.hContact == (HANDLE)wParam) { - cli.pfnRemoveEvent((HANDLE)wParam, cli.events.items[j]->cle.hDbEvent); + if (cli.events.items[j]->cle.hContact == (HCONTACT)wParam) { + cli.pfnRemoveEvent((HCONTACT)wParam, cli.events.items[j]->cle.hDbEvent); hit = 1; } } @@ -383,8 +384,8 @@ static int RemoveEventsForContact(WPARAM wParam, LPARAM) static int CListEventSettingsChanged(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; - DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam; + HCONTACT hContact = (HCONTACT)wParam; + DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam; if (hContact == NULL && cws && cws->szModule && cws->szSetting && strcmp(cws->szModule, "CList") == 0) { if (strcmp(cws->szSetting, "DisableTrayFlash") == 0) disableTrayFlash = (int)cws->value.bVal; @@ -398,8 +399,8 @@ static int CListEventSettingsChanged(WPARAM wParam, LPARAM lParam) INT_PTR AddEventSyncStub(WPARAM wParam, LPARAM lParam) { return CallServiceSync(MS_CLIST_ADDEVENT"_SYNC", wParam, lParam); } INT_PTR AddEventStub(WPARAM, LPARAM lParam) { return cli.pfnAddEvent((CLISTEVENT*)lParam) == NULL; } -INT_PTR RemoveEventStub(WPARAM wParam, LPARAM lParam) { return cli.pfnRemoveEvent((HANDLE)wParam, (HANDLE)lParam); } -INT_PTR GetEventStub(WPARAM wParam, LPARAM lParam) { return (INT_PTR)cli.pfnGetEvent((HANDLE)wParam, (int)lParam); } +INT_PTR RemoveEventStub(WPARAM wParam, LPARAM lParam) { return cli.pfnRemoveEvent((HCONTACT)wParam, (HANDLE)lParam); } +INT_PTR GetEventStub(WPARAM wParam, LPARAM lParam) { return (INT_PTR)cli.pfnGetEvent((HCONTACT)wParam, (int)lParam); } int InitCListEvents(void) { diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index 387d3b565c..08c81d6a3d 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -320,7 +320,7 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam) static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; NotifyEventHooks(hPreBuildContactMenuEvent, (WPARAM)hContact, 0); char *szProto = GetContactProto(hContact); diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 3cd0e45693..5f2ae798be 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -139,8 +139,8 @@ static int ProtocolAck(WPARAM, LPARAM lParam) if ((int)ack->hProcess < ID_STATUS_ONLINE && ack->lParam >= ID_STATUS_ONLINE) { DWORD caps = (DWORD)CallProtoServiceInt(NULL,ack->szModule, PS_GETCAPS, PFLAGNUM_1, 0); if (caps & PF1_SERVERCLIST) { - for (HANDLE hContact = db_find_first(ack->szModule); hContact; ) { - HANDLE hNext = db_find_next(hContact, ack->szModule); + for (HCONTACT hContact = db_find_first(ack->szModule); hContact; ) { + HCONTACT hNext = db_find_next(hContact, ack->szModule); if (db_get_b(hContact, "CList", "Delete", 0)) CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); hContact = hNext; @@ -152,12 +152,12 @@ static int ProtocolAck(WPARAM, LPARAM lParam) return 0; } -HICON fnGetIconFromStatusMode(HANDLE hContact, const char *szProto, int status) +HICON fnGetIconFromStatusMode(HCONTACT hContact, const char *szProto, int status) { return ImageList_GetIcon(hCListImages, cli.pfnIconFromStatusMode(szProto, status, hContact), ILD_NORMAL); } -int fnIconFromStatusMode(const char *szProto, int status, HANDLE) +int fnIconFromStatusMode(const char *szProto, int status, HCONTACT) { int index, i; @@ -176,7 +176,7 @@ int fnIconFromStatusMode(const char *szProto, int status, HANDLE) return 1; } -int fnGetContactIcon(HANDLE hContact) +int fnGetContactIcon(HCONTACT hContact) { char *szProto = GetContactProto(hContact); return cli.pfnIconFromStatusMode(szProto, @@ -185,7 +185,7 @@ int fnGetContactIcon(HANDLE hContact) static INT_PTR GetContactIcon(WPARAM wParam, LPARAM) { - return cli.pfnGetContactIcon((HANDLE)wParam); + return cli.pfnGetContactIcon((HCONTACT)wParam); } static void AddProtoIconIndex(PROTOACCOUNT* pa) @@ -245,7 +245,7 @@ static int ContactListAccountsChanged(WPARAM eventCode, LPARAM lParam) static INT_PTR ContactDoubleClicked(WPARAM wParam, LPARAM) { // Try to process event myself - if (cli.pfnEventsProcessContactDoubleClick((HANDLE)wParam) == 0) + if (cli.pfnEventsProcessContactDoubleClick((HCONTACT)wParam) == 0) return 0; // Allow third-party plugins to process a dblclick @@ -253,7 +253,7 @@ static INT_PTR ContactDoubleClicked(WPARAM wParam, LPARAM) return 0; // Otherwise try to execute the default action - TryProcessDoubleClick((HANDLE)wParam); + TryProcessDoubleClick((HCONTACT)wParam); return 0; } @@ -425,7 +425,7 @@ extern int sortByStatus, sortByProto; static INT_PTR CompareContacts(WPARAM wParam, LPARAM lParam) { - HANDLE a = (HANDLE)wParam, b = (HANDLE) lParam; + HCONTACT a = (HCONTACT)wParam, b = (HCONTACT)lParam; TCHAR namea[128], *nameb; int statusa, statusb; char *szProto1, *szProto2; @@ -433,8 +433,8 @@ static INT_PTR CompareContacts(WPARAM wParam, LPARAM lParam) szProto1 = GetContactProto(a); szProto2 = GetContactProto(b); - statusa = db_get_w((HANDLE) a, SAFESTRING(szProto1), "Status", ID_STATUS_OFFLINE); - statusb = db_get_w((HANDLE) b, SAFESTRING(szProto2), "Status", ID_STATUS_OFFLINE); + statusa = db_get_w(a, SAFESTRING(szProto1), "Status", ID_STATUS_OFFLINE); + statusb = db_get_w(b, SAFESTRING(szProto2), "Status", ID_STATUS_OFFLINE); if (sortByProto) { /* deal with statuses, online contacts have to go above offline */ @@ -533,8 +533,8 @@ void UnloadContactListModule() return; //remove transitory contacts - for (HANDLE hContact = db_find_first(); hContact != NULL; ) { - HANDLE hNext = db_find_next(hContact); + for (HCONTACT hContact = db_find_first(); hContact != NULL; ) { + HCONTACT hNext = db_find_next(hContact); if (db_get_b(hContact, "CList", "NotOnList", 0)) CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); hContact = hNext; diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp index 89ee1d5f75..bf11aa6e95 100644 --- a/src/modules/clist/clistsettings.cpp +++ b/src/modules/clist/clistsettings.cpp @@ -54,7 +54,7 @@ void FreeDisplayNameCache(void) // default handlers for the cache item creation and destruction -ClcCacheEntry* fnCreateCacheItem(HANDLE hContact) +ClcCacheEntry* fnCreateCacheItem(HCONTACT hContact) { ClcCacheEntry* p = (ClcCacheEntry*)mir_calloc(sizeof(ClcCacheEntry)); if (p == NULL) @@ -86,14 +86,14 @@ void fnFreeCacheItem(ClcCacheEntry *p) p->bIsHidden = -1; } -ClcCacheEntry* fnGetCacheEntry(HANDLE hContact) +ClcCacheEntry* fnGetCacheEntry(HCONTACT hContact) { ClcCacheEntry *p; int idx; if (!List_GetIndex(clistCache, &hContact, &idx)) { if ((p = cli.pfnCreateCacheItem(hContact)) != NULL) { List_Insert(clistCache, p, idx); - cli.pfnInvalidateDisplayNameCacheEntry(p); + cli.pfnInvalidateDisplayNameCacheEntry((HCONTACT)p); } } else p = (ClcCacheEntry*)clistCache->items[idx]; @@ -102,7 +102,7 @@ ClcCacheEntry* fnGetCacheEntry(HANDLE hContact) return p; } -void fnInvalidateDisplayNameCacheEntry(HANDLE hContact) +void fnInvalidateDisplayNameCacheEntry(HCONTACT hContact) { if (hContact == INVALID_HANDLE_VALUE) { FreeDisplayNameCache(); @@ -116,7 +116,7 @@ void fnInvalidateDisplayNameCacheEntry(HANDLE hContact) } } -TCHAR* fnGetContactDisplayName(HANDLE hContact, int mode) +TCHAR* fnGetContactDisplayName(HCONTACT hContact, int mode) { ClcCacheEntry *cacheEntry = NULL; @@ -160,7 +160,7 @@ INT_PTR GetContactDisplayName(WPARAM wParam, LPARAM lParam) { static char retVal[200]; ClcCacheEntry *cacheEntry = NULL; - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (lParam & GCDNF_UNICODE) return (INT_PTR)cli.pfnGetContactDisplayName(hContact, lParam & ~GCDNF_UNICODE); @@ -209,13 +209,13 @@ INT_PTR GetContactDisplayName(WPARAM wParam, LPARAM lParam) INT_PTR InvalidateDisplayName(WPARAM wParam, LPARAM) { - cli.pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam); + cli.pfnInvalidateDisplayNameCacheEntry((HCONTACT)wParam); return 0; } int ContactAdded(WPARAM wParam, LPARAM) { - cli.pfnChangeContactIcon((HANDLE)wParam, cli.pfnIconFromStatusMode(GetContactProto((HANDLE)wParam), ID_STATUS_OFFLINE, NULL), 1); + cli.pfnChangeContactIcon((HCONTACT)wParam, cli.pfnIconFromStatusMode(GetContactProto((HCONTACT)wParam), ID_STATUS_OFFLINE, NULL), 1); cli.pfnSortContacts(); return 0; } @@ -230,7 +230,7 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) { DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam; DBVARIANT dbv; - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; // Early exit if (hContact == NULL) @@ -270,7 +270,7 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) if (!strcmp(cws->szModule, "CList")) { if (!strcmp(cws->szSetting, "Hidden")) { if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) { - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(szProto, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact), 1); } else diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index 559e9b2b13..ce1996d89e 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -134,7 +134,7 @@ static INT_PTR CALLBACK AskForConfirmationDlgProc(HWND hWnd, UINT msg, WPARAM wP TCHAR szFinal[256]; GetDlgItemText(hWnd, IDC_TOPLINE, szFormat, SIZEOF(szFormat)); - mir_sntprintf(szFinal, SIZEOF(szFinal), szFormat, cli.pfnGetContactDisplayName((HANDLE)lParam, 0)); + mir_sntprintf(szFinal, SIZEOF(szFinal), szFormat, cli.pfnGetContactDisplayName((HCONTACT)lParam, 0)); SetDlgItemText(hWnd, IDC_TOPLINE, szFinal); } SetFocus( GetDlgItem(hWnd, IDNO)); @@ -185,7 +185,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) // Delete contact case IDYES: { - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); if (szProto != NULL) { // Check if protocol uses server side lists DWORD caps; @@ -197,7 +197,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) status = CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0); if (status == ID_STATUS_OFFLINE || (status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) { // Set a flag so we remember to delete the contact when the protocol goes online the next time - db_set_b((HANDLE)wParam, "CList", "Delete", 1); + db_set_b((HCONTACT)wParam, "CList", "Delete", 1); MessageBox(NULL, TranslateT("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."), TranslateT("Delete contact"), MB_ICONINFORMATION | MB_OK); @@ -212,7 +212,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) // Archive contact case IDC_HIDE: - db_set_b((HANDLE)wParam, "CList", "Hidden", 1); + db_set_b((HCONTACT)wParam, "CList", "Hidden", 1); break; } @@ -815,7 +815,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case CLN_NEWCONTACT: if (nmc != NULL) - cli.pfnSetAllExtraIcons(nmc->hItem); + cli.pfnSetAllExtraIcons((HCONTACT)nmc->hItem); return TRUE; case CLN_LISTREBUILT: @@ -869,7 +869,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (hItem) { if (hitFlags & CLCHT_ONITEMEXTRA) { if (!IsHContactGroup(hItem) && !IsHContactInfo(hItem)) - if ( cli.pfnGetCacheEntry(nmc->hItem)) + if (cli.pfnGetCacheEntry((HCONTACT)nmc->hItem)) NotifyEventHooks(hEventExtraClick, (WPARAM)nmc->hItem, nmc->iColumn+1); } break; diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index 4a7be77ba1..92f7f5deda 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -45,7 +45,7 @@ static const struct { {ID_STATUS_ONTHEPHONE, 150}, {ID_STATUS_OUTTOLUNCH, 425}}; -static int GetContactStatus(HANDLE hContact) +static int GetContactStatus(HCONTACT hContact) { char *szProto = GetContactProto(hContact); if (szProto == NULL) @@ -53,7 +53,7 @@ static int GetContactStatus(HANDLE hContact) return db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); } -void fnChangeContactIcon(HANDLE hContact, int iIcon, int add) +void fnChangeContactIcon(HCONTACT hContact, int iIcon, int add) { CallService(add ? MS_CLUI_CONTACTADDED : MS_CLUI_CONTACTSETICON, (WPARAM) hContact, iIcon); NotifyEventHooks(hContactIconChangedEvent, (WPARAM) hContact, iIcon); @@ -78,7 +78,7 @@ void fnLoadContactTree(void) } int hideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT); - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { int status = GetContactStatus(hContact); if ((!hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0)) cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(GetContactProto(hContact), status, hContact), 1); @@ -90,13 +90,13 @@ void fnLoadContactTree(void) int fnCompareContacts(const ClcContact* c1, const ClcContact* c2) { - HANDLE a = c1->hContact, b = c2->hContact; + HCONTACT a = c1->hContact, b = c2->hContact; TCHAR namea[128], *nameb; int statusa, statusb; int rc; - statusa = db_get_w((HANDLE) a, c1->proto, "Status", ID_STATUS_OFFLINE); - statusb = db_get_w((HANDLE) b, c2->proto, "Status", ID_STATUS_OFFLINE); + statusa = db_get_w(a, c1->proto, "Status", ID_STATUS_OFFLINE); + statusb = db_get_w(b, c2->proto, "Status", ID_STATUS_OFFLINE); if (sortByProto) { /* deal with statuses, online contacts have to go above offline */ @@ -111,17 +111,15 @@ int fnCompareContacts(const ClcContact* c1, const ClcContact* c2) } if (sortByStatus) { - int ordera, orderb; - ordera = GetStatusModeOrdering(statusa); - orderb = GetStatusModeOrdering(statusb); + int ordera = GetStatusModeOrdering(statusa); + int orderb = GetStatusModeOrdering(statusb); if (ordera != orderb) return ordera - orderb; } else { //one is offline: offline goes below online - if ((statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE)) { + if ((statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE)) return 2 * (statusa == ID_STATUS_OFFLINE) - 1; - } } nameb = cli.pfnGetContactDisplayName(a, 0); @@ -146,13 +144,13 @@ INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam) CallService(MS_CLUI_CONTACTDELETED, wParam, 0); if ((HANDLE) lParam == NULL) - db_unset((HANDLE)wParam, "CList", "Group"); + db_unset((HCONTACT)wParam, "CList", "Group"); else { grpChg.pszNewName = cli.pfnGetGroupName(lParam, NULL); - db_set_ts((HANDLE)wParam, "CList", "Group", grpChg.pszNewName); + db_set_ts((HCONTACT)wParam, "CList", "Group", grpChg.pszNewName); } CallService(MS_CLUI_CONTACTADDED, wParam, - cli.pfnIconFromStatusMode(GetContactProto((HANDLE)wParam), GetContactStatus((HANDLE)wParam), (HANDLE)wParam)); + cli.pfnIconFromStatusMode(GetContactProto((HCONTACT)wParam), GetContactStatus((HCONTACT)wParam), (HCONTACT)wParam)); NotifyEventHooks(hGroupChangeEvent, wParam, (LPARAM)&grpChg); return 0; diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index be411350a5..c453635fce 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -1096,7 +1096,7 @@ int RegisterAllIconsInIconLib() return 0; } -int TryProcessDoubleClick(HANDLE hContact) +int TryProcessDoubleClick(HCONTACT hContact) { int iMenuID = GetMenuObjbyId((int)hContactMenuObject); if (iMenuID != -1) { diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index b6162fc17e..123ee33692 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -178,7 +178,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) int i; char str[33]; DBVARIANT dbv; - HANDLE hContact; + HCONTACT hContact; TCHAR name[256], szNewParent[256], *pszLastBackslash; //get the name @@ -292,7 +292,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) db_set_ts(NULL, "CListGroups", idstr, str); //must rename setting in all child contacts too - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact); if (!lstrcmp(cache->tszGroup, oldName)) { db_set_ts(hContact, "CList", "Group", szName); diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp index 00d6817fb8..3c3dc12ef2 100644 --- a/src/modules/clist/movetogroup.cpp +++ b/src/modules/clist/movetogroup.cpp @@ -101,7 +101,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)lphGroupsItems[i], 0); lphGroupsItems.destroy(); - ptrT szContactGroup( db_get_tsa((HANDLE)wParam, "CList", "Group")); + ptrT szContactGroup(db_get_tsa((HCONTACT)wParam, "CList", "Group")); int pos = 1000; diff --git a/src/modules/database/dbintf.cpp b/src/modules/database/dbintf.cpp index a4a4e7a1a7..c07ab7502f 100644 --- a/src/modules/database/dbintf.cpp +++ b/src/modules/database/dbintf.cpp @@ -48,7 +48,7 @@ static INT_PTR srvGetContactCount(WPARAM, LPARAM) static INT_PTR srvDeleteContact(WPARAM wParam, LPARAM) { DBVARIANT dbv = {0}; - if (!db_get_ts((HANDLE)wParam, "ContactPhoto", "File", &dbv)) { + if (!db_get_ts((HCONTACT)wParam, "ContactPhoto", "File", &dbv)) { DeleteFile(dbv.ptszVal); db_free(&dbv); } diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index 977248f906..045967ed1d 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -112,7 +112,7 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam) // EVENTTYPE_AUTHREQUEST: uin(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ) // EVENTTYPE_ADDED: uin(DWORD), hContact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ) DWORD uin = *(DWORD*)dbei->pBlob; - HANDLE hContact = (HANDLE)*(DWORD*)(dbei->pBlob + sizeof(DWORD)); + HCONTACT hContact = (HCONTACT)*(DWORD*)(dbei->pBlob + sizeof(DWORD)); char *buf = LPSTR(dbei->pBlob) + sizeof(DWORD)*2; ptrT tszNick(getEventString(dbei, buf)); ptrT tszFirst(getEventString(dbei, buf)); diff --git a/src/modules/extraicons/BaseExtraIcon.cpp b/src/modules/extraicons/BaseExtraIcon.cpp index 0baffeba67..e60276bad4 100644 --- a/src/modules/extraicons/BaseExtraIcon.cpp +++ b/src/modules/extraicons/BaseExtraIcon.cpp @@ -65,13 +65,13 @@ void BaseExtraIcon::setDescIcon(const char *icon) szDescIcon = mir_strdup(icon); } -void BaseExtraIcon::onClick(HANDLE hContact) +void BaseExtraIcon::onClick(HCONTACT hContact) { if (OnClick != NULL) OnClick((WPARAM)hContact, (LPARAM)ConvertToClistSlot(slot), onClickParam); } -int BaseExtraIcon::ClistSetExtraIcon(HANDLE hContact, HANDLE hImage) +int BaseExtraIcon::ClistSetExtraIcon(HCONTACT hContact, HANDLE hImage) { ExtraIcon *tmp = extraIconsByHandle[id - 1]; if (tmp != this) diff --git a/src/modules/extraicons/CallbackExtraIcon.cpp b/src/modules/extraicons/CallbackExtraIcon.cpp index b271aef8bb..6c83193971 100644 --- a/src/modules/extraicons/CallbackExtraIcon.cpp +++ b/src/modules/extraicons/CallbackExtraIcon.cpp @@ -50,7 +50,7 @@ void CallbackExtraIcon::rebuildIcons() RebuildIcons(0, 0); } -void CallbackExtraIcon::applyIcon(HANDLE hContact) +void CallbackExtraIcon::applyIcon(HCONTACT hContact) { if (!isEnabled() || hContact == NULL) return; @@ -61,7 +61,7 @@ void CallbackExtraIcon::applyIcon(HANDLE hContact) ApplyIcon((WPARAM)hContact, 0); } -int CallbackExtraIcon::setIcon(int id, HANDLE hContact, HANDLE icon) +int CallbackExtraIcon::setIcon(int id, HCONTACT hContact, HANDLE icon) { if (!isEnabled() || hContact == NULL || id != this->id) return -1; @@ -69,7 +69,7 @@ int CallbackExtraIcon::setIcon(int id, HANDLE hContact, HANDLE icon) return ClistSetExtraIcon(hContact, icon); } -int CallbackExtraIcon::setIconByName(int id, HANDLE hContact, const char *icon) +int CallbackExtraIcon::setIconByName(int id, HCONTACT hContact, const char *icon) { return -1; } diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp index 9b968d81f1..fe75c5b1a8 100644 --- a/src/modules/extraicons/DefaultExtraIcons.cpp +++ b/src/modules/extraicons/DefaultExtraIcons.cpp @@ -33,7 +33,7 @@ ExtraIcon* GetExtraIcon(HANDLE id); HANDLE hExtraVisibility, hExtraChat, hExtraGender, hExtraProto; -static void SetVisibility(HANDLE hContact, int apparentMode, bool clear) +static void SetVisibility(HCONTACT hContact, int apparentMode, bool clear) { if (hContact == NULL) return; @@ -69,7 +69,7 @@ static void SetVisibility(HANDLE hContact, int apparentMode, bool clear) } } -static void SetGender(HANDLE hContact, int gender, bool clear) +static void SetGender(HCONTACT hContact, int gender, bool clear) { if (hContact == NULL) return; @@ -134,7 +134,7 @@ static Info infos[] = &EmailOnClick }, }; -static void SetExtraIcons(HANDLE hContact) +static void SetExtraIcons(HCONTACT hContact) { if (hContact == NULL) return; @@ -161,7 +161,7 @@ static void SetExtraIcons(HANDLE hContact) static int SettingChanged(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact == NULL) return 0; @@ -209,7 +209,7 @@ static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param) if (p == NULL) return 0; - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact == NULL) return 0; @@ -279,7 +279,7 @@ static ProtoInfo* FindProto(const char *proto) static int ProtocolApplyIcon(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; char *proto = GetContactProto(hContact); if (IsEmpty(proto)) return 0; @@ -319,7 +319,7 @@ void DefaultExtraIcons_Load() p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, LoadSkinnedIconName(p.iSkinIcon)); } - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { SetExtraIcons(hContact); SetVisibility(hContact, -1, false); SetGender(hContact, -1, false); diff --git a/src/modules/extraicons/ExtraIcon.cpp b/src/modules/extraicons/ExtraIcon.cpp index 197da8976f..0da9413ef8 100644 --- a/src/modules/extraicons/ExtraIcon.cpp +++ b/src/modules/extraicons/ExtraIcon.cpp @@ -67,7 +67,7 @@ void ExtraIcon::applyIcons() if (!isEnabled()) return; - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { // Clear to assert that it will be cleared Clist_SetExtraIcon(hContact, slot, INVALID_HANDLE_VALUE); applyIcon(hContact); diff --git a/src/modules/extraicons/ExtraIcon.h b/src/modules/extraicons/ExtraIcon.h index 31ec96a490..de259cbd9c 100644 --- a/src/modules/extraicons/ExtraIcon.h +++ b/src/modules/extraicons/ExtraIcon.h @@ -35,12 +35,12 @@ public: virtual void rebuildIcons() = 0; virtual void applyIcons(); - virtual void applyIcon(HANDLE hContact) =0 ; - virtual void onClick(HANDLE hContact) = 0; + virtual void applyIcon(HCONTACT hContact) =0 ; + virtual void onClick(HCONTACT hContact) = 0; - virtual int setIcon(int id, HANDLE hContact, HANDLE icon) = 0; - virtual int setIconByName(int id, HANDLE hContact, const char* icon) = 0; - virtual void storeIcon(HANDLE hContact, void *icon) {}; + virtual int setIcon(int id, HCONTACT hContact, HANDLE icon) = 0; + virtual int setIconByName(int id, HCONTACT hContact, const char* icon) = 0; + virtual void storeIcon(HCONTACT hContact, void *icon) {}; virtual const char *getName() const; virtual const TCHAR *getDescription() const = 0; @@ -55,7 +55,7 @@ public: virtual bool isEnabled() const; - virtual int ClistSetExtraIcon(HANDLE hContact, HANDLE hImage) = 0; + virtual int ClistSetExtraIcon(HCONTACT hContact, HANDLE hImage) = 0; int hLangpack; @@ -82,10 +82,10 @@ public: virtual void setDescIcon(const char *icon); virtual int getType() const =0; - virtual void onClick(HANDLE hContact); + virtual void onClick(HCONTACT hContact); virtual void setOnClick(MIRANDAHOOKPARAM OnClick, LPARAM param); - virtual int ClistSetExtraIcon(HANDLE hContact, HANDLE hImage); + virtual int ClistSetExtraIcon(HCONTACT hContact, HANDLE hImage); protected: int id; @@ -108,10 +108,10 @@ public: virtual int getType() const; virtual void rebuildIcons(); - virtual void applyIcon(HANDLE hContact); + virtual void applyIcon(HCONTACT hContact); - virtual int setIcon(int id, HANDLE hContact, HANDLE icon); - virtual int setIconByName(int id, HANDLE hContact, const char* icon); + virtual int setIcon(int id, HCONTACT hContact, HANDLE icon); + virtual int setIconByName(int id, HCONTACT hContact, const char* icon); private: int(*RebuildIcons)(WPARAM wParam, LPARAM lParam); @@ -132,11 +132,11 @@ public: virtual int getType() const; virtual void rebuildIcons(); - virtual void applyIcon(HANDLE hContact); + virtual void applyIcon(HCONTACT hContact); - virtual int setIcon(int id, HANDLE hContact, HANDLE icon); - virtual int setIconByName(int id, HANDLE hContact, const char* icon); - virtual void storeIcon(HANDLE hContact, void *icon); + virtual int setIcon(int id, HCONTACT hContact, HANDLE icon); + virtual int setIconByName(int id, HCONTACT hContact, const char* icon); + virtual void storeIcon(HCONTACT hContact, void *icon); }; ///////////////////////////////////////////////////////////////////////////////////////// @@ -144,7 +144,7 @@ public: class ExtraIconGroup : public ExtraIcon { - int internalSetIcon(int id, HANDLE hContact, HANDLE icon, bool bByName); + int internalSetIcon(int id, HCONTACT hContact, HANDLE icon, bool bByName); public: ExtraIconGroup(const char *name); virtual ~ExtraIconGroup(); @@ -152,11 +152,11 @@ public: virtual void addExtraIcon(BaseExtraIcon *extra); virtual void rebuildIcons(); - virtual void applyIcon(HANDLE hContact); - virtual void onClick(HANDLE hContact); + virtual void applyIcon(HCONTACT hContact); + virtual void onClick(HCONTACT hContact); - virtual int setIcon(int id, HANDLE hContact, HANDLE icon); - virtual int setIconByName(int id, HANDLE hContact, const char *icon); + virtual int setIcon(int id, HCONTACT hContact, HANDLE icon); + virtual int setIconByName(int id, HCONTACT hContact, const char *icon); virtual const TCHAR* getDescription() const; virtual const char* getDescIcon() const; @@ -167,14 +167,14 @@ public: LIST items; - virtual int ClistSetExtraIcon(HANDLE hContact, HANDLE hImage); + virtual int ClistSetExtraIcon(HCONTACT hContact, HANDLE hImage); protected: ptrT tszDescription; bool setValidExtraIcon; bool insideApply; - virtual ExtraIcon *getCurrentItem(HANDLE hContact) const; + virtual ExtraIcon *getCurrentItem(HCONTACT hContact) const; }; #endif // __EXTRAICON_H__ diff --git a/src/modules/extraicons/ExtraIconGroup.cpp b/src/modules/extraicons/ExtraIconGroup.cpp index 5ec33e2b2c..9df088c1c8 100644 --- a/src/modules/extraicons/ExtraIconGroup.cpp +++ b/src/modules/extraicons/ExtraIconGroup.cpp @@ -54,7 +54,7 @@ void ExtraIconGroup::rebuildIcons() items[i]->rebuildIcons(); } -void ExtraIconGroup::applyIcon(HANDLE hContact) +void ExtraIconGroup::applyIcon(HCONTACT hContact) { if (!isEnabled() || hContact == NULL) return; @@ -91,7 +91,7 @@ void ExtraIconGroup::setSlot(int slot) items[i]->setSlot(slot); } -ExtraIcon * ExtraIconGroup::getCurrentItem(HANDLE hContact) const +ExtraIcon * ExtraIconGroup::getCurrentItem(HCONTACT hContact) const { int id = (int)db_get_dw(hContact, MODULE_NAME, szName, 0); if (id < 1) @@ -104,24 +104,24 @@ ExtraIcon * ExtraIconGroup::getCurrentItem(HANDLE hContact) const return NULL; } -void ExtraIconGroup::onClick(HANDLE hContact) +void ExtraIconGroup::onClick(HCONTACT hContact) { ExtraIcon *extra = getCurrentItem(hContact); if (extra != NULL) extra->onClick(hContact); } -int ExtraIconGroup::setIcon(int id, HANDLE hContact, HANDLE value) +int ExtraIconGroup::setIcon(int id, HCONTACT hContact, HANDLE value) { return internalSetIcon(id, hContact, (void*)value, false); } -int ExtraIconGroup::setIconByName(int id, HANDLE hContact, const char *value) +int ExtraIconGroup::setIconByName(int id, HCONTACT hContact, const char *value) { return internalSetIcon(id, hContact, (void*)value, true); } -int ExtraIconGroup::internalSetIcon(int id, HANDLE hContact, void *value, bool bByName) +int ExtraIconGroup::internalSetIcon(int id, HCONTACT hContact, void *value, bool bByName) { if (insideApply) { for (int i=0; i < items.getCount(); i++) @@ -208,7 +208,7 @@ int ExtraIconGroup::getType() const return EXTRAICON_TYPE_GROUP; } -int ExtraIconGroup::ClistSetExtraIcon(HANDLE hContact, HANDLE hImage) +int ExtraIconGroup::ClistSetExtraIcon(HCONTACT hContact, HANDLE hImage) { if (hImage != INVALID_HANDLE_VALUE) setValidExtraIcon = true; diff --git a/src/modules/extraicons/IcolibExtraIcon.cpp b/src/modules/extraicons/IcolibExtraIcon.cpp index 78c020ce3a..acf38d3ead 100644 --- a/src/modules/extraicons/IcolibExtraIcon.cpp +++ b/src/modules/extraicons/IcolibExtraIcon.cpp @@ -46,7 +46,7 @@ void IcolibExtraIcon::rebuildIcons() { } -void IcolibExtraIcon::applyIcon(HANDLE hContact) +void IcolibExtraIcon::applyIcon(HCONTACT hContact) { if (!isEnabled() || hContact == NULL) return; @@ -60,7 +60,7 @@ void IcolibExtraIcon::applyIcon(HANDLE hContact) ClistSetExtraIcon(hContact, hImage); } -int IcolibExtraIcon::setIcon(int id, HANDLE hContact, HANDLE hIcoLib) +int IcolibExtraIcon::setIcon(int id, HCONTACT hContact, HANDLE hIcoLib) { if (hContact == NULL || id != this->id) return -1; @@ -84,7 +84,7 @@ int IcolibExtraIcon::setIcon(int id, HANDLE hContact, HANDLE hIcoLib) return 0; } -int IcolibExtraIcon::setIconByName(int id, HANDLE hContact, const char *icon) +int IcolibExtraIcon::setIconByName(int id, HCONTACT hContact, const char *icon) { if (hContact == NULL || id != this->id) return -1; @@ -106,7 +106,7 @@ int IcolibExtraIcon::setIconByName(int id, HANDLE hContact, const char *icon) return 0; } -void IcolibExtraIcon::storeIcon(HANDLE hContact, void *icon) +void IcolibExtraIcon::storeIcon(HCONTACT hContact, void *icon) { if (hContact == NULL) return; diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp index 99abd93ed0..a85fb18a28 100644 --- a/src/modules/extraicons/extraicons.cpp +++ b/src/modules/extraicons/extraicons.cpp @@ -82,7 +82,7 @@ int ExtraImage_ExtraIDToColumnNum(int extra) return (extra < 1 || extra > EXTRA_ICON_COUNT) ? -1 : extra-1; } -int Clist_SetExtraIcon(HANDLE hContact, int slot, HANDLE hImage) +int Clist_SetExtraIcon(HCONTACT hContact, int slot, HANDLE hImage) { if (cli.hwndContactTree == 0) return -1; @@ -248,7 +248,7 @@ int ClistExtraListRebuild(WPARAM wParam, LPARAM lParam) int ClistExtraImageApply(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact == NULL) return 0; @@ -262,7 +262,7 @@ int ClistExtraImageApply(WPARAM wParam, LPARAM lParam) int ClistExtraClick(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact == NULL) return 0; @@ -313,7 +313,7 @@ void fnReloadExtraIcons() bImageCreated = true; } -void fnSetAllExtraIcons(HANDLE hContact) +void fnSetAllExtraIcons(HCONTACT hContact) { if (cli.hwndContactTree == 0) return; diff --git a/src/modules/extraicons/extraicons.h b/src/modules/extraicons/extraicons.h index 3926cdc963..cedddefb0c 100644 --- a/src/modules/extraicons/extraicons.h +++ b/src/modules/extraicons/extraicons.h @@ -41,14 +41,14 @@ ExtraIcon * GetExtraIconBySlot(int slot); int GetNumberOfSlots(); int ConvertToClistSlot(int slot); -int Clist_SetExtraIcon(HANDLE hContact, int slot, HANDLE hImage); +int Clist_SetExtraIcon(HCONTACT hContact, int slot, HANDLE hImage); void DefaultExtraIcons_Load(); HANDLE ExtraIcon_Add(HICON hIcon); void fnReloadExtraIcons(); -void fnSetAllExtraIcons(HANDLE hContact); +void fnSetAllExtraIcons(HCONTACT hContact); static inline BOOL IsEmpty(const char *str) { diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp index 8432b945a9..19117a0de8 100644 --- a/src/modules/extraicons/options_ei.cpp +++ b/src/modules/extraicons/options_ei.cpp @@ -70,7 +70,7 @@ BOOL ScreenToClient(HWND hWnd, LPRECT lpRect) static void RemoveExtraIcons(int slot) { - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) Clist_SetExtraIcon(hContact, slot, INVALID_HANDLE_VALUE); } diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp index 57dcb2bc4f..d3f32ea6d5 100644 --- a/src/modules/findadd/searchresults.cpp +++ b/src/modules/findadd/searchresults.cpp @@ -379,15 +379,13 @@ void ShowMoreOptionsMenu(HWND hwndDlg, int x, int y) } case IDC_DETAILS: { - HANDLE hContact; - hContact = (HANDLE)CallProtoServiceInt(NULL,lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr); + HCONTACT hContact = (HCONTACT)CallProtoServiceInt(NULL, lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr); CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); break; } case IDC_SENDMESSAGE: { - HANDLE hContact; - hContact = (HANDLE)CallProtoServiceInt(NULL,lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr); + HCONTACT hContact = (HCONTACT)CallProtoServiceInt(NULL, lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr); CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, (LPARAM)(const char*)NULL); break; } diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp index 3b63ba8b8c..74683b5c18 100644 --- a/src/modules/ignore/ignore.cpp +++ b/src/modules/ignore/ignore.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX] = {PF1_IMRECV, PF1_URLRECV, PF1_FILERECV, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}; static const DWORD ignoreIdToPf4[IGNOREEVENT_MAX] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, PF4_SUPPORTTYPING}; -static DWORD GetMask(HANDLE hContact) +static DWORD GetMask(HCONTACT hContact) { DWORD mask = db_get_dw(hContact, "Ignore", "Mask1", (DWORD)(-1)); if (mask == (DWORD)(-1)) { @@ -145,7 +145,7 @@ static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int } } -static void InitialiseItem(HWND hwndList, HANDLE hContact, HANDLE hItem, DWORD proto1Caps, DWORD proto4Caps) +static void InitialiseItem(HWND hwndList, HCONTACT hContact, HANDLE hItem, DWORD proto1Caps, DWORD proto4Caps) { DWORD mask = GetMask(hContact); for (int i=0; i < IGNOREEVENT_MAX; i++) @@ -156,7 +156,7 @@ static void InitialiseItem(HWND hwndList, HANDLE hContact, HANDLE hItem, DWORD p SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX+1, 2)); } -static void SaveItemMask(HWND hwndList, HANDLE hContact, HANDLE hItem, const char *pszSetting) +static void SaveItemMask(HWND hwndList, HCONTACT hContact, HANDLE hItem, const char *pszSetting) { DWORD mask = 0; for (int i=0; i < IGNOREEVENT_MAX; i++) { @@ -169,7 +169,7 @@ static void SaveItemMask(HWND hwndList, HANDLE hContact, HANDLE hItem, const cha static void SetAllContactIcons(HWND hwndList) { - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0); if (hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == EMPTY_EXTRA_ICON) { DWORD proto1Caps, proto4Caps; @@ -296,7 +296,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0); if (hItem) SaveItemMask( GetDlgItem(hwndDlg, IDC_LIST), hContact, hItem, "Mask1"); if (SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) @@ -338,7 +338,7 @@ static int IgnoreOptInitialise(WPARAM wParam, LPARAM) static INT_PTR IsIgnored(WPARAM wParam, LPARAM lParam) { - DWORD mask = GetMask((HANDLE)wParam); + DWORD mask = GetMask((HCONTACT)wParam); if (lParam < 1 || lParam > IGNOREEVENT_MAX) return 1; return (mask >> (lParam-1))&1; @@ -346,20 +346,20 @@ static INT_PTR IsIgnored(WPARAM wParam, LPARAM lParam) static INT_PTR Ignore(WPARAM wParam, LPARAM lParam) { - DWORD mask = GetMask((HANDLE)wParam); + DWORD mask = GetMask((HCONTACT)wParam); if ((lParam < 1 || lParam > IGNOREEVENT_MAX) && lParam != IGNOREEVENT_ALL) return 1; if (lParam == IGNOREEVENT_ALL) mask = (1 << IGNOREEVENT_MAX)-1; else mask |= 1 << (lParam-1); - db_set_dw((HANDLE)wParam, "Ignore", "Mask1", mask); + db_set_dw((HCONTACT)wParam, "Ignore", "Mask1", mask); return 0; } static INT_PTR Unignore(WPARAM wParam, LPARAM lParam) { - DWORD mask = GetMask((HANDLE)wParam); + DWORD mask = GetMask((HCONTACT)wParam); if ((lParam < 1 || lParam > IGNOREEVENT_MAX) && lParam != IGNOREEVENT_ALL) return 1; @@ -367,7 +367,7 @@ static INT_PTR Unignore(WPARAM wParam, LPARAM lParam) mask = 0; else mask &= ~(1 << (lParam-1)); - db_set_dw((HANDLE)wParam, "Ignore", "Mask1", mask); + db_set_dw((HCONTACT)wParam, "Ignore", "Mask1", mask); return 0; } @@ -403,7 +403,7 @@ static int IgnoreAddedNotify(WPARAM, LPARAM lParam) { DBEVENTINFO *dbei = (DBEVENTINFO*)lParam; if (dbei && dbei->eventType == EVENTTYPE_ADDED && dbei->pBlob != NULL) { - HANDLE hContact = DbGetAuthEventContact(dbei); + HCONTACT hContact = DbGetAuthEventContact(dbei); if (CallService(MS_DB_CONTACT_IS, (WPARAM)hContact, 0) && IsIgnored((WPARAM)hContact, IGNOREEVENT_YOUWEREADDED)) return 1; } diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index ea474771a7..e3ef2977c5 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -199,7 +199,7 @@ void WriteDbAccounts() ///////////////////////////////////////////////////////////////////////////////////////// static int OnContactDeleted(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact) { PROTOACCOUNT* pa = Proto_GetAccount(hContact); if (Proto_IsAccountEnabled(pa) && pa->ppro) @@ -210,7 +210,7 @@ static int OnContactDeleted(WPARAM wParam, LPARAM lParam) static int OnDbSettingsChanged(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact) { PROTOACCOUNT* pa = Proto_GetAccount(hContact); if (Proto_IsAccountEnabled(pa) && pa->ppro) @@ -317,7 +317,7 @@ static INT_PTR stub11(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam) static INT_PTR stub12(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam) { - return (INT_PTR)ppi->GetCaps(wParam, (HANDLE)lParam); + return (INT_PTR)ppi->GetCaps(wParam, (HCONTACT)lParam); } static INT_PTR stub13(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM) @@ -550,9 +550,9 @@ void DeactivateAccount(PROTOACCOUNT* pa, bool bIsDynamic, bool bErase) void EraseAccount(const char* pszModuleName) { // remove protocol contacts first - HANDLE hContact = db_find_first(); + HCONTACT hContact = db_find_first(); while (hContact != NULL) { - HANDLE h1 = hContact; + HCONTACT h1 = hContact; hContact = db_find_next(h1); char *szProto = GetContactProto(hContact); diff --git a/src/modules/protocols/protochains.cpp b/src/modules/protocols/protochains.cpp index e14837c18f..cc55405227 100644 --- a/src/modules/protocols/protochains.cpp +++ b/src/modules/protocols/protochains.cpp @@ -56,7 +56,7 @@ static int GetProtocolP(MCONTACT hContact, char *szBuf, int cbLen) ///////////////////////////////////////////////////////////////////////////////////////// -INT_PTR CallContactService(HANDLE hContact, const char *szProtoService, WPARAM wParam, LPARAM lParam) +INT_PTR CallContactService(HCONTACT hContact, const char *szProtoService, WPARAM wParam, LPARAM lParam) { INT_PTR ret; CCSDATA ccs = { hContact, szProtoService, wParam, lParam }; @@ -161,7 +161,7 @@ static INT_PTR Proto_RecvChain(WPARAM wParam, LPARAM lParam) return ret; } -PROTOACCOUNT* __fastcall Proto_GetAccount(HANDLE hContact) +PROTOACCOUNT* __fastcall Proto_GetAccount(HCONTACT hContact) { if (hContact == NULL) return NULL; @@ -175,13 +175,13 @@ PROTOACCOUNT* __fastcall Proto_GetAccount(HANDLE hContact) static INT_PTR Proto_GetContactBaseProto(WPARAM wParam, LPARAM) { - PROTOACCOUNT *pa = Proto_GetAccount((HANDLE)wParam); + PROTOACCOUNT *pa = Proto_GetAccount((HCONTACT)wParam); return (INT_PTR)(Proto_IsAccountEnabled(pa) ? pa->szModuleName : NULL); } static INT_PTR Proto_GetContactBaseAccount(WPARAM wParam, LPARAM) { - PROTOACCOUNT *pa = Proto_GetAccount((HANDLE)wParam); + PROTOACCOUNT *pa = Proto_GetAccount((HCONTACT)wParam); return (INT_PTR)(pa ? pa->szModuleName : NULL); } @@ -210,14 +210,14 @@ static INT_PTR Proto_AddToContact(WPARAM wParam, LPARAM lParam) if (pd == NULL) { PROTOACCOUNT *pa = Proto_GetAccount(szProto); if (pa) { - db_set_s((HANDLE)wParam, "Protocol", "p", szProto); + db_set_s((HCONTACT)wParam, "Protocol", "p", szProto); return 0; } return 1; } if (pd->type == PROTOTYPE_PROTOCOL || pd->type == PROTOTYPE_VIRTUAL) - db_set_s((HANDLE)wParam, "Protocol", "p", szProto); + db_set_s((HCONTACT)wParam, "Protocol", "p", szProto); return 0; } @@ -228,7 +228,7 @@ static INT_PTR Proto_RemoveFromContact(WPARAM wParam, LPARAM lParam) case 0: return 1; case -1: - db_unset((HANDLE)wParam, "Protocol", "p"); + db_unset((HCONTACT)wParam, "Protocol", "p"); } return 0; diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index 8ef8aadb2d..f2a30976e7 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -203,7 +203,7 @@ static INT_PTR Proto_AuthRecv(WPARAM wParam, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // User Typing Notification services -static int Proto_ValidTypingContact(HANDLE hContact, char *szProto) +static int Proto_ValidTypingContact(HCONTACT hContact, char *szProto) { if (!hContact || !szProto) return 0; @@ -214,11 +214,11 @@ static int Proto_ValidTypingContact(HANDLE hContact, char *szProto) static INT_PTR Proto_SelfIsTyping(WPARAM wParam, LPARAM lParam) { if (lParam == PROTOTYPE_SELFTYPING_OFF || lParam == PROTOTYPE_SELFTYPING_ON) { - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); if (!szProto) return 0; - if (Proto_ValidTypingContact((HANDLE)wParam, szProto)) + if (Proto_ValidTypingContact((HCONTACT)wParam, szProto)) CallProtoServiceInt(NULL,szProto, PSS_USERISTYPING, wParam, lParam); } @@ -228,7 +228,7 @@ static INT_PTR Proto_SelfIsTyping(WPARAM wParam, LPARAM lParam) static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam) { int type = (int)lParam; - char *szProto = GetContactProto((HANDLE)wParam); + char *szProto = GetContactProto((HCONTACT)wParam); if (!szProto) return 0; @@ -238,7 +238,7 @@ static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam) if (type < PROTOTYPE_CONTACTTYPING_OFF) return 0; - if (Proto_ValidTypingContact((HANDLE)wParam, szProto)) + if (Proto_ValidTypingContact((HCONTACT)wParam, szProto)) NotifyEventHooks(hTypeEvent, wParam, lParam); return 0; @@ -246,25 +246,21 @@ static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam) void Proto_SetStatus(const char *szProto, unsigned status) { - if (CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) - { - TCHAR* awayMsg = (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGW, (WPARAM) status, (LPARAM) szProto); - if ((INT_PTR)awayMsg == CALLSERVICE_NOTFOUND) - { - char* awayMsgA = (char*)CallService(MS_AWAYMSG_GETSTATUSMSG, (WPARAM) status, (LPARAM) szProto); - if ((INT_PTR)awayMsgA != CALLSERVICE_NOTFOUND) - { + if (CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) { + TCHAR* awayMsg = (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGW, (WPARAM)status, (LPARAM)szProto); + if ((INT_PTR)awayMsg == CALLSERVICE_NOTFOUND) { + char* awayMsgA = (char*)CallService(MS_AWAYMSG_GETSTATUSMSG, (WPARAM)status, (LPARAM)szProto); + if ((INT_PTR)awayMsgA != CALLSERVICE_NOTFOUND) { awayMsg = mir_a2t(awayMsgA); mir_free(awayMsgA); } } - if ((INT_PTR)awayMsg != CALLSERVICE_NOTFOUND) - { - CallProtoServiceInt(NULL,szProto, PS_SETAWAYMSGT, status, (LPARAM) awayMsg); + if ((INT_PTR)awayMsg != CALLSERVICE_NOTFOUND) { + CallProtoServiceInt(NULL, szProto, PS_SETAWAYMSGT, status, (LPARAM)awayMsg); mir_free(awayMsg); } } - CallProtoServiceInt(NULL,szProto, PS_SETSTATUS, status, 0); + CallProtoServiceInt(NULL, szProto, PS_SETSTATUS, status, 0); } char** __fastcall Proto_FilesMatrixA(wchar_t **files) @@ -376,7 +372,7 @@ INT_PTR CallProtoService(const char* szModule, const char* szService, WPARAM wPa return CallProtoServiceInt(NULL, szModule, szService, wParam, lParam); } -INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam) +INT_PTR CallProtoServiceInt(HCONTACT hContact, const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam) { PROTOACCOUNT* pa = Proto_GetAccount(szModule); if (pa && !pa->bOldProto) { @@ -446,7 +442,7 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s else return (INT_PTR)ppi->FileResume((HANDLE)wParam, &pfr->action, (const PROTOCHAR**)&pfr->szFilename); } - case 12: return (INT_PTR)ppi->GetCaps(wParam, (HANDLE)lParam); + case 12: return (INT_PTR)ppi->GetCaps(wParam, (HCONTACT)lParam); case 13: return (INT_PTR)Proto_GetIcon(ppi, wParam); case 14: return (INT_PTR)ppi->GetInfo(hContact, wParam); case 15: @@ -473,7 +469,7 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s case 21: return (INT_PTR)ppi->RecvFile(hContact, (PROTOFILEEVENT*)lParam); case 22: return (INT_PTR)ppi->RecvMsg(hContact, (PROTORECVEVENT*)lParam); case 23: return (INT_PTR)ppi->RecvUrl(hContact, (PROTORECVEVENT*)lParam); - case 24: return (INT_PTR)ppi->SendContacts(hContact, LOWORD(wParam), HIWORD(wParam), (HANDLE*)lParam); + case 24: return (INT_PTR)ppi->SendContacts(hContact, LOWORD(wParam), HIWORD(wParam), (HCONTACT*)lParam); case 25: if (ppi->m_iVersion > 1) { TCHAR** files = Proto_FilesMatrixU((char**)lParam); @@ -494,7 +490,7 @@ INT_PTR CallProtoServiceInt(HANDLE hContact, const char *szModule, const char *s return (INT_PTR)ppi->SetAwayMsg(wParam, StrConvT((char*)lParam)); else return (INT_PTR)ppi->SetAwayMsg(wParam, (TCHAR*)lParam); - case 34: return (INT_PTR)ppi->UserIsTyping((HANDLE)wParam, lParam); + case 34: return (INT_PTR)ppi->UserIsTyping((HCONTACT)wParam, lParam); case 35: lstrcpynA((char*)lParam, ppi->m_szModuleName, wParam); return 0; case 36: return ppi->m_iStatus; diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp index ba6e40f01e..41b4a7991a 100644 --- a/src/modules/protocols/protoint.cpp +++ b/src/modules/protocols/protoint.cpp @@ -57,23 +57,23 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (HANDLE)ProtoCallService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent); } - int __cdecl Authorize(HANDLE hContact) + int __cdecl Authorize(HANDLE hDbEvent) { - return (int)ProtoCallService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hContact, 0); + return (int)ProtoCallService(m_szModuleName, PS_AUTHALLOW, (WPARAM)hDbEvent, 0); } - int __cdecl AuthDeny(HANDLE hContact, const TCHAR* szReason) + int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) { - return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, (WPARAM)hContact, (LPARAM)StrConvA(szReason)); + return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, (WPARAM)hDbEvent, (LPARAM)StrConvA(szReason)); } - int __cdecl AuthRecv(HANDLE hContact, PROTORECVEVENT* evt) + int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* evt) { CCSDATA ccs = { hContact, PSR_AUTH, 0, (LPARAM)evt }; return (int)ProtoCallService(m_szModuleName, PSR_AUTH, 0, (LPARAM)&ccs); } - int __cdecl AuthRequest(HANDLE hContact, const TCHAR* szMessage) + int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage) { CCSDATA ccs = { hContact, PSS_AUTHREQUEST, 0, (LPARAM)szMessage }; ccs.lParam = (LPARAM)mir_t2a(szMessage); @@ -87,7 +87,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (HANDLE)ProtoCallService(m_szModuleName, PS_CHANGEINFO, iInfoType, (LPARAM)pInfoData); } - HANDLE __cdecl FileAllow(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szPath) + HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath) { CCSDATA ccs = { hContact, PSS_FILEALLOW, (WPARAM)hTransfer, (LPARAM)szPath }; @@ -97,13 +97,13 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return res; } - int __cdecl FileCancel(HANDLE hContact, HANDLE hTransfer) + int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer) { CCSDATA ccs = { hContact, PSS_FILECANCEL, (WPARAM)hTransfer, 0 }; return (int)ProtoCallService(m_szModuleName, PSS_FILECANCEL, 0, (LPARAM)&ccs); } - int __cdecl FileDeny(HANDLE hContact, HANDLE hTransfer, const PROTOCHAR* szReason) + int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason) { CCSDATA ccs = { hContact, PSS_FILEDENY, (WPARAM)hTransfer, (LPARAM)szReason }; @@ -125,7 +125,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return res; } - DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact) + DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact) { return (DWORD_PTR)ProtoCallService(m_szModuleName, PS_GETCAPS, type, (LPARAM)hContact); } @@ -135,7 +135,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (HICON)ProtoCallService(m_szModuleName, PS_LOADICON, iconIndex, 0); } - int __cdecl GetInfo(HANDLE hContact, int flags) + int __cdecl GetInfo(HCONTACT hContact, int flags) { CCSDATA ccs = { hContact, PSS_GETINFO, flags, 0 }; return ProtoCallService(m_szModuleName, PSS_GETINFO, 0, (LPARAM)&ccs); @@ -176,37 +176,37 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (HWND)ProtoCallService(m_szModuleName, PS_CREATEADVSEARCHUI, 0, (LPARAM)owner); } - int __cdecl RecvContacts(HANDLE hContact, PROTORECVEVENT* evt) + int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* evt) { CCSDATA ccs = { hContact, PSR_CONTACTS, 0, (LPARAM)evt }; return (int)ProtoCallService(m_szModuleName, PSR_CONTACTS, 0, (LPARAM)&ccs); } - int __cdecl RecvFile(HANDLE hContact, PROTOFILEEVENT* evt) + int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt) { CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)evt }; return ProtoCallService(m_szModuleName, PSR_FILE, 0, (LPARAM)&ccs); } - int __cdecl RecvMsg(HANDLE hContact, PROTORECVEVENT* evt) + int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* evt) { CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)evt }; return (int)ProtoCallService(m_szModuleName, PSR_MESSAGE, 0, (LPARAM)&ccs); } - int __cdecl RecvUrl(HANDLE hContact, PROTORECVEVENT* evt) + int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* evt) { CCSDATA ccs = { hContact, PSR_URL, 0, (LPARAM)evt }; return (int)ProtoCallService(m_szModuleName, PSR_URL, 0, (LPARAM)&ccs); } - int __cdecl SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList) + int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) { CCSDATA ccs = { hContact, PSS_CONTACTS, MAKEWPARAM(flags, nContacts), (LPARAM)hContactsList }; return (int)ProtoCallService(m_szModuleName, PSS_CONTACTS, 0, (LPARAM)&ccs); } - HANDLE __cdecl SendFile(HANDLE hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) + HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles) { CCSDATA ccs = { hContact, PSS_FILE, (WPARAM)szDescription, (LPARAM)ppszFiles }; @@ -218,19 +218,19 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return res; } - int __cdecl SendMsg(HANDLE hContact, int flags, const char* msg) + int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg) { CCSDATA ccs = { hContact, PSS_MESSAGE, flags, (LPARAM)msg }; return (int)ProtoCallService(m_szModuleName, PSS_MESSAGE, 0, (LPARAM)&ccs); } - int __cdecl SendUrl(HANDLE hContact, int flags, const char* url) + int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url) { CCSDATA ccs = { hContact, PSS_URL, flags, (LPARAM)url }; return (int)ProtoCallService(m_szModuleName, PSS_URL, 0, (LPARAM)&ccs); } - int __cdecl SetApparentMode(HANDLE hContact, int mode) + int __cdecl SetApparentMode(HCONTACT hContact, int mode) { CCSDATA ccs = { hContact, PSS_SETAPPARENTMODE, mode, 0 }; return (int)ProtoCallService(m_szModuleName, PSS_SETAPPARENTMODE, 0, (LPARAM)&ccs); @@ -241,13 +241,13 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (int)ProtoCallService(m_szModuleName, PS_SETSTATUS, iNewStatus, 0); } - HANDLE __cdecl GetAwayMsg(HANDLE hContact) + HANDLE __cdecl GetAwayMsg(HCONTACT hContact) { CCSDATA ccs = { hContact, PSS_GETAWAYMSG, 0, 0 }; return (HANDLE)ProtoCallService(m_szModuleName, PSS_GETAWAYMSG, 0, (LPARAM)&ccs); } - int __cdecl RecvAwayMsg(HANDLE hContact, int statusMode, PROTORECVEVENT* evt) + int __cdecl RecvAwayMsg(HCONTACT hContact, int statusMode, PROTORECVEVENT* evt) { CCSDATA ccs = { hContact, PSR_AWAYMSG, statusMode, (LPARAM)evt }; return (int)ProtoCallService(m_szModuleName, PSR_AWAYMSG, 0, (LPARAM)&ccs); @@ -258,7 +258,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return (int)ProtoCallService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)StrConvA(msg)); } - int __cdecl UserIsTyping(HANDLE hContact, int type) + int __cdecl UserIsTyping(HCONTACT hContact, int type) { CCSDATA ccs = { hContact, PSS_USERISTYPING, (WPARAM)hContact, type }; return ProtoCallService(m_szModuleName, PSS_USERISTYPING, 0, (LPARAM)&ccs); diff --git a/src/modules/srmm/statusicon.cpp b/src/modules/srmm/statusicon.cpp index 2b88911990..d74d5eac0b 100644 --- a/src/modules/srmm/statusicon.cpp +++ b/src/modules/srmm/statusicon.cpp @@ -32,7 +32,7 @@ struct StatusIconChild : public MZeroedObject mir_free(tszTooltip); } - HANDLE hContact; + HCONTACT hContact; HICON hIcon, hIconDisabled; int flags; TCHAR *tszTooltip; @@ -88,7 +88,7 @@ INT_PTR ModifyStatusIcon(WPARAM wParam, LPARAM lParam) if (p == NULL) return 1; - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact == NULL) { mir_free(p->sid.szModule); mir_free(p->sid.szTooltip); diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index b60d5c68ac..0f47fdb23a 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.cpp @@ -68,7 +68,7 @@ static INT_PTR createDirTreeW(WPARAM, LPARAM lParam) return CreateDirectoryTreeW((WCHAR*)lParam); } -TCHAR *GetContactID(HANDLE hContact) +TCHAR *GetContactID(HCONTACT hContact) { TCHAR *theValue = {0}; char *szProto = GetContactProto(hContact); @@ -114,12 +114,12 @@ static __forceinline char *_xstrselect(char *, char *s1, TCHAR *s2) { return s1; static __forceinline char *_itox(char *, int a) { return itoa(a, (char *)mir_alloc(sizeof(char)*20), 10); } static __forceinline char *mir_a2x(char *, char *s) { return mir_strdup(s); } -static __forceinline char *GetContactNickX(char *, HANDLE hContact) +static __forceinline char *GetContactNickX(char *, HCONTACT hContact) { return mir_strdup((char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0)); } -static __forceinline char *GetContactIDX(char *, HANDLE hContact) +static __forceinline char *GetContactIDX(char *, HCONTACT hContact) { TCHAR *id = GetContactID(hContact); char* res = mir_t2a(id); @@ -201,12 +201,12 @@ static __forceinline TCHAR *_xstrselect(TCHAR *, char *s1, TCHAR *s2) { return s static __forceinline TCHAR *_itox(TCHAR *, int a) { return _itot(a, (TCHAR *)mir_alloc(sizeof(TCHAR)*20), 10); } static __forceinline TCHAR *mir_a2x(TCHAR *, char *s) { return mir_a2t(s); } -static __forceinline TCHAR *GetContactNickX(TCHAR *, HANDLE hContact) +static __forceinline TCHAR *GetContactNickX(TCHAR *, HCONTACT hContact) { return mir_tstrdup((TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)); } -static __forceinline TCHAR *GetContactIDX(TCHAR *, HANDLE hContact) +static __forceinline TCHAR *GetContactIDX(TCHAR *, HCONTACT hContact) { return GetContactID(hContact); } @@ -277,7 +277,7 @@ static __forceinline TCHAR *GetPathVarX(TCHAR *, int code) } template -XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, HANDLE hContact) +XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, HCONTACT hContact) { XCHAR *theValue = NULL; XCHAR *theKey = (XCHAR *)_alloca(sizeof(XCHAR) * (keyLength + 1)); @@ -323,7 +323,7 @@ XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, HANDLE hContact) } template -XCHAR *GetVariableFromArray(REPLACEVARSARRAY *vars, XCHAR *key, size_t keyLength, HANDLE hContact, bool *bFree) +XCHAR *GetVariableFromArray(REPLACEVARSARRAY *vars, XCHAR *key, size_t keyLength, HCONTACT hContact, bool *bFree) { *bFree = false; for (REPLACEVARSARRAY *var = vars; var && var->lptzKey; ++var) diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index 174d9ea1fc..ec3442c471 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -168,7 +168,7 @@ static HANDLE timeapiGetInfoByName(LPCTSTR tszName, DWORD dwFlags) return tz; } -static HANDLE timeapiGetInfoByContact(HANDLE hContact, DWORD dwFlags) +static HANDLE timeapiGetInfoByContact(HCONTACT hContact, DWORD dwFlags) { if (hContact == NULL) return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ; @@ -227,7 +227,7 @@ static HANDLE timeapiGetInfoByContact(HANDLE hContact, DWORD dwFlags) return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ; } -static void timeapiSetInfoByContact(HANDLE hContact, HANDLE hTZ) +static void timeapiSetInfoByContact(HCONTACT hContact, HANDLE hTZ) { MIM_TIMEZONE *tz = (MIM_TIMEZONE*)hTZ; @@ -354,7 +354,7 @@ static const ListMessages *GetListMessages(HWND hWnd, DWORD dwFlags) } -static int timeapiSelectListItem(HANDLE hContact, HWND hWnd, DWORD dwFlags) +static int timeapiSelectListItem(HCONTACT hContact, HWND hWnd, DWORD dwFlags) { if (hWnd == NULL) // nothing to do return -1; @@ -386,7 +386,7 @@ static int timeapiSelectListItem(HANDLE hContact, HWND hWnd, DWORD dwFlags) } -static int timeapiPrepareList(HANDLE hContact, HWND hWnd, DWORD dwFlags) +static int timeapiPrepareList(HCONTACT hContact, HWND hWnd, DWORD dwFlags) { if (hWnd == NULL) // nothing to do return 0; @@ -408,7 +408,7 @@ static int timeapiPrepareList(HANDLE hContact, HWND hWnd, DWORD dwFlags) } -static void timeapiStoreListResult(HANDLE hContact, HWND hWnd, DWORD dwFlags) +static void timeapiStoreListResult(HCONTACT hContact, HWND hWnd, DWORD dwFlags) { const ListMessages *lstMsg = GetListMessages(hWnd, dwFlags); if (lstMsg == NULL) return; diff --git a/src/modules/utils/windowlist.cpp b/src/modules/utils/windowlist.cpp index 29569ff93e..1337795f2d 100644 --- a/src/modules/utils/windowlist.cpp +++ b/src/modules/utils/windowlist.cpp @@ -26,12 +26,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct TWindowListItem { - TWindowListItem(HANDLE _contact, HWND _wnd) : + TWindowListItem(HCONTACT _contact, HWND _wnd) : hContact(_contact), hWnd(_wnd) {} - HANDLE hContact; + HCONTACT hContact; HWND hWnd; }; diff --git a/src/modules/visibility/visibility.cpp b/src/modules/visibility/visibility.cpp index cdc7647534..449467c3e9 100644 --- a/src/modules/visibility/visibility.cpp +++ b/src/modules/visibility/visibility.cpp @@ -107,7 +107,7 @@ static void ResetListOptions(HWND hwndList) static void SetAllContactIcons(HWND hwndList) { - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0); if (hItem == NULL) continue; @@ -244,7 +244,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP case 0: if (((LPNMHDR)lParam)->code == PSN_APPLY) { - for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0); if (hItem == NULL) continue; -- cgit v1.2.3