diff options
Diffstat (limited to 'plugins/TabSRMM/src')
43 files changed, 434 insertions, 434 deletions
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index ce68f6b70e..25c3e4188b 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -389,7 +389,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, break;
case BUTTONSETCONTAINER:
- bct->pContainer = (TContainerData *)wParam;
+ bct->pContainer = (TContainerData*)wParam;
break;
case BUTTONSETASTITLE:
diff --git a/plugins/TabSRMM/src/buttonbar.h b/plugins/TabSRMM/src/buttonbar.h index c50b1dc76e..9e0fd7a16d 100644 --- a/plugins/TabSRMM/src/buttonbar.h +++ b/plugins/TabSRMM/src/buttonbar.h @@ -34,9 +34,9 @@ static INT_PTR CB_RemoveButton(WPARAM wParam, LPARAM lParam); static INT_PTR CB_AddButton(WPARAM wParam, LPARAM lParam);
static INT_PTR CB_GetButtonState(WPARAM wParam, LPARAM lParam);
static INT_PTR CB_SetButtonState(WPARAM wParam, LPARAM lParam);
-static void CB_GetButtonSettings(HANDLE hContact,CustomButtonData *cbd);
+static void CB_GetButtonSettings(HCONTACT hContact,CustomButtonData *cbd);
-void CB_WriteButtonSettings(HANDLE hContact,CustomButtonData *cbd);
+void CB_WriteButtonSettings(HCONTACT hContact,CustomButtonData *cbd);
int sstSortButtons(const void * vmtbi1, const void * vmtbi2);
void CB_DeInitCustomButtons();
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 833b9e6a3b..1cba4cbbcd 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -101,7 +101,7 @@ static int DBRemoveEnumProc(const char *szSetting, LPARAM lParam) return 0;
}
-static int Hlp_RemoveDatabaseSettings(HANDLE hContact, char *szModule, char *szPrefix)
+static int Hlp_RemoveDatabaseSettings(HCONTACT hContact, char *szModule, char *szPrefix)
{
RemoveSettings rs;
int i, count;
@@ -350,7 +350,7 @@ static INT_PTR CB_GetButtonState(WPARAM wParam, LPARAM lParam) if (!realbutton)
return 1;
- HWND hwndDlg = M.FindWindow((HANDLE)wParam);
+ HWND hwndDlg = M.FindWindow((HCONTACT)wParam);
if(!hwndDlg)
return 1;
HWND hwndBtn = GetDlgItem(hwndDlg, tempCID);
@@ -385,7 +385,7 @@ static INT_PTR CB_SetButtonState(WPARAM wParam, LPARAM lParam) if (!realbutton)
return 1;
- HWND hwndDlg = M.FindWindow((HANDLE)wParam);
+ HWND hwndDlg = M.FindWindow((HCONTACT)wParam);
if(!hwndDlg)
return 1;
@@ -856,7 +856,7 @@ void TSAPI BB_CustomButtonClick(TWindowData *dat, DWORD idFrom, HWND hwndFrom, B }
-void CB_GetButtonSettings(HANDLE hContact, CustomButtonData *cbd)
+void CB_GetButtonSettings(HCONTACT hContact, CustomButtonData *cbd)
{
DBVARIANT dbv = {0};
char SettingName[1024] = {'\0'};
@@ -884,7 +884,7 @@ void CB_GetButtonSettings(HANDLE hContact, CustomButtonData *cbd) }
}
-void CB_WriteButtonSettings(HANDLE hContact, CustomButtonData *cbd)
+void CB_WriteButtonSettings(HCONTACT hContact, CustomButtonData *cbd)
{
char SettingName[1024] = {'\0'};
char SettingParameter[1024] = {'\0'};
diff --git a/plugins/TabSRMM/src/chat/chat.h b/plugins/TabSRMM/src/chat/chat.h index f8a4769b54..9192f6960f 100644 --- a/plugins/TabSRMM/src/chat/chat.h +++ b/plugins/TabSRMM/src/chat/chat.h @@ -103,7 +103,7 @@ struct TMUCSettings : public GlobalLogSettingsBase struct FLASH_PARAMS
{
- HANDLE hContact;
+ HCONTACT hContact;
const char* sound;
int iEvent;
HICON hNotifyIcon;
@@ -173,7 +173,7 @@ void DestroyGCMenu(HMENU *hMenu, int iIndex); void Chat_SetFilters(SESSION_INFO *si);
void TSAPI DoFlashAndSoundWorker(FLASH_PARAMS* p);
BOOL DoPopup(SESSION_INFO *si, GCEVENT* gce);
-int ShowPopup(HANDLE hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...);
+int ShowPopup(HCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...);
BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce);
// message.c
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index 61beccc984..5f44fa352c 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -35,7 +35,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup)
{
- HANDLE hContact = si->hContact;
+ HCONTACT hContact = si->hContact;
if (M.FindWindow(hContact) != 0)
return 0;
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index dc22d4b655..e082f985a0 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -102,7 +102,7 @@ BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce) return TRUE;
}
-int ShowPopup(HANDLE hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...)
+int ShowPopup(HCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...)
{
POPUPDATAT pd = { 0 };
va_list marker;
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index bc0d140318..63001f7931 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -37,7 +37,7 @@ static OBJLIST<CContactCache> arContacts(50, HandleKeySortT);
-CContactCache::CContactCache(const HANDLE hContact)
+CContactCache::CContactCache(const HCONTACT hContact)
{
m_hContact = hContact;
m_wOldStatus = m_wStatus = m_wMetaStatus = ID_STATUS_OFFLINE;
@@ -156,7 +156,7 @@ bool CContactCache::updateStatus() void CContactCache::updateMeta(bool fForce)
{
if (m_Valid) {
- HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)m_hContact, 0);
+ HCONTACT hSubContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)m_hContact, 0);
if (hSubContact && (hSubContact != m_hSubContact || fForce)) {
m_hSubContact = hSubContact;
m_szMetaProto = GetContactProto(m_hSubContact);
@@ -442,7 +442,7 @@ void CContactCache::deletedHandler() ::SendMessage(m_hwnd, WM_CLOSE, 1, 2);
releaseAlloced();
- m_hContact = (HANDLE)-1;
+ m_hContact = (HCONTACT)-1;
}
/**
@@ -512,7 +512,7 @@ void CContactCache::updateStatusMsg(const char *szKey) * @return CContactCache* pointer to the cache entry for this contact
*/
-CContactCache* CContactCache::getContactCache(HANDLE hContact)
+CContactCache* CContactCache::getContactCache(HCONTACT hContact)
{
CContactCache *cc = arContacts.find((CContactCache*)&hContact);
if (cc == NULL) {
diff --git a/plugins/TabSRMM/src/contactcache.h b/plugins/TabSRMM/src/contactcache.h index 09deffbd46..ec1f8e4bb0 100644 --- a/plugins/TabSRMM/src/contactcache.h +++ b/plugins/TabSRMM/src/contactcache.h @@ -65,46 +65,46 @@ struct TSessionStats { struct CContactCache : public MZeroedObject
{
CContactCache() {}
- CContactCache(const HANDLE hContact);
+ CContactCache(const HCONTACT hContact);
~CContactCache()
{
releaseAlloced();
}
- const bool isValid() const { return(m_Valid); }
- const WORD getStatus() const { return(m_wStatus); }
- const WORD getMetaStatus() const { return(m_wMetaStatus); }
- const WORD getActiveStatus() const { return(m_isMeta ? m_wMetaStatus : m_wStatus); }
- const WORD getOldStatus() const { return(m_wOldStatus); }
- const TCHAR* getNick() const { return(m_szNick); }
- const HANDLE getContact() const { return(m_hContact); }
- const HANDLE getActiveContact() const { return(m_isMeta ? (m_hSubContact ? m_hSubContact : m_hContact) : m_hContact); }
- const DWORD getIdleTS() const { return(m_idleTS); }
- const char* getProto() const { return(m_szProto); }
- const TCHAR* getProtoT() const { return(m_tszProto); }
- const char* getMetaProto() const { return(m_szMetaProto ? m_szMetaProto : C_INVALID_PROTO); }
- const TCHAR* getMetaProtoT() const { return(m_szMetaProto ? m_tszMetaProto : C_INVALID_PROTO_T); }
- const char* getActiveProto() const { return(m_isMeta ? (m_szMetaProto ? m_szMetaProto : m_szProto) : m_szProto); }
- const TCHAR* getActiveProtoT() const { return(m_isMeta ? (m_szMetaProto ? m_tszMetaProto : m_tszProto) : m_tszProto); }
- bool isMeta() const { return(m_isMeta); }
- bool isSubContact() const { return(m_isSubcontact); }
- bool isFavorite() const { return(m_isFavorite); }
- bool isRecent() const { return(m_isRecent); }
- const TCHAR* getRealAccount() const { return(m_szAccount ? m_szAccount : C_INVALID_ACCOUNT); }
- const TCHAR* getUIN() const { return(m_szUIN); }
- const TCHAR* getStatusMsg() const { return(m_szStatusMsg); }
- const TCHAR* getXStatusMsg() const { return(m_xStatusMsg); }
- const TCHAR* getListeningInfo() const { return(m_ListeningInfo); }
- BYTE getXStatusId() const { return(m_xStatus); }
- const HWND getWindowData(TWindowData*& dat) const { dat = m_dat; return(m_hwnd); }
- const HWND getHwnd() const { return(m_hwnd); }
- int getMaxMessageLength();
+ const bool isValid() const { return(m_Valid); }
+ const WORD getStatus() const { return(m_wStatus); }
+ const WORD getMetaStatus() const { return(m_wMetaStatus); }
+ const WORD getActiveStatus() const { return(m_isMeta ? m_wMetaStatus : m_wStatus); }
+ const WORD getOldStatus() const { return(m_wOldStatus); }
+ const TCHAR* getNick() const { return(m_szNick); }
+ const HCONTACT getContact() const { return(m_hContact); }
+ const HCONTACT getActiveContact() const { return(m_isMeta ? (m_hSubContact ? m_hSubContact : m_hContact) : m_hContact); }
+ const DWORD getIdleTS() const { return(m_idleTS); }
+ const char* getProto() const { return(m_szProto); }
+ const TCHAR* getProtoT() const { return(m_tszProto); }
+ const char* getMetaProto() const { return(m_szMetaProto ? m_szMetaProto : C_INVALID_PROTO); }
+ const TCHAR* getMetaProtoT() const { return(m_szMetaProto ? m_tszMetaProto : C_INVALID_PROTO_T); }
+ const char* getActiveProto() const { return(m_isMeta ? (m_szMetaProto ? m_szMetaProto : m_szProto) : m_szProto); }
+ const TCHAR* getActiveProtoT() const { return(m_isMeta ? (m_szMetaProto ? m_tszMetaProto : m_tszProto) : m_tszProto); }
+ bool isMeta() const { return(m_isMeta); }
+ bool isSubContact() const { return(m_isSubcontact); }
+ bool isFavorite() const { return(m_isFavorite); }
+ bool isRecent() const { return(m_isRecent); }
+ const TCHAR* getRealAccount() const { return(m_szAccount ? m_szAccount : C_INVALID_ACCOUNT); }
+ const TCHAR* getUIN() const { return(m_szUIN); }
+ const TCHAR* getStatusMsg() const { return(m_szStatusMsg); }
+ const TCHAR* getXStatusMsg() const { return(m_xStatusMsg); }
+ const TCHAR* getListeningInfo() const { return(m_ListeningInfo); }
+ BYTE getXStatusId() const { return(m_xStatus); }
+ const HWND getWindowData(TWindowData*& dat) const { dat = m_dat; return(m_hwnd); }
+ const HWND getHwnd() const { return(m_hwnd); }
+ int getMaxMessageLength();
- TWindowData* getDat() const { return(m_dat); }
+ TWindowData* getDat() const { return(m_dat); }
- void updateStats(int iType, size_t value = 0);
- const DWORD getSessionStart() const { return(m_stats->started); }
- const int getSessionMsgCount() const { return((int)m_stats->messageCount) ; }
+ void updateStats(int iType, size_t value = 0);
+ const DWORD getSessionStart() const { return(m_stats->started); }
+ const int getSessionMsgCount() const { return((int)m_stats->messageCount); }
////////////////////////////////////////////////////////////////////////////
@@ -128,7 +128,7 @@ struct CContactCache : public MZeroedObject void saveHistory(WPARAM wParam, LPARAM lParam);
void inputHistoryEvent(WPARAM wParam);
- static CContactCache* getContactCache(HANDLE hContact);
+ static CContactCache* getContactCache(HCONTACT hContact);
static void cacheUpdateMetaChanged();
private:
@@ -137,24 +137,24 @@ private: void allocHistory();
void releaseAlloced();
- HANDLE m_hContact;
- HANDLE m_hSubContact;
- WORD m_wStatus, m_wMetaStatus;
- WORD m_wOldStatus;
- char* m_szProto, *m_szMetaProto;
- TCHAR* m_tszProto, m_tszMetaProto[40];
- TCHAR* m_szAccount;
- TCHAR m_szNick[80], m_szUIN[80];
- TCHAR* m_szStatusMsg, *m_xStatusMsg, *m_ListeningInfo;
- BYTE m_xStatus;
- DWORD m_idleTS;
- bool m_isMeta, m_isSubcontact;
- bool m_Valid;
- bool m_isFavorite;
- bool m_isRecent;
- HWND m_hwnd;
- int m_nMax;
- int m_iHistoryCurrent, m_iHistoryTop, m_iHistorySize;
+ HCONTACT m_hContact;
+ HCONTACT m_hSubContact;
+ WORD m_wStatus, m_wMetaStatus;
+ WORD m_wOldStatus;
+ char* m_szProto, *m_szMetaProto;
+ TCHAR* m_tszProto, m_tszMetaProto[40];
+ TCHAR* m_szAccount;
+ TCHAR m_szNick[80], m_szUIN[80];
+ TCHAR* m_szStatusMsg, *m_xStatusMsg, *m_ListeningInfo;
+ BYTE m_xStatus;
+ DWORD m_idleTS;
+ bool m_isMeta, m_isSubcontact;
+ bool m_Valid;
+ bool m_isFavorite;
+ bool m_isRecent;
+ HWND m_hwnd;
+ int m_nMax;
+ int m_iHistoryCurrent, m_iHistoryTop, m_iHistorySize;
TWindowData *m_dat;
TSessionStats *m_stats;
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 9c3e27b556..f7d48af5fe 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -39,7 +39,7 @@ TContainerData *pLastActiveContainer = NULL; static bool fForceOverlayIcons = false;
-static int ServiceParamsOK(ButtonItem *item, WPARAM *wParam, LPARAM *lParam, HANDLE hContact)
+static int ServiceParamsOK(ButtonItem *item, WPARAM *wParam, LPARAM *lParam, HCONTACT hContact)
{
if (item->dwFlags & BUTTON_PASSHCONTACTW || item->dwFlags & BUTTON_PASSHCONTACTL || item->dwFlags & BUTTON_ISCONTACTDBACTION) {
if (hContact == 0)
@@ -135,14 +135,14 @@ void TSAPI SetAeroMargins(TContainerData *pContainer) * pointer and for removing the struct from the linked list.
*/
-TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, HANDLE hContactFrom)
+TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, HCONTACT hContactFrom)
{
if (CMimAPI::m_shutDown)
return NULL;
int iFirstFree = -1, iFound = FALSE;
- TContainerData *pContainer = (TContainerData *)mir_calloc( sizeof(TContainerData));
+ TContainerData *pContainer = (TContainerData*)mir_calloc(sizeof(TContainerData));
if (!pContainer)
return NULL;
@@ -198,7 +198,7 @@ TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, HANDLE hCont static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TContainerData *pContainer = (TContainerData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ TContainerData *pContainer = (TContainerData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
BOOL bSkinned = CSkin::m_skinEnabled ? TRUE : FALSE;
switch (msg) {
@@ -555,7 +555,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, int iItem = 0;
TCITEM item;
- TContainerData *pContainer = (TContainerData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ TContainerData *pContainer = (TContainerData*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
BOOL bSkinned = CSkin::m_skinEnabled ? TRUE : FALSE;
HWND hwndTab = GetDlgItem(hwndDlg, IDC_MSGTABS);
@@ -873,7 +873,7 @@ panel_found: }
else if (((LPNMHDR)lParam)->code == NM_RCLICK) {
POINT pt;
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
HMENU hMenu;
GetCursorPos(&pt);
@@ -1013,7 +1013,7 @@ panel_found: bool fProcessMainMenu = pContainer->MenuBar->isMainMenu();
pContainer->MenuBar->Cancel();
- HANDLE hContact;
+ HCONTACT hContact;
TWindowData *dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
DWORD dwOldFlags = pContainer->dwFlags;
ButtonItem *pItem = pContainer->buttonItems;
@@ -1175,7 +1175,7 @@ panel_found: case DM_UPDATETITLE:
{
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
const TCHAR *szNewTitle = NULL;
TWindowData *dat = NULL;
@@ -1197,7 +1197,7 @@ panel_found: dat = (TWindowData*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
}
else {
- HWND hwnd = M.FindWindow((HANDLE)wParam);
+ HWND hwnd = M.FindWindow((HCONTACT)wParam);
if (hwnd == 0) {
SESSION_INFO *si = SM_FindSessionByHCONTACT((HANDLE)wParam);
if (si) {
@@ -1205,7 +1205,7 @@ panel_found: return 0;
}
}
- hContact = (HANDLE)wParam;
+ hContact = (HCONTACT)wParam;
if (hwnd && hContact)
dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
}
@@ -1392,7 +1392,7 @@ panel_found: SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)trans, (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
}
if (pContainer->dwFlags & CNT_NEED_UPDATETITLE) {
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
pContainer->dwFlags &= ~CNT_NEED_UPDATETITLE;
if (pContainer->hwndActive) {
SendMessage(pContainer->hwndActive, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
@@ -1550,7 +1550,7 @@ panel_found: {
DWORD ws, wsold, ex = 0, exold = 0;
HMENU hSysmenu = GetSystemMenu(hwndDlg, FALSE);
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
int i=0;
UINT sBarHeight;
bool bAero = M.isAero();
@@ -1897,7 +1897,7 @@ panel_found: item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, TabCtrl_GetCurSel(hwndTab), &item);
- HANDLE hContact;
+ HCONTACT hContact;
SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
db_set_b(hContact, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd == SW_SHOWMAXIMIZED) ? 1 : 0));
@@ -1934,7 +1934,7 @@ panel_found: pContainer->dwFlags &= ~(CNT_DEFERREDCONFIGURE | CNT_CREATE_MINIMIZED | CNT_DEFERREDSIZEREQUEST | CNT_CREATE_CLONED);
for (int i=0; i < TabCtrl_GetItemCount(hwndTab); i++) {
if (TabCtrl_GetItem(hwndTab, i, &item)) {
- HANDLE hContact;
+ HCONTACT hContact;
SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
char szCName[40];
@@ -2215,7 +2215,7 @@ void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc) * if none is assigned, return the name of the default container
*/
-int TSAPI GetContainerNameForContact(HANDLE hContact, TCHAR *szName, int iNameLen)
+int TSAPI GetContainerNameForContact(HCONTACT hContact, TCHAR *szName, int iNameLen)
{
// single window mode using cloned (temporary) containers
if (M.GetByte("singlewinmode", 0)) {
@@ -2255,7 +2255,7 @@ void TSAPI DeleteContainer(int iIndex) db_set_ts(NULL, CONTAINER_KEY, szIndex, _T("**mir_free**"));
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ptrT tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
if (!lstrcmp(tszValue, tszContainerName))
db_unset(hContact, SRMSGMOD_T, CONTAINER_SUBKEY);
@@ -2289,7 +2289,7 @@ void TSAPI RenameContainer(int iIndex, const TCHAR *szNew) db_set_ts(NULL, CONTAINER_KEY, szIndex, szNew);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ptrT tszValue(db_get_tsa(hContact, SRMSGMOD_T, CONTAINER_SUBKEY));
if (!lstrcmp(tszValue, tszContainerName))
db_set_ts(hContact, SRMSGMOD_T, CONTAINER_SUBKEY, szNew);
@@ -2347,7 +2347,7 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg) int iNumProtos = (int)CallService(MS_MC_GETNUMCONTACTS, (WPARAM)dat->hContact, 0);
int iDefaultProtoByNum = (int)CallService(MS_MC_GETDEFAULTCONTACTNUM, (WPARAM)dat->hContact, 0);
- HANDLE hContactMostOnline = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)dat->hContact, 0);
+ HCONTACT hContactMostOnline = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)dat->hContact, 0);
char *szProtoMostOnline = GetContactProto(hContactMostOnline);
int isForced = M.GetDword(dat->hContact, "tabSRMM_forced", -1);
@@ -2364,8 +2364,8 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg) mir_snprintf(szTemp, sizeof(szTemp), "Handle%d", i);
TCHAR *nick = NULL, *szStatusText = NULL;
- HANDLE hContact;
- if ((hContact = (HANDLE)db_get_dw(dat->hContact, PluginConfig.szMetaName, szTemp, 0)) != 0) {
+ HCONTACT hContact;
+ if ((hContact = (HCONTACT)db_get_dw(dat->hContact, PluginConfig.szMetaName, szTemp, 0)) != 0) {
nick = pcli->pfnGetContactDisplayName(hContact, 0);
mir_snprintf(szTemp, sizeof(szTemp), "Status%d", i);
WORD wStatus = (WORD)db_get_w(dat->hContact, PluginConfig.szMetaName, szTemp, 0);
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp index 5e2a6a1fbd..c6dcd90baa 100644 --- a/plugins/TabSRMM/src/containeroptions.cpp +++ b/plugins/TabSRMM/src/containeroptions.cpp @@ -147,7 +147,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, {
TContainerData *pContainer = 0;
HWND hwndTree = GetDlgItem(hwndDlg, IDC_SECTIONTREE);
- pContainer = (TContainerData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ pContainer = (TContainerData*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG: {
@@ -160,7 +160,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, const TSideBarLayout* sblayouts = CSideBar::getLayouts(nr_layouts);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) lParam);
- pContainer = (TContainerData *) lParam;
+ pContainer = (TContainerData*) lParam;
pContainer->hWndOptions = hwndDlg;
TranslateDialogDefault(hwndDlg);
SetWindowText(hwndDlg, TranslateT("Container options"));
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index df63872efa..ffbb3e24bb 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -398,7 +398,7 @@ void CMenuBar::invoke(const int id) TWindowData *dat = (TWindowData*)GetWindowLongPtr(m_pContainer->hwndActive, GWLP_USERDATA);
- HANDLE hContact = dat ? dat->hContact : 0;
+ HCONTACT hContact = dat ? dat->hContact : 0;
if (index == 3 && hContact != 0) {
hMenu = reinterpret_cast<HMENU>(::CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0));
@@ -699,7 +699,7 @@ RECT rcLastStatusBarClick; // remembers click (down event) point for status LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- TContainerData *pContainer = (TContainerData *)GetWindowLongPtr(GetParent(hWnd), GWLP_USERDATA);
+ TContainerData *pContainer = (TContainerData*)GetWindowLongPtr(GetParent(hWnd), GWLP_USERDATA);
if (OldStatusBarproc == 0) {
WNDCLASSEX wc = {0};
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index ed244ccd1a..740e3d5f7b 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -44,7 +44,7 @@ static LIST<PLUGIN_DATAT> arPopupList(10, HandleKeySortT); BOOL bWmNotify = TRUE;
-static PLUGIN_DATAT* PU_GetByContact(const HANDLE hContact)
+static PLUGIN_DATAT* PU_GetByContact(const HCONTACT hContact)
{
return arPopupList.find((PLUGIN_DATAT*)&hContact);
}
@@ -559,7 +559,7 @@ static TCHAR* GetPreviewT(WORD eventType, DBEVENTINFO* dbe) }
}
-static int PopupUpdateT(HANDLE hContact, HANDLE hEvent)
+static int PopupUpdateT(HCONTACT hContact, HANDLE hEvent)
{
PLUGIN_DATAT *pdata = const_cast<PLUGIN_DATAT *>(PU_GetByContact(hContact));
if (!pdata)
@@ -630,7 +630,7 @@ static int PopupUpdateT(HANDLE hContact, HANDLE hEvent) return 0;
}
-static int PopupShowT(NEN_OPTIONS *pluginOptions, HANDLE hContact, HANDLE hEvent, UINT eventType, HWND hContainer)
+static int PopupShowT(NEN_OPTIONS *pluginOptions, HCONTACT hContact, HANDLE hEvent, UINT eventType, HWND hContainer)
{
//there has to be a maximum number of popups shown at the same time
if (arPopupList.getCount() >= MAX_POPUPS)
@@ -759,7 +759,7 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced) * if we want tray support, add the contact to the list of unread sessions in the tray menu
*/
-int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, HANDLE hContact, DWORD fromEvent)
+int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, HCONTACT hContact, DWORD fromEvent)
{
if (!PluginConfig.g_hMenuTrayUnread || hContact == 0 || szProto == NULL)
return 0;
@@ -823,7 +823,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro return 0;
}
-int tabSRMM_ShowPopup(HANDLE hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto, TWindowData *dat)
+int tabSRMM_ShowPopup(HCONTACT hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto, TWindowData *dat)
{
if (nen_options.iDisable) // no popups at all. Period
return 0;
@@ -883,7 +883,7 @@ passed: * remove all popups for hContact, but only if the mask matches the current "mode"
*/
-void TSAPI DeletePopupsForContact(HANDLE hContact, DWORD dwMask)
+void TSAPI DeletePopupsForContact(HCONTACT hContact, DWORD dwMask)
{
if (!(dwMask & nen_options.dwRemoveMask) || nen_options.iDisable || !PluginConfig.g_PopupAvail)
return;
diff --git a/plugins/TabSRMM/src/functions.h b/plugins/TabSRMM/src/functions.h index c090228b07..f111e98d0c 100644 --- a/plugins/TabSRMM/src/functions.h +++ b/plugins/TabSRMM/src/functions.h @@ -53,9 +53,9 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP int TSAPI NEN_ReadOptions(NEN_OPTIONS *options);
int TSAPI NEN_WriteOptions(NEN_OPTIONS *options);
-int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, HANDLE hContact, DWORD fromEvent);
+int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szProto, const TCHAR *szStatus, HCONTACT hContact, DWORD fromEvent);
int TSAPI PopupPreview(NEN_OPTIONS *pluginOptions);
-void TSAPI DeletePopupsForContact(HANDLE hContact, DWORD dwMask);
+void TSAPI DeletePopupsForContact(HCONTACT hContact, DWORD dwMask);
/*
* tray stuff
@@ -65,7 +65,7 @@ void TSAPI CreateSystrayIcon(int create); void TSAPI FlashTrayIcon(HICON hIcon);
void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced);
void TSAPI LoadFavoritesAndRecent();
-void TSAPI AddContactToFavorites(HANDLE hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus,
+void TSAPI AddContactToFavorites(HCONTACT hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus,
WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu);
void TSAPI CreateTrayMenus(int mode);
void TSAPI HandleMenuEntryFromhContact(int iSelection);
@@ -74,15 +74,15 @@ void TSAPI HandleMenuEntryFromhContact(int iSelection); * gneric msgwindow functions(creation, container management etc.)
*/
-BOOL TSAPI IsUtfSendAvailable(HANDLE hContact);
-HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, int isSend,
+BOOL TSAPI IsUtfSendAvailable(HCONTACT hContact);
+HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HCONTACT hContact, int isSend,
const char *pszInitialText, BOOL bActivateTAb, BOOL bPopupContainer, BOOL bWantPopup, HANDLE hdbEvent);
int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd);
void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iNum);
void TSAPI CreateImageList(BOOL bInitial);
-TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName, HANDLE hContact);
-TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, HANDLE hContactFrom);
+TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName, HCONTACT hContact);
+TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, HCONTACT hContactFrom);
TContainerData* TSAPI FindContainerByName(const TCHAR *name);
int TSAPI GetTabIndexFromHWND(HWND hwndTab, HWND hwnd);
@@ -100,7 +100,7 @@ TContainerData* TSAPI RemoveContainerFromList(TContainerData *pContainer); void TSAPI CloseAllContainers();
void TSAPI DeleteContainer(int iIndex);
void TSAPI RenameContainer(int iIndex, const TCHAR *newName);
-int TSAPI GetContainerNameForContact(HANDLE hContact, TCHAR *szName, int iNameLen);
+int TSAPI GetContainerNameForContact(HCONTACT hContact, TCHAR *szName, int iNameLen);
HMENU TSAPI BuildContainerMenu();
void TSAPI BuildCodePageList();
void TSAPI PreTranslateDates();
@@ -108,7 +108,7 @@ void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT void TSAPI BroadCastContainer(const TContainerData *pContainer, UINT message, WPARAM wParam, LPARAM lParam, BYTE iType = 0);
void TSAPI GetDefaultContainerTitleFormat();
void TSAPI SetAeroMargins(TContainerData *pContainer);
-int TABSRMM_FireEvent(HANDLE hContact, HWND hwnd, unsigned int type, unsigned int subType);
+int TABSRMM_FireEvent(HCONTACT hContact, HWND hwnd, unsigned int type, unsigned int subType);
INT_PTR MessageWindowOpened(WPARAM wParam, LPARAM lParam);
@@ -154,7 +154,7 @@ int TSAPI UnloadTSButtonModule(); * debugging support
*/
-int _DebugPopup(HANDLE hContact, const TCHAR *fmt, ...);
+int _DebugPopup(HCONTACT hContact, const TCHAR *fmt, ...);
int _DebugMessage(HWND hwndDlg, TWindowData *dat, const char *fmt, ...);
// themes
@@ -175,7 +175,7 @@ int TSAPI LoadLocalFlags(HWND hwnd, TWindowData *dat); int TN_ModuleInit();
int TN_OptionsInitialize(WPARAM wParam, LPARAM lParam);
int TN_ModuleDeInit();
-void TN_TypingMessage(HANDLE hContact, int iMode);
+void TN_TypingMessage(HCONTACT hContact, int iMode);
// hotkeys
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index a1f7bbd9ae..98e87b970a 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -306,7 +306,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, case IDC_SMILEYBTN:
if (dat->doSmileys && PluginConfig.g_SmileyAddAvail) {
- HANDLE hContact = dat->cache->getActiveContact();
+ HCONTACT hContact = dat->cache->getActiveContact();
if (CheckValidSmileyPack(dat->cache->getActiveProto(), hContact) != 0) {
SMADD_SHOWSEL3 smaddInfo = {0};
@@ -875,7 +875,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat) void TSAPI DM_SetDBButtonStates(HWND hwndChild, TWindowData *dat)
{
ButtonItem *buttonItem = dat->pContainer->buttonItems;
- HANDLE hContact = dat->hContact, hFinalContact = 0;
+ HCONTACT hContact = dat->hContact, hFinalContact = 0;
char *szModule, *szSetting;
HWND hwndContainer = dat->pContainer->hwnd;
@@ -978,7 +978,7 @@ void TSAPI DM_ScrollToBottom(TWindowData *dat, WPARAM wParam, LPARAM lParam) static void LoadKLThread(LPVOID _param)
{
DBVARIANT dbv;
- if (!db_get_ts(_param, SRMSGMOD_T, "locale", &dbv)) {
+ if (!db_get_ts((HCONTACT)_param, SRMSGMOD_T, "locale", &dbv)) {
HKL hkl = LoadKeyboardLayout(dbv.ptszVal, 0);
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SETLOCALE, (WPARAM)_param, (LPARAM)hkl);
db_free(&dbv);
@@ -1278,7 +1278,7 @@ void TSAPI DM_NotifyTyping(TWindowData *dat, int mode) DWORD protoCaps;
DWORD typeCaps;
const char *szProto = 0;
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
if (!dat || !dat->hContact)
return;
@@ -1626,7 +1626,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam) SendMessage(hwndDlg, DM_ADDDIVIDER, 0, 0);
}
}
- tabSRMM_ShowPopup((HANDLE)wParam, hDbEvent, dbei.eventType, m_pContainer->fHidden ? 0 : 1, m_pContainer, hwndDlg, dat->cache->getActiveProto(), dat);
+ tabSRMM_ShowPopup((HCONTACT)wParam, hDbEvent, dbei.eventType, m_pContainer->fHidden ? 0 : 1, m_pContainer, hwndDlg, dat->cache->getActiveProto(), dat);
if (IsWindowVisible(m_pContainer->hwnd))
m_pContainer->fHidden = false;
}
@@ -1896,7 +1896,7 @@ static HANDLE hHookIconPressedEvt; static int OnSrmmIconChanged(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
M.BroadcastMessage(DM_STATUSICONCHANGE, 0, 0);
else {
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index c346c06a79..219036be27 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -402,11 +402,11 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam) CContactCache* c = 0;
bool fChanged = false, fNickChanged = false, fExtendedStatusChange = false;
- hwnd = M.FindWindow((HANDLE)wParam);
+ hwnd = M.FindWindow((HCONTACT)wParam);
if (hwnd == 0 && wParam != 0) { // we are not interested in this event if there is no open message window/tab
if (!strcmp(setting, "Status") || !strcmp(setting, "MyHandle") || !strcmp(setting, "Nick") || !strcmp(cws->szModule, SRMSGMOD_T)) {
- c = CContactCache::getContactCache((HANDLE)wParam);
+ c = CContactCache::getContactCache((HCONTACT)wParam);
if (c) {
fChanged = c->updateStatus();
if (strcmp(setting, "Status"))
@@ -424,7 +424,7 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam) }
if (wParam) {
- c = CContactCache::getContactCache((HANDLE)wParam);
+ c = CContactCache::getContactCache((HCONTACT)wParam);
if (c) {
szProto = c->getProto();
if (!strcmp(cws->szModule, SRMSGMOD_T)) { // catch own relevant settings
@@ -500,7 +500,7 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam) int CGlobals::DBContactDeleted(WPARAM wParam, LPARAM lParam)
{
if (wParam) {
- CContactCache *c = CContactCache::getContactCache((HANDLE)wParam);
+ CContactCache *c = CContactCache::getContactCache((HCONTACT)wParam);
if (c)
c->deletedHandler();
}
@@ -515,7 +515,7 @@ int CGlobals::DBContactDeleted(WPARAM wParam, LPARAM lParam) int CGlobals::MetaContactEvent(WPARAM wParam, LPARAM lParam)
{
if (wParam) {
- CContactCache *c = CContactCache::getContactCache((HANDLE)wParam);
+ CContactCache *c = CContactCache::getContactCache((HCONTACT)wParam);
if (c) {
c->updateMeta(true);
if (c->getHwnd()) {
@@ -532,7 +532,7 @@ int CGlobals::PreshutdownSendRecv(WPARAM wParam, LPARAM lParam) ::TN_ModuleDeInit();
::CloseAllContainers();
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
db_set_dw(hContact, SRMSGMOD_T, "messagecount", 0);
::SI_DeinitStatusIcons();
@@ -582,7 +582,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) cle.pszService = "SRMsg/ReadMessage";
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)) {
if (db_get_dw(hContact, "SendLater", "count", 0))
sendLater->addContact(hContact);
@@ -616,7 +616,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) if (dat == NULL || !c->isValid())
return;
- HANDLE hContact = c->getContact();
+ HCONTACT hContact = c->getContact();
if (!PluginConfig.m_LogStatusChanges && !M.GetByte(hContact, "logstatuschanges", 0))
return;
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index a92858d9e1..d1918004c7 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -95,7 +95,7 @@ static INT_PTR HotkeyProcessor(WPARAM wParam, LPARAM lParam) void TSAPI HandleMenuEntryFromhContact(int iSelection)
{
- HWND hWnd = M.FindWindow((HANDLE)iSelection);
+ HWND hWnd = M.FindWindow((HCONTACT)iSelection);
if (iSelection == 0)
return;
@@ -205,7 +205,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP return TRUE;
}
else if (dis->CtlType == ODT_MENU) {
- HWND hWnd = M.FindWindow((HANDLE)dis->itemID);
+ HWND hWnd = M.FindWindow((HCONTACT)dis->itemID);
DWORD idle = 0;
if (hWnd == NULL) {
@@ -390,7 +390,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case DM_DOCREATETAB:
{
- HWND hWnd = M.FindWindow((HANDLE)lParam);
+ HWND hWnd = M.FindWindow((HCONTACT)lParam);
if (hWnd && IsWindow(hWnd)) {
TContainerData *pContainer = 0;
SendMessage(hWnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer);
@@ -401,7 +401,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP else
SendMessage(hWnd, WM_CLOSE, 0, 1);
- CreateNewTabForContact((TContainerData *)wParam, (HANDLE)lParam, 0, NULL, TRUE, TRUE, FALSE, 0);
+ CreateNewTabForContact((TContainerData*)wParam, (HCONTACT)lParam, 0, NULL, TRUE, TRUE, FALSE, 0);
}
}
}
@@ -420,7 +420,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP else
SendMessage(si->hWnd, WM_CLOSE, 0, 1);
- si->hWnd = CreateNewRoom((TContainerData *)wParam, si, TRUE, 0, 0);
+ si->hWnd = CreateNewRoom((TContainerData*)wParam, si, TRUE, 0, 0);
}
}
}
@@ -443,13 +443,13 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP */
case DM_REMOVECLISTEVENT:
CallService(MS_CLIST_REMOVEEVENT, wParam, lParam);
- db_event_markRead((HANDLE)wParam, (HANDLE)lParam);
+ db_event_markRead((HCONTACT)wParam, (HANDLE)lParam);
return 0;
case DM_SETLOCALE:
{
- HKL hkl = (HKL)lParam;
- HANDLE hContact = (HANDLE)wParam;
+ HKL hkl = (HKL)lParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HWND hWnd = M.FindWindow(hContact);
if (hWnd) {
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 5b11efa34e..90a8c07f74 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -1364,7 +1364,7 @@ void CInfoPanel::dismissConfig(bool fForced) * @param panel CInfoPanel* the panel which owns it
*/
-CTip::CTip(const HWND hwndParent, const HANDLE hContact, const TCHAR *pszText, const CInfoPanel* panel)
+CTip::CTip(const HWND hwndParent, const HCONTACT hContact, const TCHAR *pszText, const CInfoPanel* panel)
{
m_hwnd = ::CreateWindowEx(WS_EX_TOOLWINDOW, _T("RichEditTipClass"), _T(""), (M.isAero() ? WS_THICKFRAME : WS_BORDER) | WS_POPUPWINDOW | WS_TABSTOP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
0, 0, 40, 40, 0, 0, g_hInst, this);
diff --git a/plugins/TabSRMM/src/infopanel.h b/plugins/TabSRMM/src/infopanel.h index cd5a25031f..0e2c962706 100644 --- a/plugins/TabSRMM/src/infopanel.h +++ b/plugins/TabSRMM/src/infopanel.h @@ -74,7 +74,7 @@ public: LEFT_BAR_WIDTH = 20
};
- CTip (const HWND hwndParent, const HANDLE hContact, const TCHAR *pszText = 0, const CInfoPanel *panel = 0);
+ CTip (const HWND hwndParent, const HCONTACT hContact, const TCHAR *pszText = 0, const CInfoPanel *panel = 0);
~CTip()
{
mir_free(m_pszText);
@@ -89,16 +89,16 @@ private: static INT_PTR CALLBACK WndProcStub(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK RichEditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
- HWND m_hwnd; // our window handle
- HWND m_hRich; // handle of the rich edit child
- HWND m_hwndParent; // parent window (used for position calculations and to send notifications)
- HANDLE m_hContact; // contact handle
- char *m_pszText; // the richedit text
- SIZE m_szRich; // size of the richedit control (height auto-calculated to make it fit the text)
- RECT m_rcRich; // adjusted rectangle for the richedit control (client coordinates)
- HICON m_hIcon; // optional icon to show in the title line
- LPCTSTR m_szTitle; // optional text to show in the title
- int m_leftWidth;
+ HWND m_hwnd; // our window handle
+ HWND m_hRich; // handle of the rich edit child
+ HWND m_hwndParent; // parent window (used for position calculations and to send notifications)
+ HCONTACT m_hContact; // contact handle
+ char *m_pszText; // the richedit text
+ SIZE m_szRich; // size of the richedit control (height auto-calculated to make it fit the text)
+ RECT m_rcRich; // adjusted rectangle for the richedit control (client coordinates)
+ HICON m_hIcon; // optional icon to show in the title line
+ LPCTSTR m_szTitle; // optional text to show in the title
+ int m_leftWidth;
const CInfoPanel *m_panel; // the info panel parent (if any)
};
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index d385388432..69a97a7a5f 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -164,12 +164,12 @@ void CMimAPI::BroadcastMessageAsync(UINT msg, WPARAM wParam, LPARAM lParam) WindowList_BroadcastAsync(m_hMessageWindowList, msg, wParam, lParam);
}
-HWND CMimAPI::FindWindow(HANDLE h) const
+HWND CMimAPI::FindWindow(HCONTACT h) const
{
return WindowList_Find(m_hMessageWindowList, h);
}
-INT_PTR CMimAPI::AddWindow(HWND hWnd, HANDLE h)
+INT_PTR CMimAPI::AddWindow(HWND hWnd, HCONTACT h)
{
return WindowList_Add(m_hMessageWindowList, hWnd, h);
}
@@ -335,7 +335,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam) int issplit = 1, foundWin = 0, preTyping = 0;
BOOL fShowOnClist = TRUE;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact) {
if ((hwnd = M.FindWindow(hContact)) && M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING))
preTyping = SendMessage(hwnd, DM_TYPING, 0, lParam);
@@ -407,7 +407,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam) }
if (fShowOnClist) {
CLISTEVENT cle = { sizeof(cle) };
- cle.hContact = (HANDLE)wParam;
+ cle.hContact = (HCONTACT)wParam;
cle.hDbEvent = (HANDLE)1;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hIcon = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING];
@@ -468,7 +468,7 @@ int CMimAPI::ProtoAck(WPARAM wParam, LPARAM lParam) int CMimAPI::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return NULL;
@@ -497,7 +497,7 @@ int CMimAPI::PrebuildContactMenu(WPARAM wParam, LPARAM lParam) int CMimAPI::DispatchNewEvent(WPARAM wParam, LPARAM lParam)
{
if (wParam) {
- HWND h = M.FindWindow((HANDLE)wParam);
+ HWND h = M.FindWindow((HCONTACT)wParam);
if (h)
PostMessage(h, HM_DBEVENTADDED, wParam, lParam); // was SENDMESSAGE !!! XXX
}
@@ -522,7 +522,7 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam) DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HWND hwnd = M.FindWindow(hContact);
BOOL isCustomEvent = IsCustomEvent(dbei.eventType);
@@ -614,7 +614,7 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam) else {
char *szProto = GetContactProto(hContact);
if (PluginConfig.g_MetaContactsAvail && szProto && !strcmp(szProto, (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0))) {
- HANDLE hSubconttact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, wParam, 0);
+ HCONTACT hSubconttact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, wParam, 0);
szProto = GetContactProto(hSubconttact);
}
if (szProto) {
diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h index e79f38077a..51f70830db 100644 --- a/plugins/TabSRMM/src/mim.h +++ b/plugins/TabSRMM/src/mim.h @@ -107,14 +107,14 @@ public: { return db_get_dw(0, szModule, szSetting, uDefault); }
static DWORD __forceinline GetDword(const char *szSetting, DWORD uDefault)
{ return db_get_dw(0, SRMSGMOD_T, szSetting, uDefault); }
- static DWORD __forceinline GetDword(const HANDLE hContact, const char *szSetting, DWORD uDefault)
+ static DWORD __forceinline GetDword(const HCONTACT hContact, const char *szSetting, DWORD uDefault)
{ return db_get_dw(hContact, SRMSGMOD_T, szSetting, uDefault); }
static int __forceinline GetByte(const char *szSetting, int uDefault)
{ return db_get_b(0, SRMSGMOD_T, szSetting, uDefault); }
static int __forceinline GetByte(const char *szModule, const char *szSetting, int uDefault)
{ return db_get_b(0, szModule, szSetting, uDefault); }
- static int __forceinline GetByte(const HANDLE hContact, const char *szSetting, int uDefault)
+ static int __forceinline GetByte(const HCONTACT hContact, const char *szSetting, int uDefault)
{ return db_get_b(hContact, SRMSGMOD_T, szSetting, uDefault); }
static bool __forceinline GetBool(const char *szModule, const char *szSetting, bool uDefault)
@@ -182,9 +182,9 @@ public: void BroadcastMessage(UINT msg, WPARAM wParam, LPARAM lParam);
void BroadcastMessageAsync(UINT msg, WPARAM wParam, LPARAM lParam);
- INT_PTR AddWindow(HWND hWnd, HANDLE h);
+ INT_PTR AddWindow(HWND hWnd, HCONTACT h);
INT_PTR RemoveWindow(HWND hWnd);
- HWND FindWindow(HANDLE h) const;
+ HWND FindWindow(HCONTACT h) const;
static LPCTSTR StriStr(const TCHAR *szString, const TCHAR *szSearchFor);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 2d5d635a3a..7662b3703b 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -71,7 +71,7 @@ static void _clrMsgFilter(LPARAM lParam) m->wParam = 0;
}
-BOOL TSAPI IsUtfSendAvailable(HANDLE hContact)
+BOOL TSAPI IsUtfSendAvailable(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index d8bf4baa15..9a7f0217bc 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -711,7 +711,7 @@ int TSAPI GetAvatarVisibility(HWND hwndDlg, TWindowData *dat) * checks, if there is a valid smileypack installed for the given protocol
*/
-int TSAPI CheckValidSmileyPack(const char *szProto, HANDLE hContact)
+int TSAPI CheckValidSmileyPack(const char *szProto, HCONTACT hContact)
{
SMADD_INFO2 smainfo = {0};
@@ -894,7 +894,7 @@ void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, HANDLE hEvent, DBEVENTIN if ((GetForegroundWindow() != dat->pContainer->hwnd || dat->pContainer->hwndActive != hwndDlg) && !(dbei->flags & DBEF_SENT) && dbei->eventType == EVENTTYPE_MESSAGE && !(dat->dwFlagsEx & MWF_SHOW_FLASHCLIST)) {
ZeroMemory(&cle, sizeof(cle));
cle.cbSize = sizeof(cle);
- cle.hContact = (HANDLE)dat->hContact;
+ cle.hContact = (HCONTACT)dat->hContact;
cle.hDbEvent = hEvent;
cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
@@ -1214,7 +1214,7 @@ void TSAPI GetMYUIN(TWindowData *dat) static int g_IEViewAvail = -1;
static int g_HPPAvail = -1;
-UINT TSAPI GetIEViewMode(HWND hwndDlg, HANDLE hContact)
+UINT TSAPI GetIEViewMode(HWND hwndDlg, HCONTACT hContact)
{
int iWantIEView = 0, iWantHPP = 0;
diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h index 0b9aac3e20..6e85f994ab 100644 --- a/plugins/TabSRMM/src/msgdlgutils.h +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -40,7 +40,7 @@ int TSAPI MsgWindowUpdateMenu (TWindowData *dat, HMENU submenu, int menuID); int TSAPI MsgWindowMenuHandler (TWindowData *dat, int selection, int menuId);
int TSAPI GetAvatarVisibility (HWND hwndDlg, TWindowData *dat);
void TSAPI UpdateStatusBar (const TWindowData *dat);
-int TSAPI CheckValidSmileyPack (const char *szProto, HANDLE hContact);
+int TSAPI CheckValidSmileyPack (const char *szProto, HCONTACT hContact);
TCHAR* TSAPI QuoteText (const TCHAR *text, int charsPerLine, int removeExistingQuotes);
void TSAPI UpdateReadChars (const TWindowData *dat);
void TSAPI ShowPicture (TWindowData *dat, BOOL showNewPic);
@@ -52,7 +52,7 @@ BOOL TSAPI DoRtfToTags (TCHAR * pszText, const TWindowData *dat); void TSAPI GetMYUIN (TWindowData *dat);
void TSAPI SetMessageLog (TWindowData *dat);
void TSAPI SwitchMessageLog (TWindowData *dat, int iMode);
-UINT TSAPI GetIEViewMode (HWND hwndDlg, HANDLE hContact);
+UINT TSAPI GetIEViewMode (HWND hwndDlg, HCONTACT hContact);
void TSAPI FindFirstEvent (TWindowData *dat);
void TSAPI SaveSplitter (TWindowData *dat);
void TSAPI LoadSplitter (TWindowData *dat);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 910c7a16a0..d031bf322f 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -93,7 +93,7 @@ static HICON Logicons[NR_LOGICONS]; #define STREAMSTAGE_STOP 3
struct LogStreamData {
int stage;
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hDbEvent, hDbEventLast;
char *buffer;
int bufferOffset, bufferLen;
@@ -556,7 +556,7 @@ int DbEventIsForMsgWindow(DBEVENTINFO *dbei) return et && ( et->flags & DETF_MSGWINDOW );
}
-static char *Template_CreateRTFFromDbEvent(TWindowData *dat, HANDLE hContact, HANDLE hDbEvent, int prefixParaBreak, LogStreamData *streamData)
+static char *Template_CreateRTFFromDbEvent(TWindowData *dat, HCONTACT hContact, HANDLE hDbEvent, int prefixParaBreak, LogStreamData *streamData)
{
char *buffer, c;
TCHAR ci, cc;
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index b136c44603..2d54a4702a 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -847,7 +847,7 @@ static void RebuildList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown) if (hItemUnknown && M.GetByte(SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItemUnknown, 1);
- 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, SRMSGMOD, SRMSGSET_TYPING, defType))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
@@ -862,7 +862,7 @@ static void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown) if (hItemUnknown)
db_set_b(0, SRMSGMOD, 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, SRMSGMOD, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0) ? 1 : 0));
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index d7c069a011..9185fea23e 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -133,7 +133,7 @@ static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam) {
TContainerData *pContainer;
- HWND hwnd = M.FindWindow((HANDLE)wParam);
+ HWND hwnd = M.FindWindow((HCONTACT)wParam);
if (hwnd != NULL) {
TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (dat == NULL || (pContainer = dat->pContainer) == NULL)
@@ -166,7 +166,7 @@ static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam) static INT_PTR SetUserPrefs(WPARAM wParam, LPARAM)
{
- HWND hWnd = WindowList_Find(PluginConfig.hUserPrefsWindowList, (HANDLE)wParam);
+ HWND hWnd = WindowList_Find(PluginConfig.hUserPrefsWindowList, (HCONTACT)wParam);
if (hWnd) {
SetForegroundWindow(hWnd); // already open, bring it to front
return 0;
@@ -197,7 +197,7 @@ static INT_PTR GetMessageWindowFlags(WPARAM wParam, LPARAM lParam) HWND hwndTarget = (HWND)lParam;
if (hwndTarget == 0)
- hwndTarget = M.FindWindow((HANDLE)wParam);
+ hwndTarget = M.FindWindow((HCONTACT)wParam);
if (hwndTarget == 0)
return 0;
@@ -234,7 +234,7 @@ INT_PTR MessageWindowOpened(WPARAM wParam, LPARAM lParam) TContainerData *pContainer = NULL;
if (wParam)
- hwnd = M.FindWindow((HANDLE)wParam);
+ hwnd = M.FindWindow((HCONTACT)wParam);
else if (lParam)
hwnd = (HWND) lParam;
else
@@ -271,7 +271,7 @@ INT_PTR MessageWindowOpened(WPARAM wParam, LPARAM lParam) static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam)
{
- HANDLE hContact = ((CLISTEVENT *) lParam)->hContact;
+ HCONTACT hContact = ((CLISTEVENT *) lParam)->hContact;
HWND hwndExisting = M.FindWindow(hContact);
if (hwndExisting != 0)
@@ -296,7 +296,7 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam) INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
TNewWindowData newData = { 0 };
int isSplit = 1;
@@ -355,7 +355,7 @@ INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam) INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
TNewWindowData newData = { 0 };
int isSplit = 1;
@@ -391,7 +391,7 @@ INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam) SendMessage(hwnd, DM_ACTIVATEME, 0, 0); // ask the message window about its parent...
} else {
TCHAR szName[CONTAINER_NAMELEN + 1];
- GetContainerNameForContact((HANDLE)wParam, szName, CONTAINER_NAMELEN);
+ GetContainerNameForContact((HCONTACT)wParam, szName, CONTAINER_NAMELEN);
TContainerData *pContainer = FindContainerByName(szName);
if (pContainer == NULL)
pContainer = CreateContainer(szName, FALSE, hContact);
@@ -465,7 +465,7 @@ int MyAvatarChanged(WPARAM wParam, LPARAM lParam) int AvatarChanged(WPARAM wParam, LPARAM lParam)
{
avatarCacheEntry *ace = (avatarCacheEntry *)lParam;
- HWND hwnd = M.FindWindow((HANDLE)wParam);
+ HWND hwnd = M.FindWindow((HCONTACT)wParam);
if (wParam == 0) { // protocol picture has changed...
M.BroadcastMessage(DM_PROTOAVATARCHANGED, wParam, lParam);
@@ -660,7 +660,7 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild) * bPopupContainer: restore container if it was minimized, otherwise flash it...
*/
-HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, int isSend, const char *pszInitialText, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup, HANDLE hdbEvent)
+HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HCONTACT hContact, int isSend, const char *pszInitialText, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup, HANDLE hdbEvent)
{
TCHAR newcontactname[128], tabtitle[128];
int newItem;
@@ -832,7 +832,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i * a new (cloned) one.
*/
-TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName, HANDLE hContact)
+TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName, HCONTACT hContact)
{
int iMaxTabs = M.GetDword("maxtabs", 0);
if (iMaxTabs > 0 && M.GetByte("limittabs", 0) && !_tcsncmp(szName, _T("default"), 6)) {
@@ -880,7 +880,7 @@ void TSAPI CreateImageList(BOOL bInitial) PluginConfig.g_IconTypingEvent = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING];
}
-int TABSRMM_FireEvent(HANDLE hContact, HWND hwnd, unsigned int type, unsigned int subType)
+int TABSRMM_FireEvent(HCONTACT hContact, HWND hwnd, unsigned int type, unsigned int subType)
{
if (hContact == NULL || hwnd == NULL || !M.GetByte("_eventapi", 1))
return 0;
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index b6a3ace22d..0412e44e76 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -194,7 +194,7 @@ struct TContainerData LONG uChildMinHeight;
int tBorder;
int tBorder_outer_left, tBorder_outer_right, tBorder_outer_top, tBorder_outer_bottom;
- HANDLE hContactFrom;
+ HCONTACT hContactFrom;
BOOL isCloned;
HWND hwndStatus;
int statusBarHeight;
@@ -237,100 +237,100 @@ struct SESSION_INFO; struct TWindowData
{
- UINT cbSize;
- BYTE bType;
+ UINT cbSize;
+ BYTE bType;
TContainerData *pContainer; // parent container description structure
- HWND hwnd;
- DWORD dwFlags;
- DWORD dwFlagsEx;
- HANDLE hContact;
- char *szProto;
- TCHAR szMyNickname[130];
- TCHAR szStatusBar[100];
- TCHAR szStatusBarCustom[100];
- TCHAR newtitle[130]; // tab title...
- TCHAR szStatus[50];
- WORD wStatus;
- char *sendBuffer;
- int iSendBufferSize;
- int iSendLength; // message length in utf-8 octets
- HICON hTabIcon, hTabStatusIcon, hXStatusIcon, hClientIcon, hTaskbarIcon;
- HICON iFlashIcon;
- BOOL mayFlashTab;
- BOOL bTabFlash;
- HWND hwndIEView, hwndFlash, hwndIWebBrowserControl, hwndHPP;
- HWND hwndContactPic, hwndPanelPic, hwndPanelPicParent;
- UINT bbLSideWidth; //MAD
- UINT bbRSideWidth; //MAD
- BYTE kstate[256];
+ HWND hwnd;
+ DWORD dwFlags;
+ DWORD dwFlagsEx;
+ HCONTACT hContact;
+ char *szProto;
+ TCHAR szMyNickname[130];
+ TCHAR szStatusBar[100];
+ TCHAR szStatusBarCustom[100];
+ TCHAR newtitle[130]; // tab title...
+ TCHAR szStatus[50];
+ WORD wStatus;
+ char *sendBuffer;
+ int iSendBufferSize;
+ int iSendLength; // message length in utf-8 octets
+ HICON hTabIcon, hTabStatusIcon, hXStatusIcon, hClientIcon, hTaskbarIcon;
+ HICON iFlashIcon;
+ BOOL mayFlashTab;
+ BOOL bTabFlash;
+ HWND hwndIEView, hwndFlash, hwndIWebBrowserControl, hwndHPP;
+ HWND hwndContactPic, hwndPanelPic, hwndPanelPicParent;
+ UINT bbLSideWidth; //MAD
+ UINT bbRSideWidth; //MAD
+ BYTE kstate[256];
SESSION_INFO *si;
- RECT rcNick, rcUIN, rcStatus, rcPic;
- HANDLE hDbEventFirst, hDbEventLast;
- int sendMode;
- int splitterY, originalSplitterY, dynaSplitter, savedSplitter, savedSplitY, savedDynaSplit;
- int multiSplitterX;
- SIZE minEditBoxSize;
- int showUIElements;
- int nTypeSecs;
- int nTypeMode;
- DWORD nLastTyping;
- int showTyping;
- DWORD lastMessage;
- int iTabID;
- HKL hkl; // keyboard layout identifier
- DWORD dwTickLastEvent, dwUnread;
- HBITMAP hOwnPic;
- SIZE pic;
- int showPic, showInfoPic;
- BOOL fMustOffset;
- BOOL isHistory;
- int doSmileys;
- UINT codePage;
- HICON hSmileyIcon;
- int iLastEventType;
- time_t lastEventTime;
- int iRealAvatarHeight;
- int iButtonBarReallyNeeds;
- DWORD dwLastActivity;
- int iOpenJobs;
- int iCurrentQueueError;
- BOOL bIsMeta;
- HANDLE hFlashingEvent;
- TCHAR myUin[80];
- BOOL bNotOnList;
- int SendFormat;
- HANDLE *hQueuedEvents;
- int iNextQueuedEvent;
+ RECT rcNick, rcUIN, rcStatus, rcPic;
+ HANDLE hDbEventFirst, hDbEventLast;
+ int sendMode;
+ int splitterY, originalSplitterY, dynaSplitter, savedSplitter, savedSplitY, savedDynaSplit;
+ int multiSplitterX;
+ SIZE minEditBoxSize;
+ int showUIElements;
+ int nTypeSecs;
+ int nTypeMode;
+ DWORD nLastTyping;
+ int showTyping;
+ DWORD lastMessage;
+ int iTabID;
+ HKL hkl; // keyboard layout identifier
+ DWORD dwTickLastEvent, dwUnread;
+ HBITMAP hOwnPic;
+ SIZE pic;
+ int showPic, showInfoPic;
+ BOOL fMustOffset;
+ BOOL isHistory;
+ int doSmileys;
+ UINT codePage;
+ HICON hSmileyIcon;
+ int iLastEventType;
+ time_t lastEventTime;
+ int iRealAvatarHeight;
+ int iButtonBarReallyNeeds;
+ DWORD dwLastActivity;
+ int iOpenJobs;
+ int iCurrentQueueError;
+ BOOL bIsMeta;
+ HANDLE hFlashingEvent;
+ TCHAR myUin[80];
+ BOOL bNotOnList;
+ int SendFormat;
+ HANDLE *hQueuedEvents;
+ int iNextQueuedEvent;
#define EVENT_QUEUE_SIZE 10
- int iEventQueueSize;
- LCID lcid;
- TCHAR lcID[10];
- int panelWidth;
- DWORD idle;
- HWND hwndTip;
+ int iEventQueueSize;
+ LCID lcid;
+ TCHAR lcID[10];
+ int panelWidth;
+ DWORD idle;
+ HWND hwndTip;
TOOLINFO ti;
- HANDLE hTimeZone;
- DWORD panelStatusCX;
+ HANDLE hTimeZone;
+ DWORD panelStatusCX;
COLORREF inputbg;
avatarCacheEntry *ace, *ownAce;
- HANDLE *hHistoryEvents;
- int maxHistory, curHistory;
- HANDLE hTheme, hThemeIP, hThemeToolbar;
- char szMicroLf[128];
- DWORD isAutoRTL;
- int nMax; // max message size
- int textLen; // current text len
- LONG ipFieldHeight;
- BOOL clr_added;
- BOOL fIsReattach;
- WPARAM wParam; // used for "delayed" actions like moved splitters in minimized windows
- LPARAM lParam;
- int iHaveRTLLang;
- BOOL fInsertMode;
- bool fkeyProcessed;
- bool fEditNotesActive;
+ HANDLE *hHistoryEvents;
+ int maxHistory, curHistory;
+ HANDLE hTheme, hThemeIP, hThemeToolbar;
+ char szMicroLf[128];
+ DWORD isAutoRTL;
+ int nMax; // max message size
+ int textLen; // current text len
+ LONG ipFieldHeight;
+ BOOL clr_added;
+ BOOL fIsReattach;
+ WPARAM wParam; // used for "delayed" actions like moved splitters in minimized windows
+ LPARAM lParam;
+ int iHaveRTLLang;
+ BOOL fInsertMode;
+ bool fkeyProcessed;
+ bool fEditNotesActive;
CInfoPanel *Panel;
CContactCache *cache;
@@ -417,17 +417,18 @@ struct TIconDescW struct TNewWindowData
{
- HANDLE hContact;
- int isWchar;
- const char* szInitialText;
- int iTabID;
- int iTabImage;
- int iActivate;
- TCITEM item;
- TContainerData* pContainer;
- BOOL bWantPopup;
- HANDLE hdbEvent;
- HKL hkl;
+ HCONTACT hContact;
+ int isWchar;
+ LPCSTR szInitialText;
+ int iTabID;
+ int iTabImage;
+ int iActivate;
+ TCITEM item;
+ BOOL bWantPopup;
+ HANDLE hdbEvent;
+ HKL hkl;
+
+ TContainerData *pContainer;
};
// flags for the container dwFlags
@@ -894,7 +895,7 @@ struct TABSRMM_SessionInfo { typedef struct {
int cbSize;
- HANDLE hContact;
+ HCONTACT hContact;
int uFlags; // should be same as input data unless 0, then it will be the actual type
HWND hwndWindow; //top level window for the contact or NULL if no window exists
int uState; // see window states
diff --git a/plugins/TabSRMM/src/nen.h b/plugins/TabSRMM/src/nen.h index cb7c400a53..812369f357 100644 --- a/plugins/TabSRMM/src/nen.h +++ b/plugins/TabSRMM/src/nen.h @@ -43,7 +43,7 @@ #define MODULE "tabSRMM_NEN"
-int tabSRMM_ShowPopup(HANDLE hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto, TWindowData *dat);
+int tabSRMM_ShowPopup(HCONTACT hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto, TWindowData *dat);
#define DEFAULT_COLBACK RGB(255,255,128)
#define DEFAULT_COLTEXT RGB(0,0,0)
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 8b6e673db2..81631416d7 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -269,7 +269,7 @@ int _cdecl CSendLater::addStub(const char *szSetting, LPARAM lParam) * addJob() will deal with possible duplicates
* @param hContact HANDLE: contact's handle
*/
-void CSendLater::processSingleContact(const HANDLE hContact)
+void CSendLater::processSingleContact(const HCONTACT hContact)
{
int iCount = db_get_dw(hContact, "SendLater", "count", 0);
@@ -291,7 +291,7 @@ void CSendLater::processContacts() {
if (m_fAvail && m_sendLaterContactList.getCount() != 0) {
for (int i=0; i < m_sendLaterContactList.getCount(); i++)
- processSingleContact(m_sendLaterContactList[i]);
+ processSingleContact((HCONTACT)m_sendLaterContactList[i]);
m_sendLaterContactList.destroy();
}
@@ -310,9 +310,9 @@ void CSendLater::processContacts() */
int CSendLater::addJob(const char *szSetting, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)lParam;
- DBVARIANT dbv = {0};
- char *szOrig_Utf = 0;
+ HCONTACT hContact = (HCONTACT)lParam;
+ DBVARIANT dbv = {0};
+ char *szOrig_Utf = 0;
if (!m_fAvail || !szSetting || !strcmp(szSetting, "count") || lstrlenA(szSetting) < 8)
return 0;
@@ -395,13 +395,12 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) */
int CSendLater::sendIt(CSendLaterJob *job)
{
- HANDLE hContact = job->hContact;
- time_t now = time(0);
- DWORD dwFlags = 0;
- DBVARIANT dbv = {0};
+ HCONTACT hContact = job->hContact;
+ time_t now = time(0);
+ DWORD dwFlags = 0;
+ DBVARIANT dbv = {0};
const char *szProto = 0;
-
if (job->bCode == CSendLaterJob::JOB_HOLD || job->bCode == CSendLaterJob::JOB_DEFERRED || job->fSuccess || job->fFailed || job->lastSent > now)
return 0; // this one is frozen or done (will be removed soon), don't process it now.
@@ -486,7 +485,7 @@ int CSendLater::sendIt(CSendLaterJob *job) * and new jobs are created.
*/
-void CSendLater::addContact(const HANDLE hContact)
+void CSendLater::addContact(const HCONTACT hContact)
{
if (!m_fAvail)
return;
@@ -559,7 +558,7 @@ void CSendLater::qMgrUpdate(bool fReEnable) }
}
-LRESULT CSendLater::qMgrAddFilter(const HANDLE hContact, const TCHAR* tszNick)
+LRESULT CSendLater::qMgrAddFilter(const HCONTACT hContact, const TCHAR* tszNick)
{
LRESULT lr;
diff --git a/plugins/TabSRMM/src/sendlater.h b/plugins/TabSRMM/src/sendlater.h index 3ac3d1b302..9c49b3fc00 100644 --- a/plugins/TabSRMM/src/sendlater.h +++ b/plugins/TabSRMM/src/sendlater.h @@ -68,18 +68,19 @@ public: bool mustDelete();
CSendLaterJob();
~CSendLaterJob();
- char szId[20]; // database key name (time stamp of original send)
- HANDLE hContact; // original contact where the message has been assigned
- HANDLE hTargetContact; // *real* contact (can be different for metacontacts, e.g).
- HANDLE hProcess; // returned from the protocols sending service. needed to find it in the ACK handler
- time_t created; // job was created at this time (important to kill jobs, that are too old)
- time_t lastSent; // time at which the delivery was initiated. used to handle timeouts
- char *sendBuffer; // utf-8 send buffer
- PBYTE pBuf; // conventional send buffer (for non-utf8 protocols)
- DWORD dwFlags;
- int iSendCount; // # of times we tried to send it...
- bool fSuccess, fFailed;
- BYTE bCode; // error/progress code (for the UI)
+
+ char szId[20]; // database key name (time stamp of original send)
+ HCONTACT hContact; // original contact where the message has been assigned
+ HCONTACT hTargetContact; // *real* contact (can be different for metacontacts, e.g).
+ HANDLE hProcess; // returned from the protocols sending service. needed to find it in the ACK handler
+ time_t created; // job was created at this time (important to kill jobs, that are too old)
+ time_t lastSent; // time at which the delivery was initiated. used to handle timeouts
+ char *sendBuffer; // utf-8 send buffer
+ PBYTE pBuf; // conventional send buffer (for non-utf8 protocols)
+ DWORD dwFlags;
+ int iSendCount; // # of times we tried to send it...
+ bool fSuccess, fFailed;
+ BYTE bCode; // error/progress code (for the UI)
};
class CSendLater {
@@ -109,7 +110,7 @@ public: bool processCurrentJob();
void processContacts();
int addJob(const char *szSetting, LPARAM lParam);
- void addContact(const HANDLE hContact);
+ void addContact(const HCONTACT hContact);
HANDLE processAck(const ACKDATA *ack);
void invokeQueueMgrDlg();
@@ -117,7 +118,7 @@ public: static INT_PTR svcQMgr(WPARAM wParam, LPARAM lParam);
private:
- void processSingleContact(const HANDLE hContact);
+ void processSingleContact(const HCONTACT hContact);
int sendIt(CSendLaterJob *job);
INT_PTR CALLBACK DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -126,7 +127,7 @@ private: void qMgrFillList(bool fClear = true);
void qMgrSetupColumns();
void qMgrSaveColumns();
- LRESULT qMgrAddFilter(const HANDLE hContact, const TCHAR* tszNick);
+ LRESULT qMgrAddFilter(const HCONTACT hContact, const TCHAR* tszNick);
LIST<void> m_sendLaterContactList;
LIST<CSendLaterJob> m_sendLaterJobList;
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index a3a0764f30..30b9d6a183 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -127,7 +127,7 @@ entry_found: #define SPLIT_WORD_CUTOFF 20
-static int SendChunkW(WCHAR *chunk, HANDLE hContact, DWORD dwFlags)
+static int SendChunkW(WCHAR *chunk, HCONTACT hContact, DWORD dwFlags)
{
int wLen = lstrlenW(chunk);
DWORD memRequired = (wLen + 1) * sizeof(WCHAR);
@@ -142,7 +142,7 @@ static int SendChunkW(WCHAR *chunk, HANDLE hContact, DWORD dwFlags) return CallContactService(hContact, PSS_MESSAGE, dwFlags, (LPARAM)pBuf);
}
-static int SendChunkA(char *chunk, HANDLE hContact, char *szSvc, DWORD dwFlags)
+static int SendChunkA(char *chunk, HCONTACT hContact, char *szSvc, DWORD dwFlags)
{
return(CallContactService(hContact, szSvc, dwFlags, (LPARAM)chunk));
}
@@ -150,13 +150,13 @@ static int SendChunkA(char *chunk, HANDLE hContact, char *szSvc, DWORD dwFlags) static void DoSplitSendW(LPVOID param)
{
SendJob *job = sendQueue->getJobByIndex((int)param);
- BOOL fFirstSend = FALSE;
+ BOOL fFirstSend = FALSE;
WCHAR *wszSaved, savedChar;
- int iCur = 0, iSavedCur = 0, i;
- BOOL fSplitting = TRUE;
- HANDLE hContact = job->hOwner;
- DWORD dwFlags = job->dwFlags;
- int chunkSize = job->chunkSize / 2;
+ int iCur = 0, iSavedCur = 0, i;
+ BOOL fSplitting = TRUE;
+ HCONTACT hContact = job->hOwner;
+ DWORD dwFlags = job->dwFlags;
+ int chunkSize = job->chunkSize / 2;
char *szProto = GetContactProto(hContact);
int iLen = lstrlenA(job->szSendBuffer);
@@ -224,14 +224,14 @@ static void DoSplitSendW(LPVOID param) static void DoSplitSendA(LPVOID param)
{
SendJob *job = sendQueue->getJobByIndex((int)param);
- int id;
- BOOL fFirstSend = FALSE;
+ int id;
+ BOOL fFirstSend = FALSE;
char *szBegin, *szTemp, *szSaved, savedChar;
- int iLen, iCur = 0, iSavedCur = 0, i;
- BOOL fSplitting = TRUE;
- HANDLE hContact = job->hOwner;
- DWORD dwFlags = job->dwFlags;
- int chunkSize = job->chunkSize;
+ int iLen, iCur = 0, iSavedCur = 0, i;
+ BOOL fSplitting = TRUE;
+ HCONTACT hContact = job->hOwner;
+ DWORD dwFlags = job->dwFlags;
+ int chunkSize = job->chunkSize;
iLen = lstrlenA(job->szSendBuffer);
szTemp = (char *)mir_alloc(iLen + 1);
@@ -322,7 +322,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) int iSendLength = getSendLength(iEntry, dat->sendMode);
- 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 && SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
CContactCache *c = CContactCache::getContactCache(hContact);
@@ -339,7 +339,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) return 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 && SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
doSendLater(iEntry, 0, hContact, false);
@@ -804,7 +804,7 @@ LRESULT SendQueue::WarnPendingJobs(unsigned int uNrMessages) *
* @return the index on success, -1 on failure
*/
-int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, bool fIsSendLater)
+int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HCONTACT hContact, bool fIsSendLater)
{
bool fAvail = sendLater->isAvail();
diff --git a/plugins/TabSRMM/src/sendqueue.h b/plugins/TabSRMM/src/sendqueue.h index 05dec3a0d2..38ee818db2 100644 --- a/plugins/TabSRMM/src/sendqueue.h +++ b/plugins/TabSRMM/src/sendqueue.h @@ -44,7 +44,7 @@ struct SendJob char *szSendBuffer;
int iSendLength; // length of message in utf-8 octets (used to check maxlen)
int sendCount;
- HANDLE hOwner;
+ HCONTACT hOwner;
HWND hwndOwner;
unsigned iStatus;
TCHAR szErrorMsg[128];
@@ -92,7 +92,7 @@ public: void recallFailed(const TWindowData *dat, int iEntry) const;
void showErrorControls(TWindowData *dat, const int showCmd) const;
int ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam);
- int doSendLater(int iIndex, TWindowData *dat, HANDLE hContact = 0, bool fIsSendLater = true);
+ int doSendLater(int iIndex, TWindowData *dat, HCONTACT hContact = 0, bool fIsSendLater = true);
/*
* static members
*/
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index aa4d89dc70..68ae9c218f 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -840,7 +840,7 @@ CSideBarButton* CSideBar::findSession(const TWindowData *dat) * @return CSideBarButtonItem*: pointer to the found item. Zero, if none was found
*/
-CSideBarButton* CSideBar::findSession(const HANDLE hContact)
+CSideBarButton* CSideBar::findSession(const HCONTACT hContact)
{
if (hContact == NULL)
return NULL;
diff --git a/plugins/TabSRMM/src/sidebar.h b/plugins/TabSRMM/src/sidebar.h index 71e1f4070b..6150b2526b 100644 --- a/plugins/TabSRMM/src/sidebar.h +++ b/plugins/TabSRMM/src/sidebar.h @@ -194,7 +194,7 @@ private: void removeAll();
void Invalidate();
CSideBarButton* findSession(const TWindowData *dat);
- CSideBarButton* findSession(const HANDLE hContact);
+ CSideBarButton* findSession(const HCONTACT hContact);
LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 2df7517252..292c70872e 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -178,7 +178,7 @@ int _DebugTraceA(const char *fmt, ...) * popup plugin.
*/
-int _DebugPopup(HANDLE hContact, const TCHAR *fmt, ...)
+int _DebugPopup(HCONTACT hContact, const TCHAR *fmt, ...)
{
va_list va;
TCHAR debug[1024];
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index b939e197a3..0bbe718678 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -972,7 +972,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara TabControlData *tabdat = (TabControlData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (tabdat) {
if (tabdat->pContainer == NULL)
- tabdat->pContainer = (TContainerData *)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
+ tabdat->pContainer = (TContainerData*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
tabdat->dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
}
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index a2584bebe2..8c900a51d6 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -81,7 +81,7 @@ static int helpActive = 0; * templates
*/
-static void LoadTemplatesFrom(TTemplateSet *tSet, HANDLE hContact, int rtl)
+static void LoadTemplatesFrom(TTemplateSet *tSet, HCONTACT hContact, int rtl)
{
DBVARIANT dbv = {0};
int i;
@@ -112,8 +112,8 @@ void LoadDefaultTemplates() db_set_ts(NULL, TEMPLATES_MODULE, TemplateNames[i], LTR_Default.szTemplates[i]);
db_set_b(0, TEMPLATES_MODULE, "setup", 2);
}
- LoadTemplatesFrom(<R_Active, (HANDLE)0, 0);
- LoadTemplatesFrom(&RTL_Active, (HANDLE)0, 1);
+ LoadTemplatesFrom(<R_Active, 0, 0);
+ LoadTemplatesFrom(&RTL_Active, 0, 1);
}
INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -140,7 +140,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP COLORREF url_visited = RGB(128, 0, 128);
COLORREF url_unvisited = RGB(0, 0, 255);
dat = (TWindowData*)mir_calloc( sizeof(TWindowData));
- dat->pContainer = (TContainerData *)mir_alloc(sizeof(TContainerData));
+ dat->pContainer = (TContainerData*)mir_alloc(sizeof(TContainerData));
ZeroMemory(dat->pContainer, sizeof(TContainerData));
teInfo = (TemplateEditorInfo *)dat->pContainer;
ZeroMemory(teInfo, sizeof(TemplateEditorInfo));
diff --git a/plugins/TabSRMM/src/templates.h b/plugins/TabSRMM/src/templates.h index dc2cff5b1a..505411aadc 100644 --- a/plugins/TabSRMM/src/templates.h +++ b/plugins/TabSRMM/src/templates.h @@ -31,18 +31,18 @@ struct TemplateEditorInfo int inEdit; // template currently in editor
BOOL updateInfo[TMPL_ERRMSG + 1]; // item states...
HWND hwndParent;
- HANDLE hContact;
+ HCONTACT hContact;
};
struct TemplateEditorNew
{
- HANDLE hContact;
+ HCONTACT hContact;
BOOL rtl;
HWND hwndParent;
};
BOOL CALLBACK DlgProcTemplateEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-static void LoadTemplatesFrom(TTemplateSet *tSet, HANDLE hContact, int rtl);
+static void LoadTemplatesFrom(TTemplateSet *tSet, HCONTACT hContact, int rtl);
void LoadDefaultTemplates();
#define DM_UPDATETEMPLATEPREVIEW (WM_USER + 50)
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index 53f93000a5..b636ae54e6 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -231,7 +231,7 @@ void TSAPI FlashTrayIcon(HICON hIcon) * is deleted, if necessary.
*/
-void TSAPI AddContactToFavorites(HANDLE hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu)
+void TSAPI AddContactToFavorites(HCONTACT hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu)
{
MENUITEMINFO mii = {0};
TCHAR szMenuEntry[80];
@@ -248,7 +248,7 @@ void TSAPI AddContactToFavorites(HANDLE hContact, const TCHAR *szNickname, const szProto = GetContactProto(hContact);
if (szProto) {
if (wStatus == 0)
- wStatus = db_get_w((HANDLE)hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ wStatus = db_get_w((HCONTACT)hContact, szProto, "Status", ID_STATUS_OFFLINE);
if (szStatus == NULL)
szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
}
@@ -273,7 +273,7 @@ void TSAPI AddContactToFavorites(HANDLE hContact, const TCHAR *szNickname, const UINT uid = GetMenuItemID(hMenu, 0);
if (uid) {
DeleteMenu(hMenu, (UINT_PTR)0, MF_BYPOSITION);
- db_set_dw((HANDLE)uid, SRMSGMOD_T, "isRecent", 0);
+ db_set_dw((HCONTACT)uid, SRMSGMOD_T, "isRecent", 0);
}
}
addnew:
@@ -324,7 +324,7 @@ void TSAPI AddContactToFavorites(HANDLE hContact, const TCHAR *szNickname, const typedef struct _recentEntry {
DWORD dwTimestamp;
- HANDLE hContact;
+ HCONTACT hContact;
} RCENTRY;
void TSAPI LoadFavoritesAndRecent()
@@ -336,7 +336,7 @@ void TSAPI LoadFavoritesAndRecent() if (recentEntries == NULL)
return;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (M.GetByte(hContact, "isFavorite", 0))
AddContactToFavorites(hContact, NULL, NULL, NULL, 0, 0, 1, PluginConfig.g_hMenuFavorites);
if ((dwRecent = M.GetDword(hContact, "isRecent", 0)) != 0 && iIndex < nen_options.wMaxRecent) {
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index a5ee6aa901..937482a3ff 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -89,7 +89,7 @@ static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM return DefWindowProc(hWnd, message, wParam, lParam);
}
-void TN_TypingMessage(HANDLE hContact, int iMode)
+void TN_TypingMessage(HCONTACT hContact, int iMode)
{
// hidden & ignored contacts check
if (db_get_b(hContact, "CList", "Hidden", 0) || (db_get_dw(hContact, "Ignore", "Mask1",0) & 1)) // 9 - online notification
@@ -363,7 +363,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
ppd.lchIcon = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING];
- ppd.lchContact = (HANDLE)wParam;
+ ppd.lchContact = (HCONTACT)wParam;
ppd.PluginWindowProc = NULL;
ppd.PluginData = NULL;
PUAddPopupT(&ppd);
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index a5b57a9287..ac362d93f1 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -57,13 +57,13 @@ static int have_ieview = 0, have_hpp = 0; static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG: {
DWORD sCodePage;
int i;
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
DWORD maxhist = M.GetDword(hContact, "maxhist", 0);
BYTE bIEView = M.GetByte(hContact, "ieview", 0);
BYTE bHPP = M.GetByte(hContact, "hpplog", 0);
@@ -362,87 +362,86 @@ int TSAPI LoadLocalFlags(HWND hwnd, TWindowData *dat) */
static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch(msg) {
- case WM_INITDIALOG: {
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ switch (msg) {
+ case WM_INITDIALOG:
+ hContact = (HCONTACT)lParam;
+ TranslateDialogDefault(hwndDlg);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)hContact);
+ SendMessage(hwndDlg, WM_COMMAND, WM_USER + 200, 0);
+ return TRUE;
- hContact = (HANDLE)lParam;
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)hContact);
- SendMessage(hwndDlg, WM_COMMAND, WM_USER + 200, 0);
- return TRUE;
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case WM_USER + 200: {
+ DWORD dwLocalFlags, dwLocalMask, maskval;
+ int i = 0;
+
+ dwLocalFlags = M.GetDword(hContact, "mwflags", 0);
+ dwLocalMask = M.GetDword(hContact, "mwmask", 0);
+
+ while (checkboxes[i].uId) {
+ maskval = checkboxes[i].uFlag;
+
+ if (dwLocalMask & maskval)
+ CheckDlgButton(hwndDlg, checkboxes[i].uId, (dwLocalFlags & maskval) ? BST_CHECKED : BST_UNCHECKED);
+ else
+ CheckDlgButton(hwndDlg, checkboxes[i].uId, BST_INDETERMINATE);
+ i++;
+ }
+ if (M.GetByte("logstatuschanges", 0) == M.GetByte(hContact, "logstatuschanges", 0))
+ CheckDlgButton(hwndDlg, IDC_UPREFS_LOGSTATUS, BST_INDETERMINATE);
+ else
+ CheckDlgButton(hwndDlg, IDC_UPREFS_LOGSTATUS, M.GetByte(hContact, "logstatuschanges", 0) ? BST_CHECKED : BST_UNCHECKED);
+ break;
}
- case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case WM_USER + 200: {
- DWORD dwLocalFlags, dwLocalMask, maskval;
- int i = 0;
+ case WM_USER + 100: {
+ int i = 0;
+ LRESULT state;
+ HWND hwnd = M.FindWindow(hContact);
+ TWindowData *dat = NULL;
+ DWORD *dwActionToTake = (DWORD *)lParam, dwMask = 0, dwFlags = 0, maskval;
- dwLocalFlags = M.GetDword(hContact, "mwflags", 0);
- dwLocalMask = M.GetDword(hContact, "mwmask", 0);
+ if (hwnd)
+ dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- while(checkboxes[i].uId) {
- maskval = checkboxes[i].uFlag;
+ while (checkboxes[i].uId) {
+ maskval = checkboxes[i].uFlag;
- if (dwLocalMask & maskval)
- CheckDlgButton(hwndDlg, checkboxes[i].uId, (dwLocalFlags & maskval) ? BST_CHECKED : BST_UNCHECKED);
- else
- CheckDlgButton(hwndDlg, checkboxes[i].uId, BST_INDETERMINATE);
- i++;
- }
- if (M.GetByte("logstatuschanges", 0) == M.GetByte(hContact, "logstatuschanges", 0))
- CheckDlgButton(hwndDlg, IDC_UPREFS_LOGSTATUS, BST_INDETERMINATE);
- else
- CheckDlgButton(hwndDlg, IDC_UPREFS_LOGSTATUS, M.GetByte(hContact, "logstatuschanges", 0) ? BST_CHECKED : BST_UNCHECKED);
- break;
- }
- case WM_USER + 100: {
- int i=0;
- LRESULT state;
- HWND hwnd = M.FindWindow(hContact);
- TWindowData *dat = NULL;
- DWORD *dwActionToTake = (DWORD *)lParam, dwMask = 0, dwFlags = 0, maskval;
-
- if (hwnd)
- dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
-
- while(checkboxes[i].uId) {
- maskval = checkboxes[i].uFlag;
-
- state = IsDlgButtonChecked(hwndDlg, checkboxes[i].uId);
- if (state != BST_INDETERMINATE) {
- dwMask |= maskval;
- dwFlags = (state == BST_CHECKED) ? (dwFlags | maskval) : (dwFlags & ~maskval);
- }
- i++;
- }
- state = IsDlgButtonChecked(hwndDlg, IDC_UPREFS_LOGSTATUS);
- if (state != BST_INDETERMINATE) {
- db_set_b(hContact, SRMSGMOD_T, "logstatuschanges", (BYTE)state);
- }
- if (dwMask) {
- db_set_dw(hContact, SRMSGMOD_T, "mwmask", dwMask);
- db_set_dw(hContact, SRMSGMOD_T, "mwflags", dwFlags);
- }
- else {
- db_unset(hContact, SRMSGMOD_T, "mwmask");
- db_unset(hContact, SRMSGMOD_T, "mwflags");
- }
- if (hwnd && dat) {
- if (dwMask)
- *dwActionToTake |= (DWORD)UPREF_ACTION_REMAKELOG;
- if ((dat->dwFlags & MWF_LOG_RTL) != (dwFlags & MWF_LOG_RTL))
- *dwActionToTake |= (DWORD)UPREF_ACTION_APPLYOPTIONS;
- }
- break;
+ state = IsDlgButtonChecked(hwndDlg, checkboxes[i].uId);
+ if (state != BST_INDETERMINATE) {
+ dwMask |= maskval;
+ dwFlags = (state == BST_CHECKED) ? (dwFlags | maskval) : (dwFlags & ~maskval);
}
- case IDC_REVERTGLOBAL:
- db_unset(hContact, SRMSGMOD_T, "mwmask");
- db_unset(hContact, SRMSGMOD_T, "mwflags");
- SendMessage(hwndDlg, WM_COMMAND, WM_USER + 200, 0);
- break;
+ i++;
+ }
+ state = IsDlgButtonChecked(hwndDlg, IDC_UPREFS_LOGSTATUS);
+ if (state != BST_INDETERMINATE) {
+ db_set_b(hContact, SRMSGMOD_T, "logstatuschanges", (BYTE)state);
}
+ if (dwMask) {
+ db_set_dw(hContact, SRMSGMOD_T, "mwmask", dwMask);
+ db_set_dw(hContact, SRMSGMOD_T, "mwflags", dwFlags);
+ }
+ else {
+ db_unset(hContact, SRMSGMOD_T, "mwmask");
+ db_unset(hContact, SRMSGMOD_T, "mwflags");
+ }
+ if (hwnd && dat) {
+ if (dwMask)
+ *dwActionToTake |= (DWORD)UPREF_ACTION_REMAKELOG;
+ if ((dat->dwFlags & MWF_LOG_RTL) != (dwFlags & MWF_LOG_RTL))
+ *dwActionToTake |= (DWORD)UPREF_ACTION_APPLYOPTIONS;
+ }
+ break;
+ }
+ case IDC_REVERTGLOBAL:
+ db_unset(hContact, SRMSGMOD_T, "mwmask");
+ db_unset(hContact, SRMSGMOD_T, "mwflags");
+ SendMessage(hwndDlg, WM_COMMAND, WM_USER + 200, 0);
break;
+ }
+ break;
}
return FALSE;
}
@@ -456,16 +455,16 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA * @return LRESULT (ignored for dialog procs, use
* DWLP_MSGRESULT)
*/
- INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
TCITEM tci;
- switch(msg) {
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)hContact);
WindowList_Add(PluginConfig.hUserPrefsWindowList, hwndDlg, hContact);
@@ -507,7 +506,7 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_OPTIONSTAB)), &tci);
ShowWindow((HWND)tci.lParam, SW_HIDE);
break;
- case TCN_SELCHANGE:
+ case TCN_SELCHANGE:
tci.mask = TCIF_PARAM;
TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_OPTIONSTAB)), &tci);
ShowWindow((HWND)tci.lParam, SW_SHOW);
@@ -518,7 +517,7 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA break;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDCANCEL:
DestroyWindow(hwndDlg);
break;
@@ -530,7 +529,7 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA tci.mask = TCIF_PARAM;
int count = TabCtrl_GetItemCount(GetDlgItem(hwndDlg, IDC_OPTIONSTAB));
- for (int i=0; i < count; i++) {
+ for (int i = 0; i < count; i++) {
TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), i, &tci);
SendMessage((HWND)tci.lParam, WM_COMMAND, WM_USER + 100, (LPARAM)&dwActionToTake);
}
@@ -569,4 +568,4 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA break;
}
return FALSE;
- }
+}
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 55525d62c5..2d6d5c7f5e 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -617,7 +617,7 @@ int Utils::RTFColorToIndex(int iCol) */
INT_PTR CALLBACK Utils::PopupDlgProcError(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)PUGetPluginData(hWnd);
+ HCONTACT hContact = (HCONTACT)PUGetPluginData(hWnd);
switch (message) {
case WM_COMMAND:
@@ -642,7 +642,7 @@ INT_PTR CALLBACK Utils::PopupDlgProcError(HWND hWnd, UINT message, WPARAM wParam * @param cs TContainerSettings* target structure
* @return 0 on success, 1 failure (blob does not exist OR is not a valid private setting structure
*/
-int Utils::ReadContainerSettingsFromDB(const HANDLE hContact, TContainerSettings *cs, const char *szKey)
+int Utils::ReadContainerSettingsFromDB(const HCONTACT hContact, TContainerSettings *cs, const char *szKey)
{
CopyMemory(cs, &PluginConfig.globalContainerSettings, sizeof(TContainerSettings));
@@ -664,7 +664,7 @@ int Utils::ReadContainerSettingsFromDB(const HANDLE hContact, TContainerSettings return 1;
}
-int Utils::WriteContainerSettingsToDB(const HANDLE hContact, TContainerSettings *cs, const char *szKey)
+int Utils::WriteContainerSettingsToDB(const HCONTACT hContact, TContainerSettings *cs, const char *szKey)
{
::db_set_blob(hContact, SRMSGMOD_T, szKey ? szKey : CNT_KEYNAME, cs, sizeof(TContainerSettings));
return 0;
@@ -823,7 +823,7 @@ HICON Utils::iconFromAvatar(const TWindowData *dat) return hIcon;
}
-AVATARCACHEENTRY* Utils::loadAvatarFromAVS(const HANDLE hContact)
+AVATARCACHEENTRY* Utils::loadAvatarFromAVS(const HCONTACT hContact)
{
if (!ServiceExists(MS_AV_GETAVATARBITMAP))
return 0;
@@ -1336,7 +1336,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (!(m_dwFlags & MB_YESNO || m_dwFlags & MB_YESNOCANCEL))
::ShowWindow(hwnd, SW_SHOWNORMAL);
- WindowList_Add(hWindowList, hwnd, hwnd);
+ WindowList_Add(hWindowList, hwnd, (HCONTACT)hwnd);
}
return TRUE;
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h index 90ae419e8e..7e3b56b310 100644 --- a/plugins/TabSRMM/src/utils.h +++ b/plugins/TabSRMM/src/utils.h @@ -76,8 +76,8 @@ public: static void TSAPI RTF_ColorAdd (const TCHAR *tszColname, size_t length);
static void TSAPI CreateColorMap (TCHAR *Text);
static int TSAPI RTFColorToIndex (int iCol);
- static int TSAPI ReadContainerSettingsFromDB (const HANDLE hContact, TContainerSettings *cs, const char *szKey = 0);
- static int TSAPI WriteContainerSettingsToDB (const HANDLE hContact, TContainerSettings *cs, const char *szKey = 0);
+ static int TSAPI ReadContainerSettingsFromDB (const HCONTACT hContact, TContainerSettings *cs, const char *szKey = 0);
+ static int TSAPI WriteContainerSettingsToDB (const HCONTACT hContact, TContainerSettings *cs, const char *szKey = 0);
static void TSAPI SettingsToContainer (TContainerData *pContainer);
static void TSAPI ContainerToSettings (TContainerData *pContainer);
static void TSAPI ReadPrivateContainerSettings (TContainerData *pContainer, bool fForce = false);
@@ -97,7 +97,7 @@ public: const TCHAR *tszFilename, bool fForceOverwrite);
static void TSAPI scaleAvatarHeightLimited (const HBITMAP hBm, double& dNewWidth, double& dNewHeight, const LONG maxHeight);
- static AVATARCACHEENTRY* TSAPI loadAvatarFromAVS (const HANDLE hContact);
+ static AVATARCACHEENTRY* TSAPI loadAvatarFromAVS (const HCONTACT hContact);
static void TSAPI sanitizeFilename (wchar_t *tszFilename);
static void TSAPI ensureTralingBackslash (wchar_t *szPathname);
|