summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Scriver/src')
-rw-r--r--plugins/Scriver/src/chat/chat.h4
-rw-r--r--plugins/Scriver/src/chat/manager.cpp2
-rw-r--r--plugins/Scriver/src/chat/tools.cpp2
-rw-r--r--plugins/Scriver/src/cmdlist.cpp6
-rw-r--r--plugins/Scriver/src/cmdlist.h6
-rw-r--r--plugins/Scriver/src/commonheaders.h2
-rw-r--r--plugins/Scriver/src/globals.cpp8
-rw-r--r--plugins/Scriver/src/globals.h2
-rw-r--r--plugins/Scriver/src/input.cpp2
-rw-r--r--plugins/Scriver/src/input.h2
-rw-r--r--plugins/Scriver/src/msgdialog.cpp18
-rw-r--r--plugins/Scriver/src/msglog.cpp8
-rw-r--r--plugins/Scriver/src/msgoptions.cpp4
-rw-r--r--plugins/Scriver/src/msgs.cpp50
-rw-r--r--plugins/Scriver/src/msgs.h12
-rw-r--r--plugins/Scriver/src/msgwindow.cpp25
-rw-r--r--plugins/Scriver/src/msgwindow.h8
-rw-r--r--plugins/Scriver/src/sendqueue.cpp6
-rw-r--r--plugins/Scriver/src/sendqueue.h8
-rw-r--r--plugins/Scriver/src/statusicon.cpp8
-rw-r--r--plugins/Scriver/src/statusicon.h6
21 files changed, 93 insertions, 96 deletions
diff --git a/plugins/Scriver/src/chat/chat.h b/plugins/Scriver/src/chat/chat.h
index 795a882eee..4481f69b4e 100644
--- a/plugins/Scriver/src/chat/chat.h
+++ b/plugins/Scriver/src/chat/chat.h
@@ -93,7 +93,7 @@ INT_PTR CALLBACK DlgProcColorToolWindow(HWND hwndDlg, UINT msg, WPARAM wParam, L
void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedraw);
void LoadMsgLogBitmaps(void);
void FreeMsgLogBitmaps(void);
-TCHAR* GetChatLogsFilename (HANDLE hContact, time_t tTime);
+TCHAR* GetChatLogsFilename(HCONTACT hContact, time_t tTime);
// window.c
int GetTextPixelSize( TCHAR* pszText, HFONT hFont, BOOL bWidth);
@@ -105,7 +105,7 @@ int OptionsInit(void);
void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground);
// manager.c
-HWND SM_FindWindowByContact(HANDLE hContact);
+HWND SM_FindWindowByContact(HCONTACT hContact);
SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent);
char SM_GetStatusIndicator(SESSION_INFO *si, USERINFO *ui);
diff --git a/plugins/Scriver/src/chat/manager.cpp b/plugins/Scriver/src/chat/manager.cpp
index 821a82bde6..51b1b7b4e0 100644
--- a/plugins/Scriver/src/chat/manager.cpp
+++ b/plugins/Scriver/src/chat/manager.cpp
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../commonheaders.h"
-HWND SM_FindWindowByContact(HANDLE hContact)
+HWND SM_FindWindowByContact(HCONTACT hContact)
{
SESSION_INFO *pTemp = pci->wndList;
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp
index e5b2cfc617..196d868a7f 100644
--- a/plugins/Scriver/src/chat/tools.cpp
+++ b/plugins/Scriver/src/chat/tools.cpp
@@ -152,7 +152,7 @@ BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char* pszModule, int
return TRUE;
}
-TCHAR* GetChatLogsFilename(HANDLE hContact, time_t tTime)
+TCHAR* GetChatLogsFilename(HCONTACT hContact, time_t tTime)
{
REPLACEVARSARRAY rva[11];
TCHAR *p = { 0 }, *tszParsedName = { 0 };
diff --git a/plugins/Scriver/src/cmdlist.cpp b/plugins/Scriver/src/cmdlist.cpp
index af591908db..1c6669877b 100644
--- a/plugins/Scriver/src/cmdlist.cpp
+++ b/plugins/Scriver/src/cmdlist.cpp
@@ -71,7 +71,7 @@ TCmdList *tcmdlist_remove(TCmdList *list, TCmdList *n)
return list;
}
-TCmdList *tcmdlist_append2(TCmdList *list, HANDLE hContact, const char *data)
+TCmdList *tcmdlist_append2(TCmdList *list, HCONTACT hContact, const char *data)
{
TCmdList *new_list = (TCmdList *)mir_alloc(sizeof(TCmdList));
TCmdList *attach_to = NULL;
@@ -98,7 +98,7 @@ TCmdList *tcmdlist_append2(TCmdList *list, HANDLE hContact, const char *data)
return list;
}
-TCmdList *tcmdlist_remove2(TCmdList *list, HANDLE hContact)
+TCmdList *tcmdlist_remove2(TCmdList *list, HCONTACT hContact)
{
for (TCmdList *n = list; n != NULL; n = n->next) {
if (n->hContact == hContact) {
@@ -113,7 +113,7 @@ TCmdList *tcmdlist_remove2(TCmdList *list, HANDLE hContact)
return list;
}
-TCmdList *tcmdlist_get2(TCmdList *list, HANDLE hContact)
+TCmdList *tcmdlist_get2(TCmdList *list, HCONTACT hContact)
{
for (TCmdList *n = list; n != NULL; n = n->next)
if (n->hContact == hContact)
diff --git a/plugins/Scriver/src/cmdlist.h b/plugins/Scriver/src/cmdlist.h
index f3ff8309db..ec9675474c 100644
--- a/plugins/Scriver/src/cmdlist.h
+++ b/plugins/Scriver/src/cmdlist.h
@@ -32,9 +32,9 @@ typedef struct _TCmdList {
TCmdList *tcmdlist_append(TCmdList *list, const char *data, int maxSize, BOOL temporary);
TCmdList *tcmdlist_remove(TCmdList *list, TCmdList *n);
TCmdList *tcmdlist_remove_first(TCmdList *list);
-TCmdList *tcmdlist_append2(TCmdList *list, HANDLE hContact, const char *data);
-TCmdList *tcmdlist_remove2(TCmdList *list, HANDLE hContact);
-TCmdList *tcmdlist_get2(TCmdList *list, HANDLE hContact);
+TCmdList *tcmdlist_append2(TCmdList *list, HCONTACT hContact, const char *data);
+TCmdList *tcmdlist_remove2(TCmdList *list, HCONTACT hContact);
+TCmdList *tcmdlist_get2(TCmdList *list, HCONTACT hContact);
int tcmdlist_len(TCmdList *list);
TCmdList *tcmdlist_last(TCmdList *list);
void tcmdlist_free(TCmdList * list);
diff --git a/plugins/Scriver/src/commonheaders.h b/plugins/Scriver/src/commonheaders.h
index d49706abec..9061830df1 100644
--- a/plugins/Scriver/src/commonheaders.h
+++ b/plugins/Scriver/src/commonheaders.h
@@ -102,7 +102,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define CFM_WEIGHT 0x00400000
#endif
-extern HWND SM_FindWindowByContact(HANDLE hContact);
+extern HWND SM_FindWindowByContact(HCONTACT hContact);
extern HINSTANCE g_hInst;
extern CREOleCallback reOleCallback;
extern void ChangeStatusIcons();
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp
index dcb1ec887f..51b2afb776 100644
--- a/plugins/Scriver/src/globals.cpp
+++ b/plugins/Scriver/src/globals.cpp
@@ -400,15 +400,15 @@ static int ackevent(WPARAM wParam, LPARAM lParam)
return 0;
ACKDATA *ack = (ACKDATA*)lParam;
- MessageSendQueueItem *item = FindSendQueueItem((HANDLE)pAck->hContact, (HANDLE)pAck->hProcess);
+ MessageSendQueueItem *item = FindSendQueueItem(pAck->hContact, (HANDLE)pAck->hProcess);
if (item == NULL)
return 0;
HWND hwndSender = item->hwndSender;
if (ack->result == ACKRESULT_FAILED) {
- if (item->hwndErrorDlg != NULL) {
- item = FindOldestPendingSendQueueItem(hwndSender, (HANDLE)pAck->hContact);
- }
+ if (item->hwndErrorDlg != NULL)
+ item = FindOldestPendingSendQueueItem(hwndSender, pAck->hContact);
+
if (item != NULL && item->hwndErrorDlg == NULL) {
if (hwndSender != NULL) {
ErrorWindowData *ewd = (ErrorWindowData *)mir_alloc(sizeof(ErrorWindowData));
diff --git a/plugins/Scriver/src/globals.h b/plugins/Scriver/src/globals.h
index 20cd1e1a19..65ae3b8706 100644
--- a/plugins/Scriver/src/globals.h
+++ b/plugins/Scriver/src/globals.h
@@ -129,7 +129,7 @@ void ReleaseIcons();
void LoadGlobalIcons();
HICON GetCachedIcon(const char *name);
void RegisterFontServiceFonts();
-int ScriverRestoreWindowPosition(HWND hwnd,HANDLE hContact,const char *szModule,const char *szNamePrefix, int flags, int showCmd);
+int ScriverRestoreWindowPosition(HWND hwnd,HCONTACT hContact,const char *szModule,const char *szNamePrefix, int flags, int showCmd);
int ImageList_AddIcon_Ex(HIMAGELIST hIml, int id);
int ImageList_AddIcon_Ex2(HIMAGELIST hIml, HICON hIcon);
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp
index e38356629c..01d286fd0a 100644
--- a/plugins/Scriver/src/input.cpp
+++ b/plugins/Scriver/src/input.cpp
@@ -29,7 +29,7 @@ enum KB_ACTIONS {KB_PREV_TAB = 1, KB_NEXT_TAB, KB_SWITCHTOOLBAR,
KB_SWITCHSTATUSBAR, KB_SWITCHTITLEBAR, KB_SWITCHINFOBAR, KB_MINIMIZE, KB_CLOSE, KB_CLEAR_LOG,
KB_TAB1, KB_TAB2, KB_TAB3, KB_TAB4, KB_TAB5, KB_TAB6, KB_TAB7, KB_TAB8, KB_TAB9, KB_SEND_ALL, KB_PASTESEND, KB_QUOTE};
-void InputAreaContextMenu(HWND hwnd, WPARAM wParam, LPARAM lParam, HANDLE hContact)
+void InputAreaContextMenu(HWND hwnd, WPARAM wParam, LPARAM lParam, HCONTACT hContact)
{
POINT pt;
CHARRANGE sel, all = { 0, -1 };
diff --git a/plugins/Scriver/src/input.h b/plugins/Scriver/src/input.h
index 7d4e8313e2..a36c5b02e0 100644
--- a/plugins/Scriver/src/input.h
+++ b/plugins/Scriver/src/input.h
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef INPUT_H
#define INPUT_H
-extern void InputAreaContextMenu(HWND hwnd, WPARAM wParam, LPARAM lParam, HANDLE hContact);
+extern void InputAreaContextMenu(HWND hwnd, WPARAM wParam, LPARAM lParam, HCONTACT hContact);
extern void RegisterKeyBindings();
extern int InputAreaShortcuts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, CommonWindowData *windowData);
BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK *lParam);
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index dc7281a159..2f76dded88 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -131,7 +131,7 @@ static TCHAR *GetQuotedTextW(TCHAR * text)
return out;
}
-static void saveDraftMessage(HWND hwnd, HANDLE hContact, int codepage)
+static void saveDraftMessage(HWND hwnd, HCONTACT hContact, int codepage)
{
char *textBuffer = GetRichTextEncoded(hwnd, codepage);
if (textBuffer != NULL) {
@@ -141,7 +141,7 @@ static void saveDraftMessage(HWND hwnd, HANDLE hContact, int codepage)
else g_dat.draftList = tcmdlist_remove2(g_dat.draftList, hContact);
}
-void NotifyLocalWinEvent(HANDLE hContact, HWND hwnd, unsigned int type)
+void NotifyLocalWinEvent(HCONTACT hContact, HWND hwnd, unsigned int type)
{
if (hContact == NULL || hwnd == NULL)
return;
@@ -158,7 +158,7 @@ void NotifyLocalWinEvent(HANDLE hContact, HWND hwnd, unsigned int type)
NotifyEventHooks(hHookWinEvt, 0, (LPARAM)&mwe);
}
-static BOOL IsUtfSendAvailable(HANDLE hContact)
+static BOOL IsUtfSendAvailable(HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
if ( szProto == NULL )
@@ -255,12 +255,12 @@ void SetStatusIcon(struct SrmmWindowData *dat)
return;
char *szProto = dat->szProto;
- HANDLE hContact = dat->windowData.hContact;
+ HCONTACT hContact = dat->windowData.hContact;
char* szMetaProto = (char*)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
if ((INT_PTR)szMetaProto != CALLSERVICE_NOTFOUND && strcmp(dat->szProto, szMetaProto) == 0 &&
db_get_b(NULL,"CLC","Meta",0) == 0) {
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)dat->windowData.hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)dat->windowData.hContact, 0);
if (hContact != NULL)
szProto = GetContactProto(hContact);
else
@@ -1076,7 +1076,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
TabControlData tcd;
tcd.iFlags = TCDF_TEXT | TCDF_ICON;
tcd.hIcon = GetTabIcon(dat);
- tcd.pszText = GetTabName((HANDLE *)dat->windowData.hContact);
+ tcd.pszText = GetTabName(dat->windowData.hContact);
SendMessage(dat->hwndParent, CM_UPDATETABCONTROL, (WPARAM)&tcd, (LPARAM)hwndDlg);
mir_free(tcd.pszText);
}
@@ -1086,7 +1086,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
TitleBarData tbd = {0};
tbd.iFlags = TBDF_TEXT | TBDF_ICON;
GetTitlebarIcon(dat, &tbd);
- tbd.pszText = GetWindowTitle((HANDLE *)dat->windowData.hContact, dat->szProto);
+ tbd.pszText = GetWindowTitle(dat->windowData.hContact, dat->szProto);
SendMessage(dat->hwndParent, CM_UPDATETITLEBAR, (WPARAM)&tbd, (LPARAM)hwndDlg);
mir_free(tbd.pszText);
}
@@ -1772,8 +1772,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
smaddInfo.targetMessage = EM_REPLACESEL;
smaddInfo.targetWParam = TRUE;
smaddInfo.Protocolname = dat->szProto;
- if (dat->szProto!=NULL && strcmp(dat->szProto,"MetaContacts")==0) {
- HANDLE hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) dat->windowData.hContact, 0);
+ if (dat->szProto!=NULL && strcmp(dat->szProto,"MetaContacts") == 0) {
+ HCONTACT hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)dat->windowData.hContact, 0);
if (hContact!=NULL) {
smaddInfo.Protocolname = GetContactProto(hContact);
}
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp
index a6c124cb08..0a14b4575f 100644
--- a/plugins/Scriver/src/msglog.cpp
+++ b/plugins/Scriver/src/msglog.cpp
@@ -74,7 +74,7 @@ struct EventData
struct LogStreamData
{
int stage;
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hDbEvent, hDbEventLast;
char *buffer;
int bufferOffset, bufferLen;
@@ -85,7 +85,7 @@ struct LogStreamData
EventData *events;
};
-TCHAR *GetNickname(HANDLE hContact, const char* szProto)
+TCHAR *GetNickname(HCONTACT hContact, const char* szProto)
{
CONTACTINFO ci = { sizeof(ci) };
ci.hContact = hContact;
@@ -151,7 +151,7 @@ int DbEventIsShown(DBEVENTINFO * dbei, struct SrmmWindowData *dat)
return DbEventIsCustomForMsgWindow(dbei);
}
-EventData* getEventFromDB(struct SrmmWindowData *dat, HANDLE hContact, HANDLE hDbEvent)
+EventData* getEventFromDB(struct SrmmWindowData *dat, HCONTACT hContact, HANDLE hDbEvent)
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
@@ -922,7 +922,7 @@ void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend)
smre.hwndRichEditControl = GetDlgItem(hwndDlg, IDC_LOG);
smre.Protocolname = dat->szProto;
if (dat->szProto != NULL && strcmp(dat->szProto, "MetaContacts") == 0) {
- HANDLE hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)dat->windowData.hContact, 0);
+ HCONTACT hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)dat->windowData.hContact, 0);
if (hContact != NULL)
smre.Protocolname = GetContactProto(hContact);
}
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp
index 21a5586116..962ae1dfc2 100644
--- a/plugins/Scriver/src/msgoptions.cpp
+++ b/plugins/Scriver/src/msgoptions.cpp
@@ -845,7 +845,7 @@ static void RebuildList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
if (hItemUnknown && db_get_b(NULL, SRMMMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItemUnknown, 1);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem && db_get_b(hContact, SRMMMOD, SRMSGSET_TYPING, defType))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
@@ -860,7 +860,7 @@ static void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
if (hItemUnknown)
db_set_b(NULL, SRMMMOD, SRMSGSET_TYPINGUNKNOWN, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemUnknown, 0) ? 1 : 0));
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem)
db_set_b(hContact, SRMMMOD, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0) ? 1 : 0));
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 2dc31ada48..f4f9133162 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -27,7 +27,7 @@ HCURSOR hCurSplitNS, hCurSplitWE, hCurHyperlinkHand, hDragCursor;
HANDLE hHookWinEvt, hHookWinPopup, hHookWinWrite;
HGENMENU hMsgMenuItem;
-extern HWND GetParentWindow(HANDLE hContact, BOOL bChat);
+extern HWND GetParentWindow(HCONTACT hContact, BOOL bChat);
#define EVENTTYPE_SCRIVER 2010
#define SCRIVER_DB_GETEVENTTEXT "Scriver/GetText"
@@ -59,11 +59,11 @@ static int SRMMStatusToPf2(int status)
return 0;
}
-int IsAutoPopup(HANDLE hContact) {
+int IsAutoPopup(HCONTACT hContact) {
if (g_dat.flags & SMF_AUTOPOPUP) {
char *szProto = GetContactProto(hContact);
if (strcmp(szProto, "MetaContacts") == 0 ) {
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
if (hContact != NULL)
szProto = GetContactProto(hContact);
}
@@ -96,7 +96,7 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
if (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ))
return 0;
- HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam);
+ HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam);
if (hwnd)
SendMessage(hwnd, HM_DBEVENTADDED, wParam, lParam);
@@ -108,9 +108,9 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
if (hwnd == NULL) {
/* new message */
SkinPlaySound("AlertMsg");
- if (IsAutoPopup((HANDLE)wParam)) {
+ if (IsAutoPopup((HCONTACT)wParam)) {
NewMessageWindowLParam newData = { 0 };
- newData.hContact = (HANDLE)wParam;
+ newData.hContact = (HCONTACT)wParam;
HWND hParent = GetParentWindow(newData.hContact, FALSE);
newData.flags = NMWLP_INCOMING;
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), hParent, DlgProcMessage, (LPARAM)&newData);
@@ -123,7 +123,7 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
CLISTEVENT cle = { sizeof(cle) };
cle.flags = CLEF_TCHAR;
- cle.hContact = (HANDLE)wParam;
+ cle.hContact = (HCONTACT)wParam;
cle.hDbEvent = (HANDLE)lParam;
cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
@@ -137,14 +137,14 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
static INT_PTR SendMessageCommandW(WPARAM wParam, LPARAM lParam)
{
/* does the HCONTACT's protocol support IM messages? */
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if (szProto == NULL)
return 1; /* unknown contact */
if (!CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)
return 1;
- HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam);
+ HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam);
if (hwnd != NULL) {
if (lParam) {
HWND hEdit = GetDlgItem(hwnd, IDC_MESSAGE);
@@ -155,7 +155,7 @@ static INT_PTR SendMessageCommandW(WPARAM wParam, LPARAM lParam)
}
else {
NewMessageWindowLParam newData = { 0 };
- newData.hContact = (HANDLE)wParam;
+ newData.hContact = (HCONTACT)wParam;
newData.szInitialText = (const char *) lParam;
newData.isWchar = 1;
HWND hParent = GetParentWindow(newData.hContact, FALSE);
@@ -166,7 +166,7 @@ static INT_PTR SendMessageCommandW(WPARAM wParam, LPARAM lParam)
static INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam)
{
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
//logInfo("Show message window for: %s (%s)", CallService(MS_CLIST_GETCONTACTDISPLAYNAME, wParam, 0), szProto);
if (szProto) {
/* does the HCONTACT's protocol support IM messages? */
@@ -176,7 +176,7 @@ static INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam)
else /* unknown contact */
return 1;
- HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam);
+ HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam);
if (hwnd != NULL) {
if (lParam) {
HWND hEdit = GetDlgItem(hwnd, IDC_MESSAGE);
@@ -187,7 +187,7 @@ static INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam)
}
else {
NewMessageWindowLParam newData = { 0 };
- newData.hContact = (HANDLE)wParam;
+ newData.hContact = (HCONTACT)wParam;
newData.szInitialText = (const char *)lParam;
HWND hParent = GetParentWindow(newData.hContact, FALSE);
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), hParent, DlgProcMessage, (LPARAM)& newData);
@@ -210,7 +210,7 @@ static int TypingMessage(WPARAM wParam, LPARAM lParam)
SkinPlaySound((lParam) ? "TNStart" : "TNStop");
- HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam);
+ HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam);
if (hwnd)
SendMessage(hwnd, DM_TYPING, 0, lParam);
else if (lParam && (g_dat.flags2 & SMF2_SHOWTYPINGTRAY)) {
@@ -231,7 +231,7 @@ static int TypingMessage(WPARAM wParam, LPARAM lParam)
CLISTEVENT cle = {0};
cle.cbSize = sizeof(cle);
- cle.hContact = (HANDLE)wParam;
+ cle.hContact = (HCONTACT)wParam;
cle.hDbEvent = (HANDLE)1;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hIcon = GetCachedIcon("scriver_TYPING");
@@ -247,7 +247,7 @@ static int TypingMessage(WPARAM wParam, LPARAM lParam)
static int MessageSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto)))
return 0;
WindowList_Broadcast(g_dat.hMessageWindowList, DM_CLISTSETTINGSCHANGED, wParam, lParam);
@@ -257,10 +257,8 @@ static int MessageSettingChanged(WPARAM wParam, LPARAM lParam)
static int ContactDeleted(WPARAM wParam, LPARAM lParam)
{
HWND hwnd;
-
- if ((hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam))) {
+ if ((hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam)))
SendMessage(hwnd, WM_CLOSE, 0, 0);
- }
return 0;
}
@@ -276,7 +274,7 @@ static void RestoreUnreadMessageAlerts(void)
cle.flags = CLEF_TCHAR;
cle.ptszTooltip = toolTip;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hDbEvent = db_event_firstUnread(hContact);
while (hDbEvent) {
dbei.cbBlob = 0;
@@ -340,9 +338,9 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam)
{
- HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam);
+ HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam);
if (hwnd == NULL)
- hwnd = SM_FindWindowByContact((HANDLE)wParam);
+ hwnd = SM_FindWindowByContact((HCONTACT)wParam);
if (hwnd == NULL)
return 1;
@@ -356,7 +354,7 @@ static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam)
static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == 0)
return 0;
@@ -378,7 +376,7 @@ static int AvatarChanged(WPARAM wParam, LPARAM lParam)
if (wParam == 0) // protocol picture has changed...
WindowList_Broadcast(g_dat.hMessageWindowList, DM_AVATARCHANGED, wParam, lParam);
else {
- HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam);
+ HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam);
SendMessage(hwnd, DM_AVATARCHANGED, wParam, lParam);
}
return 0;
@@ -409,9 +407,9 @@ void ChangeStatusIcons()
int StatusIconPressed(WPARAM wParam, LPARAM lParam)
{
StatusIconClickData *sicd = (StatusIconClickData *) lParam;
- HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HANDLE)wParam);
+ HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, (HCONTACT)wParam);
if (hwnd == NULL)
- hwnd = SM_FindWindowByContact((HANDLE)wParam);
+ hwnd = SM_FindWindowByContact((HCONTACT)wParam);
if (hwnd != NULL) {
if (!strcmp(SRMMMOD, sicd->szModule)) {
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h
index 03bacc17be..9272e3638b 100644
--- a/plugins/Scriver/src/msgs.h
+++ b/plugins/Scriver/src/msgs.h
@@ -61,7 +61,7 @@ struct TabCtrlData
struct ParentWindowData
{
HWND hwnd;
- HANDLE hContact;
+ HCONTACT hContact;
int childrenCount;
HWND hwndActive;
HWND hwndStatus;
@@ -84,7 +84,7 @@ struct ParentWindowData
struct MessageWindowTabData
{
HWND hwnd;
- HANDLE hContact;
+ HCONTACT hContact;
char *szProto;
ParentWindowData *parent;
HICON hIcon;
@@ -94,7 +94,7 @@ struct MessageWindowTabData
struct NewMessageWindowLParam
{
- HANDLE hContact;
+ HCONTACT hContact;
BOOL isChat;
int isWchar;
LPCSTR szInitialText;
@@ -105,7 +105,7 @@ struct NewMessageWindowLParam
struct CommonWindowData
{
- HANDLE hContact;
+ HCONTACT hContact;
int codePage;
DWORD flags;
HWND hwndLog;
@@ -230,8 +230,8 @@ int safe_wcslen(wchar_t *msg, int maxLen);
void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend);
void LoadMsgLogIcons(void);
void FreeMsgLogIcons(void);
-TCHAR *GetNickname(HANDLE hContact, const char* szProto);
-int IsAutoPopup(HANDLE hContact);
+TCHAR *GetNickname(HCONTACT hContact, const char* szProto);
+int IsAutoPopup(HCONTACT hContact);
#define MSGFONTID_MYMSG 0
#define MSGFONTID_YOURMSG 1
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp
index 1c691acadd..ffa0b80403 100644
--- a/plugins/Scriver/src/msgwindow.cpp
+++ b/plugins/Scriver/src/msgwindow.cpp
@@ -33,11 +33,11 @@ static void DrawTab(ParentWindowData *dat, HWND hwnd, WPARAM wParam, LPARAM lPa
/////////////////////////////////////////////////////////////////////////////////////////
-extern TCHAR *GetNickname(HANDLE hContact, const char* szProto);
+extern TCHAR *GetNickname(HCONTACT hContact, const char* szProto);
static const TCHAR *titleTokenNames[] = {_T("%name%"), _T("%status%"), _T("%statusmsg%"), _T("%account%")};
-TCHAR* GetWindowTitle(HANDLE *hContact, const char *szProto)
+TCHAR* GetWindowTitle(HCONTACT hContact, const char *szProto)
{
int isTemplate;
int i, j, len;
@@ -135,7 +135,7 @@ TCHAR* GetWindowTitle(HANDLE *hContact, const char *szProto)
return title;
}
-TCHAR* GetTabName(HANDLE *hContact)
+TCHAR* GetTabName(HCONTACT hContact)
{
if (hContact)
return GetNickname(hContact, NULL);
@@ -317,7 +317,7 @@ static void ActivateChild(ParentWindowData *dat, HWND child)
SendMessage(dat->hwndActive, DM_ACTIVATE, WA_ACTIVE, 0);
}
-static void AddChild(ParentWindowData *dat, HWND hwnd, HANDLE hContact)
+static void AddChild(ParentWindowData *dat, HWND hwnd, HCONTACT hContact)
{
MessageWindowTabData *mwtd = (MessageWindowTabData *)mir_alloc(sizeof(MessageWindowTabData));
mwtd->hwnd = hwnd;
@@ -549,13 +549,13 @@ LRESULT CALLBACK TabCtrlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
MessageWindowTabData *mwtd = (MessageWindowTabData *)tci.lParam;
if (mwtd != NULL) {
HWND hChild = mwtd->hwnd;
- HANDLE hContact = mwtd->hContact;
+ HCONTACT hContact = mwtd->hContact;
GetCursorPos(&pt);
HWND hParent = WindowFromPoint(pt);
while (GetParent(hParent) != NULL)
hParent = GetParent(hParent);
- hParent = WindowList_Find(g_dat.hParentWindowList, hParent);
+ hParent = WindowList_Find(g_dat.hParentWindowList, (HCONTACT)hParent);
if ((hParent != NULL && hParent != GetParent(hwnd)) || (hParent == NULL && mwtd->parent->childrenCount > 1 && (GetKeyState(VK_CONTROL) & 0x8000))) {
if (hParent == NULL) {
RECT rc, rcDesktop;
@@ -739,7 +739,6 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case WM_INITDIALOG:
{
HMENU hMenu;
- HANDLE hSContact;
int savePerContact = db_get_b(NULL, SRMMMOD, SRMSGSET_SAVEPERCONTACT, SRMSGDEFSET_SAVEPERCONTACT);
NewMessageWindowLParam *newData = (NewMessageWindowLParam *) lParam;
dat = (ParentWindowData *) mir_alloc(sizeof(ParentWindowData));
@@ -775,12 +774,12 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (dat->prev != NULL)
dat->prev->next = dat;
- WindowList_Add(g_dat.hParentWindowList, hwndDlg, hwndDlg);
+ WindowList_Add(g_dat.hParentWindowList, hwndDlg, (HCONTACT)hwndDlg);
SubclassTabCtrl(dat->hwndTabs);
SetContainerWindowStyle(dat);
- hSContact = savePerContact ? dat->hContact : NULL;
+ HCONTACT hSContact = savePerContact ? dat->hContact : NULL;
dat->bTopmost = db_get_b(hSContact, SRMMMOD, SRMSGSET_TOPMOST, SRMSGDEFSET_TOPMOST);
if (ScriverRestoreWindowPosition(hwndDlg, hSContact, SRMMMOD, (newData->isChat && !savePerContact) ? "chat" : "", 0, SW_HIDE))
SetWindowPos(hwndDlg, 0, 0, 0, 450, 300, SWP_NOZORDER | SWP_NOMOVE | SWP_HIDEWINDOW);
@@ -1129,7 +1128,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
WindowList_Remove(g_dat.hParentWindowList, hwndDlg);
int savePerContact = db_get_b(NULL, SRMMMOD, SRMSGSET_SAVEPERCONTACT, SRMSGDEFSET_SAVEPERCONTACT);
- HANDLE hContact = (savePerContact) ? dat->hContact : NULL;
+ HCONTACT hContact = (savePerContact) ? dat->hContact : NULL;
WINDOWPLACEMENT wp = { sizeof(wp) };
GetWindowPlacement(hwndDlg, &wp);
@@ -1208,7 +1207,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
return TRUE;
case CM_ADDCHILD:
- AddChild(dat, (HWND)wParam, (HANDLE)lParam);
+ AddChild(dat, (HWND)wParam, (HCONTACT)lParam);
return TRUE;
case CM_ACTIVATECHILD:
@@ -1507,7 +1506,7 @@ static void DrawTab(ParentWindowData *dat, HWND hwnd, WPARAM wParam, LPARAM lPar
}
}
-int ScriverRestoreWindowPosition(HWND hwnd, HANDLE hContact, const char *szModule,const char *szNamePrefix, int flags, int showCmd)
+int ScriverRestoreWindowPosition(HWND hwnd, HCONTACT hContact, const char *szModule,const char *szNamePrefix, int flags, int showCmd)
{
WINDOWPLACEMENT wp;
wp.length = sizeof(wp);
@@ -1545,7 +1544,7 @@ int ScriverRestoreWindowPosition(HWND hwnd, HANDLE hContact, const char *szModul
return 0;
}
-HWND GetParentWindow(HANDLE hContact, BOOL bChat)
+HWND GetParentWindow(HCONTACT hContact, BOOL bChat)
{
NewMessageWindowLParam newData = { 0 };
newData.hContact = hContact;
diff --git a/plugins/Scriver/src/msgwindow.h b/plugins/Scriver/src/msgwindow.h
index ea71f2977c..c1977b23bd 100644
--- a/plugins/Scriver/src/msgwindow.h
+++ b/plugins/Scriver/src/msgwindow.h
@@ -88,9 +88,9 @@ struct TabControlData
HICON hIcon;
};
-TCHAR* GetWindowTitle(HANDLE *hContact, const char *szProto);
-TCHAR* GetTabName(HANDLE *hContact);
-HWND GetParentWindow(HANDLE hContact, BOOL bChat);
-void NotifyLocalWinEvent(HANDLE hContact, HWND hwnd, unsigned int type);
+TCHAR* GetWindowTitle(HCONTACT hContact, const char *szProto);
+TCHAR* GetTabName(HCONTACT hContact);
+HWND GetParentWindow(HCONTACT hContact, BOOL bChat);
+void NotifyLocalWinEvent(HCONTACT hContact, HWND hwnd, unsigned int type);
#endif
diff --git a/plugins/Scriver/src/sendqueue.cpp b/plugins/Scriver/src/sendqueue.cpp
index b77fc7a741..0328efb80a 100644
--- a/plugins/Scriver/src/sendqueue.cpp
+++ b/plugins/Scriver/src/sendqueue.cpp
@@ -66,7 +66,7 @@ MessageSendQueueItem* CreateSendQueueItem(HWND hwndSender)
return item;
}
-MessageSendQueueItem* FindOldestPendingSendQueueItem(HWND hwndSender, HANDLE hContact)
+MessageSendQueueItem* FindOldestPendingSendQueueItem(HWND hwndSender, HCONTACT hContact)
{
MessageSendQueueItem *item, *found = NULL;
EnterCriticalSection(&queueMutex);
@@ -79,7 +79,7 @@ MessageSendQueueItem* FindOldestPendingSendQueueItem(HWND hwndSender, HANDLE hCo
return found;
}
-MessageSendQueueItem* FindSendQueueItem(HANDLE hContact, HANDLE hSendId)
+MessageSendQueueItem* FindSendQueueItem(HCONTACT hContact, HANDLE hSendId)
{
mir_cslock lock(queueMutex);
for (MessageSendQueueItem *item = global_sendQueue; item != NULL; item = item->next)
@@ -159,7 +159,7 @@ void ReleaseSendQueueItems(HWND hwndSender)
}
}
-int ReattachSendQueueItems(HWND hwndSender, HANDLE hContact)
+int ReattachSendQueueItems(HWND hwndSender, HCONTACT hContact)
{
int count = 0;
diff --git a/plugins/Scriver/src/sendqueue.h b/plugins/Scriver/src/sendqueue.h
index 7d8955648a..204deec72a 100644
--- a/plugins/Scriver/src/sendqueue.h
+++ b/plugins/Scriver/src/sendqueue.h
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct MessageSendQueueItem
{
HWND hwndSender;
- HANDLE hContact;
+ HCONTACT hContact;
char *proto;
HANDLE hSendId;
int timeout;
@@ -44,12 +44,12 @@ void InitSendQueue();
void DestroySendQueue();
MessageSendQueueItem* CreateSendQueueItem(HWND hwndSender);
TCHAR * GetSendBufferMsg(MessageSendQueueItem *item);
-MessageSendQueueItem* FindOldestPendingSendQueueItem(HWND hwndSender, HANDLE hContact);
-MessageSendQueueItem* FindSendQueueItem(HANDLE hContact, HANDLE hSendId);
+MessageSendQueueItem* FindOldestPendingSendQueueItem(HWND hwndSender, HCONTACT hContact);
+MessageSendQueueItem* FindSendQueueItem(HCONTACT hContact, HANDLE hSendId);
BOOL RemoveSendQueueItem(MessageSendQueueItem* item);
void ReportSendQueueTimeouts(HWND hwndSender);
void ReleaseSendQueueItems(HWND hwndSender);
-int ReattachSendQueueItems(HWND hwndSender, HANDLE hContact);
+int ReattachSendQueueItems(HWND hwndSender, HCONTACT hContact);
void RemoveAllSendQueueItems();
void SendSendQueueItem(MessageSendQueueItem* item);
diff --git a/plugins/Scriver/src/statusicon.cpp b/plugins/Scriver/src/statusicon.cpp
index f9c3d02936..28b26064f6 100644
--- a/plugins/Scriver/src/statusicon.cpp
+++ b/plugins/Scriver/src/statusicon.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
HANDLE hHookIconPressedEvt;
-void DrawStatusIcons(HANDLE hContact, HDC hDC, RECT r, int gap)
+void DrawStatusIcons(HCONTACT hContact, HDC hDC, RECT r, int gap)
{
HICON hIcon;
int x = r.left;
@@ -42,7 +42,7 @@ void DrawStatusIcons(HANDLE hContact, HDC hDC, RECT r, int gap)
}
}
-void CheckStatusIconClick(HANDLE hContact, HWND hwndFrom, POINT pt, RECT r, int gap, int click_flags)
+void CheckStatusIconClick(HCONTACT hContact, HWND hwndFrom, POINT pt, RECT r, int gap, int click_flags)
{
unsigned int iconNum = (pt.x - r.left) / (GetSystemMetrics(SM_CXSMICON) + gap);
StatusIconData *si = Srmm_GetNthIcon(hContact, iconNum);
@@ -61,7 +61,7 @@ void CheckStatusIconClick(HANDLE hContact, HWND hwndFrom, POINT pt, RECT r, int
static int OnSrmmIconChanged(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
WindowList_Broadcast(g_dat.hParentWindowList, DM_STATUSICONCHANGE, 0, 0);
else {
@@ -88,7 +88,7 @@ int DeinitStatusIcons()
return 0;
}
-int GetStatusIconsCount(HANDLE hContact)
+int GetStatusIconsCount(HCONTACT hContact)
{
int nIcon = 0;
while ( Srmm_GetNthIcon(hContact, nIcon) != NULL)
diff --git a/plugins/Scriver/src/statusicon.h b/plugins/Scriver/src/statusicon.h
index 7148a292c8..5d86eb7e22 100644
--- a/plugins/Scriver/src/statusicon.h
+++ b/plugins/Scriver/src/statusicon.h
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int InitStatusIcons();
int DeinitStatusIcons();
-int GetStatusIconsCount(HANDLE hContact);
-void DrawStatusIcons(HANDLE hContact, HDC hdc, RECT r, int gap);
-void CheckStatusIconClick(HANDLE hContact, HWND hwndFrom, POINT pt, RECT rc, int gap, int flags);
+int GetStatusIconsCount(HCONTACT hContact);
+void DrawStatusIcons(HCONTACT hContact, HDC hdc, RECT r, int gap);
+void CheckStatusIconClick(HCONTACT hContact, HWND hwndFrom, POINT pt, RECT rc, int gap, int flags);
#endif