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 --- plugins/WebView/src/main.cpp | 2 +- plugins/WebView/src/webview.cpp | 24 +++++++++--------- plugins/WebView/src/webview.h | 12 ++++----- plugins/WebView/src/webview_alerts.cpp | 42 +++++++++++++++++--------------- plugins/WebView/src/webview_datawnd.cpp | 12 ++++----- plugins/WebView/src/webview_getdata.cpp | 3 ++- plugins/WebView/src/webview_opts.cpp | 20 +++++++-------- plugins/WebView/src/webview_services.cpp | 26 ++++++++++---------- 8 files changed, 72 insertions(+), 69 deletions(-) (limited to 'plugins/WebView') diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index a627aec43b..1432bb4c4e 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -96,7 +96,7 @@ void ChangeContactStatus(int con_stat) if (con_stat == 3) status_code = ID_STATUS_NA; - for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) + for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) db_set_w(hContact, MODULENAME, "Status", status_code); } diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index 5ce833865b..c1e00d6532 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -104,7 +104,7 @@ void FillFontListThread(void *param) /*****************************************************************************/ void TxtclrLoop() { - for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { + for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { HWND hwndDlg = WindowList_Find(hWindowList, hContact); SetDlgItemText(hwndDlg, IDC_DATA, _T("")); InvalidateRect(hwndDlg, NULL, 1); @@ -114,7 +114,7 @@ void TxtclrLoop() /*****************************************************************************/ void BGclrLoop() { - for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { + for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { HWND hwndDlg = (WindowList_Find(hWindowList, hContact)); SetDlgItemText(hwndDlg, IDC_DATA, _T("")); SendMessage(GetDlgItem(hwndDlg, IDC_DATA), EM_SETBKGNDCOLOR, 0, BackgoundClr); @@ -128,7 +128,7 @@ void StartUpdate(void *dummy) StartUpDelay = 1; Sleep(((db_get_dw(NULL, MODULENAME, START_DELAY_KEY, 0)) * SECOND)); - for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) + for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) GetData(hContact); StartUpDelay = 0; @@ -138,7 +138,7 @@ void StartUpdate(void *dummy) void ContactLoop(void *dummy) { if (StartUpDelay == 0) { - for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { + for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { GetData(hContact); Sleep(10); // avoid 100% CPU } @@ -176,7 +176,7 @@ void InitialiseGlobals(void) /*****************************************************************************/ int Doubleclick(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; char *szProto = GetContactProto(hContact); if ( lstrcmpA(MODULENAME, szProto)) return 0; @@ -371,7 +371,7 @@ int ModulesLoaded(WPARAM, LPARAM) /*****************************************************************************/ INT_PTR DataWndMenuCommand(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; HWND hwndDlg = WindowList_Find(hWindowList, hContact); if (hwndDlg != NULL) { DestroyWindow(hwndDlg); @@ -432,7 +432,7 @@ INT_PTR AddContactMenuCommand(WPARAM, LPARAM) } /*****************************************************************************/ -int OnTopMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact) +int OnTopMenuCommand(WPARAM wParam, LPARAM lParam, HCONTACT singlecontact) { int ontop = 0; int done = 0; @@ -455,7 +455,7 @@ int OnTopMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact) /*****************************************************************************/ INT_PTR WebsiteMenuCommand(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; ptrT url( db_get_tsa(hContact, MODULENAME, "URL")); if (url) CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM)url); @@ -465,7 +465,7 @@ INT_PTR WebsiteMenuCommand(WPARAM wParam, LPARAM lParam) } /*****************************************************************************/ -int UpdateMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact) +int UpdateMenuCommand(WPARAM wParam, LPARAM lParam, HCONTACT singlecontact) { mir_forkthread(GetData, singlecontact); return 0; @@ -474,14 +474,14 @@ int UpdateMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact) /*****************************************************************************/ int ContactMenuItemUpdateData(WPARAM wParam, LPARAM lParam) { - UpdateMenuCommand(wParam, lParam, (HANDLE)wParam); + UpdateMenuCommand(wParam, lParam, (HCONTACT)wParam); return 0; } /*****************************************************************************/ INT_PTR CntOptionsMenuCommand(WPARAM wParam, LPARAM) { - HWND hwndDlg = WindowList_Find(hWindowList, (HANDLE)wParam); + HWND hwndDlg = WindowList_Find(hWindowList, (HCONTACT)wParam); if (hwndDlg) { DestroyWindow(hwndDlg); return 0; @@ -496,7 +496,7 @@ INT_PTR CntOptionsMenuCommand(WPARAM wParam, LPARAM) /*****************************************************************************/ INT_PTR CntAlertMenuCommand(WPARAM wParam, LPARAM) { - HWND hwndDlg = WindowList_Find(hWindowList, (HANDLE) wParam); + HWND hwndDlg = WindowList_Find(hWindowList, (HCONTACT) wParam); if (hwndDlg) { DestroyWindow(hwndDlg); return 0; diff --git a/plugins/WebView/src/webview.h b/plugins/WebView/src/webview.h index d74d6de614..73c410bf7d 100644 --- a/plugins/WebView/src/webview.h +++ b/plugins/WebView/src/webview.h @@ -117,7 +117,7 @@ //lets get rid of some warnings void CodetoSymbol(char *truncated); -void GetData(HANDLE hContact); +void GetData(void *param); void FillFontListThread(void *); INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); @@ -190,8 +190,8 @@ INT_PTR ShowHideContactCommand(WPARAM wParam, LPARAM lParam); INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM lParam); INT_PTR StpPrcssMenuCommand(WPARAM wParam, LPARAM lParam); -int UpdateMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact); -int OnTopMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact); +int UpdateMenuCommand(WPARAM wParam, LPARAM lParam, HCONTACT singlecontact); +int OnTopMenuCommand(WPARAM wParam, LPARAM lParam, HCONTACT singlecontact); // void ChangeContactStatus(int con_stat); @@ -206,7 +206,7 @@ void RemoveTabs(char *truncated); void FastTagFilter(char *truncated); void EraseBlock(char *truncated); void EraseSymbols(char *truncated); -int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactname, int notpresent); +int ProcessAlerts(HCONTACT hContact, char *truncated, char *tstr, char *contactname, int notpresent); INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); @@ -223,8 +223,8 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM void AckFunc(void *dummy); int SiteDeleted(WPARAM wParam, LPARAM lParam); -int WErrorPopup(HANDLE hContact, TCHAR *textdisplay); -int WAlertPopup(HANDLE hContact, TCHAR *displaytext); +int WErrorPopup(HCONTACT hContact, TCHAR *textdisplay); +int WAlertPopup(HCONTACT hContact, TCHAR *displaytext); ////////////////////// // wrappers diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 5da24a6c4d..0ab3287d87 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -29,7 +29,7 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) switch (message) { case WM_COMMAND: case WM_CONTEXTMENU: - HANDLE hContact = PUGetContact(hWnd); + HCONTACT hContact = PUGetContact(hWnd); ptrT url( db_get_tsa(hContact, MODULENAME, URL_KEY)); if (message == WM_COMMAND) { // left click @@ -44,7 +44,7 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if ( db_get_b(NULL, MODULENAME, LCLK_WEB_PGE_KEY, 0)) { CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM)url); PUDeletePopup(hWnd); - db_set_w((HANDLE)wParam, MODULENAME, "Status", ID_STATUS_ONLINE); + db_set_w((HCONTACT)wParam, MODULENAME, "Status", ID_STATUS_ONLINE); } // dismiss if ( db_get_b(NULL, MODULENAME, LCLK_DISMISS_KEY, 1)) @@ -65,7 +65,7 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if ( db_get_b(NULL, MODULENAME, RCLK_WEB_PGE_KEY, 1)) { CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM)url); PUDeletePopup(hWnd); - db_set_w((HANDLE)wParam, MODULENAME, "Status", ID_STATUS_ONLINE); + db_set_w((HCONTACT)wParam, MODULENAME, "Status", ID_STATUS_ONLINE); } // dismiss if ( db_get_b(NULL, MODULENAME, RCLK_DISMISS_KEY, 0)) @@ -88,21 +88,21 @@ int WDisplayDataAlert(void *hContact) } /*****************************************************************************/ -int WAlertPopup(HANDLE hContact, TCHAR *displaytext) +int WAlertPopup(HCONTACT hContact, TCHAR *displaytext) { NotifyEventHooks(hHookAlertPopup, (WPARAM)hContact, (LPARAM)displaytext); return 0; } /*****************************************************************************/ -int WErrorPopup(HANDLE hContact, TCHAR *textdisplay) +int WErrorPopup(HCONTACT hContact, TCHAR *textdisplay) { NotifyEventHooks(hHookErrorPopup, (WPARAM)hContact, (LPARAM) textdisplay); return 0; } /*****************************************************************************/ -int WAlertOSD(HANDLE hContact, TCHAR *displaytext) +int WAlertOSD(HCONTACT hContact, TCHAR *displaytext) { NotifyEventHooks(hHookAlertOSD, (WPARAM)hContact, (LPARAM) displaytext); return 0; @@ -115,13 +115,13 @@ int WPopupAlert(WPARAM wParam, LPARAM lParam) if( ((HANDLE)wParam) != NULL) { DBVARIANT dbv; - db_get_ts((HANDLE)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv); + db_get_ts((HCONTACT)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv); lstrcpyn(ppd.lptzContactName, dbv.ptszVal, SIZEOF(ppd.lptzContactName)); db_free(&dbv); } else lstrcpy(ppd.lptzContactName, _A2T(MODULENAME)); - ppd.lchContact = (HANDLE)wParam; + ppd.lchContact = (HCONTACT)wParam; ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE)); TCHAR *displaytext = (TCHAR*)lParam; @@ -158,7 +158,7 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) POPUPDATA ppd = { 0 }; if (((HANDLE)wParam) != NULL) { DBVARIANT dbv; - if ( !db_get_s((HANDLE)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { + if ( !db_get_s((HCONTACT)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { lstrcpynA(ppd.lptzContactName, dbv.pszVal, SIZEOF(ppd.lptzContactName)); db_free(&dbv); } @@ -166,7 +166,7 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) if (ppd.lptzContactName[0] == 0) strncpy_s(ppd.lptzContactName, SIZEOF(ppd.lptzContactName), MODULENAME, _TRUNCATE); - ppd.lchContact = (HANDLE)wParam; + ppd.lchContact = (HCONTACT)wParam; ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE)); char *displaytext = (char*)lParam; @@ -205,7 +205,7 @@ int OSDAlert(WPARAM wParam, LPARAM lParam) if (((HANDLE)wParam) != NULL) { DBVARIANT dbv; - if ( !db_get_s((HANDLE)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { + if ( !db_get_s((HCONTACT)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { strncpy_s(contactname, SIZEOF(contactname), dbv.pszVal, _TRUNCATE); db_free(&dbv); } @@ -225,7 +225,7 @@ int OSDAlert(WPARAM wParam, LPARAM lParam) /*****************************************************************************/ int ErrorMsgs(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; TCHAR newdisplaytext[2000], *displaytext = (TCHAR*)lParam; if ( db_get_b(NULL, MODULENAME, SUPPRESS_ERR_KEY, 0)) @@ -254,7 +254,7 @@ int ErrorMsgs(WPARAM wParam, LPARAM lParam) } /*****************************************************************************/ -void SaveToFile(HANDLE hContact, char *truncated) +void SaveToFile(HCONTACT hContact, char *truncated) { char *mode; if (!db_get_b(hContact, MODULENAME, APPEND_KEY, 0)) @@ -299,7 +299,7 @@ void SaveToFile(HANDLE hContact, char *truncated) } /*****************************************************************************/ -int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactname, int notpresent) +int ProcessAlerts(HCONTACT hContact, char *truncated, char *tstr, char *contactname, int notpresent) { char alertstring[255]; TCHAR displaystring[300]; @@ -479,7 +479,7 @@ int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactnam // file exists? if ( _taccess(newcachepath, 0) != -1) { if ((pcachefile = _tfopen(newcachepath, _T("r"))) == NULL) - WErrorPopup(contactname, TranslateT("Cannot read from file")); + WErrorPopup((HCONTACT)contactname, TranslateT("Cannot read from file")); else { ZeroMemory(&cachecompare, sizeof(cachecompare)); fread(cachecompare, sizeof(cachecompare), 1, pcachefile); @@ -488,7 +488,7 @@ int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactnam } // write to cache if ((pcachefile = _tfopen(newcachepath, _T("w"))) == NULL) - WErrorPopup(contactname, TranslateT("Cannot write to file 1")); + WErrorPopup((HCONTACT)contactname, TranslateT("Cannot write to file 1")); else { fwrite(tempraw, strlen(tempraw), 1, pcachefile); //smaller cache fclose(pcachefile); @@ -691,7 +691,7 @@ int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactnam // file exists? if ( _taccess(newcachepath, 0) != -1) { if ((pcachefile = _tfopen(newcachepath, _T("r"))) == NULL) - WErrorPopup(contactname, TranslateT("Cannot read from file")); + WErrorPopup((HCONTACT)contactname, TranslateT("Cannot read from file")); else { ZeroMemory(&cachecompare, sizeof(cachecompare)); fread(cachecompare, sizeof(cachecompare), 1, pcachefile); @@ -700,7 +700,7 @@ int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactnam } // write to cache if ((pcachefile = _tfopen(newcachepath, _T("w"))) == NULL) - WErrorPopup(contactname, TranslateT("Cannot write to file 2")); + WErrorPopup((HCONTACT)contactname, TranslateT("Cannot write to file 2")); else { fwrite(raw, strlen(raw), 1, pcachefile); //smaller cache db_set_ts(hContact, MODULENAME, CACHE_FILE_KEY, newcachepath); @@ -814,7 +814,7 @@ int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactnam /*****************************************************************************/ int DataWndAlertCommand(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if ( WindowList_Find(hWindowList, hContact)) return 0; @@ -836,8 +836,10 @@ int DataWndAlertCommand(WPARAM wParam, LPARAM lParam) } /*****************************************************************************/ -void ReadFromFile(HANDLE hContact) +void ReadFromFile(void *param) { + HCONTACT hContact = (HCONTACT)param; + DBVARIANT dbv; char truncated[MAXSIZE1]; int AmountWspcRem = 0; diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index 2c166e17ae..24ba98a50b 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -119,16 +119,16 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara static TCHAR tszSizeString[] = _T("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); -static HANDLE FindContactByUrl(HWND hwndDlg) +static HCONTACT FindContactByUrl(HWND hwndDlg) { - HANDLE res = NULL; + HCONTACT res = NULL; TCHAR urltext[300], titlebartxt[300]; int contactcount = 0; GetDlgItemText(hwndDlg, IDC_OPEN_URL, urltext, SIZEOF(urltext)); GetWindowText(hwndDlg, titlebartxt, SIZEOF(titlebartxt)); - for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { + for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { ptrT db1( db_get_tsa(hContact, MODULENAME, URL_KEY)); ptrT db2( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); @@ -149,13 +149,13 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DBVARIANT dbv; RECT rc; TCHAR url[300]; - HANDLE hContact; + HCONTACT hContact; switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); { - HANDLE hContact2 = (HANDLE) lParam; + HCONTACT hContact2 = (HCONTACT)lParam; SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG) hContact2); WindowList_Add(hWindowList, hwndDlg, hContact2); @@ -339,7 +339,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_OPEN_URL: GetDlgItemText(hwndDlg, IDC_OPEN_URL, url, SIZEOF(url)); CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM)url); - db_set_w((HANDLE)wParam, MODULENAME, "Status", ID_STATUS_ONLINE); + db_set_w((HCONTACT)wParam, MODULENAME, "Status", ID_STATUS_ONLINE); break; case IDC_UPDATE_BUTTON: diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 4522eee824..b56688180c 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -27,8 +27,9 @@ int Startingup = 1; int AlreadyDownloading = 0; /*******************/ -void GetData(HANDLE hContact) +void GetData(void *param) { + HCONTACT hContact = (HCONTACT)param; int statpos = 0, dispos = 0, statposend = 0; char*pos; DBVARIANT dbv; diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index d7606ecb12..fd3246dc47 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -277,7 +277,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l int alertIndex = 0; int eventIndex = 0; static int test; - HANDLE hContact; + HCONTACT hContact; ParentHwnd = GetParent(hwndDlg); @@ -285,7 +285,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case WM_INITDIALOG: test = 0; TranslateDialogDefault(hwndDlg); - hContact = (HANDLE)lParam; + hContact = (HCONTACT)lParam; SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG) hContact); @@ -509,7 +509,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l break; case IDC_ENABLE_ALERTS: - hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA); + hContact = (HCONTACT)GetWindowLong(hwndDlg, GWLP_USERDATA); EnableWindow(GetDlgItem(hwndDlg, IDC_ADD_DATE_NAME), (IsDlgButtonChecked(hwndDlg, IDC_ENABLE_ALERTS))); if ( IsDlgButtonChecked(hwndDlg, IDC_ADD_DATE_NAME)) { @@ -631,7 +631,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_ALERT_TYPE: if (HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_EDITCHANGE) { - hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA); + hContact = (HCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA); int alertIndex = SendDlgItemMessage(hwndDlg, IDC_ALERT_TYPE, CB_GETCURSEL, 0, 0); if (HIWORD(wParam) == CBN_SELCHANGE) { @@ -678,7 +678,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_EVENT_TYPE: if (HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_EDITCHANGE) { - HANDLE hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA); + HCONTACT hContact = (HCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA); int eventIndex = SendDlgItemMessage(hwndDlg, IDC_EVENT_TYPE, CB_GETCURSEL, 0, 0); if (HIWORD(wParam) == CBN_SELCHANGE) { @@ -709,7 +709,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_ALERT_APPLY: case IDC_OK2: { - hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA); + hContact = (HCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA); TCHAR buf[MAX_PATH]; eventIndex = db_get_b(hContact, MODULENAME, EVNT_INDEX_KEY, 0); @@ -815,13 +815,13 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM HWND ParentHwnd = GetParent(hwndDlg); static int test; static int test2; - HANDLE hContact; + HCONTACT hContact; switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - hContact = (HANDLE) lParam; + hContact = (HCONTACT) lParam; test = 0; test2 = 0; @@ -927,7 +927,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_CPY_STRINGS: { TCHAR string[128]; - hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA); + hContact = (HCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA); GetDlgItemText(hwndDlg, IDC_START, string, SIZEOF(string)); db_set_ts(hContact, MODULENAME, ALRT_S_STRING_KEY, string); @@ -1022,7 +1022,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break; } - hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA); + hContact = (HCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA); GetDlgItemText(hwndDlg, IDC_URL, url, SIZEOF(url)); db_set_ts(hContact, MODULENAME, URL_KEY, url); diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 776c5431e1..717966f75d 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -32,7 +32,7 @@ static char szInvalidChars[] = { '\\', '/', ':', '*', '?', '\"', '<', '>', '|' } int DBSettingChanged(WPARAM wParam, LPARAM lParam) { // We can't upload changes to NULL contact - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact == NULL) return 0; @@ -60,7 +60,7 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) for (int i=0; i < SIZEOF(szInvalidChars); i++ ) { TCHAR *p = _tcschr(nick, szInvalidChars[i]); if (p != NULL) { - WErrorPopup("ERROR", TranslateT("Invalid symbol present in contact name.")); + WErrorPopup((HCONTACT)"ERROR", TranslateT("Invalid symbol present in contact name.")); *p = '_'; invalidpresent =1; } @@ -111,7 +111,7 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) /*****************************************************************************/ int SiteDeleted(WPARAM wParam, LPARAM lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; if (lstrcmpA(GetContactProto(hContact), MODULENAME)) return 0; @@ -152,7 +152,7 @@ INT_PTR OpenCacheDir(WPARAM, LPARAM) mir_sntprintf(cachedirectorypath, SIZEOF(cachedirectorypath), _T("%s")_T(MODULENAME)_T("cache\\%s"), cachepath, cacheend); if( _taccess(cachedirectorypath, 0) != 0) - WErrorPopup("ERROR", TranslateT("Cache folder does not exist.")); + WErrorPopup((HCONTACT)"ERROR", TranslateT("Cache folder does not exist.")); else ShellExecute(NULL, _T("open"), cachedirectorypath, NULL, NULL, SW_SHOWNORMAL); return 0; @@ -163,11 +163,11 @@ INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM lParam) { FILE *pfile = fopen("psite.bat", "r"); if (pfile == NULL) { - WErrorPopup("ERROR", TranslateT("Missing \"psite.bat\" file.")); + WErrorPopup((HCONTACT)"ERROR", TranslateT("Missing \"psite.bat\" file.")); return 0; } - ptrT url( db_get_tsa((HANDLE) wParam, MODULENAME, "URL")); + ptrT url( db_get_tsa((HCONTACT)wParam, MODULENAME, "URL")); if (url == NULL) return 0; @@ -188,7 +188,7 @@ INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM lParam) /*****************************************************************************/ INT_PTR StpPrcssMenuCommand(WPARAM wParam, LPARAM) { - db_set_b((HANDLE)wParam, MODULENAME, STOP_KEY, 1); + db_set_b((HCONTACT)wParam, MODULENAME, STOP_KEY, 1); return 0; } @@ -251,7 +251,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam) // Make sure no contact has offline status for any reason on first time run if ( db_get_b(NULL, MODULENAME, "FirstTime", 100) == 100) { - for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) + for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE); db_set_b(NULL, MODULENAME, "FirstTime", 1); @@ -341,7 +341,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) int samename = 0; // search for existing contact - for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { + for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) { // check ID to see if the contact already exist in the database if (!db_get_ts(hContact, MODULENAME, "URL", &dbv)) { if (!lstrcmpi(psr->nick, dbv.ptszVal)) { @@ -359,7 +359,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) } if (psr->nick == NULL) { - WErrorPopup("ERROR", TranslateT("Please select site in Find/Add contacts...")); + WErrorPopup((HCONTACT)"ERROR", TranslateT("Please select site in Find/Add contacts...")); return 0; } @@ -367,7 +367,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) if (psr->cbSize != sizeof(PROTOSEARCHRESULT)) return NULL; - HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0); + HCONTACT hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) MODULENAME); /////////write to db @@ -403,7 +403,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) TCHAR *Nend = _tcschr(Newnick, '.'); if (Nend) *Nend = '\0'; - for (HANDLE hContact2 = db_find_first(MODULENAME); hContact2 != NULL; hContact2 = db_find_next(hContact2, MODULENAME)) { + for (HCONTACT hContact2 = db_find_first(MODULENAME); hContact2 != NULL; hContact2 = db_find_next(hContact2, MODULENAME)) { if (!db_get_ts(hContact2, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { if (!lstrcmpi(Newnick, dbv.ptszVal)) { // remove the flag for not on list and hidden, thus make the @@ -461,6 +461,6 @@ INT_PTR GetInfo(WPARAM, LPARAM) /*****************************************************************************/ void AckFunc(void *dummy) { - for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) + for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0); } -- cgit v1.2.3