From 68d3fd47bb9b75e65859d14199ffee01f16ac9a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 20:47:51 +0000 Subject: HCONTACT is not needed anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Weather/src/weather.h | 30 +++++++++++++++--------------- plugins/Weather/src/weather_addstn.cpp | 4 ++-- plugins/Weather/src/weather_contacts.cpp | 30 +++++++++++++++--------------- plugins/Weather/src/weather_conv.cpp | 2 +- plugins/Weather/src/weather_data.cpp | 14 +++++++------- plugins/Weather/src/weather_mwin.cpp | 22 +++++++++++----------- plugins/Weather/src/weather_popup.cpp | 10 +++++----- plugins/Weather/src/weather_svcs.cpp | 10 +++++----- plugins/Weather/src/weather_update.cpp | 24 ++++++++++++------------ plugins/Weather/src/weather_userinfo.cpp | 18 +++++++++--------- 10 files changed, 82 insertions(+), 82 deletions(-) (limited to 'plugins/Weather/src') diff --git a/plugins/Weather/src/weather.h b/plugins/Weather/src/weather.h index 27fd3f82c7..44952fa752 100644 --- a/plugins/Weather/src/weather.h +++ b/plugins/Weather/src/weather.h @@ -226,7 +226,7 @@ struct MYOPTIONS // other misc stuff TCHAR Default[64]; - HCONTACT DefStn; + MCONTACT DefStn; }; void DestroyOptions(void); @@ -234,7 +234,7 @@ void DestroyOptions(void); //============ STRUCT USED TO MAKE AN UPDATE LIST ============ struct WCONTACTLIST { - HCONTACT hContact; + MCONTACT hContact; struct WCONTACTLIST *next; }; @@ -395,7 +395,7 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa int ContactDeleted(WPARAM wParam,LPARAM lParam); -BOOL IsMyContact(HCONTACT hContact); +BOOL IsMyContact(MCONTACT hContact); // functions in weather_conv.c BOOL is_number(char *s); @@ -422,10 +422,10 @@ void GetID(TCHAR *pszID); TCHAR *GetError(int code); // functions in weather_data.c -void GetStationID(HCONTACT hContact, TCHAR* id, size_t idlen); -WEATHERINFO LoadWeatherInfo(HCONTACT Change); -int DBGetData(HCONTACT hContact, char *setting, DBVARIANT *dbv); -int DBGetStaticString(HCONTACT hContact, const char *szModule, const char *valueName, TCHAR *dest, size_t dest_len); +void GetStationID(MCONTACT hContact, TCHAR* id, size_t idlen); +WEATHERINFO LoadWeatherInfo(MCONTACT Change); +int DBGetData(MCONTACT hContact, char *setting, DBVARIANT *dbv); +int DBGetStaticString(MCONTACT hContact, const char *szModule, const char *valueName, TCHAR *dest, size_t dest_len); void EraseAllInfo(void); @@ -438,7 +438,7 @@ void wSetData(WCHAR **Data, const WCHAR *Value); void wfree(char **Data); void wfree(WCHAR **Data); -void DBDataManage(HCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM lParam); +void DBDataManage(MCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM lParam); // functions in weather_http.c int InternetDownloadFile (char *szUrl, char *cookie, TCHAR** szData); @@ -498,12 +498,12 @@ INT_PTR WeatherLoadIcon(WPARAM wParam, LPARAM lParam); void UpdateMenu(BOOL State); void UpdatePopupMenu(BOOL State); void AddMenuItems(); -void AvatarDownloaded(HCONTACT hContact); +void AvatarDownloaded(MCONTACT hContact); // functions in weather_update.c -int UpdateWeather(HCONTACT hContact); +int UpdateWeather(MCONTACT hContact); -int RetrieveWeather(HCONTACT hContact, WEATHERINFO *winfo); +int RetrieveWeather(MCONTACT hContact, WEATHERINFO *winfo); void UpdateAll(BOOL AutoUpdate, BOOL RemoveOld); void UpdateThreadProc(LPVOID hWnd); @@ -512,7 +512,7 @@ INT_PTR UpdateAllInfo(WPARAM wParam,LPARAM lParam); INT_PTR UpdateSingleRemove(WPARAM wParam,LPARAM lParam); INT_PTR UpdateAllRemove(WPARAM wParam,LPARAM lParam); -int GetWeatherData(HCONTACT hContact); +int GetWeatherData(MCONTACT hContact); void CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); void CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime); @@ -522,8 +522,8 @@ void InitMwin(void); void DestroyMwin(void); INT_PTR Mwin_MenuClicked(WPARAM wParam, LPARAM lParam); int BuildContactMenu(WPARAM wparam, LPARAM lparam); -void UpdateMwinData(HCONTACT hContact); -void removeWindow(HCONTACT hContact); +void UpdateMwinData(MCONTACT hContact); +void removeWindow(MCONTACT hContact); // functions in weather_userinfo.c int UserInfoInit(WPARAM wParam, LPARAM lParam); @@ -535,7 +535,7 @@ INT_PTR CALLBACK DlgProcINIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int BriefInfo(WPARAM wParam, LPARAM lParam); INT_PTR BriefInfoSvc(WPARAM wParam, LPARAM lParam); -void LoadBriefInfoText(HWND hwndDlg, HCONTACT hContact); +void LoadBriefInfoText(HWND hwndDlg, MCONTACT hContact); INT_PTR CALLBACK DlgProcBrief(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); void InitIcons(void); diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index a587b471a6..3e61f0d159 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -40,7 +40,7 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam) return 0; // search for existing contact - for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { // check if it is a weather contact if ( IsMyContact(hContact)) { DBVARIANT dbv; @@ -64,7 +64,7 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam) // if contact with the same ID was not found, add it if (psr->cbSize < sizeof(PROTOSEARCHRESULT)) return 0; - HCONTACT hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)WEATHERPROTONAME); // suppress online notification for the new contact CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, IGNOREEVENT_USERONLINE); diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 13758addac..f52f5d13eb 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -43,7 +43,7 @@ INT_PTR ViewLog(WPARAM wParam, LPARAM lParam) { // see if the log path is set DBVARIANT dbv; - if (!db_get_ts((HCONTACT)wParam, WEATHERPROTONAME, "Log", &dbv)) { + if (!db_get_ts((MCONTACT)wParam, WEATHERPROTONAME, "Log", &dbv)) { if (dbv.pszVal[0] != 0) ShellExecute((HWND)lParam, _T("open"), dbv.ptszVal, _T(""), _T(""), SW_SHOW); db_free(&dbv); @@ -59,10 +59,10 @@ INT_PTR ViewLog(WPARAM wParam, LPARAM lParam) INT_PTR LoadForecast(WPARAM wParam, LPARAM lParam) { TCHAR id[256], loc2[256]; - GetStationID((HCONTACT)wParam, id, SIZEOF(id)); + GetStationID((MCONTACT)wParam, id, SIZEOF(id)); if (id[0] != 0) { // check if the complte forecast URL is set. If it is not, display warning and quit - if (DBGetStaticString((HCONTACT)wParam, WEATHERPROTONAME, "InfoURL", loc2, SIZEOF(loc2)) || loc2[0] == 0) { + if (DBGetStaticString((MCONTACT)wParam, WEATHERPROTONAME, "InfoURL", loc2, SIZEOF(loc2)) || loc2[0] == 0) { MessageBox(NULL, TranslateT("The URL for complete forcast have not been set. You can set it from the Edit Settings dialog."), TranslateT("Weather Protocol"), MB_ICONINFORMATION); return 1; @@ -78,10 +78,10 @@ INT_PTR LoadForecast(WPARAM wParam, LPARAM lParam) INT_PTR WeatherMap(WPARAM wParam, LPARAM lParam) { TCHAR id[256], loc2[256]; - GetStationID((HCONTACT)wParam, id, SIZEOF(id)); + GetStationID((MCONTACT)wParam, id, SIZEOF(id)); if (id[0] != 0) { // check if the weather map URL is set. If it is not, display warning and quit - if (DBGetStaticString((HCONTACT)wParam, WEATHERPROTONAME, "MapURL", loc2, SIZEOF(loc2)) || loc2[0] == 0) { + if (DBGetStaticString((MCONTACT)wParam, WEATHERPROTONAME, "MapURL", loc2, SIZEOF(loc2)) || loc2[0] == 0) { MessageBox(NULL, TranslateT("The URL for weather map have not been set. You can set it from the Edit Settings dialog."), TranslateT("Weather Protocol"), MB_ICONINFORMATION); return 1; } @@ -99,7 +99,7 @@ INT_PTR WeatherMap(WPARAM wParam, LPARAM lParam) // wParam = current contact INT_PTR EditSettings(WPARAM wParam, LPARAM lParam) { - HWND hEditDlg = WindowList_Find(hWindowList, (HCONTACT)wParam); + HWND hEditDlg = WindowList_Find(hWindowList, (MCONTACT)wParam); // search the dialog list to prevent multiple instance of dialog for the same contact if (hEditDlg != NULL) { @@ -109,7 +109,7 @@ INT_PTR EditSettings(WPARAM wParam, LPARAM lParam) } else { // if the dialog box is not opened, open a new one - if (IsMyContact((HCONTACT)wParam)) + if (IsMyContact((MCONTACT)wParam)) CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_EDIT), NULL, DlgProcChange, (LPARAM)wParam); } @@ -118,7 +118,7 @@ INT_PTR EditSettings(WPARAM wParam, LPARAM lParam) typedef struct { - HCONTACT hContact; + MCONTACT hContact; HICON hRename; HICON hUserDetail; HICON hFile; @@ -133,7 +133,7 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa TCHAR str[256], str2[256], city[256], filter[256], *pfilter, *chop; char loc[512]; OPENFILENAME ofn; // common dialog box structure - HCONTACT hContact; + MCONTACT hContact; WIDATA *sData; CntSetWndDataType *wndData = NULL; @@ -142,7 +142,7 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa TranslateDialogDefault(hwndDlg); wndData = ( CntSetWndDataType* )mir_alloc(sizeof(CntSetWndDataType)); - wndData->hContact = hContact = (HCONTACT)lParam; + wndData->hContact = hContact = (MCONTACT)lParam; wndData->hRename = LoadSkinnedIcon(SKINICON_OTHER_RENAME); wndData->hUserDetail = LoadSkinnedIcon(SKINICON_OTHER_USERDETAILS); wndData->hFile = LoadSkinnedIcon(SKINICON_EVENT_FILE); @@ -430,14 +430,14 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa // wParam = deleted contact int ContactDeleted(WPARAM wParam, LPARAM lParam) { - if (!IsMyContact((HCONTACT)wParam)) + if (!IsMyContact((MCONTACT)wParam)) return 0; - removeWindow((HCONTACT)wParam); + removeWindow((MCONTACT)wParam); // exit this function if it is not default station DBVARIANT dbv; - if (!db_get_ts((HCONTACT)wParam, WEATHERPROTONAME, "ID", &dbv)) { + if (!db_get_ts((MCONTACT)wParam, WEATHERPROTONAME, "ID", &dbv)) { if ( _tcscmp(dbv.ptszVal, opt.Default)) { db_free(&dbv); return 0; @@ -448,7 +448,7 @@ int ContactDeleted(WPARAM wParam, LPARAM lParam) // now the default station is deleted, try to get a new one // start looking for other weather stations - for (HCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) { + for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) { if ( !db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) { // if the station is not a default station, set it as the new default station // this is the first weather station encountered from the search @@ -475,7 +475,7 @@ int ContactDeleted(WPARAM wParam, LPARAM lParam) return 0; } -BOOL IsMyContact(HCONTACT hContact) +BOOL IsMyContact(MCONTACT hContact) { const char* szProto = GetContactProto(hContact); return szProto != NULL && strcmp(WEATHERPROTONAME, szProto) == 0; diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index 7e18e3f749..129c36eb2b 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -572,7 +572,7 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str) TCHAR svcReturnText[MAX_TEXT_SIZE]; INT_PTR GetDisplaySvcFunc(WPARAM wParam, LPARAM lParam) { - WEATHERINFO winfo = LoadWeatherInfo((HCONTACT)wParam); + WEATHERINFO winfo = LoadWeatherInfo((MCONTACT)wParam); return (INT_PTR)GetDisplay(&winfo, (TCHAR*)lParam, svcReturnText); } diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index 288b415509..8d5a3bd5a8 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -30,7 +30,7 @@ saving individual weather data for a weather contact. // hContact = the current contact handle // return value = the string for station ID -void GetStationID(HCONTACT hContact, TCHAR* id, size_t idlen) +void GetStationID(MCONTACT hContact, TCHAR* id, size_t idlen) { // accessing the database if (DBGetStaticString(hContact, WEATHERPROTONAME, "ID", id, idlen)) @@ -40,7 +40,7 @@ void GetStationID(HCONTACT hContact, TCHAR* id, size_t idlen) // initialize weather info by loading values from database // hContact = current contact handle // return value = the current weather information in WEATHERINFO struct -WEATHERINFO LoadWeatherInfo(HCONTACT hContact) +WEATHERINFO LoadWeatherInfo(MCONTACT hContact) { // obtaining values from the DB // assuming station ID must exist at all time, but others does not have to @@ -86,7 +86,7 @@ WEATHERINFO LoadWeatherInfo(HCONTACT hContact) // getting weather setting from database // return 0 on success -int DBGetData(HCONTACT hContact, char *setting, DBVARIANT *dbv) +int DBGetData(MCONTACT hContact, char *setting, DBVARIANT *dbv) { if ( db_get_ts(hContact, WEATHERCONDITION, setting, dbv)) { size_t len = strlen(setting) + 1; @@ -100,7 +100,7 @@ int DBGetData(HCONTACT hContact, char *setting, DBVARIANT *dbv) return 0; } -int DBGetStaticString(HCONTACT hContact, const char *szModule, const char *valueName, TCHAR *dest, size_t dest_len) +int DBGetStaticString(MCONTACT hContact, const char *szModule, const char *valueName, TCHAR *dest, size_t dest_len) { DBVARIANT dbv; if ( db_get_ts( hContact, szModule, valueName, &dbv )) @@ -121,10 +121,10 @@ void EraseAllInfo() { TCHAR str[255]; int ContactCount = 0; - HCONTACT LastContact = NULL; + MCONTACT LastContact = NULL; DBVARIANT dbv; // loop through all contacts - for (HCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) { + for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) { db_set_w(hContact,WEATHERPROTONAME, "Status",ID_STATUS_OFFLINE); db_set_w(hContact,WEATHERPROTONAME, "StatusIcon",ID_STATUS_OFFLINE); db_unset(hContact, "CList", "MyHandle"); @@ -424,7 +424,7 @@ int GetWeatherDataFromDB(const char *szSetting, LPARAM lparam) // remove or display the weather information for a contact // hContact - the contact in which the info is going to be removed -void DBDataManage(HCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM lParam) +void DBDataManage(MCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM lParam) { LIST arSettings(10); diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index ccf23266cb..75f32395be 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -30,7 +30,7 @@ HGENMENU hMwinMenu; typedef struct { - HCONTACT hContact; + MCONTACT hContact; HWND hAvt; BOOL haveAvatar; } MWinDataType; @@ -47,7 +47,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara data = (MWinDataType*)mir_calloc(sizeof(MWinDataType)); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data); - data->hContact = (HCONTACT)((LPCREATESTRUCT)lParam)->lpCreateParams; + data->hContact = (MCONTACT)((LPCREATESTRUCT)lParam)->lpCreateParams; data->hAvt = CreateWindow(AVATAR_CONTROL_CLASS, TEXT(""), WS_CHILD, 0, 0, opt.AvatarSize, opt.AvatarSize, hwnd, NULL, hInst, 0); if (data->hAvt) SendMessage(data->hAvt, AVATAR_SETCONTACT, 0, (LPARAM)data->hContact); @@ -246,7 +246,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara return(TRUE); } -static void addWindow(HCONTACT hContact) +static void addWindow(MCONTACT hContact) { DBVARIANT dbv; db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv); @@ -273,7 +273,7 @@ static void addWindow(HCONTACT hContact) db_set_b(hContact, "CList", "Hidden", TRUE); } -void removeWindow(HCONTACT hContact) +void removeWindow(MCONTACT hContact) { DWORD frameId = db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0); @@ -284,7 +284,7 @@ void removeWindow(HCONTACT hContact) db_unset(hContact, "CList", "Hidden"); } -void UpdateMwinData(HCONTACT hContact) +void UpdateMwinData(MCONTACT hContact) { HWND hwnd = WindowList_Find(hMwinWindowList, hContact); if (hwnd != NULL) @@ -294,11 +294,11 @@ void UpdateMwinData(HCONTACT hContact) INT_PTR Mwin_MenuClicked(WPARAM wParam,LPARAM lParam) { - BOOL addwnd = WindowList_Find(hMwinWindowList, (HCONTACT)wParam) == NULL; + BOOL addwnd = WindowList_Find(hMwinWindowList, (MCONTACT)wParam) == NULL; if (addwnd) - addWindow((HCONTACT)wParam); + addWindow((MCONTACT)wParam); else - removeWindow((HCONTACT)wParam); + removeWindow((MCONTACT)wParam); return 0; } @@ -307,7 +307,7 @@ int BuildContactMenu(WPARAM wparam,LPARAM lparam) { CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIM_FLAGS | - (db_get_dw((HCONTACT)wparam, WEATHERPROTONAME, "mwin", 0) ? CMIF_CHECKED : 0); + (db_get_dw((MCONTACT)wparam, WEATHERPROTONAME, "mwin", 0) ? CMIF_CHECKED : 0); Menu_ModifyItem(hMwinMenu, &mi); return 0; } @@ -372,7 +372,7 @@ void InitMwin(void) strcpy(fontid.prefix, "fnt1"); FontRegisterT(&fontid); - for (HCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) + for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0)) addWindow(hContact); @@ -381,7 +381,7 @@ void InitMwin(void) void DestroyMwin(void) { - for (HCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) { + for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) { DWORD frameId = db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0); if (frameId) CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0); diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index 27152b0d9b..d1477eee2e 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -36,13 +36,13 @@ int WeatherPopup(WPARAM wParam, LPARAM lParam) { // determine if the popup should display or not if (opt.UsePopup && opt.UpdatePopup && (!opt.PopupOnChange || (BOOL)lParam) && - !db_get_b((HCONTACT)wParam, WEATHERPROTONAME, "DPopUp", 0)) + !db_get_b((MCONTACT)wParam, WEATHERPROTONAME, "DPopUp", 0)) { - WEATHERINFO winfo = LoadWeatherInfo((HCONTACT)wParam); + WEATHERINFO winfo = LoadWeatherInfo((MCONTACT)wParam); // setup the popup POPUPDATAT ppd = { 0 }; - ppd.lchContact = (HCONTACT)wParam; + ppd.lchContact = (MCONTACT)wParam; ppd.PluginData = ppd.lchIcon = LoadSkinnedProtoIcon(WEATHERPROTONAME, winfo.status); GetDisplay(&winfo, opt.pTitle, ppd.lptzContactName); GetDisplay(&winfo, opt.pText, ppd.lptzText); @@ -120,7 +120,7 @@ int WPShowMessage(TCHAR* lpzText, WORD kind) LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { DWORD ID = 0; - HCONTACT hContact; + MCONTACT hContact; hContact = PUGetContact(hWnd); switch(message) { @@ -248,7 +248,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) HMENU hMenu, hMenu1; RECT pos; HWND button; - HCONTACT hContact; + MCONTACT hContact; switch (msg) { case WM_INITDIALOG: diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index 5bbe057899..96033c2ba7 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -110,7 +110,7 @@ INT_PTR WeatherLoadIcon(WPARAM wParam,LPARAM lParam) static void __cdecl AckThreadProc(HANDLE param) { Sleep(100); - ProtoBroadcastAck(WEATHERPROTONAME, (HCONTACT)param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0); + ProtoBroadcastAck(WEATHERPROTONAME, (MCONTACT)param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0); } // nothing to do here because weather proto do not need to retrieve contact info form network @@ -163,7 +163,7 @@ INT_PTR WeatherGetAvatarInfo(WPARAM wParam, LPARAM lParam) } -void AvatarDownloaded(HCONTACT hContact) +void AvatarDownloaded(MCONTACT hContact) { PROTO_AVATAR_INFORMATIONT AI = {0}; AI.cbSize = sizeof(AI); @@ -181,11 +181,11 @@ static void __cdecl WeatherGetAwayMsgThread(void *hContact) Sleep(100); DBVARIANT dbv; - if (!db_get_ts((HCONTACT)hContact, "CList", "StatusMsg", &dbv)) { - ProtoBroadcastAck(WEATHERPROTONAME, (HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); + if (!db_get_ts((MCONTACT)hContact, "CList", "StatusMsg", &dbv)) { + ProtoBroadcastAck(WEATHERPROTONAME, (MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal); db_free( &dbv ); } - else ProtoBroadcastAck(WEATHERPROTONAME, (HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0); + else ProtoBroadcastAck(WEATHERPROTONAME, (MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0); } static INT_PTR WeatherGetAwayMsg(WPARAM wParam, LPARAM lParam) diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index a951d5980b..3736b1a87f 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -34,7 +34,7 @@ UPDATELIST *UpdateListTail; // retrieve weather info and display / log them // hContact = current contact -int UpdateWeather(HCONTACT hContact) +int UpdateWeather(MCONTACT hContact) { TCHAR str[256], str2[MAX_TEXT_SIZE]; DBVARIANT dbv; @@ -219,7 +219,7 @@ int UpdateWeather(HCONTACT hContact) // a linked list queue for updating weather station // this function add a weather contact to the end of queue for update // hContact = current contact -void UpdateListAdd(HCONTACT hContact) +void UpdateListAdd(MCONTACT hContact) { UPDATELIST *newItem = (UPDATELIST*)mir_alloc(sizeof(UPDATELIST)); newItem->hContact = hContact; @@ -236,9 +236,9 @@ void UpdateListAdd(HCONTACT hContact) // get the first item from the update queue and remove it from the queue // return value = the contact for next update -HCONTACT UpdateGetFirst() +MCONTACT UpdateGetFirst() { - HCONTACT hContact = NULL; + MCONTACT hContact = NULL; WaitForSingleObject(hUpdateMutex, INFINITE); @@ -283,10 +283,10 @@ void DestroyUpdateList(void) void UpdateAll(BOOL AutoUpdate, BOOL RemoveData) { // add all weather contact to the update queue list - for (HCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) + for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) if ( !db_get_b(hContact,WEATHERPROTONAME, "AutoUpdate",FALSE) || !AutoUpdate) { if (RemoveData) - DBDataManage((HCONTACT)hContact, WDBM_REMOVE, 0, 0); + DBDataManage((MCONTACT)hContact, WDBM_REMOVE, 0, 0); UpdateListAdd(hContact); } @@ -300,9 +300,9 @@ void UpdateAll(BOOL AutoUpdate, BOOL RemoveData) // wParam = handle for the weather station that is going to be updated INT_PTR UpdateSingleStation(WPARAM wParam, LPARAM lParam) { - if (IsMyContact((HCONTACT)wParam)) { + if (IsMyContact((MCONTACT)wParam)) { // add the station to the end of the update queue - UpdateListAdd((HCONTACT)wParam); + UpdateListAdd((MCONTACT)wParam); // if it is not updating, then start the update thread process // if it is updating, the stations just added to the queue will get @@ -318,10 +318,10 @@ INT_PTR UpdateSingleStation(WPARAM wParam, LPARAM lParam) // wParam = handle for the weather station that is going to be updated INT_PTR UpdateSingleRemove(WPARAM wParam, LPARAM lParam) { - if (IsMyContact((HCONTACT)wParam)) { + if (IsMyContact((MCONTACT)wParam)) { // add the station to the end of the update queue, and also remove old data - DBDataManage((HCONTACT)wParam, WDBM_REMOVE, 0, 0); - UpdateListAdd((HCONTACT)wParam); + DBDataManage((MCONTACT)wParam, WDBM_REMOVE, 0, 0); + UpdateListAdd((MCONTACT)wParam); // if it is not updating, then start the update thread process // if it is updating, the stations just added to the queue will get updated by the already-running process @@ -373,7 +373,7 @@ INT_PTR UpdateAllRemove(WPARAM wParam,LPARAM lParam) { // getting weather data and save them into the database // hContact = the contact to get the data -int GetWeatherData(HCONTACT hContact) +int GetWeatherData(MCONTACT hContact) { // get eacnh part of the id's TCHAR id[256]; diff --git a/plugins/Weather/src/weather_userinfo.cpp b/plugins/Weather/src/weather_userinfo.cpp index 827badd085..d6e3f1b64e 100644 --- a/plugins/Weather/src/weather_userinfo.cpp +++ b/plugins/Weather/src/weather_userinfo.cpp @@ -46,7 +46,7 @@ int UserInfoInit(WPARAM wParam, LPARAM lParam) } else { // check if it is a weather contact - if (IsMyContact((HCONTACT)lParam)) { + if (IsMyContact((MCONTACT)lParam)) { // register the contact info page odp.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO); odp.pfnDlgProc = DlgProcUIPage; @@ -64,16 +64,16 @@ INT_PTR CALLBACK DlgProcUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa WEATHERINFO w; TCHAR str[MAX_TEXT_SIZE]; - HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); SendMessage(GetDlgItem(hwndDlg,IDC_MOREDETAIL), BUTTONSETASFLATBTN, TRUE, 0); // save the contact handle for later use - hContact = (HCONTACT)lParam; + hContact = (MCONTACT)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)hContact); // load weather info for the contact - w = LoadWeatherInfo((HCONTACT)lParam); + w = LoadWeatherInfo((MCONTACT)lParam); SetDlgItemText(hwndDlg, IDC_INFO1, GetDisplay(&w, TranslateT("Current condition for %n"), str)); SendDlgItemMessage(hwndDlg, IDC_INFOICON, STM_SETICON, @@ -158,12 +158,12 @@ static int BriefDlgResizer(HWND hwnd, LPARAM lParam, UTILRESIZECONTROL *urc) INT_PTR CALLBACK DlgProcMoreData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static const unsigned tabstops = 48; - HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); switch (msg) { case WM_INITDIALOG: // save the contact handle for later use - hContact = (HCONTACT)lParam; + hContact = (MCONTACT)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)hContact); SendDlgItemMessage(hwndDlg, IDC_MTEXT, EM_AUTOURLDETECT, (WPARAM) TRUE, 0); @@ -327,7 +327,7 @@ INT_PTR CALLBACK DlgProcMoreData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l // set the title of the dialog and on the which rectangle // also load brief info into message box -void LoadBriefInfoText(HWND hwndDlg, HCONTACT hContact) +void LoadBriefInfoText(HWND hwndDlg, MCONTACT hContact) { WEATHERINFO winfo; TCHAR str[4096], str2[4096]; @@ -354,8 +354,8 @@ void LoadBriefInfoText(HWND hwndDlg, HCONTACT hContact) int BriefInfo(WPARAM wParam, LPARAM lParam) { // make sure that the contact is actually a weather one - if (IsMyContact((HCONTACT)wParam)) { - HWND hMoreDataDlg = WindowList_Find(hDataWindowList, (HCONTACT)wParam); + if (IsMyContact((MCONTACT)wParam)) { + HWND hMoreDataDlg = WindowList_Find(hDataWindowList, (MCONTACT)wParam); if (hMoreDataDlg != NULL) { SetForegroundWindow(hMoreDataDlg); SetFocus(hMoreDataDlg); -- cgit v1.2.3