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 ++++---- 29 files changed, 154 insertions(+), 154 deletions(-) (limited to 'src/core') 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); -- cgit v1.2.3