diff options
Diffstat (limited to 'plugins')
650 files changed, 4799 insertions, 5063 deletions
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp index cfdfd8ec4b..d664fd1995 100644 --- a/plugins/AVS/src/acc.cpp +++ b/plugins/AVS/src/acc.cpp @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct
{
- HANDLE hContact;
+ HCONTACT hContact;
char proto[64];
HANDLE hHook;
HANDLE hHookMy;
@@ -556,7 +556,7 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l {
DestroyAnimation(hwnd, data);
- data->hContact = (HANDLE) lParam;
+ data->hContact = (HCONTACT)lParam;
if (lParam == NULL)
data->proto[0] = '\0';
else
diff --git a/plugins/AVS/src/acc.h b/plugins/AVS/src/acc.h index 79f0d826a1..576215b1a4 100644 --- a/plugins/AVS/src/acc.h +++ b/plugins/AVS/src/acc.h @@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA. #ifndef __ACC_H__
# define __ACC_H__
-INT_PTR avSetAvatar( HANDLE hContact, TCHAR* tszPath );
+INT_PTR avSetAvatar(HCONTACT hContact, TCHAR* tszPath );
INT_PTR avSetMyAvatar( char* szProto, TCHAR* tszPath );
int LoadACC();
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 9ca7415ba9..c6155f3bef 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -88,7 +88,7 @@ static CacheNode* AddToList(CacheNode *node) return pCurrent;
}
-CacheNode *FindAvatarInCache(HANDLE hContact, BOOL add, BOOL findAny)
+CacheNode *FindAvatarInCache(HCONTACT hContact, BOOL add, BOOL findAny)
{
if (g_shutDown)
return NULL;
@@ -143,7 +143,7 @@ CacheNode *FindAvatarInCache(HANDLE hContact, BOOL add, BOOL findAny) * popup plugin.
*/
-void NotifyMetaAware(HANDLE hContact, CacheNode *node = NULL, AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)-1)
+void NotifyMetaAware(HCONTACT hContact, CacheNode *node = NULL, AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)-1)
{
if (g_shutDown)
return;
@@ -154,8 +154,8 @@ void NotifyMetaAware(HANDLE hContact, CacheNode *node = NULL, AVATARCACHEENTRY * NotifyEventHooks(hEventChanged, (WPARAM)hContact, (LPARAM)ace);
if (g_MetaAvail && (node->dwFlags & MC_ISSUBCONTACT) && db_get_b(NULL, g_szMetaName, "Enabled", 0)) {
- HANDLE hMasterContact = (HANDLE)db_get_dw(hContact, g_szMetaName, "Handle", 0);
- if (hMasterContact && (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMasterContact, 0) == hContact &&
+ HCONTACT hMasterContact = (HCONTACT)db_get_dw(hContact, g_szMetaName, "Handle", 0);
+ if (hMasterContact && (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMasterContact, 0) == hContact &&
!db_get_b(hMasterContact, "ContactPhoto", "Locked", 0))
NotifyEventHooks(hEventChanged, (WPARAM)hMasterContact, (LPARAM)ace);
}
@@ -200,7 +200,7 @@ void NotifyMetaAware(HANDLE hContact, CacheNode *node = NULL, AVATARCACHEENTRY * // Just delete an avatar from cache
// An cache entry is never deleted. What is deleted is the image handle inside it
// This is done this way to keep track of which avatars avs have to keep track
-void DeleteAvatarFromCache(HANDLE hContact, BOOL forever)
+void DeleteAvatarFromCache(HCONTACT hContact, BOOL forever)
{
if (g_shutDown)
return;
@@ -222,7 +222,7 @@ void DeleteAvatarFromCache(HANDLE hContact, BOOL forever) /////////////////////////////////////////////////////////////////////////////////////////
-int SetAvatarAttribute(HANDLE hContact, DWORD attrib, int mode)
+int SetAvatarAttribute(HCONTACT hContact, DWORD attrib, int mode)
{
if (g_shutDown)
return 0;
@@ -305,7 +305,7 @@ void PicLoader(LPVOID param) mir_sleep(dwDelay);
}
else if (node->mustLoad < 0 && node->ace.hContact) { // delete this picture
- HANDLE hContact = node->ace.hContact;
+ HCONTACT hContact = node->ace.hContact;
EnterCriticalSection(&cachecs);
node->mustLoad = 0;
node->loaded = 0;
diff --git a/plugins/AVS/src/commonheaders.h b/plugins/AVS/src/commonheaders.h index c5f91779c2..2b7b8d7877 100644 --- a/plugins/AVS/src/commonheaders.h +++ b/plugins/AVS/src/commonheaders.h @@ -123,24 +123,24 @@ extern HANDLE hEventChanged, hEventContactAvatarChanged, hMyAvatarChanged; int GetFileHash(TCHAR* filename);
DWORD GetFileSize(TCHAR *szFilename);
-void MakePathRelative(HANDLE hContact);
-void MakePathRelative(HANDLE hContact, TCHAR *dest);
+void MakePathRelative(HCONTACT hContact);
+void MakePathRelative(HCONTACT hContact, TCHAR *dest);
HBITMAP LoadPNG(struct avatarCacheEntry *ace, char *szFilename);
void InitCache(void);
void UnloadCache(void);
-int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto);
-void DeleteAvatarFromCache(HANDLE, BOOL);
+int CreateAvatarInCache(HCONTACT hContact, avatarCacheEntry *ace, char *szProto);
+void DeleteAvatarFromCache(HCONTACT hContact, BOOL);
void PicLoader(LPVOID param);
void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bmHeight, DWORD dwFlags);
-int ChangeAvatar(HANDLE hContact, BOOL fLoad, BOOL fNotifyHist = FALSE, int pa_format = 0);
+int ChangeAvatar(HCONTACT hContact, BOOL fLoad, BOOL fNotifyHist = FALSE, int pa_format = 0);
void DeleteGlobalUserAvatar();
-int FetchAvatarFor(HANDLE hContact, char *szProto = NULL);
-CacheNode* FindAvatarInCache(HANDLE hContact, BOOL add, BOOL findAny = FALSE);
-int SetAvatarAttribute(HANDLE hContact, DWORD attrib, int mode);
+int FetchAvatarFor(HCONTACT hContact, char *szProto = NULL);
+CacheNode* FindAvatarInCache(HCONTACT hContact, BOOL add, BOOL findAny = FALSE);
+int SetAvatarAttribute(HCONTACT hContact, DWORD attrib, int mode);
void SetIgnoreNotify(char *protocol, BOOL ignore);
INT_PTR DrawAvatarPicture(WPARAM wParam, LPARAM lParam);
@@ -149,9 +149,9 @@ INT_PTR GetMyAvatar(WPARAM wParam, LPARAM lParam); INT_PTR ProtectAvatar(WPARAM wParam, LPARAM lParam);
INT_PTR ReportMyAvatarChanged(WPARAM wParam, LPARAM lParam);
-HANDLE GetContactThatHaveTheAvatar(HANDLE hContact, int locked = -1);
+HCONTACT GetContactThatHaveTheAvatar(HCONTACT hContact, int locked = -1);
-void ProcessAvatarInfo(HANDLE hContact, int type, PROTO_AVATAR_INFORMATIONT *pai, const char *szProto);
+void ProcessAvatarInfo(HCONTACT hContact, int type, PROTO_AVATAR_INFORMATIONT *pai, const char *szProto);
int Proto_GetDelayAfterFail(const char *proto);
BOOL Proto_NeedDelaysForAvatars(const char *proto);
@@ -161,4 +161,4 @@ int Proto_AvatarImageProportion(const char *proto); void Proto_GetAvatarMaxSize(const char *proto, int *width, int *height);
int Proto_GetAvatarMaxFileSize(const char *proto);
-protoPicCacheEntry* GetProtoDefaultAvatar(HANDLE hContact);
\ No newline at end of file +protoPicCacheEntry* GetProtoDefaultAvatar(HCONTACT hContact);
\ No newline at end of file diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp index f081908245..9e7be9b152 100644 --- a/plugins/AVS/src/image_utils.cpp +++ b/plugins/AVS/src/image_utils.cpp @@ -2,7 +2,7 @@ #include "image_utils.h"
extern int _DebugTrace(const char *fmt, ...);
-extern int _DebugTrace(HANDLE hContact, const char *fmt, ...);
+extern int _DebugTrace(HCONTACT hContact, const char *fmt, ...);
#define GET_PIXEL(__P__, __X__, __Y__) ( __P__ + width * 4 * (__Y__) + 4 * (__X__))
@@ -410,7 +410,7 @@ DWORD GetImgHash(HBITMAP hBitmap) /*
* Changes the handle to a grayscale image
*/
-HBITMAP MakeGrayscale(HANDLE hContact, HBITMAP hBitmap)
+HBITMAP MakeGrayscale(HCONTACT hContact, HBITMAP hBitmap)
{
if (hBitmap) {
FIBITMAP *dib = fei->FI_CreateDIBFromHBITMAP(hBitmap);
@@ -433,7 +433,7 @@ HBITMAP MakeGrayscale(HANDLE hContact, HBITMAP hBitmap) * See if finds a transparent background in image, and set its transparency
* Return TRUE if found a transparent background
*/
-BOOL MakeTransparentBkg(HANDLE hContact, HBITMAP *hBitmap)
+BOOL MakeTransparentBkg(HCONTACT hContact, HBITMAP *hBitmap)
{
BYTE *p = NULL;
DWORD dwLen;
diff --git a/plugins/AVS/src/image_utils.h b/plugins/AVS/src/image_utils.h index eadb2a3cfe..f22dc47c04 100644 --- a/plugins/AVS/src/image_utils.h +++ b/plugins/AVS/src/image_utils.h @@ -37,8 +37,8 @@ int BmpFilterSaveBitmapW(HBITMAP hBmp, wchar_t *wszFile, int flags); HBITMAP CopyBitmapTo32(HBITMAP hBitmap);
BOOL PreMultiply(HBITMAP hBitmap);
-BOOL MakeTransparentBkg(HANDLE hContact, HBITMAP *hBitmap);
-HBITMAP MakeGrayscale(HANDLE hContact, HBITMAP hBitmap);
+BOOL MakeTransparentBkg(HCONTACT hContact, HBITMAP *hBitmap);
+HBITMAP MakeGrayscale(HCONTACT hContact, HBITMAP hBitmap);
DWORD GetImgHash(HBITMAP hBitmap);
int AVS_pathIsAbsolute(const TCHAR *path);
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 591ac7a693..a4422d83b4 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -134,8 +134,8 @@ static int MetaChanged(WPARAM wParam, LPARAM lParam) AVATARCACHEENTRY *ace;
- HANDLE hContact = (HANDLE) wParam;
- HANDLE hSubContact = GetContactThatHaveTheAvatar(hContact);
+ HCONTACT hContact = (HCONTACT)wParam;
+ HCONTACT hSubContact = GetContactThatHaveTheAvatar(hContact);
// Get the node
CacheNode *node = FindAvatarInCache(hSubContact, TRUE);
@@ -190,7 +190,7 @@ static void LoadAccountInfo(PROTOACCOUNT *acc) g_ProtoPictures.insert(pce);
pce = new protoPicCacheEntry;
- CreateAvatarInCache((HANDLE)-1, pce, acc->szModuleName);
+ CreateAvatarInCache((HCONTACT)-1, pce, acc->szModuleName);
pce->szProtoname = mir_strdup(acc->szModuleName);
pce->tszAccName = mir_tstrdup(acc->tszAccountName);
g_MyAvatars.insert(pce);
@@ -242,7 +242,7 @@ static int ContactSettingChanged(WPARAM wParam, LPARAM lParam) static int ContactDeleted(WPARAM wParam, LPARAM lParam)
{
- DeleteAvatarFromCache((HANDLE)wParam, TRUE);
+ DeleteAvatarFromCache((HCONTACT)wParam, TRUE);
return 0;
}
@@ -401,7 +401,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) // Load global avatar
protoPicCacheEntry *pce = new protoPicCacheEntry;
- CreateAvatarInCache((HANDLE)-1, pce, "");
+ CreateAvatarInCache((HCONTACT)-1, pce, "");
pce->szProtoname = mir_strdup("");
g_MyAvatars.insert(pce);
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index fa15d767a3..ee1fc4007a 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DM_AVATARCHANGED (WM_USER + 12)
#define DM_PROTOCOLCHANGED (WM_USER + 13)
-extern int _DebugPopup(HANDLE hContact, const char *fmt, ...);
+extern int _DebugPopup(HCONTACT hContact, const char *fmt, ...);
extern INT_PTR SetAvatar(WPARAM wParam, LPARAM lParam);
extern OBJLIST<protoPicCacheEntry> g_ProtoPictures;
extern HANDLE hEventChanged;
@@ -41,7 +41,7 @@ extern BOOL ScreenToClient(HWND hWnd, LPRECT lpRect); static BOOL dialoginit = TRUE;
struct WindowData {
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hHook;
};
@@ -423,7 +423,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar BOOL newVal = ListView_GetCheckState(hwndList, i);
if (oldVal && !newVal)
- for (HANDLE hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto))
+ for (HCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto))
DeleteAvatarFromCache(hContact, TRUE);
if (newVal)
@@ -440,7 +440,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar /////////////////////////////////////////////////////////////////////////////////////////
-static void LoadTransparentData(HWND hwndDlg, HANDLE hContact)
+static void LoadTransparentData(HWND hwndDlg, HCONTACT hContact)
{
CheckDlgButton(hwndDlg, IDC_MAKETRANSPBKG, db_get_b(hContact, "ContactPhoto", "MakeTransparentBkg", db_get_b(0, AVS_MODULE, "MakeTransparentBkg", 0)));
SendDlgItemMessage(hwndDlg, IDC_BKG_NUM_POINTS_SPIN, UDM_SETPOS, 0, (LPARAM)db_get_w(hContact, "ContactPhoto", "TranspBkgNumPoints", db_get_w(0, AVS_MODULE, "TranspBkgNumPoints", 5)));
@@ -455,7 +455,7 @@ static void LoadTransparentData(HWND hwndDlg, HANDLE hContact) EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE), transp_enabled);
}
-static void SaveTransparentData(HWND hwndDlg, HANDLE hContact)
+static void SaveTransparentData(HWND hwndDlg, HCONTACT hContact)
{
BOOL transp = IsDlgButtonChecked(hwndDlg, IDC_MAKETRANSPBKG);
if (db_get_b(0, AVS_MODULE, "MakeTransparentBkg", 0) == transp)
@@ -476,18 +476,18 @@ static void SaveTransparentData(HWND hwndDlg, HANDLE hContact) db_set_w(hContact, "ContactPhoto", "TranspBkgColorDiff", tmp);
}
-static void SaveTransparentData(HWND hwndDlg, HANDLE hContact, BOOL locked)
+static void SaveTransparentData(HWND hwndDlg, HCONTACT hContact, BOOL locked)
{
SaveTransparentData(hwndDlg, hContact);
- HANDLE tmp = GetContactThatHaveTheAvatar(hContact, locked);
+ HCONTACT tmp = GetContactThatHaveTheAvatar(hContact, locked);
if (tmp != hContact)
SaveTransparentData(hwndDlg, tmp);
}
INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
struct WindowData *dat = (struct WindowData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (dat)
@@ -501,10 +501,10 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA struct WindowData *dat = (struct WindowData *)malloc(sizeof(struct WindowData));
if (dat)
- dat->hContact = (HANDLE)lParam;
+ dat->hContact = (HCONTACT)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
TranslateDialogDefault(hwndDlg);
if (hContact) {
szNick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
@@ -759,7 +759,7 @@ int OptInit(WPARAM wParam, LPARAM lParam) static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
struct WindowData *dat = (struct WindowData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (dat)
@@ -771,7 +771,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa dat = (struct WindowData *) malloc(sizeof(struct WindowData));
if (dat == NULL)
return FALSE;
- dat->hContact = (HANDLE)lParam;
+ dat->hContact = (HCONTACT)lParam;
HWND protopic = GetDlgItem(hwndDlg, IDC_PROTOPIC);
SendMessage(protopic, AVATAR_SETCONTACT, 0, (LPARAM) dat->hContact);
@@ -781,7 +781,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa SendMessage(protopic, AVATAR_SETRESIZEIFSMALLER, 0, (LPARAM) FALSE);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
TranslateDialogDefault(hwndDlg);
SendMessage(hwndDlg, DM_SETAVATARNAME, 0, 0);
CheckDlgButton(hwndDlg, IDC_PROTECTAVATAR, db_get_b(hContact, "ContactPhoto", "Locked", 0) ? TRUE : FALSE);
@@ -1148,7 +1148,7 @@ int OnDetailsInit(WPARAM wParam, LPARAM lParam) odp.hInstance = g_hInst;
odp.pszTitle = LPGEN("Avatar");
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
if (hContact == NULL) {
// User dialog
odp.pfnDlgProc = DlgProcAvatarProtoInfo;
diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp index beefe4e8ee..9273720962 100644 --- a/plugins/AVS/src/poll.cpp +++ b/plugins/AVS/src/poll.cpp @@ -45,15 +45,15 @@ A queue to request items. One request is done at a time, REQUEST_WAIT_TIME milis static void RequestThread(void *vParam);
extern HANDLE hShutdownEvent;
-extern int DeleteAvatar(HANDLE hContact);
-extern void MakePathRelative(HANDLE hContact, TCHAR *path);
+extern int DeleteAvatar(HCONTACT hContact);
+extern void MakePathRelative(HCONTACT hContact, TCHAR *path);
int Proto_GetDelayAfterFail(const char *proto);
BOOL Proto_IsFetchingWhenProtoNotVisibleAllowed(const char *proto);
BOOL Proto_IsFetchingWhenContactOfflineAllowed(const char *proto);
#ifdef _DEBUG
int _DebugTrace(const char *fmt, ...);
-int _DebugTrace(HANDLE hContact, const char *fmt, ...);
+int _DebugTrace(HCONTACT hContact, const char *fmt, ...);
#endif
// Functions ////////////////////////////////////////////////////////////////////////////
@@ -100,7 +100,7 @@ static BOOL PollCheckProtocol(const char *szProto) }
// Return true if this contact can have avatar requested
-static BOOL PollContactCanHaveAvatar(HANDLE hContact, const char *szProto)
+static BOOL PollContactCanHaveAvatar(HCONTACT hContact, const char *szProto)
{
int status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return (Proto_IsFetchingWhenContactOfflineAllowed(szProto) || status != ID_STATUS_OFFLINE)
@@ -108,12 +108,12 @@ static BOOL PollContactCanHaveAvatar(HANDLE hContact, const char *szProto) }
// Return true if this contact has to be checked
-static BOOL PollCheckContact(HANDLE hContact, const char *szProto)
+static BOOL PollCheckContact(HCONTACT hContact, const char *szProto)
{
return !db_get_b(hContact, "ContactPhoto", "Locked", 0) && FindAvatarInCache(hContact, FALSE, TRUE) != NULL;
}
-static void QueueRemove(HANDLE hContact)
+static void QueueRemove(HCONTACT hContact)
{
mir_cslock lck(cs);
@@ -124,7 +124,7 @@ static void QueueRemove(HANDLE hContact) }
}
-static void QueueAdd(HANDLE hContact, int waitTime)
+static void QueueAdd(HCONTACT hContact, int waitTime)
{
if (fei == NULL || g_shutDown)
return;
@@ -143,12 +143,12 @@ static void QueueAdd(HANDLE hContact, int waitTime) }
// Add an contact to a queue
-void QueueAdd(HANDLE hContact)
+void QueueAdd(HCONTACT hContact)
{
QueueAdd(hContact, waitTime);
}
-void ProcessAvatarInfo(HANDLE hContact, int type, PROTO_AVATAR_INFORMATIONT *pai, const char *szProto)
+void ProcessAvatarInfo(HCONTACT hContact, int type, PROTO_AVATAR_INFORMATIONT *pai, const char *szProto)
{
QueueRemove(hContact);
@@ -202,7 +202,7 @@ void ProcessAvatarInfo(HANDLE hContact, int type, PROTO_AVATAR_INFORMATIONT *pai }
}
-int FetchAvatarFor(HANDLE hContact, char *szProto)
+int FetchAvatarFor(HCONTACT hContact, char *szProto)
{
int result = GAIR_NOAVATAR;
@@ -258,7 +258,7 @@ static void RequestThread(void *vParam) }
// Will request this item
- HANDLE hContact = qi.hContact;
+ HCONTACT hContact = qi.hContact;
queue.remove( queue.getCount()-1 );
QueueRemove(hContact);
LeaveCriticalSection(&cs);
diff --git a/plugins/AVS/src/poll.h b/plugins/AVS/src/poll.h index 99d15da999..7b7924a9cf 100644 --- a/plugins/AVS/src/poll.h +++ b/plugins/AVS/src/poll.h @@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. struct QueueItem
{
- HANDLE hContact;
+ HCONTACT hContact;
DWORD check_time;
};
@@ -31,6 +31,6 @@ void InitPolls(); void UninitPolls();
// Add an contact to a queue
-void QueueAdd(HANDLE hContact);
+void QueueAdd(HCONTACT hContact);
#endif // __POLL_H__
diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 8866404681..85218de38b 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -31,22 +31,22 @@ INT_PTR GetAvatarBitmap(WPARAM wParam, LPARAM lParam) if (wParam == 0 || g_shutDown || fei == NULL)
return 0;
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
hContact = GetContactThatHaveTheAvatar(hContact);
// Get the node
CacheNode *node = FindAvatarInCache(hContact, TRUE);
if (node == NULL || !node->loaded)
- return (INT_PTR) GetProtoDefaultAvatar(hContact);
+ return (INT_PTR)GetProtoDefaultAvatar(hContact);
else
- return (INT_PTR) &node->ace;
+ return (INT_PTR)&node->ace;
}
/////////////////////////////////////////////////////////////////////////////////////////
INT_PTR ProtectAvatar(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
BYTE was_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
if (fei == NULL || was_locked == (BYTE)lParam) // no need for redundant lockings...
@@ -118,7 +118,7 @@ UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP return FALSE;
}
-static INT_PTR avSetAvatar(HANDLE hContact, TCHAR *tszPath)
+static INT_PTR avSetAvatar(HCONTACT hContact, TCHAR *tszPath)
{
BYTE is_locked = 0;
TCHAR FileName[MAX_PATH], szBackupName[MAX_PATH];
@@ -188,12 +188,12 @@ static INT_PTR avSetAvatar(HANDLE hContact, TCHAR *tszPath) INT_PTR SetAvatar(WPARAM wParam, LPARAM lParam)
{
- return avSetAvatar((HANDLE)wParam, _A2T((const char*)lParam ));
+ return avSetAvatar((HCONTACT)wParam, _A2T((const char*)lParam));
}
INT_PTR SetAvatarW(WPARAM wParam, LPARAM lParam)
{
- return avSetAvatar((HANDLE)wParam, (TCHAR*)lParam );
+ return avSetAvatar((HCONTACT)wParam, (TCHAR*)lParam);
}
/*
@@ -932,7 +932,7 @@ static void ReloadMyAvatar(LPVOID lpParam) if (g_MyAvatars[i].hbmPic)
DeleteObject(g_MyAvatars[i].hbmPic);
- if (CreateAvatarInCache((HANDLE)-1, &g_MyAvatars[i], myAvatarProto) != -1)
+ if (CreateAvatarInCache((HCONTACT)-1, &g_MyAvatars[i], myAvatarProto) != -1)
NotifyEventHooks(hMyAvatarChanged, (WPARAM)myAvatarProto, (LPARAM)&g_MyAvatars[i]);
else
NotifyEventHooks(hMyAvatarChanged, (WPARAM)myAvatarProto, 0);
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index e72921dc62..3c6a40c4e8 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -37,7 +37,7 @@ int _DebugTrace(const char *fmt, ...) return 0;
}
-int _DebugTrace(HANDLE hContact, const char *fmt, ...)
+int _DebugTrace(HCONTACT hContact, const char *fmt, ...)
{
char text[1024];
size_t len;
@@ -119,7 +119,7 @@ size_t AVS_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut) * convert the avatar image path to a relative one...
* given: contact handle, path to image
*/
-void MakePathRelative(HANDLE hContact, TCHAR *path)
+void MakePathRelative(HCONTACT hContact, TCHAR *path)
{
TCHAR szFinalPath[MAX_PATH];
szFinalPath[0] = '\0';
@@ -137,7 +137,7 @@ void MakePathRelative(HANDLE hContact, TCHAR *path) * given: contact handle
*/
-void MakePathRelative(HANDLE hContact)
+void MakePathRelative(HCONTACT hContact)
{
DBVARIANT dbv;
if ( !db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
@@ -148,7 +148,7 @@ void MakePathRelative(HANDLE hContact) // create the avatar in cache
// returns 0 if not created (no avatar), iIndex otherwise, -2 if has to request avatar, -3 if avatar too big
-int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto)
+int CreateAvatarInCache(HCONTACT hContact, avatarCacheEntry *ace, char *szProto)
{
DBVARIANT dbv = {0};
char *szExt = NULL;
@@ -493,7 +493,7 @@ BOOL Proto_IsFetchingWhenContactOfflineAllowed(const char *proto) /////////////////////////////////////////////////////////////////////////////////////////
-protoPicCacheEntry *GetProtoDefaultAvatar(HANDLE hContact)
+protoPicCacheEntry *GetProtoDefaultAvatar(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto) {
@@ -506,7 +506,7 @@ protoPicCacheEntry *GetProtoDefaultAvatar(HANDLE hContact) return NULL;
}
-HANDLE GetContactThatHaveTheAvatar(HANDLE hContact, int locked)
+HCONTACT GetContactThatHaveTheAvatar(HCONTACT hContact, int locked)
{
if (g_MetaAvail && db_get_b(NULL, g_szMetaName, "Enabled", 0)) {
if (db_get_dw(hContact, g_szMetaName, "NumContacts", 0) >= 1) {
@@ -514,13 +514,13 @@ HANDLE GetContactThatHaveTheAvatar(HANDLE hContact, int locked) locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
if (!locked)
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
}
}
return hContact;
}
-int ChangeAvatar(HANDLE hContact, BOOL fLoad, BOOL fNotifyHist, int pa_format)
+int ChangeAvatar(HCONTACT hContact, BOOL fLoad, BOOL fNotifyHist, int pa_format)
{
if (g_shutDown)
return 0;
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index e543699041..009ada955c 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -267,7 +267,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp psr->id = mir_tstrdup(szUserId);
acs->psr = psr;
- HANDLE hContact = (HANDLE)CallProtoService(acs->proto, PS_ADDTOLIST, IsDlgButtonChecked(hdlg, IDC_ADDTEMP) ? PALF_TEMPORARY : 0, (LPARAM)acs->psr);
+ HCONTACT hContact = (HCONTACT)CallProtoService(acs->proto, PS_ADDTOLIST, IsDlgButtonChecked(hdlg, IDC_ADDTEMP) ? PALF_TEMPORARY : 0, (LPARAM)acs->psr);
if (hContact == NULL) {
MessageBox(NULL,
TranslateT("The contact cannot be added to your contact list. If you are not logged into the selected account, please try to do so. Also, make sure the contact ID is entered correctly."),
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp index 98548ce133..5761003923 100644 --- a/plugins/Alarms/src/alarms.cpp +++ b/plugins/Alarms/src/alarms.cpp @@ -64,7 +64,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA return DefWindowProc(hWnd, message, wParam, lParam);
}
-void ShowPopup(HANDLE hContact, const TCHAR *msg)
+void ShowPopup(HCONTACT hContact, const TCHAR *msg)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
TCHAR *lpzContactName = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
@@ -87,7 +87,7 @@ void ShowPopup(HANDLE hContact, const TCHAR *msg) static int PluginSendMessage(WPARAM wParam,LPARAM lParam)
{
- CallContactService((HANDLE)wParam,PSS_MESSAGE,0,lParam);
+ CallContactService((HCONTACT)wParam,PSS_MESSAGE,0,lParam);
return 0;
}
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp index cedb7552fe..e48b15d779 100644 --- a/plugins/AssocMgr/src/test.cpp +++ b/plugins/AssocMgr/src/test.cpp @@ -126,7 +126,7 @@ static int ServiceParseAimLink(WPARAM wParam,LPARAM lParam) /* send a message to a contact */
else if (!_strnicmp(arg,"goim?",5)) {
char *tok,*sn=NULL,*msg=NULL;
- HANDLE hContact;
+ HCONTACT hContact;
if (*(arg+=5)==0) return 1; /* parse failed */
tok=strtok(arg,"&"); /* first token */
while(tok!=NULL) {
@@ -206,9 +206,9 @@ void aim_links_destroy() #define hInst GetModuleHandleA("ICQ")
static __inline HANDLE HContactFromUIN(DWORD dwUIN,int *Added) { dwUIN; Added; return db_find_first(); }
static __inline HANDLE ICQFindFirstContact(void) { return NULL; }
-static __inline HANDLE ICQFindNextContact(HANDLE hContact) { hContact; return NULL; }
-static __inline void AddToCache(HANDLE hContact,DWORD dwUin) { hContact; dwUin; }
-static __inline DWORD ICQGetContactSettingUIN(HANDLE hContact) { hContact; return 0; }
+static __inline HANDLE ICQFindNextContact(HCONTACT hContact) { hContact; return NULL; }
+static __inline void AddToCache(HCONTACT hContact,DWORD dwUin) { hContact; dwUin; }
+static __inline DWORD ICQGetContactSettingUIN(HCONTACT hContact) { hContact; return 0; }
static __inline HANDLE HandleFromCacheByUin(DWORD dwUin) { dwUin; return NULL; }
#include <m_protosvc.h>
#include <m_message.h>
@@ -254,7 +254,7 @@ typedef struct { static HANDLE IsHContactFromUIN(DWORD uin)
{
- HANDLE hContact;
+ HCONTACT hContact;
DWORD dwUin;
hContact=HandleFromCacheByUin(uin);
if(hContact!=NULL) return hContact;
@@ -300,7 +300,7 @@ static void AddIcqUser(ICQFILEINFO *info) static void MessageIcqUser(ICQFILEINFO *info)
{
- HANDLE hContact;
+ HCONTACT hContact;
if(ServiceExists(MS_MSG_SENDMESSAGE)) {
hContact=HContactFromUIN(atoi(info->uin),NULL); /* adds the contact if needed */
if(hContact!=NULL)
@@ -445,7 +445,7 @@ static int ServiceParseYmsgrLink(WPARAM wParam,LPARAM lParam) /* send a message to a contact */
else if (!_strnicmp(arg,"sendim?",7)) {
char *tok,*id=NULL,*msg=NULL;
- HANDLE hContact;
+ HCONTACT hContact;
if (*(arg+=7)==0) return 1; /* parse failed */
tok=strtok(arg,"&"); /* first token */
if(tok!=NULL) id=tok;
@@ -562,7 +562,7 @@ static int ServiceParseMsnimLink(WPARAM wParam,LPARAM lParam) /* "voice" and "video" not yet implemented, perform same action as "chat" */
else if (!_strnicmp(arg,"chat?",5) || !_strnicmp(arg,"voice?",6) || !_strnicmp(arg,"video?",6)) {
char *tok,*email=NULL;
- HANDLE hContact;
+ HCONTACT hContact;
if (*(arg+=5)==0) return 1; /* parse failed */
if (*arg=='?' && *(++arg)==0) return 1; /* for "voice?" and "video?" */
tok=strtok(arg,"&"); /* first token */
@@ -637,7 +637,7 @@ static int ServiceParseLink(WPARAM wParam,LPARAM lParam) if(arg==NULL) return 1; /* parse failed */
for (++arg;*arg=='/';++arg);
/* send a message to a contact */
- { HANDLE hContact;
+ { HCONTACT hContact;
if(ServiceExists(MS_MSG_SENDMESSAGE)) {
hContact=gg_getcontact(atoi(arg),TRUE,FALSE,arg);
if(hContact!=NULL)
@@ -714,7 +714,7 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam) /* send a message to a contact */
else if (*arg==0 || (!_strnicmp(arg,"message",7) && (*(arg+7)==';' || *(arg+7)==0))) {
char *tok,*subj=NULL,*body=NULL;
- HANDLE hContact;
+ HCONTACT hContact;
char msg[1024];
arg+=7;
while(*arg==';') ++arg;
@@ -754,7 +754,7 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam) }
/* remove user from contact list */
else if (!_strnicmp(arg,"remove",6) && (*(arg+6)==';' || *(arg+6)==0)) {
- HANDLE hContact;
+ HCONTACT hContact;
hContact=JabberHContactFromJID(jid);
if(hContact==NULL) /* not yet implemented: show standard miranda dialog here */
CallService(MS_DB_CONTACT_DELETE,(WPARAM)hContact,0);
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index 4771928552..92a2fbeaca 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -61,7 +61,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda return &pluginInfo;
}
-INT_PTR getIconToUse(HANDLE hContact, LPARAM lParam)
+INT_PTR getIconToUse(HCONTACT hContact, LPARAM lParam)
{
char *proto = GetContactProto(hContact);
// if (lParam == 1) return icon_none;
@@ -94,7 +94,7 @@ int onExtraImageApplying(WPARAM wParam, LPARAM lParam) if (wParam == NULL)
return 0;
- int usedIcon = getIconToUse((HANDLE) wParam, lParam);
+ int usedIcon = getIconToUse((HCONTACT)wParam, lParam);
const char *icon;
switch (usedIcon) {
@@ -103,14 +103,14 @@ int onExtraImageApplying(WPARAM wParam, LPARAM lParam) case icon_auth: icon = "auth_icon"; break;
default: icon = NULL; break;
}
- ExtraIcon_SetIcon(hExtraIcon, (HANDLE)wParam, icon);
+ ExtraIcon_SetIcon(hExtraIcon, (HCONTACT)wParam, icon);
return 0;
}
int onContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
- char *proto = GetContactProto((HANDLE)wParam);
+ char *proto = GetContactProto((HCONTACT)wParam);
if (!proto) return 0;
if (!lstrcmpA(cws->szModule,proto))
@@ -123,7 +123,7 @@ int onContactSettingChanged(WPARAM wParam,LPARAM lParam) int onDBContactAdded(WPARAM wParam, LPARAM lParam)
{
// A new contact added, mark it as recent
- db_set_b((HANDLE)wParam, MODULENAME, "ShowIcons", 1);
+ db_set_b((HCONTACT)wParam, MODULENAME, "ShowIcons", 1);
onExtraImageApplying(wParam, 0);
return 0;
@@ -131,8 +131,8 @@ int onDBContactAdded(WPARAM wParam, LPARAM lParam) INT_PTR onAuthMenuSelected(WPARAM wParam, LPARAM lParam)
{
- byte enabled = db_get_b((HANDLE)wParam,"AuthState","ShowIcons",1);
- db_set_b((HANDLE)wParam, MODULENAME, "ShowIcons", !enabled);
+ byte enabled = db_get_b((HCONTACT)wParam,"AuthState","ShowIcons",1);
+ db_set_b((HCONTACT)wParam, MODULENAME, "ShowIcons", !enabled);
onExtraImageApplying(wParam, 0);
return 0;
@@ -140,7 +140,7 @@ INT_PTR onAuthMenuSelected(WPARAM wParam, LPARAM lParam) int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
char *proto = GetContactProto(hContact);
if (!proto)
return 0;
@@ -173,7 +173,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) hExtraIcon = ExtraIcon_Register("authstate", LPGEN("Auth State"), "authgrant_icon");
// Set initial value for all contacts
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
onExtraImageApplying((WPARAM)hContact, 1);
hOptInitialise = HookEvent(ME_OPT_INITIALISE, onOptInitialise);
diff --git a/plugins/AuthState/src/options.cpp b/plugins/AuthState/src/options.cpp index 5fe5635b92..48fb2add44 100644 --- a/plugins/AuthState/src/options.cpp +++ b/plugins/AuthState/src/options.cpp @@ -55,7 +55,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP bContactMenuItem = IsDlgButtonChecked(hwndDlg, IDC_ENABLEMENUITEM);
bIconsForRecentContacts = IsDlgButtonChecked(hwndDlg, IDC_ICONSFORRECENT);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
onExtraImageApplying((WPARAM)hContact,0);
//Store options values to DB
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index a48161c85b..a51db88ff1 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -181,7 +181,7 @@ static BOOL CheckAllContactsOffline(void) {
BOOL fSmartCheck,fAllOffline=TRUE; /* tentatively */
fSmartCheck=db_get_b(NULL,"AutoShutdown","SmartOfflineCheck",SETTING_SMARTOFFLINECHECK_DEFAULT);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *pszProto = GetContactProto(hContact);
if (pszProto != NULL && CallProtoService(pszProto,PS_GETSTATUS,0,0) != ID_STATUS_OFFLINE) {
if (db_get_b(hContact,pszProto,"ChatRoom",0)) continue;
@@ -203,7 +203,7 @@ static int StatusSettingChanged(WPARAM wParam,LPARAM lParam) if (currentWatcherType&SDWTF_STATUS) {
DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam;
if ((HANDLE)wParam != NULL && dbcws->value.wVal==ID_STATUS_OFFLINE && !lstrcmpA(dbcws->szSetting,"Status")) {
- char *pszProto = GetContactProto((HANDLE)wParam);
+ char *pszProto = GetContactProto((HCONTACT)wParam);
if (pszProto != NULL && !lstrcmpA(dbcws->szModule,pszProto))
if (CheckAllContactsOffline())
ShutdownAndStopWatcher();
@@ -239,7 +239,7 @@ static BOOL CALLBACK CpuUsageWatcherProc(BYTE nCpuUsage,LPARAM lParam) static int WeatherUpdated(WPARAM wParam,LPARAM lParam)
{
- char *pszProto = GetContactProto((HANDLE)wParam);
+ char *pszProto = GetContactProto((HCONTACT)wParam);
if ((BOOL)lParam && pszProto != NULL && CallProtoService(pszProto,PS_GETSTATUS,0,0)==THUNDER)
if (db_get_b(NULL,"AutoShutdown","WeatherShutdown",SETTING_WEATHERSHUTDOWN_DEFAULT))
ServiceShutdown(SDSDT_SHUTDOWN,TRUE);
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 46c84d363d..82a987b0b5 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -23,22 +23,22 @@ Avatar History Plugin HGENMENU hMenu = NULL;
DWORD WINAPI AvatarDialogThread(LPVOID param);
static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
-int ShowSaveDialog(HWND hwnd, TCHAR* fn,HANDLE hContact = NULL);
+int ShowSaveDialog(HWND hwnd, TCHAR* fn,HCONTACT hContact = NULL);
BOOL ProtocolEnabled(const char *proto);
-int FillAvatarListFromDB(HWND list, HANDLE hContact);
-int FillAvatarListFromFolder(HWND list, HANDLE hContact);
-int FillAvatarListFromFiles(HWND list, HANDLE hContact);
+int FillAvatarListFromDB(HWND list, HCONTACT hContact);
+int FillAvatarListFromFolder(HWND list, HCONTACT hContact);
+int FillAvatarListFromFiles(HWND list, HCONTACT hContact);
int CleanupAvatarPic(HWND hwnd);
bool UpdateAvatarPic(HWND hwnd);
-TCHAR * GetContactFolder(TCHAR *fn, HANDLE hContact);
+TCHAR * GetContactFolder(TCHAR *fn, HCONTACT hContact);
BOOL ResolveShortcut(TCHAR *shortcut, TCHAR *file);
static INT_PTR ShowDialogSvc(WPARAM wParam, LPARAM lParam);
struct AvatarDialogData
{
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR fn[MAX_PATH];
HWND parent;
};
@@ -65,7 +65,7 @@ public: TCHAR *filelink;
};
-int OpenAvatarDialog(HANDLE hContact, char* fn)
+int OpenAvatarDialog(HCONTACT hContact, char* fn)
{
HWND hAvatarWindow = WindowList_Find(hAvatarWindowsList, hContact);
if (hAvatarWindow)
@@ -222,7 +222,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l DestroyMenu(menu);
ListEntry *le = (ListEntry*) SendMessage(hwndList, LB_GETITEMDATA, pos, 0);
- HANDLE hContact = (HANDLE) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT) GetWindowLongPtr(hwnd, GWLP_USERDATA);
switch(ret) {
case ID_AVATARLISTPOPUP_SAVEAS:
ShowSaveDialog(hwnd, le->filename, hContact);
@@ -302,7 +302,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l switch(LOWORD(wParam)) {
case IDOK:
if (HIWORD(wParam) == BN_CLICKED) {
- HANDLE hContact = (HANDLE) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT) GetWindowLongPtr(hwnd, GWLP_USERDATA);
db_set_b(hContact, MODULE_NAME, "AvatarPopups", (BYTE) IsDlgButtonChecked(hwnd, IDC_POPUPUSER));
db_set_b(hContact, MODULE_NAME, "LogToDisk", (BYTE) IsDlgButtonChecked(hwnd, IDC_LOGUSER));
db_set_b(hContact, MODULE_NAME, "LogToHistory", (BYTE) IsDlgButtonChecked(hwnd, IDC_HISTORYUSER));
@@ -324,7 +324,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l case IDC_OPENFOLDER:
if (HIWORD(wParam) == BN_CLICKED && opts.log_per_contact_folders) {
TCHAR avfolder[MAX_PATH];
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
GetContactFolder(avfolder, hContact);
ShellExecute(NULL, db_get_b(NULL, MODULE_NAME, "OpenFolderMethod", 0) ? _T("explore") : _T("open"), avfolder, NULL, NULL, SW_SHOWNORMAL);
return TRUE;
@@ -373,7 +373,7 @@ int AddFileToList(TCHAR *path,TCHAR *lnk,TCHAR *filename, HWND list) return max_pos;
}
-int FillAvatarListFromFiles(HWND list, HANDLE hContact)
+int FillAvatarListFromFiles(HWND list, HCONTACT hContact)
{
int max_pos = 0;
TCHAR dir[MAX_PATH], path[MAX_PATH];
@@ -400,7 +400,7 @@ int FillAvatarListFromFiles(HWND list, HANDLE hContact) return 0;
}
-int FillAvatarListFromFolder(HWND list, HANDLE hContact)
+int FillAvatarListFromFolder(HWND list, HCONTACT hContact)
{
int max_pos = 0;
TCHAR dir[MAX_PATH], path[MAX_PATH];
@@ -429,7 +429,7 @@ int FillAvatarListFromFolder(HWND list, HANDLE hContact) return 0;
}
-int FillAvatarListFromDB(HWND list, HANDLE hContact)
+int FillAvatarListFromDB(HWND list, HCONTACT hContact)
{
int max_pos = 0;
BYTE blob[2048];
@@ -513,7 +513,7 @@ int CleanupAvatarPic(HWND hwnd) int PreBuildContactMenu(WPARAM wParam,LPARAM lParam)
{
- char *proto = GetContactProto((HANDLE)wParam);
+ char *proto = GetContactProto((HCONTACT)wParam);
Menu_ShowItem(hMenu, ProtocolEnabled(proto));
return 0;
}
@@ -534,12 +534,12 @@ void InitMenuItem() static INT_PTR ShowDialogSvc(WPARAM wParam, LPARAM lParam)
{
- OpenAvatarDialog((HANDLE)wParam, (char*)lParam);
+ OpenAvatarDialog((HCONTACT)wParam, (char*)lParam);
return 0;
}
-int ShowSaveDialog(HWND hwnd, TCHAR* fn, HANDLE hContact)
+int ShowSaveDialog(HWND hwnd, TCHAR* fn, HCONTACT hContact)
{
TCHAR filter[MAX_PATH];
TCHAR file[MAX_PATH];
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index cc6b049e70..156134bea9 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -40,7 +40,7 @@ int OptInit(WPARAM wParam,LPARAM lParam); TCHAR* GetHistoryFolder(TCHAR *fn);
TCHAR* GetProtocolFolder(TCHAR *fn, char *proto);
-TCHAR* GetOldStyleAvatarName(TCHAR *fn, HANDLE hContact);
+TCHAR* GetOldStyleAvatarName(TCHAR *fn, HCONTACT hContact);
void InitMenuItem();
@@ -84,7 +84,7 @@ static INT_PTR GetCachedAvatar(WPARAM wParam, LPARAM lParam) static INT_PTR IsEnabled(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT) wParam;
return ContactEnabled(hContact, "LogToDisk", AVH_DEF_LOGTODISK)
|| ContactEnabled(hContact, "AvatarPopups", AVH_DEF_AVPOPUPS)
|| ContactEnabled(hContact, "LogToHistory", AVH_DEF_LOGTOHISTORY);
@@ -105,11 +105,11 @@ static INT_PTR IsEnabled(WPARAM wParam, LPARAM lParam) static int AvatarChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return 0;
- char *proto = GetContactProto((HANDLE)wParam);
+ char *proto = GetContactProto((HCONTACT)wParam);
if (proto == NULL)
return 0;
@@ -158,7 +158,7 @@ static int AvatarChanged(WPARAM wParam, LPARAM lParam) ShowDebugPopup(hContact, TranslateT("AVH Debug: File copied successfully"), history_filename);
if (ServiceExists(MS_MC_GETMETACONTACT)) {
- HANDLE hMetaContact = (HANDLE) CallService(MS_MC_GETMETACONTACT, wParam, 0);
+ HCONTACT hMetaContact = (HCONTACT)CallService(MS_MC_GETMETACONTACT, wParam, 0);
if (hMetaContact != NULL && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY)) {
TCHAR filename[MAX_PATH] = _T("");
@@ -203,8 +203,7 @@ static int AvatarChanged(WPARAM wParam, LPARAM lParam) CreateOldStyleShortcut(hContact, history_filename);
if (ServiceExists(MS_MC_GETMETACONTACT)) {
- HANDLE hMetaContact = (HANDLE) CallService(MS_MC_GETMETACONTACT, wParam, 0);
-
+ HCONTACT hMetaContact = (HCONTACT)CallService(MS_MC_GETMETACONTACT, wParam, 0);
if (hMetaContact != NULL && ContactEnabled(hMetaContact, "LogToDisk", AVH_DEF_LOGTOHISTORY))
CreateOldStyleShortcut(hMetaContact, history_filename);
}
diff --git a/plugins/AvatarHistory/src/AvatarHistory.h b/plugins/AvatarHistory/src/AvatarHistory.h index 20dcd8f518..334ef74109 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.h +++ b/plugins/AvatarHistory/src/AvatarHistory.h @@ -60,22 +60,22 @@ void LoadOptions(); void SetupIcoLib();
HICON createDefaultOverlayedIcon(BOOL big);
-HICON createProtoOverlayedIcon(HANDLE hContact);
+HICON createProtoOverlayedIcon(HCONTACT hContact);
int PreBuildContactMenu(WPARAM wParam,LPARAM lParam);
int IcoLibIconsChanged(WPARAM wParam,LPARAM lParam);
-int OpenAvatarDialog(HANDLE hContact, char* fn);
+int OpenAvatarDialog(HCONTACT hContact, char* fn);
// utils
TCHAR* GetCachedAvatar(char *proto, TCHAR *hash);
BOOL ProtocolEnabled(const char *proto);
-BOOL ContactEnabled(HANDLE hContact, char *setting, int def);
+BOOL ContactEnabled(HCONTACT hContact, char *setting, int def);
BOOL CopyImageFile(TCHAR *old_file, TCHAR *new_file);
void ConvertToFilename(TCHAR *str, size_t size);
-void CreateOldStyleShortcut(HANDLE hContact, TCHAR *history_filename);
+void CreateOldStyleShortcut(HCONTACT hContact, TCHAR *history_filename);
BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut);
#define POPUP_ACTION_DONOTHING 0
diff --git a/plugins/AvatarHistory/src/icolib.cpp b/plugins/AvatarHistory/src/icolib.cpp index 5ff2475db7..b3307b0a7b 100644 --- a/plugins/AvatarHistory/src/icolib.cpp +++ b/plugins/AvatarHistory/src/icolib.cpp @@ -74,7 +74,7 @@ HICON createDefaultOverlayedIcon(BOOL big) }
-HICON createProtoOverlayedIcon(HANDLE hContact)
+HICON createProtoOverlayedIcon(HCONTACT hContact)
{
HICON icon1 = LoadIconEx(I_OVERLAY);
diff --git a/plugins/AvatarHistory/src/options.cpp b/plugins/AvatarHistory/src/options.cpp index d7fbcdca68..7044b2122f 100644 --- a/plugins/AvatarHistory/src/options.cpp +++ b/plugins/AvatarHistory/src/options.cpp @@ -133,7 +133,7 @@ static INT_PTR CALLBACK PopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA op.popup_use_win_colors = IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS) != 0;
op.popup_use_default_colors = IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS) != 0;
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
ShowTestPopup(hContact,TranslateT("Test Contact"), TranslateT("Test description"), &op);
break;
}
diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp index dbdd6821ca..34a39ec6c7 100644 --- a/plugins/AvatarHistory/src/popup.cpp +++ b/plugins/AvatarHistory/src/popup.cpp @@ -62,18 +62,18 @@ void ShowErrPopup(const TCHAR *description, const TCHAR *title) }
-void ShowTestPopup(HANDLE hContact,const TCHAR *title, const TCHAR *description, const Options *op)
+void ShowTestPopup(HCONTACT hContact,const TCHAR *title, const TCHAR *description, const Options *op)
{
ShowPopupEx(hContact, title, description, NULL, POPUP_TYPE_TEST, op);
}
-void ShowPopup(HANDLE hContact, const TCHAR *title, const TCHAR *description)
+void ShowPopup(HCONTACT hContact, const TCHAR *title, const TCHAR *description)
{
ShowPopupEx(hContact, title, description, hContact, POPUP_TYPE_NORMAL, &opts);
}
-void ShowDebugPopup(HANDLE hContact, const TCHAR *title, const TCHAR *description)
+void ShowDebugPopup(HCONTACT hContact, const TCHAR *title, const TCHAR *description)
{
if (db_get_b(NULL,MODULE_NAME,"Debug",0))
{
@@ -89,7 +89,7 @@ typedef struct PopupDataType;
// Show an popup
-void ShowPopupEx(HANDLE hContact, const TCHAR *title, const TCHAR *description,
+void ShowPopupEx(HCONTACT hContact, const TCHAR *title, const TCHAR *description,
void *plugin_data, int type, const Options *op)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT))
diff --git a/plugins/AvatarHistory/src/popup.h b/plugins/AvatarHistory/src/popup.h index 706d5824e3..6738f7d577 100644 --- a/plugins/AvatarHistory/src/popup.h +++ b/plugins/AvatarHistory/src/popup.h @@ -54,16 +54,16 @@ void DeInitPopups(); #define POPUP_TYPE_ERROR 2
// Show an popup
-void ShowPopup(HANDLE hContact, const TCHAR *title, const TCHAR *description);
-void ShowDebugPopup(HANDLE hContact, const TCHAR *title, const TCHAR *description);
+void ShowPopup(HCONTACT hContact, const TCHAR *title, const TCHAR *description);
+void ShowDebugPopup(HCONTACT hContact, const TCHAR *title, const TCHAR *description);
// Show an test
-void ShowTestPopup(HANDLE hContact,const TCHAR *title, const TCHAR *description, const Options *op);
+void ShowTestPopup(HCONTACT hContact,const TCHAR *title, const TCHAR *description, const Options *op);
// Show an error popup
void ShowErrPopup(const char *description, const char *title = NULL);
-void ShowPopupEx(HANDLE hContact, const TCHAR *title, const TCHAR *description,
+void ShowPopupEx(HCONTACT hContact, const TCHAR *title, const TCHAR *description,
void *plugin_data, int type, const Options *op);
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index 388a2e85d5..3d0bd65ec3 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -34,7 +34,7 @@ BOOL ProtocolEnabled(const char *proto) return (BOOL) db_get_b(NULL, MODULE_NAME, setting, TRUE);
}
-BOOL ContactEnabled(HANDLE hContact, char *setting, int def)
+BOOL ContactEnabled(HCONTACT hContact, char *setting, int def)
{
if (hContact == NULL)
return FALSE;
@@ -77,7 +77,7 @@ void ConvertToFilename(TCHAR *str, size_t size) }
}
-int GetUIDFromHContact(HANDLE contact, TCHAR* uinout, int uinout_len)
+int GetUIDFromHContact(HCONTACT contact, TCHAR* uinout, int uinout_len)
{
bool found = true;
@@ -138,7 +138,7 @@ TCHAR* GetProtocolFolder(TCHAR *fn, char *proto) return fn;
}
-TCHAR* GetContactFolder(TCHAR *fn, HANDLE hContact)
+TCHAR* GetContactFolder(TCHAR *fn, HCONTACT hContact)
{
char *proto = GetContactProto(hContact);
GetProtocolFolder(fn, proto);
@@ -158,7 +158,7 @@ TCHAR* GetContactFolder(TCHAR *fn, HANDLE hContact) return fn;
}
-TCHAR* GetOldStyleAvatarName(TCHAR *fn, HANDLE hContact)
+TCHAR* GetOldStyleAvatarName(TCHAR *fn, HCONTACT hContact)
{
GetContactFolder(fn, hContact);
@@ -172,7 +172,7 @@ TCHAR* GetOldStyleAvatarName(TCHAR *fn, HANDLE hContact) return fn;
}
-void CreateOldStyleShortcut(HANDLE hContact, TCHAR *history_filename)
+void CreateOldStyleShortcut(HCONTACT hContact, TCHAR *history_filename)
{
TCHAR shortcut[MAX_PATH] = _T("");
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index 2542a43364..c02fe931d7 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -76,7 +76,7 @@ INT_PTR ExecuteTaskService(WPARAM wParam, LPARAM lParam); int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- int count = EventList::GetContactMessageNumber((HANDLE)wParam);
+ int count = EventList::GetContactMessageNumber((HCONTACT)wParam);
bool isInList = HistoryWindow::IsInList(GetForegroundWindow());
Menu_ShowItem(hContactMenu, count != 0);
@@ -196,7 +196,7 @@ HICON LoadIconEx(int iconId, int big) INT_PTR ShowContactHistory(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HistoryWindow::Open(hContact);
return 0;
}
@@ -210,7 +210,7 @@ int PreShutdownHistoryModule(WPARAM, LPARAM) int HistoryContactDelete(WPARAM wParam, LPARAM)
{
- HistoryWindow::Close((HANDLE)wParam);
+ HistoryWindow::Close((HCONTACT)wParam);
return 0;
}
diff --git a/plugins/BasicHistory/src/BinaryExport.cpp b/plugins/BasicHistory/src/BinaryExport.cpp index 0e1636af2f..5a506d9791 100644 --- a/plugins/BasicHistory/src/BinaryExport.cpp +++ b/plugins/BasicHistory/src/BinaryExport.cpp @@ -22,8 +22,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define EXP_FILE (*((std::ofstream*)IExport::stream))
#define IMP_FILE (*((std::ifstream*)IImport::stream))
-std::wstring GetProtocolName(HANDLE hContact);
-std::wstring GetContactId(HANDLE hContact);
+std::wstring GetProtocolName(HCONTACT hContact);
+std::wstring GetContactId(HCONTACT hContact);
#pragma pack(push, 1)
@@ -158,7 +158,7 @@ bool ReadHeader(BinaryFileHeader& header, std::istream* stream) return true;
}
-int BinaryExport::IsContactInFile(const std::vector<HANDLE>& contacts)
+int BinaryExport::IsContactInFile(const std::vector<HCONTACT>& contacts)
{
BinaryFileHeader header;
if (!ReadHeader(header, IImport::stream))
diff --git a/plugins/BasicHistory/src/BinaryExport.h b/plugins/BasicHistory/src/BinaryExport.h index 386625226f..493e707088 100644 --- a/plugins/BasicHistory/src/BinaryExport.h +++ b/plugins/BasicHistory/src/BinaryExport.h @@ -34,7 +34,7 @@ public: virtual void WriteFooter();
virtual void WriteGroup(bool isMe, const std::wstring &time, const std::wstring &user, const std::wstring &eventText);
virtual void WriteMessage(bool isMe, const std::wstring &longDate, const std::wstring &shortDate, const std::wstring &user, const std::wstring &message, const DBEVENTINFO& dbei);
- virtual int IsContactInFile(const std::vector<HANDLE>& contacts);
+ virtual int IsContactInFile(const std::vector<HCONTACT>& contacts);
virtual bool GetEventList(std::vector<IImport::ExternalMessage>& eventList);
virtual ~BinaryExport();
diff --git a/plugins/BasicHistory/src/DatExport.cpp b/plugins/BasicHistory/src/DatExport.cpp index 491f446560..c0882ddc61 100644 --- a/plugins/BasicHistory/src/DatExport.cpp +++ b/plugins/BasicHistory/src/DatExport.cpp @@ -23,8 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define EXP_FILE (*((std::ofstream*)IExport::stream))
#define IMP_FILE (*((std::ifstream*)IImport::stream))
-std::wstring GetProtocolName(HANDLE hContact);
-std::wstring GetContactId(HANDLE hContact);
+std::wstring GetProtocolName(HCONTACT hContact);
+std::wstring GetContactId(HCONTACT hContact);
#pragma pack(push, 1)
@@ -128,7 +128,7 @@ bool ReadHeader(MCHeader& header, std::istream* stream) return true;
}
-int DatExport::IsContactInFile(const std::vector<HANDLE>& contacts)
+int DatExport::IsContactInFile(const std::vector<HCONTACT>& contacts)
{
MCHeader header;
if (!ReadHeader(header, IImport::stream))
diff --git a/plugins/BasicHistory/src/DatExport.h b/plugins/BasicHistory/src/DatExport.h index 980a12d148..9609a994f6 100644 --- a/plugins/BasicHistory/src/DatExport.h +++ b/plugins/BasicHistory/src/DatExport.h @@ -34,7 +34,7 @@ public: virtual void WriteFooter();
virtual void WriteGroup(bool isMe, const std::wstring &time, const std::wstring &user, const std::wstring &eventText);
virtual void WriteMessage(bool isMe, const std::wstring &longDate, const std::wstring &shortDate, const std::wstring &user, const std::wstring &message, const DBEVENTINFO& dbei);
- virtual int IsContactInFile(const std::vector<HANDLE>& contacts);
+ virtual int IsContactInFile(const std::vector<HCONTACT>& contacts);
virtual bool GetEventList(std::vector<IImport::ExternalMessage>& eventList);
DatExport()
@@ -45,7 +45,7 @@ public: virtual ~DatExport();
private:
int dataSize;
- HANDLE hContact;
+ HCONTACT hContact;
std::string memBuf;
inline int WriteString(const std::wstring &str);
//inline bool ReadString(std::wstring &str, int size);
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index 0ec5f8b5c0..044b32e3e5 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -40,7 +40,7 @@ EventList::EventList() goldBlobSize = 0;
}
-EventList::EventList(HANDLE _hContact, int filter)
+EventList::EventList(HCONTACT _hContact, int filter)
:hWnd(NULL),
isWnd(false),
hContact(_hContact),
@@ -188,7 +188,7 @@ std::wstring EventList::GetFilterName() return filterName;
}
-void EventList::GetTempList(std::list<EventTempIndex>& tempList, bool noFilter, bool noExt, HANDLE _hContact)
+void EventList::GetTempList(std::list<EventTempIndex>& tempList, bool noFilter, bool noExt, HCONTACT _hContact)
{
bool isWndLocal = isWnd;
EventTempIndex ti;
@@ -299,7 +299,7 @@ void EventList::RefreshEventList() }
}
-bool EventList::SearchInContact(HANDLE hContact, TCHAR *strFind, ComparatorInterface* compFun)
+bool EventList::SearchInContact(HCONTACT hContact, TCHAR *strFind, ComparatorInterface* compFun)
{
InitFilters();
@@ -431,7 +431,7 @@ std::wstring EventList::GetMyName() return myName;
}
-inline std::wstring GetProtocolName(HANDLE hContact)
+inline std::wstring GetProtocolName(HCONTACT hContact)
{
char* ac = (char *)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, (WPARAM)hContact, 0);
std::wstring proto1;
@@ -471,7 +471,7 @@ std::wstring EventList::GetMyId() return myId;
}
-inline std::wstring GetContactId(HANDLE hContact)
+inline std::wstring GetContactId(HCONTACT hContact)
{
std::wstring id;
CONTACTINFO ci;
@@ -643,7 +643,7 @@ CRITICAL_SECTION EventList::criticalSection; std::map<HANDLE, EventList::ImportDiscData> EventList::contactFileMap;
std::wstring EventList::contactFileDir;
-void EventList::AddImporter(HANDLE hContact, IImport::ImportType type, const std::wstring& file)
+void EventList::AddImporter(HCONTACT hContact, IImport::ImportType type, const std::wstring& file)
{
EnterCriticalSection(&criticalSection);
TCHAR buf[32];
@@ -673,7 +673,7 @@ void EventList::Deinit() DeleteCriticalSection(&EventList::criticalSection);
}
-int EventList::GetContactMessageNumber(HANDLE hContact)
+int EventList::GetContactMessageNumber(HCONTACT hContact)
{
int count = db_event_count(hContact);
EnterCriticalSection(&criticalSection);
@@ -685,7 +685,7 @@ int EventList::GetContactMessageNumber(HANDLE hContact) return count;
}
-bool EventList::IsImportedHistory(HANDLE hContact)
+bool EventList::IsImportedHistory(HCONTACT hContact)
{
bool count = false;
EnterCriticalSection(&criticalSection);
@@ -697,7 +697,7 @@ bool EventList::IsImportedHistory(HANDLE hContact) return count;
}
-void EventList::DeleteImporter(HANDLE hContact)
+void EventList::DeleteImporter(HCONTACT hContact)
{
EnterCriticalSection(&criticalSection);
std::map<HANDLE, EventList::ImportDiscData>::iterator it = contactFileMap.find(hContact);
diff --git a/plugins/BasicHistory/src/EventList.h b/plugins/BasicHistory/src/EventList.h index a32ff92b9c..6a3327760c 100644 --- a/plugins/BasicHistory/src/EventList.h +++ b/plugins/BasicHistory/src/EventList.h @@ -80,7 +80,7 @@ private: void InitFilters();
void InitNames();
void AddGroup(const EventIndex& ev);
- void GetTempList(std::list<EventTempIndex>& tempList, bool noFilter, bool noExt, HANDLE _hContact);
+ void GetTempList(std::list<EventTempIndex>& tempList, bool noFilter, bool noExt, HCONTACT _hContact);
void ImportMessages(const std::vector<IImport::ExternalMessage>& messages);
protected:
TCHAR contactName[256];
@@ -102,11 +102,11 @@ protected: void RebuildGroup(int selected);
public:
EventList();
- EventList(HANDLE _hContact, int filter);
+ EventList(HCONTACT _hContact, int filter);
~EventList();
HWND hWnd;
- HANDLE hContact;
+ HCONTACT hContact;
std::vector<std::deque<EventIndex> > eventList;
bool useImportedMessages;
@@ -116,7 +116,7 @@ public: int GetFilterNr();
std::wstring GetFilterName();
void RefreshEventList();
- bool SearchInContact(HANDLE hContact, TCHAR *strFind, ComparatorInterface* compFun);
+ bool SearchInContact(HCONTACT hContact, TCHAR *strFind, ComparatorInterface* compFun);
std::wstring GetContactName();
std::wstring GetMyName();
std::wstring GetProtocolName();
@@ -124,10 +124,10 @@ public: std::wstring GetContactId();
std::string GetBaseProtocol();
void MargeMessages(const std::vector<IImport::ExternalMessage>& messages);
- static void AddImporter(HANDLE hContact, IImport::ImportType type, const std::wstring& file);
- static int GetContactMessageNumber(HANDLE hContact);
- static bool IsImportedHistory(HANDLE hContact);
- static void DeleteImporter(HANDLE hContact);
+ static void AddImporter(HCONTACT hContact, IImport::ImportType type, const std::wstring& file);
+ static int GetContactMessageNumber(HCONTACT hContact);
+ static bool IsImportedHistory(HCONTACT hContact);
+ static void DeleteImporter(HCONTACT hContact);
static void GetObjectDescription( DBEVENTINFO *dbei, TCHAR* str, int cbStr );
bool GetEventData(const EventIndex& ev, EventData& data);
void GetExtEventDBei(const EventIndex& ev);
diff --git a/plugins/BasicHistory/src/ExportManager.cpp b/plugins/BasicHistory/src/ExportManager.cpp index 05edac8053..30453b10a9 100644 --- a/plugins/BasicHistory/src/ExportManager.cpp +++ b/plugins/BasicHistory/src/ExportManager.cpp @@ -26,8 +26,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "Options.h"
#include "codecvt_CodePage.h"
-ExportManager::ExportManager(HWND _hwnd, HANDLE _hContact, int filter)
- :EventList(_hContact, filter),
+ExportManager::ExportManager(HWND _hwnd, HCONTACT _hContact, int filter) :
+ EventList(_hContact, filter),
hwnd(_hwnd),
oldOnTop(false)
{
@@ -196,7 +196,7 @@ const TCHAR* ExportManager::GetExt(IImport::ImportType type) return ext;
}
-int ExportManager::Import(IImport::ImportType type, const std::vector<HANDLE>& contacts)
+int ExportManager::Import(IImport::ImportType type, const std::vector<HCONTACT>& contacts)
{
IImport* imp = NULL;
switch(type) {
@@ -233,7 +233,7 @@ int ExportManager::Import(IImport::ImportType type, const std::vector<HANDLE>& c return t;
}
-bool ExportManager::Import(IImport::ImportType type, std::vector<IImport::ExternalMessage>& eventList, std::wstring* err, bool* differentContact, std::vector<HANDLE>* contacts)
+bool ExportManager::Import(IImport::ImportType type, std::vector<IImport::ExternalMessage>& eventList, std::wstring* err, bool* differentContact, std::vector<HCONTACT>* contacts)
{
IImport* imp = NULL;
switch(type) {
@@ -258,7 +258,7 @@ bool ExportManager::Import(IImport::ImportType type, std::vector<IImport::Extern return false;
imp->SetStream(stream);
- std::vector<HANDLE> v;
+ std::vector<HCONTACT> v;
v.push_back(hContact);
bool ret = true;
int contInFile = imp->IsContactInFile(v);
diff --git a/plugins/BasicHistory/src/ExportManager.h b/plugins/BasicHistory/src/ExportManager.h index 17ed0bb8ef..c0a3a8acf7 100644 --- a/plugins/BasicHistory/src/ExportManager.h +++ b/plugins/BasicHistory/src/ExportManager.h @@ -30,7 +30,7 @@ private: protected:
virtual void AddGroup(bool isMe, const std::wstring &time, const std::wstring &user, const std::wstring &eventText, int ico);
public:
- ExportManager(HWND _hwnd, HANDLE _hContact, int filter);
+ ExportManager(HWND _hwnd, HCONTACT _hContact, int filter);
void SetAutoExport(const std::wstring _file, int _deltaTime, DWORD _now)
{
@@ -52,8 +52,8 @@ public: bool Export(IExport::ExportType type);
void SetDeleteWithoutExportEvents(int _deltaTime, DWORD _now);
void DeleteExportedEvents();
- int Import(IImport::ImportType type, const std::vector<HANDLE>& contacts);
- bool Import(IImport::ImportType type, std::vector<IImport::ExternalMessage>& eventList, std::wstring* err = NULL, bool* differentContact = NULL, std::vector<HANDLE>* contacts = NULL);
+ int Import(IImport::ImportType type, const std::vector<HCONTACT>& contacts);
+ bool Import(IImport::ImportType type, std::vector<IImport::ExternalMessage>& eventList, std::wstring* err = NULL, bool* differentContact = NULL, std::vector<HCONTACT>* contacts = NULL);
static const TCHAR* GetExt(IImport::ImportType type);
};
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 0e998322e7..766b8805d6 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -38,7 +38,7 @@ extern IconItem iconList[]; void ResetCList(HWND hWnd);
-HistoryWindow::HistoryWindow(HANDLE _hContact) :
+HistoryWindow::HistoryWindow(HCONTACT _hContact) :
isDestroyed(true),
splitterY(0),
splitterOrgY(0),
@@ -176,7 +176,7 @@ void HistoryWindow::Deinit() }
}
-void HistoryWindow::Open(HANDLE hContact)
+void HistoryWindow::Open(HCONTACT hContact)
{
if (hContact == NULL)
{
@@ -199,7 +199,7 @@ void HistoryWindow::Open(HANDLE hContact) }
}
-void HistoryWindow::Close(HANDLE hContact)
+void HistoryWindow::Close(HCONTACT hContact)
{
std::map<HANDLE, HistoryWindow*>::iterator it = windows.find(hContact);
if (it != windows.end())
@@ -243,7 +243,7 @@ void HistoryWindow::Close(HistoryWindow* historyWindow) }
}
-void HistoryWindow::RebuildEvents(HANDLE hContact)
+void HistoryWindow::RebuildEvents(HCONTACT hContact)
{
if (hContact != NULL)
{
@@ -427,7 +427,7 @@ void HistoryWindow::OptionsSearchingChanged() INT_PTR HistoryWindow::DeleteAllUserHistory(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HWND hWnd = NULL;
int start = 0;
int end = 0;
@@ -568,18 +568,18 @@ void OpenOptions(char* group, char* page, char* tab = NULL) class ShowMessageData
{
public:
- ShowMessageData(HANDLE _hContact)
+ ShowMessageData(HCONTACT _hContact)
:hContact(_hContact)
{
}
- ShowMessageData(HANDLE _hContact, const std::wstring &_str)
+ ShowMessageData(HCONTACT _hContact, const std::wstring &_str)
:hContact(_hContact),
str(_str)
{
}
- HANDLE hContact;
+ HCONTACT hContact;
std::wstring str;
};
@@ -1655,7 +1655,7 @@ void HistoryWindow::ReloadContacts() }
}
- 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 (EventList::GetContactMessageNumber(_hContact) && (metaContactProto == NULL || db_get_b(_hContact, metaContactProto, "IsSubcontact", 0) == 0)) {
HANDLE hItem = (HANDLE)SendMessage(contactList, CLM_FINDCONTACT, (WPARAM)_hContact, 0);
if (hItem == NULL)
@@ -1779,7 +1779,7 @@ bool HistoryWindow::DoHotkey(UINT msg, LPARAM lParam, WPARAM wParam, int window) void HistoryWindow::RestorePos()
{
- HANDLE contactToLoad = hContact;
+ HCONTACT contactToLoad = hContact;
if (hContact == NULL) {
Utils_RestoreWindowPosition(hWnd,NULL,MODULE,"history_");
contactToLoad = NULL;
@@ -1803,9 +1803,9 @@ void HistoryWindow::RestorePos() void HistoryWindow::SavePos(bool all)
{
- HANDLE contactToSave = hContact;
+ HCONTACT contactToSave = hContact;
if (all) {
- 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_unset(_hContact, MODULE, "history_x");
db_unset(_hContact, MODULE, "history_y");
db_unset(_hContact, MODULE, "history_width");
@@ -2027,13 +2027,13 @@ void HistoryWindow::DoImport(IImport::ImportType type) ExportManager exp(hWnd, hContact, GetFilterNr());
std::vector<IImport::ExternalMessage> messages;
std::wstring err;
- std::vector<HANDLE> contacts;
+ std::vector<HCONTACT> contacts;
- for (HANDLE _hContact = db_find_first(); _hContact != NULL; _hContact = db_find_next(_hContact))
+ for (HCONTACT _hContact = db_find_first(); _hContact != NULL; _hContact = db_find_next(_hContact))
contacts.push_back(_hContact);
bool changeContact = false;
- HANDLE lastContact = hContact;
+ HCONTACT lastContact = hContact;
int i = 1;
do
{
@@ -2173,14 +2173,11 @@ bool HistoryWindow::ContactChanged(bool sync) {
if (!isLoading)
{
- HANDLE hItem = (HANDLE)SendDlgItemMessage(hWnd, IDC_LIST_CONTACTS, CLM_GETSELECTION, 0, 0);
- if (hItem != NULL)
- {
+ HCONTACT hItem = (HCONTACT)SendDlgItemMessage(hWnd, IDC_LIST_CONTACTS, CLM_GETSELECTION, 0, 0);
+ if (hItem != NULL) {
int typeOf = SendDlgItemMessage(hWnd, IDC_LIST_CONTACTS, CLM_GETITEMTYPE,(WPARAM)hItem,0);
- if (typeOf == CLCIT_CONTACT)
- {
- if (hContact != hItem)
- {
+ if (typeOf == CLCIT_CONTACT) {
+ if (hContact != hItem) {
ChangeToFreeWindow(this);
isLoading = true;
hContact = hItem;
@@ -2192,10 +2189,8 @@ bool HistoryWindow::ContactChanged(bool sync) return true;
}
}
- else if (typeOf == CLCIT_INFO && hSystem == hItem)
- {
- if (hContact != NULL)
- {
+ else if (typeOf == CLCIT_INFO && hSystem == hItem) {
+ if (hContact != NULL) {
ChangeToFreeWindow(this);
isLoading = true;
hContact = NULL;
@@ -2261,11 +2256,11 @@ void HistoryWindow::FormatQuote(std::wstring& quote, const MessageData& md, cons while(f > 0 && f < (int)msg.length());
}
-HANDLE HistoryWindow::GetNextContact(HANDLE hContact, int adder)
+HCONTACT HistoryWindow::GetNextContact(HCONTACT hContact, int adder)
{
HWND contactList = GetDlgItem(hWnd,IDC_LIST_CONTACTS);
bool find = false;
- HANDLE _hContact;
+ HCONTACT _hContact;
if (adder > 0) {
if (hContact != NULL) {
_hContact = db_find_next(hContact);
@@ -2299,7 +2294,7 @@ HANDLE HistoryWindow::GetNextContact(HANDLE hContact, int adder) }
}
else {
- HANDLE lastContact = NULL;
+ HCONTACT lastContact = NULL;
_hContact = db_find_first();
while(_hContact && _hContact != hContact) {
HANDLE hItem = (HANDLE)SendMessage(contactList, CLM_FINDCONTACT, (WPARAM)_hContact, 0);
diff --git a/plugins/BasicHistory/src/HistoryWindow.h b/plugins/BasicHistory/src/HistoryWindow.h index 66202937b4..4bebe0e738 100644 --- a/plugins/BasicHistory/src/HistoryWindow.h +++ b/plugins/BasicHistory/src/HistoryWindow.h @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. class HistoryWindow : public SearchContext
{
private:
- HistoryWindow(HANDLE _hContact);
+ HistoryWindow(HCONTACT _hContact);
void Initialise();
void Destroy();
void SplitterMoved(HWND splitter, LONG pos, bool screenPos);
@@ -75,9 +75,9 @@ protected: public:
~HistoryWindow();
static void Deinit();
- static void Open(HANDLE hContact);
- static void Close(HANDLE hContact);
- static void RebuildEvents(HANDLE hContact);
+ static void Open(HCONTACT hContact);
+ static void Close(HCONTACT hContact);
+ static void RebuildEvents(HCONTACT hContact);
static bool IsInList(HWND hWnd);
static int FontsChanged(WPARAM wParam, LPARAM lParam);
static INT_PTR DeleteAllUserHistory(WPARAM wParam, LPARAM lParam);
@@ -89,7 +89,7 @@ public: // SearchContext interface
virtual void SelectEventGroup(int sel);
- virtual HANDLE GetNextContact(HANDLE hContact, int adder);
+ virtual HCONTACT GetNextContact(HCONTACT hContact, int adder);
virtual void SelectContact(HANDLE _hContact);
};
diff --git a/plugins/BasicHistory/src/IImport.h b/plugins/BasicHistory/src/IImport.h index aef3b35179..6fc3b6f340 100644 --- a/plugins/BasicHistory/src/IImport.h +++ b/plugins/BasicHistory/src/IImport.h @@ -43,7 +43,7 @@ public: }
virtual const TCHAR* GetExt() = 0;
- virtual int IsContactInFile(const std::vector<HANDLE>& contacts) = 0;
+ virtual int IsContactInFile(const std::vector<HCONTACT>& contacts) = 0;
virtual bool GetEventList(std::vector<ExternalMessage>& eventList) = 0;
virtual ~IImport()
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index a8db8de746..bd563ed046 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -562,7 +562,7 @@ void Options::SaveTasks(std::list<TaskOptions>* tasks) db_set_s(0, MODULE, buf, it->zipPassword.c_str());
mir_snprintf(buf, SIZEOF(buf), "IsInTask_%d", i);
- 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_unset(hContact, MODULE, buf);
for (size_t j = 0; j < it->contacts.size(); ++j)
@@ -617,7 +617,7 @@ void Options::SaveTasks(std::list<TaskOptions>* tasks) db_unset(NULL, MODULE, buf);
mir_snprintf(buf, SIZEOF(buf), "IsInTask_%d", i);
- 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_unset(hContact, MODULE, buf);
}
@@ -705,7 +705,7 @@ void Options::LoadTasks() }
mir_snprintf(buf, SIZEOF(buf), "IsInTask_%d", i);
- 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_b(hContact, MODULE, buf, 0) == 1)
to.contacts.push_back(hContact);
@@ -1587,7 +1587,7 @@ void SaveList(HWND hwnd, HANDLE hSystem, TaskOptions* to) if (hSystem)
to->isSystem = SendMessage(hwnd, CLM_GETCHECKMARK, (WPARAM) hSystem, 0) != 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) SendMessage(hwnd, CLM_FINDCONTACT, (WPARAM) hContact, 0);
if (hItem && SendMessage(hwnd, CLM_GETCHECKMARK, (WPARAM) hItem, 0))
to->contacts.push_back(hContact);
diff --git a/plugins/BasicHistory/src/Options.h b/plugins/BasicHistory/src/Options.h index 21a0976d9d..99da9d7908 100644 --- a/plugins/BasicHistory/src/Options.h +++ b/plugins/BasicHistory/src/Options.h @@ -92,7 +92,7 @@ struct TaskOptions std::wstring filePath;
std::wstring taskName;
std::string zipPassword; // char* because zip file using ANSI password
- std::vector<HANDLE> contacts;
+ std::vector<HCONTACT> contacts;
TaskOptions()
{
forceExecute = false;
diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index 25d6e61053..9f52474d35 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -219,7 +219,7 @@ bool IsValidTask(TaskOptions& to, std::list<TaskOptions>* top, std::wstring* err static void CALLBACK DoRebuildEventsInMainAPCFunc(ULONG_PTR dwParam)
{
- HANDLE* contacts = (HANDLE*) dwParam;
+ HCONTACT *contacts = (HCONTACT*)dwParam;
size_t size = (size_t)contacts[0];
for (size_t i = 1; i <= size; ++i)
HistoryWindow::RebuildEvents(contacts[i]);
@@ -277,7 +277,7 @@ bool DoTask(TaskOptions& to) std::wstring filePath = to.filePath;
std::wstring dir;
std::list<std::wstring> files;
- std::vector<HANDLE> contacts;
+ std::vector<HCONTACT> contacts;
if (to.useFtp || to.compress) {
std::map<std::wstring, bool> existingContacts;
TCHAR temp[MAX_PATH];
@@ -352,7 +352,7 @@ bool DoTask(TaskOptions& to) }
if (!error) {
- std::list<HANDLE> contactList;
+ std::list<HCONTACT> contactList;
for (std::list<std::wstring>::iterator it = files.begin(); it != files.end(); ++it) {
mExp.SetAutoImport(*it);
int ret = mExp.Import(to.importType, contacts);
@@ -377,7 +377,7 @@ bool DoTask(TaskOptions& to) }
if (ret >= 0) {
- mExp.hContact = contacts[ret];
+ mExp.hContact = contacts[ret];
if (to.type == TaskOptions::Import) {
EventList::AddImporter(mExp.hContact, to.importType, *it);
contactList.push_back(mExp.hContact);
@@ -413,7 +413,7 @@ bool DoTask(TaskOptions& to) HANDLE* contacts = new HANDLE[contactList.size() + 1];
contacts[0] = (HANDLE)contactList.size();
int i = 1;
- for (std::list<HANDLE>::iterator it = contactList.begin(); it != contactList.end(); ++it)
+ for (std::list<HCONTACT>::iterator it = contactList.begin(); it != contactList.end(); ++it)
contacts[i++] = *it;
QueueUserAPC(DoRebuildEventsInMainAPCFunc, g_hMainThread, (ULONG_PTR) contacts);
diff --git a/plugins/BasicHistory/src/SearchContext.h b/plugins/BasicHistory/src/SearchContext.h index 6b1655d857..dd16d95d79 100644 --- a/plugins/BasicHistory/src/SearchContext.h +++ b/plugins/BasicHistory/src/SearchContext.h @@ -29,7 +29,7 @@ public: int selected;
virtual void SelectEventGroup(int sel) = 0;
- virtual HANDLE GetNextContact(HANDLE hContact, int adder) = 0;
+ virtual HCONTACT GetNextContact(HCONTACT hContact, int adder) = 0;
virtual void SelectContact(HANDLE _hContact) = 0;
struct MessageData
diff --git a/plugins/BasicHistory/src/Searcher.cpp b/plugins/BasicHistory/src/Searcher.cpp index 0c9091e4f6..4a1ed6dce1 100644 --- a/plugins/BasicHistory/src/Searcher.cpp +++ b/plugins/BasicHistory/src/Searcher.cpp @@ -223,7 +223,7 @@ void Searcher::Find() if (sel < 0) {
isFindContactChanged = true;
if (allUsers) {
- HANDLE hNext = context->hContact;
+ HCONTACT hNext = context->hContact;
do
{
hNext = context->GetNextContact(hNext, adder2);
@@ -237,7 +237,7 @@ void Searcher::Find() else if (sel >= (int)context->eventList.size()) {
isFindContactChanged = true;
if (allUsers) {
- HANDLE hNext = context->hContact;
+ HCONTACT hNext = context->hContact;
do
{
hNext = context->GetNextContact(hNext, adder2);
diff --git a/plugins/Boltun/src/actionQueue.cpp b/plugins/Boltun/src/actionQueue.cpp index 3514ae994b..3f0fead59b 100644 --- a/plugins/Boltun/src/actionQueue.cpp +++ b/plugins/Boltun/src/actionQueue.cpp @@ -29,15 +29,15 @@ using namespace std; extern TalkBot* bot;
-typedef void (*ActionHandler)(HANDLE hContact, const TalkBot::MessageInfo *inf);
+typedef void (*ActionHandler)(HCONTACT hContact, const TalkBot::MessageInfo *inf);
typedef struct _QueueElement {
- HANDLE hContact;
+ HCONTACT hContact;
const TalkBot::MessageInfo *inf;
ActionHandler Handler;
bool Sticky;
int TimeOffset;
- _QueueElement(HANDLE contact, ActionHandler handler, int timeOffset, const TalkBot::MessageInfo *info = NULL, bool sticky = false)
+ _QueueElement(HCONTACT contact, ActionHandler handler, int timeOffset, const TalkBot::MessageInfo *info = NULL, bool sticky = false)
:hContact(contact), Handler(handler), TimeOffset(timeOffset), inf(info), Sticky(sticky)
{
}
@@ -72,7 +72,7 @@ void UpdateTimer() timerID = 0;
}
-static bool NotifyTyping(HANDLE hContact)
+static bool NotifyTyping(HCONTACT hContact)
{
int res = db_get_b(hContact, "SRMsg", "SupportTyping", 2);
if (res == 2)
@@ -80,7 +80,7 @@ static bool NotifyTyping(HANDLE hContact) return res != 0;
}
-static void TimerAnswer(HANDLE hContact, const TalkBot::MessageInfo* info)
+static void TimerAnswer(HCONTACT hContact, const TalkBot::MessageInfo* info)
{
DBEVENTINFO ldbei;
int size = (int)info->Answer.length() + 1;
@@ -118,7 +118,7 @@ static void TimerAnswer(HANDLE hContact, const TalkBot::MessageInfo* info) typingContactsLock.Leave();
}
-static void StartTyping(HANDLE hContact, const TalkBot::MessageInfo*)
+static void StartTyping(HCONTACT hContact, const TalkBot::MessageInfo*)
{
CallService(MS_PROTO_SELFISTYPING, (WPARAM)hContact,
(LPARAM)PROTOTYPE_SELFTYPING_ON);
@@ -127,7 +127,7 @@ static void StartTyping(HANDLE hContact, const TalkBot::MessageInfo*) typingContactsLock.Leave();
}
-void DoAnswer(HANDLE hContact, const TalkBot::MessageInfo *info, bool sticky = false)
+void DoAnswer(HCONTACT hContact, const TalkBot::MessageInfo *info, bool sticky = false)
{
if (info->Answer[0] == _T('\0'))
return;
@@ -206,7 +206,7 @@ void DoAnswer(HANDLE hContact, const TalkBot::MessageInfo *info, bool sticky = f cs.Leave();
}
-void AnswerToContact(HANDLE hContact, const TCHAR* messageToAnswer)
+void AnswerToContact(HCONTACT hContact, const TCHAR* messageToAnswer)
{
if (Config.TalkWarnContacts && db_get_b(hContact, BOLTUN_KEY,
DB_CONTACT_WARNED, FALSE) == FALSE)
@@ -218,7 +218,7 @@ void AnswerToContact(HANDLE hContact, const TCHAR* messageToAnswer) DoAnswer(hContact, bot->Reply(hContact, messageToAnswer, false));
}
-void StartChatting(HANDLE hContact)
+void StartChatting(HCONTACT hContact)
{
DoAnswer(hContact, new TalkBot::MessageInfo(bot->GetInitMessage(hContact)), true);
}
diff --git a/plugins/Boltun/src/actionQueue.h b/plugins/Boltun/src/actionQueue.h index 780bbde97a..e8d62b8f6b 100644 --- a/plugins/Boltun/src/actionQueue.h +++ b/plugins/Boltun/src/actionQueue.h @@ -21,8 +21,8 @@ #ifndef ACTIONQUEUE_H
#define ACTIONQUEUE_H
-void AnswerToContact(HANDLE hContact, const TCHAR* messageToAnswer);
+void AnswerToContact(HCONTACT hContact, const TCHAR* messageToAnswer);
-void StartChatting(HANDLE hContact);
+void StartChatting(HCONTACT hContact);
#endif /* ACTIONQUEUE_H */
\ No newline at end of file diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 26a370b50e..709e5b3a9f 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -178,7 +178,7 @@ static bool LoadMind(const TCHAR* filename, int &line) return true;
}*/
-static bool BoltunAutoChat(HANDLE hContact)
+static bool BoltunAutoChat(HCONTACT hContact)
{
if (db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT
, FALSE) == TRUE)
@@ -212,7 +212,8 @@ static bool BoltunAutoChat(HANDLE hContact) static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam, hDbEvent = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)wParam;
+ HANDLE hDbEvent = (HANDLE)lParam;
if (!BoltunAutoChat(hContact))
return 0;
@@ -500,7 +501,7 @@ static int MessageOptInit(WPARAM wParam, LPARAM lParam) static int ContactClick(WPARAM wParam, LPARAM lParam, BOOL clickNotToChat)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
BOOL boltunautochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
BOOL boltunnottochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
@@ -544,7 +545,7 @@ static INT_PTR ContactClickNotToChat(WPARAM wParam, LPARAM lParam) static INT_PTR ContactClickStartChatting(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
StartChatting(hContact);
return 0;
}
@@ -553,7 +554,7 @@ static int MessagePrebuild(WPARAM wParam, LPARAM lParam) {
CLISTMENUITEM clmi = { sizeof(clmi) };
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!blInit || (db_get_b(hContact,"CList","NotOnList",0) == 1))
{
clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 59c00baeab..ecf709b150 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -67,19 +67,19 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE;
}
-time_t getLastSeen(HANDLE hContact)
+time_t getLastSeen(HCONTACT hContact)
{
return db_get_dw(hContact, MODULE_NAME, "LastSeen", db_get_dw(hContact, MODULE_NAME, "CreationTime", (DWORD)-1));
}
-void setLastSeen(HANDLE hContact)
+void setLastSeen(HCONTACT hContact)
{
db_set_dw(hContact, MODULE_NAME, "LastSeen", (DWORD)time(NULL));
if (db_get_b(hContact, MODULE_NAME, "StillAbsentNotified", 0))
db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 0);
}
-time_t getLastInputMsg(HANDLE hContact)
+time_t getLastInputMsg(HCONTACT hContact)
{
HANDLE hDbEvent = db_event_last(hContact);
while (hDbEvent) {
@@ -212,7 +212,7 @@ LRESULT CALLBACK PopupDlgProcNoSet(HWND hWnd, UINT message, WPARAM wParam, LPARA /**
* Checks - whether user has been gone for specified number of days
*/
-bool isContactGoneFor(HANDLE hContact, int days)
+bool isContactGoneFor(HCONTACT hContact, int days)
{
time_t lastSeen = getLastSeen(hContact);
time_t lastInputMsg = getLastInputMsg(hContact);
@@ -257,7 +257,7 @@ bool isContactGoneFor(HANDLE hContact, int days) return (daysSinceOnline >= days && (daysSinceMessage == -1 || daysSinceMessage >= days));
}
-void ReturnNotify(HANDLE hContact, TCHAR *message)
+void ReturnNotify(HCONTACT hContact, TCHAR *message)
{
if (db_get_b(hContact, "CList", "NotOnList", 0) == 1 || db_get_b(hContact, "CList", "Hidden", 0) == 1)
return;
@@ -297,7 +297,7 @@ void ReturnNotify(HANDLE hContact, TCHAR *message) }
}
-void GoneNotify(HANDLE hContact, TCHAR *message)
+void GoneNotify(HCONTACT hContact, TCHAR *message)
{
if (db_get_b(hContact, "CList", "NotOnList", 0) == 1 || db_get_b(hContact, "CList", "Hidden", 0) == 1)
return;
@@ -343,12 +343,12 @@ void GoneNotify(HANDLE hContact, TCHAR *message) */
INT_PTR MissYouAction(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
if (lParam) {
CLISTEVENT* cle = (CLISTEVENT*)lParam;
hContact = cle->hContact;
}
- else hContact = (HANDLE)wParam;
+ else hContact = (HCONTACT)wParam;
CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, 0);
return 0;
@@ -361,12 +361,12 @@ INT_PTR MissYouAction(WPARAM wParam, LPARAM lParam) */
INT_PTR ContactReturnedAction(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
if (lParam) {
CLISTEVENT* cle = (CLISTEVENT*)lParam;
hContact = cle->hContact;
}
- else hContact = (HANDLE)wParam;
+ else hContact = (HCONTACT)wParam;
if (options.iShowMessageWindow>0)
CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, 0);
@@ -385,12 +385,12 @@ INT_PTR ContactReturnedAction(WPARAM wParam, LPARAM lParam) */
INT_PTR ContactStillAbsentAction(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
if (lParam) {
CLISTEVENT* cle = (CLISTEVENT*)lParam;
hContact = cle->hContact;
}
- else hContact = (HANDLE)wParam;
+ else hContact = (HCONTACT)wParam;
switch (options.action2) {
case GCA_DELETE:
@@ -423,15 +423,15 @@ int onIconsChanged(WPARAM wParam, LPARAM lParam) */
INT_PTR MenuMissYouClick(WPARAM wParam, LPARAM lParam)
{
- if (db_get_b((HANDLE)wParam, MODULE_NAME, "MissYou", 0)) {
- db_set_b((HANDLE)wParam, MODULE_NAME, "MissYou", 0);
+ if (db_get_b((HCONTACT)wParam, MODULE_NAME, "MissYou", 0)) {
+ db_set_b((HCONTACT)wParam, MODULE_NAME, "MissYou", 0);
if (options.MissYouIcon)
- ExtraIcon_Clear(hExtraIcon, (HANDLE)wParam);
+ ExtraIcon_Clear(hExtraIcon, (HCONTACT)wParam);
}
else {
- db_set_b((HANDLE)wParam, MODULE_NAME, "MissYou", 1);
+ db_set_b((HCONTACT)wParam, MODULE_NAME, "MissYou", 1);
if (options.MissYouIcon)
- ExtraIcon_SetIcon(hExtraIcon, (HANDLE)wParam, "enabled_icon");
+ ExtraIcon_SetIcon(hExtraIcon, (HCONTACT)wParam, "enabled_icon");
}
return 0;
@@ -442,13 +442,13 @@ INT_PTR MenuMissYouClick(WPARAM wParam, LPARAM lParam) */
int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- char *proto = GetContactProto((HANDLE)wParam);
+ char *proto = GetContactProto((HCONTACT)wParam);
if (!proto)
return 0;
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON | CMIM_NAME | CMIF_TCHAR;
- if (db_get_b((HANDLE)wParam, MODULE_NAME, "MissYou", 0)) {
+ if (db_get_b((HCONTACT)wParam, MODULE_NAME, "MissYou", 0)) {
mi.ptszName = LPGENT("Disable Miss You");
mi.icolibItem = iconList[1].hIcolib;
}
@@ -457,14 +457,14 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) mi.icolibItem = iconList[2].hIcolib;
}
Menu_ModifyItem(hContactMenu, &mi);
- Menu_ShowItem(hContactMenu, !db_get_b((HANDLE)wParam, proto, "ChatRoom", 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND));
+ Menu_ShowItem(hContactMenu, !db_get_b((HCONTACT)wParam, proto, "ChatRoom", 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND));
return 0;
}
int onExtraImageApplying(WPARAM wParam, LPARAM lParam)
{
- if ( db_get_b((HANDLE)wParam, MODULE_NAME, "MissYou", 0))
- ExtraIcon_SetIcon(hExtraIcon, (HANDLE)wParam, "enabled_icon");
+ if ( db_get_b((HCONTACT)wParam, MODULE_NAME, "MissYou", 0))
+ ExtraIcon_SetIcon(hExtraIcon, (HCONTACT)wParam, "enabled_icon");
return 0;
}
@@ -474,7 +474,7 @@ int onExtraImageApplying(WPARAM wParam, LPARAM lParam) */
int SettingChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT) wParam;
DBCONTACTWRITESETTING *inf = (DBCONTACTWRITESETTING *) lParam;
if (hContact == NULL || inf->value.type == DBVT_DELETED || strcmp(inf->szSetting, "Status") != 0)
@@ -565,7 +565,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *proto = GetContactProto(hContact);
if (proto && (db_get_b(hContact, proto, "ChatRoom", 0) == 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) && isContactGoneFor(hContact, options.iAbsencePeriod2) && (db_get_b(hContact, MODULE_NAME, "StillAbsentNotified", 0) == 0))
{
@@ -671,7 +671,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda int ContactAdded(WPARAM wParam, LPARAM lParam)
{
- db_set_dw((HANDLE)wParam, MODULE_NAME, "CreationTime", (DWORD)time(0));
+ db_set_dw((HCONTACT)wParam, MODULE_NAME, "CreationTime", (DWORD)time(0));
return 0;
}
@@ -709,7 +709,7 @@ extern "C" int __declspec(dllexport) Load(void) DBVARIANT dbv;
DWORD current_time = (DWORD)time(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)) {
if ( !db_get(hContact, MODULE_NAME, "CreationTime", &dbv))
db_free(&dbv);
else
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index f668e70a9b..7d710ce26c 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -25,9 +25,9 @@ #define DEF_COLOR_FORE 0x000000
extern HICON hIcon;
-extern time_t getLastSeen(HANDLE);
-extern time_t getLastInputMsg(HANDLE);
-extern bool isContactGoneFor(HANDLE, int);
+extern time_t getLastSeen(HCONTACT);
+extern time_t getLastInputMsg(HCONTACT);
+extern bool isContactGoneFor(HCONTACT, int);
Options options;
void LoadOptions()
@@ -247,7 +247,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, SaveOptions();
// clear all notified settings
- 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_b(hContact, MODULE_NAME, "StillAbsentNotified", 0))
db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 0);
@@ -458,7 +458,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar {
time_t tmpTime;
TCHAR tmpBuf[51] = {0};
- tmpTime = getLastSeen((HANDLE)lparam);
+ tmpTime = getLastSeen((HCONTACT)lparam);
if (tmpTime == -1)
SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, TranslateT("not detected"));
else {
@@ -466,7 +466,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, tmpBuf);
}
- tmpTime = getLastInputMsg((HANDLE)lparam);
+ tmpTime = getLastInputMsg((HCONTACT)lparam);
if (tmpTime == -1)
SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, TranslateT("not found"));
else {
@@ -474,19 +474,19 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf);
}
- unsigned int AbsencePeriod = db_get_dw((HANDLE)lparam, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
+ unsigned int AbsencePeriod = db_get_dw((HCONTACT)lparam, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
SendDlgItemMessage(hdlg, IDC_SPINABSENCE, UDM_SETRANGE, 0, MAKELONG(999, 1));
SetDlgItemInt(hdlg, IDC_EDITABSENCE, AbsencePeriod, FALSE);
- if (isContactGoneFor((HANDLE)lparam, options.iAbsencePeriod2))
+ if (isContactGoneFor((HCONTACT)lparam, options.iAbsencePeriod2))
SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, TranslateT("This contact has been absent for an extended period of time."));
else
SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, _T(""));
- SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_SETCHECK, db_get_b((HANDLE)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
- SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_SETCHECK, db_get_b((HANDLE)lparam, MODULE_NAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
- SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_SETCHECK, db_get_b((HANDLE)lparam, MODULE_NAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_SETCHECK, db_get_b((HCONTACT)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_SETCHECK, db_get_b((HCONTACT)lparam, MODULE_NAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_SETCHECK, db_get_b((HCONTACT)lparam, MODULE_NAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
TranslateDialogDefault(hdlg);
return TRUE;
@@ -500,7 +500,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar {
case (PSN_APPLY):
{
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lparam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lparam)->lParam;
if (hContact)
{
db_set_dw(hContact, MODULE_NAME, "iAbsencePeriod", GetDlgItemInt(hdlg, IDC_EDITABSENCE, 0, FALSE));
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index 9395887a5c..d47444d3bd 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -12,7 +12,7 @@ void populateSettingsList(HWND hwnd2List) void populateContacts(HANDLE BPhContact,HWND hwnd2CB)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *szProto = GetContactProto(hContact);
if (szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) {
TCHAR name[300];
@@ -25,7 +25,7 @@ void populateContacts(HANDLE BPhContact,HWND hwnd2CB) }
}
-void saveLastSetting(HANDLE hContact, HWND hwnd)
+void saveLastSetting(HCONTACT hContact, HWND hwnd)
{
TCHAR number[8];//, string[1024];//for sending file name
switch (db_get_b(hContact, modname, "LastSetting", 2)) { // nothing to do
@@ -63,7 +63,7 @@ void hideAll(HWND hwnd) ShowWindow(GetDlgItem(hwnd, IDC_SPIN), SW_HIDE);
}
-void getDefaultMessage(HWND hwnd, UINT control, HANDLE hContact)
+void getDefaultMessage(HWND hwnd, UINT control, HCONTACT hContact)
{
DBVARIANT dbv;
if (!db_get_ts(hContact, modname, "PounceMsg", &dbv)) {
@@ -178,7 +178,7 @@ void statusModes(windowInfo *wi, int myStatusMode) // myStatusMode=1 sendIfMySta CheckDlgButton(hwnd, IDC_CHECK10, (statusFlag&LUNCH)>>9);
}
-void deletePounce(HANDLE hContact)
+void deletePounce(HCONTACT hContact)
{
db_unset(hContact,modname, "PounceMsg");
db_unset(hContact,modname, "SendIfMyStatusIsFLAG");
@@ -192,12 +192,12 @@ void deletePounce(HANDLE hContact) INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
switch(msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)lParam);
getDefaultMessage(hwnd, IDC_MESSAGE, hContact);
@@ -259,7 +259,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l msg(TranslateT("error......"), TranslateT("Buddy Pounce"));
DestroyWindow(hwnd);
}
- wi->hContact = (HANDLE)lParam;
+ wi->hContact = (HCONTACT)lParam;
wi->SendIfMy = 0;
wi->SendWhenThey = 0;
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)wi);
@@ -290,7 +290,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case IDC_SIMPLE:
case IDOK:
{
- HANDLE hContact = (HANDLE)SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETITEMDATA, SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETCURSEL,0,0),0);
+ HCONTACT hContact = (HCONTACT)SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETITEMDATA, SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETCURSEL,0,0),0);
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE))+1;
if (length>1) {
TCHAR *text = (TCHAR*)mir_alloc(length*sizeof(TCHAR));
@@ -416,7 +416,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
windowInfo *wi = (windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- HANDLE hContact = ((windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA))->hContact;
+ HCONTACT hContact = ((windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA))->hContact;
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE))+1;
if (length > 1) {
TCHAR *text = (TCHAR*)mir_alloc(length*sizeof(TCHAR));
@@ -570,13 +570,13 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
switch(msg) {
case WM_INITDIALOG:
SetWindowLongPtr(hwnd, GWLP_USERDATA, (WPARAM)lParam);
TranslateDialogDefault(hwnd);
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
{
DBVARIANT dbv;
if (db_get_ts(hContact, modname, "PounceMsg", &dbv))
@@ -608,7 +608,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP return 0;
}
-void CreateMessageAcknowlegedWindow(HANDLE hContact, int SentSuccess)
+void CreateMessageAcknowlegedWindow(HCONTACT hContact, int SentSuccess)
{
HWND hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMSEND), 0, PounceSentDlgProc, (LPARAM)hContact);
TCHAR msg[256];
diff --git a/plugins/BuddyPounce/src/headers.h b/plugins/BuddyPounce/src/headers.h index 3a48a35375..48c499442c 100644 --- a/plugins/BuddyPounce/src/headers.h +++ b/plugins/BuddyPounce/src/headers.h @@ -47,14 +47,14 @@ struct windowInfo
{
- HANDLE hContact;
+ HCONTACT hContact;
HWND SendIfMy;
HWND SendWhenThey;
};
struct SendPounceDlgProcStruct
{
- HANDLE hContact;
+ HCONTACT hContact;
int timer;
TCHAR *message;
};
@@ -66,13 +66,13 @@ extern HINSTANCE hInst; //=======================================================
// main.c
-void SendPounce(TCHAR* text, HANDLE hContact);
+void SendPounce(TCHAR* text, HCONTACT hContact);
//dialog.c
INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-void CreateMessageAcknowlegedWindow(HANDLE hContact, int SentSuccess);
+void CreateMessageAcknowlegedWindow(HCONTACT hContact, int SentSuccess);
#endif //_COMMONHEADERS_H
\ No newline at end of file diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index cbca095e37..18e8a64c44 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -133,7 +133,7 @@ int statusCheck(int statusFlag, int status) }
return 0;
}
-int CheckDate(HANDLE hContact)
+int CheckDate(HCONTACT hContact)
{
time_t curtime = time (NULL);
if(!db_get_b(hContact,modname,"GiveUpDays",0))
@@ -143,7 +143,7 @@ int CheckDate(HANDLE hContact) return 0;
}
-void SendPounce(TCHAR *text, HANDLE hContact)
+void SendPounce(TCHAR *text, HCONTACT hContact)
{
char* pszUtf = mir_utf8encodeT(text);
if (HANDLE hSendId = (HANDLE)CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)pszUtf))
@@ -153,14 +153,14 @@ void SendPounce(TCHAR *text, HANDLE hContact) int UserOnlineSettingChanged(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
char *szProto = GetContactProto(hContact);
if((HANDLE)wParam == NULL || strcmp(cws->szSetting,"Status")) return 0;
if (szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) {
int newStatus = cws->value.wVal;
- int oldStatus = db_get_w((HANDLE)wParam,"UserOnline","OldStatus",ID_STATUS_OFFLINE);
+ int oldStatus = db_get_w((HCONTACT)wParam,"UserOnline","OldStatus",ID_STATUS_OFFLINE);
if (newStatus != oldStatus && wParam != NULL && newStatus != ID_STATUS_OFFLINE) {
DBVARIANT dbv;
@@ -192,7 +192,7 @@ int UserOnlineSettingChanged(WPARAM wParam,LPARAM lParam) INT_PTR BuddyPounceMenuCommand(WPARAM wParam, LPARAM lParam)
{
- if (db_get_b(NULL, modname, "UseAdvanced", 0) || db_get_b((HANDLE)wParam, modname, "UseAdvanced", 0))
+ if (db_get_b(NULL, modname, "UseAdvanced", 0) || db_get_b((HCONTACT)wParam, modname, "UseAdvanced", 0))
CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_POUNCE),0,BuddyPounceDlgProc, wParam);
else CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_POUNCE_SIMPLE),0,BuddyPounceSimpleDlgProc, wParam);
return 0;
@@ -200,7 +200,7 @@ INT_PTR BuddyPounceMenuCommand(WPARAM wParam, LPARAM lParam) INT_PTR AddSimpleMessage(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
TCHAR* message = (TCHAR*)lParam;
time_t today = time(NULL);
db_set_ws(hContact, modname, "PounceMsg", message);
@@ -214,7 +214,7 @@ INT_PTR AddSimpleMessage(WPARAM wParam, LPARAM lParam) INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
TCHAR* message = (TCHAR*)lParam;
DBVARIANT dbv;
if (!db_get_ts(hContact, modname, "PounceMsg",&dbv))
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index cb41658ae4..22725f9e07 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -67,7 +67,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) static int OnDbChanged(WPARAM wparam, LPARAM lparam)
{
- HANDLE hContact = (HANDLE)wparam;
+ HCONTACT hContact = (HCONTACT)wparam;
DBCONTACTWRITESETTING *cws = ( DBCONTACTWRITESETTING* )lparam;
// if user changes his UIN or JID on any account
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 4415e69a78..f52a7e44a4 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -83,7 +83,7 @@ static VOID NTAPI ShowContactMenu(ULONG_PTR wParam) void Popup_DoAction(HWND hWnd, BYTE Action, PLUGIN_DATA *pdata)
{
- HANDLE hContact = (HANDLE)CallService(MS_POPUP_GETCONTACT, (WPARAM)hWnd, 0);
+ HCONTACT hContact = (HCONTACT)CallService(MS_POPUP_GETCONTACT, (WPARAM)hWnd, 0);
switch (Action) {
case PCA_OPENMESSAGEWND: // open message window
if (hContact && hContact != INVALID_HANDLE_VALUE)
@@ -201,7 +201,7 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) if (lstrcmpA(cws->szSetting, DB_MIRVER))
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
SHOWPOPUP_DATA sd = {0};
char *szProto = GetContactProto(hContact);
if (g_PreviewOptPage)
@@ -231,7 +231,7 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) PopupOptPage.DBToMem();
}
- HANDLE hContactOrMeta = (hContact && bMetaContactsExists) ? (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0) : hContact;
+ HCONTACT hContactOrMeta = (hContact && bMetaContactsExists) ? (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0) : hContact;
if (!hContactOrMeta)
hContactOrMeta = hContact;
diff --git a/plugins/ClientChangeNotify/src/Common.h b/plugins/ClientChangeNotify/src/Common.h index 2869333d1c..f9ce032674 100644 --- a/plugins/ClientChangeNotify/src/Common.h +++ b/plugins/ClientChangeNotify/src/Common.h @@ -138,7 +138,7 @@ struct PLUGIN_DATA struct SHOWPOPUP_DATA
{
- HANDLE hContact;
+ HCONTACT hContact;
TCString OldMirVer;
TCString MirVer;
COptPage *PopupOptPage;
diff --git a/plugins/ClientChangeNotify/src/CommonLibs/CString.cpp b/plugins/ClientChangeNotify/src/CommonLibs/CString.cpp index de3e26d238..52e4f69295 100644 --- a/plugins/ClientChangeNotify/src/CommonLibs/CString.cpp +++ b/plugins/ClientChangeNotify/src/CommonLibs/CString.cpp @@ -272,19 +272,19 @@ template class TString<TCHAR>; template class TString<char>;
template class TString<WCHAR>;
-CString db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, const char *szDefaultValue)
+CString db_get_s(HCONTACT hContact, const char *szModule, const char *szSetting, const char *szDefaultValue)
{
ptrA p( db_get_sa(hContact, szModule, szSetting));
return CString(p == NULL ? szDefaultValue : p);
}
-TCString db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
+TCString db_get_s(HCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
{
ptrT p( db_get_tsa(hContact, szModule, szSetting));
return TCString(p == NULL ? szDefaultValue : p);
}
-TCString DBGetContactSettingAsString(HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
+TCString DBGetContactSettingAsString(HCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
{ // also converts numeric values to a string
DBVARIANT dbv = {0};
int iRes = db_get_ws(hContact, szModule, szSetting, &dbv);
diff --git a/plugins/ClientChangeNotify/src/CommonLibs/CString.h b/plugins/ClientChangeNotify/src/CommonLibs/CString.h index fc81efed22..c1f555c72a 100644 --- a/plugins/ClientChangeNotify/src/CommonLibs/CString.h +++ b/plugins/ClientChangeNotify/src/CommonLibs/CString.h @@ -163,10 +163,10 @@ __inline CHARARRAY WCHAR2UTF8(WCString Str) #undef db_get_s
-CString db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, const char *szDefaultValue);
-TCString db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue);
-int db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
-TCString DBGetContactSettingAsString(HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue); // also converts numeric values to a string
+CString db_get_s(HCONTACT hContact, const char *szModule, const char *szSetting, const char *szDefaultValue);
+TCString db_get_s(HCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue);
+int db_get_s(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
+TCString DBGetContactSettingAsString(HCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue); // also converts numeric values to a string
// various string helpers. their return values are valid only while the class is visible
class UTF8Encode
diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp index 0aeba193a2..806b58c785 100644 --- a/plugins/Clist_blind/src/clcopts.cpp +++ b/plugins/Clist_blind/src/clcopts.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h"
-TCHAR* MyDBGetContactSettingTString(HANDLE hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def);
+TCHAR* MyDBGetContactSettingTString(HCONTACT hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def);
#define DBFONTF_BOLD 1
diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp index a8e5220189..f709c123f0 100644 --- a/plugins/Clist_blind/src/clistopts.cpp +++ b/plugins/Clist_blind/src/clistopts.cpp @@ -28,7 +28,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP switch (msg) {
case WM_USER + 1:
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT) wParam;
DBCONTACTWRITESETTING *ws = (DBCONTACTWRITESETTING *) lParam;
if (hContact == NULL && ws != NULL && ws->szModule != NULL && ws->szSetting != NULL
&& lstrcmpiA(ws->szModule, "CList") == 0 && lstrcmpiA(ws->szSetting, "UseGroups") == 0 && IsWindowVisible(hwndDlg)) {
@@ -221,7 +221,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP pcli->pfnTrayIconIconsChanged();
pcli->pfnLoadContactTree(); /* this won't do job properly since it only really works when changes happen */
- pcli->pfnInvalidateDisplayNameCacheEntry( INVALID_HANDLE_VALUE ); /* force reshuffle */
+ pcli->pfnInvalidateDisplayNameCacheEntry((HCONTACT)INVALID_HANDLE_VALUE); /* force reshuffle */
return TRUE;
}
break;
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index 90872edde0..593c331d66 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -185,7 +185,7 @@ extern "C" int __declspec(dllexport) Unload(void) /////////////////////////////////////////////////////////////////////////////////////////
-TCHAR* MyDBGetContactSettingTString(HANDLE hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def)
+TCHAR* MyDBGetContactSettingTString(HCONTACT hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def)
{
DBVARIANT dbv;
diff --git a/plugins/Clist_modern/src/hdr/modern_awaymsg.h b/plugins/Clist_modern/src/hdr/modern_awaymsg.h index ced79d077f..df40446f2c 100644 --- a/plugins/Clist_modern/src/hdr/modern_awaymsg.h +++ b/plugins/Clist_modern/src/hdr/modern_awaymsg.h @@ -34,4 +34,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void InitAwayMsgModule();
void UninitAwayMsgModule();
-void amRequestAwayMsg(HANDLE hContact);
+void amRequestAwayMsg(HCONTACT hContact);
diff --git a/plugins/Clist_modern/src/hdr/modern_cache_funcs.h b/plugins/Clist_modern/src/hdr/modern_cache_funcs.h index 8566333734..9b32eb6788 100644 --- a/plugins/Clist_modern/src/hdr/modern_cache_funcs.h +++ b/plugins/Clist_modern/src/hdr/modern_cache_funcs.h @@ -37,11 +37,11 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact); void Cache_GetSecondLineText(struct SHORTDATA *dat, ClcCacheEntry *pdnce);
void Cache_GetThirdLineText(struct SHORTDATA *dat, ClcCacheEntry *pdnce);
void Cache_GetAvatar(ClcData *dat, ClcContact *contact);
-void Cache_GetTimezone(ClcData *dat, HANDLE hContact);
+void Cache_GetTimezone(ClcData *dat, HCONTACT hContact);
int Cache_GetLineText(ClcCacheEntry *pdnce, int type, LPTSTR text, int text_size, TCHAR *variable_text, BOOL xstatus_has_priority,
BOOL show_status_if_no_away, BOOL show_listening_if_no_away, BOOL use_name_and_message_for_xstatus,
BOOL pdnce_time_show_only_if_different);
-void amRequestAwayMsg(HANDLE hContact);
+void amRequestAwayMsg(HCONTACT hContact);
#endif // __CACHE_FUNCS_H__
diff --git a/plugins/Clist_modern/src/hdr/modern_clc.h b/plugins/Clist_modern/src/hdr/modern_clc.h index af1838b8a5..2e8cfe1224 100644 --- a/plugins/Clist_modern/src/hdr/modern_clc.h +++ b/plugins/Clist_modern/src/hdr/modern_clc.h @@ -396,7 +396,7 @@ void ClcOptionsChanged(void); //clcidents.c
int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex);
-int FindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible, BOOL isIgnoreSubcontacts );
+int FindItem(HWND hwnd, ClcData *dat, HCONTACT hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts);
int cliGetRowByIndex(ClcData *dat,int testindex,ClcContact **contact,ClcGroup **subgroup);
HANDLE ContactToHItem(ClcContact *contact);
HANDLE ContactToItemHandle(ClcContact *contact,DWORD *nmFlags);
@@ -406,9 +406,9 @@ void ClearRowByIndexCache(); ClcGroup *cli_AddGroup(HWND hwnd,ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers);
void cli_FreeGroup(ClcGroup *group);
int cli_AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText);
-void cliRebuildEntireList(HWND hwnd,ClcData *dat);
-void cli_DeleteItemFromTree(HWND hwnd,HANDLE hItem);
-void cli_AddContactToTree(HWND hwnd,ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline);
+void cliRebuildEntireList(HWND hwnd, ClcData *dat);
+void cli_DeleteItemFromTree(HWND hwnd, HCONTACT hItem);
+void cli_AddContactToTree(HWND hwnd,ClcData *dat,HCONTACT hContact,int updateTotalCount,int checkHideOffline);
void cli_SortCLC(HWND hwnd,ClcData *dat,int useInsertionSort);
int GetNewSelection(ClcGroup *group,int selection, int direction);
@@ -433,13 +433,13 @@ DWORD GetDefaultExStyle(void); void GetFontSetting(int i,LOGFONT *lf,COLORREF *colour,BYTE *effect, COLORREF *eColour1,COLORREF *eColour2);
//clistsettings.c
-TCHAR * GetContactDisplayNameW( HANDLE hContact, int mode );
+TCHAR * GetContactDisplayNameW(HCONTACT hContact, int mode );
//groups.c
TCHAR* GetGroupNameTS( int idx, DWORD* pdwFlags );
int RenameGroupT(WPARAM groupID, LPARAM newName);
-int GetContactCachedStatus(HANDLE hContact);
-char *GetContactCachedProtocol(HANDLE hContact);
+int GetContactCachedStatus(HCONTACT hContact);
+char *GetContactCachedProtocol(HCONTACT hContact);
#endif /* _CLC_H_ */
diff --git a/plugins/Clist_modern/src/hdr/modern_clist.h b/plugins/Clist_modern/src/hdr/modern_clist.h index ff9c776fd4..1c6c5923e8 100644 --- a/plugins/Clist_modern/src/hdr/modern_clist.h +++ b/plugins/Clist_modern/src/hdr/modern_clist.h @@ -28,9 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define _CLIST_H_
void LoadContactTree(void);
-HTREEITEM GetTreeItemByHContact(HANDLE hContact);
-void cli_ChangeContactIcon(HANDLE hContact,int iIcon,int add);
-int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status);
+HTREEITEM GetTreeItemByHContact(HCONTACT hContact);
+void cli_ChangeContactIcon(HCONTACT hContact,int iIcon,int add);
+int GetContactInfosForSort(HCONTACT hContact,char **Proto,TCHAR **Name,int *Status);
///////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h index f9424cb810..636388c61a 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h +++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h @@ -241,14 +241,14 @@ int AniAva_InitModule(); // HAVE TO BE AFTER GDI+ INITIALIZED int AniAva_UnloadModule();
int AniAva_UpdateOptions(); //reload options, //hot enable/disable engine
-int AniAva_AddAvatar(HANDLE hContact, TCHAR * szFilename, int width, int heigth); // adds avatars to be displayed
-int AniAva_SetAvatarPos(HANDLE hContact, RECT *rc, int overlayIdx, BYTE bAlpha); // update avatars pos
-int AniAva_InvalidateAvatarPositions(HANDLE hContact); // reset positions of avatars to be drawn (still be painted at same place)
+int AniAva_AddAvatar(HCONTACT hContact, TCHAR * szFilename, int width, int heigth); // adds avatars to be displayed
+int AniAva_SetAvatarPos(HCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha); // update avatars pos
+int AniAva_InvalidateAvatarPositions(HCONTACT hContact); // reset positions of avatars to be drawn (still be painted at same place)
int AniAva_RemoveInvalidatedAvatars(); // all avatars without validated position will be stop painted and probably removed
-int AniAva_RemoveAvatar(HANDLE hContact); // remove avatar
+int AniAva_RemoveAvatar(HCONTACT hContact); // remove avatar
int AniAva_RedrawAllAvatars(BOOL updateZOrder); // request to repaint all
void AniAva_UpdateParent();
-int AniAva_RenderAvatar( HANDLE hContact, HDC hdcMem, RECT *rc );
+int AniAva_RenderAvatar(HCONTACT hContact, HDC hdcMem, RECT *rc );
#define CCI_NAME 1
#define CCI_GROUP (1<<1)
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index 7d8eb47536..64409abab3 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -207,21 +207,21 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); //RowTemplate.c
BOOL FindMenuHanleByGlobalID(HMENU hMenu, int globalID, struct _MenuItemHandles * dat); //GenMenu.c
BOOL MatchMask(char *name, char *mask); //mod_skin_selector.c
-char* GetContactCachedProtocol(HANDLE hContact); //clistsettings.c
+char* GetContactCachedProtocol(HCONTACT hContact); //clistsettings.c
char* GetParamN(char *string, char *buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces); //mod_skin_selector.c
WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim, BOOL SkipSpaces);
-DWORD CompareContacts2_getLMTime(HANDLE u); //contact.c
+DWORD CompareContacts2_getLMTime(HCONTACT u); //contact.c
DWORD mod_CalcHash(const char * a); //mod_skin_selector.c
-HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status); //clistmod.c
+HICON cliGetIconFromStatusMode(HCONTACT hContact, const char *szProto,int status); //clistmod.c
HICON GetMainStatusOverlay(int STATUS); //clc.c
-int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szStatus, ClcData *dat); //clcitems.c
+int __fastcall CLVM_GetContactHiddenStatus(HCONTACT hContact, char *szStatus, ClcData *dat); //clcitems.c
int BgStatusBarChange(WPARAM wParam,LPARAM lParam); //clcopts.c
int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack); //clc.c
int ModernSkinButtonDeleteAll(); //modernbutton.c
-int GetContactCachedStatus(HANDLE hContact); //clistsettings.c
+int GetContactCachedStatus(HCONTACT hContact); //clistsettings.c
int GetContactIconC(ClcCacheEntry *cacheEntry); //clistmod.c
int GetContactIndex(ClcGroup *group,ClcContact *contact); //clcidents.c
-int GetStatusForContact(HANDLE hContact,char *szProto); //clistsettings.c
+int GetStatusForContact(HCONTACT hContact,char *szProto); //clistsettings.c
int InitCustomMenus(void); //clistmenus.c
int InitFramesMenus(void); //framesmenus.c
int LoadMoveToGroup(); //movetogroup.c
@@ -247,7 +247,7 @@ void Docking_GetMonitorRectFromWindow(HWND hWnd,RECT *rc); void DrawAvatarImageWithGDIp(HDC hDestDC,int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1,DWORD flag,BYTE alpha); //gdiplus.cpp
void FreeRowCell(); //RowHeight
void InitGdiPlus(); //gdiplus.cpp
-void InvalidateDNCEbyPointer(HANDLE hContact,ClcCacheEntry *pdnce,int SettingType); //clistsettings.c
+void InvalidateDNCEbyPointer(HCONTACT hContact,ClcCacheEntry *pdnce,int SettingType); //clistsettings.c
void ShutdownGdiPlus(); //gdiplus.cpp
void UninitCustomMenus(); //clistmenus.c
void UnloadAvatarOverlayIcon(); //clc.c
@@ -255,7 +255,7 @@ void UnLoadContactListModule(); / void UpdateAllAvatars(ClcData *dat); //cache_func.c
//cluiframes.c
-void gtaRenewText(HANDLE hContact);
+void gtaRenewText(HCONTACT hContact);
int ExtraImage_ExtraIDToColumnNum(int extra);
int LoadSkinButtonModule();
@@ -281,15 +281,15 @@ int cli_AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText); int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly);
int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixOk);
int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex);
-int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact);
-int cli_GetContactIcon(HANDLE hContact);
-int cli_RemoveEvent(HANDLE hContact, HANDLE hDbEvent);
-void cli_AddContactToTree(HWND hwnd,ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline);
-void cli_DeleteItemFromTree(HWND hwnd, HANDLE hItem);
+int cli_IconFromStatusMode(const char *szProto,int nStatus, HCONTACT hContact);
+int cli_GetContactIcon(HCONTACT hContact);
+int cli_RemoveEvent(HCONTACT hContact, HANDLE hDbEvent);
+void cli_AddContactToTree(HWND hwnd,ClcData *dat,HCONTACT hContact,int updateTotalCount,int checkHideOffline);
+void cli_DeleteItemFromTree(HWND hwnd, HCONTACT hItem);
void cli_FreeContact( ClcContact* );
void cli_FreeGroup( ClcGroup* );
char* cli_GetGroupCountsText(ClcData *dat, ClcContact *contact);
-void cli_ChangeContactIcon(HANDLE hContact,int iIcon,int add);
+void cli_ChangeContactIcon(HCONTACT hContact,int iIcon,int add);
LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wParam,LPARAM lParam);
struct CListEvent* cliCreateEvent( void );
struct CListEvent* cli_AddEvent(CLISTEVENT *cle);
@@ -297,12 +297,12 @@ LRESULT CALLBACK cli_ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wPara int cliShowHide(WPARAM wParam,LPARAM lParam);
BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect,BOOL bErase );
int cliCompareContacts(const ClcContact *contact1,const ClcContact *contact2);
-int cliFindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible);
+int cliFindItem(HWND hwnd, ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCount);
int cliTrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam);
void cliCluiProtocolStatusChanged(int status,const char * proto);
HMENU cliBuildGroupPopupMenu(ClcGroup *group);
-void cliInvalidateDisplayNameCacheEntry(HANDLE hContact);
+void cliInvalidateDisplayNameCacheEntry(HCONTACT hContact);
void cliCheckCacheItem(ClcCacheEntry *pdnce);
void cli_SaveStateAndRebuildList(HWND hwnd, ClcData *dat);
void CLUI_cli_LoadCluiGlobalOpts(void);
@@ -310,8 +310,8 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam,LPARAM lParam); BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect,BOOL bErase );
ClcContact* cliCreateClcContact( void );
-ClcCacheEntry* cliCreateCacheItem(HANDLE hContact);
-ClcCacheEntry* cliGetCacheEntry(HANDLE hContact);
+ClcCacheEntry* cliCreateCacheItem(HCONTACT hContact);
+ClcCacheEntry* cliGetCacheEntry(HCONTACT hContact);
#define WM_DWMCOMPOSITIONCHANGED 0x031E
@@ -332,7 +332,7 @@ extern tPaintCallbackProc CLCPaint_PaintCallbackProc(HWND hWnd, HDC hDC, RECT *r /* SkinEngine.c */
-BYTE SkinDBGetContactSettingByte(HANDLE hContact, const char* szSection, const char*szKey, BYTE bDefault);
+BYTE SkinDBGetContactSettingByte(HCONTACT hContact, const char* szSection, const char*szKey, BYTE bDefault);
extern OVERLAYICONINFO g_pAvatarOverlayIcons[ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE + 1];
extern OVERLAYICONINFO g_pStatusOverlayIcons[ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE + 1];
diff --git a/plugins/Clist_modern/src/hdr/modern_gettextasync.h b/plugins/Clist_modern/src/hdr/modern_gettextasync.h index b0e08b64a2..4e8c7c6ed5 100644 --- a/plugins/Clist_modern/src/hdr/modern_gettextasync.h +++ b/plugins/Clist_modern/src/hdr/modern_gettextasync.h @@ -1,5 +1,5 @@ #pragma once
void InitCacheAsync();
void UninitCacheAsync();
-void gtaRenewText(HANDLE hContact);
-int gtaAddRequest(ClcData *dat,ClcContact *contact,HANDLE hContact);
+void gtaRenewText(HCONTACT hContact);
+int gtaAddRequest(ClcData *dat,ClcContact *contact,HCONTACT hContact);
diff --git a/plugins/Clist_modern/src/hdr/modern_global_structure.h b/plugins/Clist_modern/src/hdr/modern_global_structure.h index 5ba424dde0..7be8dd2ff8 100644 --- a/plugins/Clist_modern/src/hdr/modern_global_structure.h +++ b/plugins/Clist_modern/src/hdr/modern_global_structure.h @@ -18,7 +18,7 @@ typedef struct tagCLUIDATA DWORD dwFlags;
TCHAR *szNoEvents;
int hIconNotify;
- HANDLE hUpdateContact;
+ HCONTACT hUpdateContact;
/* Contact List View Mode */
TCHAR groupFilter[2048];
diff --git a/plugins/Clist_modern/src/hdr/modern_skinned_profile.h b/plugins/Clist_modern/src/hdr/modern_skinned_profile.h index 78fdb1578d..0eebf53cba 100644 --- a/plugins/Clist_modern/src/hdr/modern_skinned_profile.h +++ b/plugins/Clist_modern/src/hdr/modern_skinned_profile.h @@ -233,10 +233,10 @@ public: HRESULT Init();
HRESULT Clear();
- static BYTE SpiGetSkinByte ( HANDLE hContact, const char * szSection, const char * szKey, const BYTE defValue );
- static WORD SpiGetSkinWord ( HANDLE hContact, const char * szSection, const char * szKey, const WORD defValue );
- static DWORD SpiGetSkinDword( HANDLE hContact, const char * szSection, const char * szKey, const DWORD defValue );
- static BOOL SpiCheckSkinned( HANDLE hContact, const char * szSection, const char * szKey );
+ static BYTE SpiGetSkinByte (HCONTACT hContact, const char * szSection, const char * szKey, const BYTE defValue );
+ static WORD SpiGetSkinWord (HCONTACT hContact, const char * szSection, const char * szKey, const WORD defValue );
+ static DWORD SpiGetSkinDword(HCONTACT hContact, const char * szSection, const char * szKey, const DWORD defValue );
+ static BOOL SpiCheckSkinned(HCONTACT hContact, const char * szSection, const char * szKey );
};
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index 08415dda17..1a27ac5079 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -60,7 +60,7 @@ enum { struct ANIAVA_OBJECT
{
- HANDLE hContact;
+ HCONTACT hContact;
HWND hWindow;
BOOL bInvalidPos;
BOOL bToBeDeleted;
@@ -284,7 +284,7 @@ int AniAva_UpdateOptions() }
// adds avatars to be displayed
-int AniAva_AddAvatar(HANDLE hContact, TCHAR * szFilename, int width, int heigth)
+int AniAva_AddAvatar(HCONTACT hContact, TCHAR * szFilename, int width, int heigth)
{
aacheck 0;
if (!GDIPlus_IsAnimatedGif (szFilename))
@@ -344,7 +344,7 @@ void AniAva_UpdateParent() }
}
-ANIAVA_OBJECT * FindAvatarByContact( HANDLE hContact )
+ANIAVA_OBJECT * FindAvatarByContact(HCONTACT hContact )
{
for ( int i=0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT *pai = ((ANIAVA_OBJECT *)s_Objects[i]);
@@ -354,7 +354,7 @@ ANIAVA_OBJECT * FindAvatarByContact( HANDLE hContact ) return NULL;
}
-int AniAva_RenderAvatar( HANDLE hContact, HDC hdcMem, RECT *rc )
+int AniAva_RenderAvatar(HCONTACT hContact, HDC hdcMem, RECT *rc )
{
aacheck 0;
mir_cslock lck(s_CS);
@@ -365,7 +365,7 @@ int AniAva_RenderAvatar( HANDLE hContact, HDC hdcMem, RECT *rc ) }
// update avatars pos
-int AniAva_SetAvatarPos(HANDLE hContact, RECT *rc, int overlayIdx, BYTE bAlpha)
+int AniAva_SetAvatarPos(HCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha)
{
aacheck 0;
mir_cslock lck(s_CS);
@@ -404,7 +404,7 @@ int AniAva_SetAvatarPos(HANDLE hContact, RECT *rc, int overlayIdx, BYTE bAlpha) return 1;
}
// remove avatar
-int AniAva_RemoveAvatar(HANDLE hContact)
+int AniAva_RemoveAvatar(HCONTACT hContact)
{
aacheck 0;
mir_cslock lck(s_CS);
@@ -419,7 +419,7 @@ int AniAva_RemoveAvatar(HANDLE hContact) return 1;
}
// reset positions of avatars to be drawn (still be painted at same place)
-int AniAva_InvalidateAvatarPositions(HANDLE hContact)
+int AniAva_InvalidateAvatarPositions(HCONTACT hContact)
{
aacheck 0;
mir_cslock lck(s_CS);
diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp index 7953807781..b9b66caab0 100644 --- a/plugins/Clist_modern/src/modern_awaymsg.cpp +++ b/plugins/Clist_modern/src/modern_awaymsg.cpp @@ -42,13 +42,10 @@ static LIST<void> amItems(10, PtrKeySortT); static HANDLE hamProcessEvent = NULL;
static DWORD amRequestTick = 0;
-static int amAddHandleToChain(HANDLE hContact);
-static HANDLE amGetCurrentChain();
-
/*
* Add contact handle to requests queue
*/
-static int amAddHandleToChain(HANDLE hContact)
+static int amAddHandleToChain(HCONTACT hContact)
{
mir_cslockfull lck(amCS);
if (amItems.find(hContact) != NULL)
@@ -63,13 +60,13 @@ static int amAddHandleToChain(HANDLE hContact) /*
* Gets handle from queue for request
*/
-static HANDLE amGetCurrentChain()
+static HCONTACT amGetCurrentChain()
{
mir_cslock lck(amCS);
if (amItems.getCount() == 0)
return NULL;
- HANDLE res = amItems[0];
+ HCONTACT res = (HCONTACT)amItems[0];
amItems.remove(0);
return res;
}
@@ -85,7 +82,7 @@ static void amThreadProc(void *) memset(&dnce, 0, sizeof(dnce));
while (!MirandaExiting()) {
- HANDLE hContact = amGetCurrentChain();
+ HCONTACT hContact = amGetCurrentChain();
while (hContact) {
DWORD time = GetTickCount();
if ((time-amRequestTick) < AMASKPERIOD) {
@@ -94,7 +91,7 @@ static void amThreadProc(void *) return;
}
CListSettings_FreeCacheItemData(&dnce);
- dnce.hContact = (HANDLE)hContact;
+ dnce.hContact = hContact;
Sync(CLUI_SyncGetPDNCE, (WPARAM) 0, (LPARAM)&dnce);
HANDLE ACK = 0;
@@ -146,7 +143,7 @@ BOOL amWakeThread() /*
* Sub to be called outside on status changing to retrieve away message
*/
-void amRequestAwayMsg(HANDLE hContact)
+void amRequestAwayMsg(HCONTACT hContact)
{
if (!g_CluiData.bInternalAwayMsgDiscovery || !hContact)
return;
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index f41b7c1db9..0066366f4c 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -54,7 +54,7 @@ void CListSettings_FreeCacheItemDataOption( ClcCacheEntry *pDst, DWORD flag ); /*
* Get time zone for contact
*/
-void Cache_GetTimezone(ClcData *dat, HANDLE hContact)
+void Cache_GetTimezone(ClcData *dat, HCONTACT hContact)
{
ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hContact);
if (dat == NULL && pcli->hwndContactTree)
@@ -205,7 +205,7 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce, sp.Protocolname = pdnce->m_cache_cszProto;
if ( db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) != 1 && pdnce->m_cache_cszProto != NULL && g_szMetaModuleName && strcmp(pdnce->m_cache_cszProto, g_szMetaModuleName) == 0) {
- HANDLE hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (LPARAM)pdnce->hContact, 0);
+ HCONTACT hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (LPARAM)pdnce->hContact, 0);
if (hContact != 0)
sp.Protocolname = GetContactProto(hContact);
}
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 7a364dd2bb..8aaad5eddf 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -258,7 +258,7 @@ static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam) else if (!strcmp(cws->szSetting,"ListeningTo"))
pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,wParam,0);
else if (!strcmp(cws->szSetting,"Transport") || !strcmp(cws->szSetting,"IsTransported")) {
- pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
+ pcli->pfnInvalidateDisplayNameCacheEntry((HCONTACT)wParam);
pcli->pfnClcBroadcast( CLM_AUTOREBUILD,wParam,0);
}
}
@@ -273,8 +273,8 @@ static int clcHookDbEventAdded(WPARAM wParam,LPARAM lParam) DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get((HANDLE)lParam, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
- ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry((HANDLE)wParam);
- db_set_dw((HANDLE)wParam, "CList", "mf_lastmsg", dbei.timestamp);
+ ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry((HCONTACT)wParam);
+ db_set_dw((HCONTACT)wParam, "CList", "mf_lastmsg", dbei.timestamp);
if (pdnce)
pdnce->dwLastMsgTime = dbei.timestamp;
}
@@ -1472,17 +1472,17 @@ static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM w BYTE flags = 0;
ClcContact *contact;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
memset(iExtraImage, 0xFF, sizeof(iExtraImage));
else {
memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
flags = contact->flags;
}
- pcli->pfnDeleteItemFromTree(hwnd, (HANDLE) wParam);
- if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b((HANDLE) wParam, "CList", "Hidden", 0)) {
+ pcli->pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam);
+ if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b((HCONTACT)wParam, "CList", "Hidden", 0)) {
NMCLISTCONTROL nm;
- pcli->pfnAddContactToTree(hwnd, dat, (HANDLE) wParam, 1, 1);
- if (pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL)) {
+ pcli->pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1);
+ if (pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
contact->flags |= CONTACTF_CHECKED;
@@ -1507,41 +1507,41 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP BOOL needRepaint = FALSE;
WORD status;
RECT iconRect = {0};
- int contacticon = corecli.pfnGetContactIcon((HANDLE)wParam);
- HANDLE hSelItem = NULL;
+ int contacticon = corecli.pfnGetContactIcon((HCONTACT)wParam);
+ HCONTACT hSelItem = NULL;
ClcContact *selcontact = NULL;
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if (szProto == NULL)
status = ID_STATUS_OFFLINE;
else
- status = GetContactCachedStatus((HANDLE) wParam);
+ status = GetContactCachedStatus((HCONTACT)wParam);
BOOL image_is_special = (LOWORD(contacticon) != (LOWORD(lParam))); //check only base icons
- int nHiddenStatus = CLVM_GetContactHiddenStatus((HANDLE)wParam, szProto, dat);
+ int nHiddenStatus = CLVM_GetContactHiddenStatus((HCONTACT)wParam, szProto, dat);
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- bool isVisiblebyFilter = (( ( style & CLS_SHOWHIDDEN ) && nHiddenStatus != -1 ) || !nHiddenStatus );
- bool ifVisibleByClui = !pcli->pfnIsHiddenMode( dat, status );
- bool isVisible = g_CluiData.bFilterEffective&CLVM_FILTER_STATUS ? TRUE : ifVisibleByClui;
- bool isIconChanged = cli_GetContactIcon((HANDLE)wParam) != LOWORD(lParam);
+ bool isVisiblebyFilter = (( ( style & CLS_SHOWHIDDEN ) && nHiddenStatus != -1 ) || !nHiddenStatus );
+ bool ifVisibleByClui = !pcli->pfnIsHiddenMode( dat, status );
+ bool isVisible = g_CluiData.bFilterEffective&CLVM_FILTER_STATUS ? TRUE : ifVisibleByClui;
+ bool isIconChanged = cli_GetContactIcon((HCONTACT)wParam) != LOWORD(lParam);
- shouldShow = isVisiblebyFilter && ( isVisible || isIconChanged ) ;
+ shouldShow = isVisiblebyFilter && ( isVisible || isIconChanged ) ;
// XXX CLVM changed - this means an offline msg is flashing, so the contact should be shown
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL)) {
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = pcli->pfnContactToHItem(selcontact);
- pcli->pfnAddContactToTree(hwnd, dat, (HANDLE) wParam, (style & CLS_CONTACTLIST) == 0, 0);
+ hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
+ pcli->pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, (style & CLS_CONTACTLIST) == 0, 0);
recalcScrollBar = 1;
needRepaint = TRUE;
- pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL);
+ pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL);
if (contact) {
contact->iImage = lParam;
contact->image_is_special = image_is_special;
- pcli->pfnNotifyNewContact(hwnd, (HANDLE) wParam);
+ pcli->pfnNotifyNewContact(hwnd, (HCONTACT)wParam);
dat->needsResort = 1;
}
}
@@ -1555,7 +1555,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->hideOffline || g_CluiData.bFilterEffective)) { // CLVM changed
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = pcli->pfnContactToHItem(selcontact);
+ hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
pcli->pfnRemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
needRepaint = TRUE;
recalcScrollBar = 1;
@@ -1603,7 +1603,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP static LRESULT clcOnIntmAvatarChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
ClcContact *contact;
- if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
+ if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL, FALSE))
Cache_GetAvatar(dat, contact);
else if (dat->use_avatar_service && !wParam)
UpdateAllAvatars(dat);
@@ -1615,7 +1615,7 @@ static LRESULT clcOnIntmAvatarChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM static LRESULT clcOnIntmTimeZoneChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
ClcContact *contact;
- if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL, FALSE))
return corecli.pfnContactListControlWndProc(hwnd,msg,wParam,lParam);
if (contact) {
@@ -1630,13 +1630,13 @@ static LRESULT clcOnIntmNameChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP {
int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
+ pcli->pfnInvalidateDisplayNameCacheEntry((HCONTACT)wParam);
ClcContact *contact;
- if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL, FALSE))
return ret;
- lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam,0),SIZEOF(contact->szText));
+ lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HCONTACT)wParam, 0), SIZEOF(contact->szText));
if (contact) {
Cache_GetText(dat,contact,1);
cliRecalcScrollBar(hwnd,dat);
@@ -1655,7 +1655,7 @@ static LRESULT clcOnIntmApparentModeChanged(ClcData *dat, HWND hwnd, UINT msg, W static LRESULT clcOnIntmStatusMsgChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
ClcContact *contact;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL || IsHContactInfo(hContact) || IsHContactGroup(hContact))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (!FindItem(hwnd,dat,hContact,&contact,NULL,NULL,FALSE))
@@ -1674,7 +1674,7 @@ static LRESULT clcOnIntmNotOnListChanged(ClcData *dat, HWND hwnd, UINT msg, WPAR DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
ClcContact *contact;
- if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL, TRUE))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (contact->type != CLCIT_CONTACT)
@@ -1691,10 +1691,11 @@ static LRESULT clcOnIntmNotOnListChanged(ClcData *dat, HWND hwnd, UINT msg, WPAR static LRESULT clcOnIntmScrollBarChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_CONTACTLIST)
- {
- if (dat->noVScrollbar) ShowScrollBar(hwnd, SB_VERT, FALSE);
- else pcli->pfnRecalcScrollBar(hwnd, dat);
+ if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_CONTACTLIST) {
+ if (dat->noVScrollbar)
+ ShowScrollBar(hwnd, SB_VERT, FALSE);
+ else
+ pcli->pfnRecalcScrollBar(hwnd, dat);
}
return 0;
}
@@ -1703,20 +1704,20 @@ static LRESULT clcOnIntmStatusChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM {
int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (wParam != 0) {
- ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry((HANDLE)wParam);
+ ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry((HCONTACT)wParam);
if (pdnce && pdnce->m_cache_cszProto) {
pdnce___SetStatus( pdnce, GetStatusForContact(pdnce->hContact,pdnce->m_cache_cszProto));
if (!dat->force_in_dialog && (dat->second_line_show || dat->third_line_show))
gtaRenewText(pdnce->hContact);
- SendMessage(hwnd,INTM_ICONCHANGED, wParam, corecli.pfnGetContactIcon((HANDLE)wParam));
+ SendMessage(hwnd, INTM_ICONCHANGED, wParam, corecli.pfnGetContactIcon((HCONTACT)wParam));
ClcContact *contact;
- if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE)) {
+ if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL, TRUE)) {
if (contact && contact->type == CLCIT_CONTACT) {
if (!contact->image_is_special && pdnce___GetStatus( pdnce ) > ID_STATUS_OFFLINE)
- contact->iImage = corecli.pfnGetContactIcon((HANDLE)wParam);
+ contact->iImage = corecli.pfnGetContactIcon((HCONTACT)wParam);
if (contact->isSubcontact && contact->subcontacts && contact->subcontacts->type == CLCIT_CONTACT)
- pcli->pfnClcBroadcast( INTM_STATUSCHANGED,(WPARAM)contact->subcontacts->hContact,0); //forward status changing to host meta contact
+ pcli->pfnClcBroadcast(INTM_STATUSCHANGED, (WPARAM)contact->subcontacts->hContact, 0); //forward status changing to host meta contact
}
}
}
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp index 165a0ab00b..2bd079760f 100644 --- a/plugins/Clist_modern/src/modern_clcidents.cpp +++ b/plugins/Clist_modern/src/modern_clcidents.cpp @@ -104,12 +104,12 @@ int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex) return -1;
}
-int cliFindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible)
+int cliFindItem(HWND hwnd, ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible)
{
- return FindItem(hwnd,dat, hItem,contact,subgroup,isVisible,FALSE);
+ return FindItem(hwnd, dat, (HCONTACT)hItem, contact, subgroup, isVisible, FALSE);
}
-int FindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible, BOOL isIgnoreSubcontacts)
+int FindItem(HWND hwnd, ClcData *dat, HCONTACT hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts)
{
int index = 0, i;
int nowVisible = 1;
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index bb65dcd753..b01e397d01 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -46,7 +46,7 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup) cont->SubAllocated = subcount;
int i=0;
for (int j = 0; j < subcount; j++) {
- HANDLE hsub = (HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)cont->hContact,j);
+ HCONTACT hsub = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)cont->hContact, j);
cacheEntry = pcli->pfnGetCacheEntry(hsub);
WORD wStatus = pdnce___GetStatus(cacheEntry);
if (showOfflineHereGroup || (!( db_get_b(NULL,"CLC","MetaHideOfflineSub",SETTING_METAHIDEOFFLINESUB_DEFAULT) && db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT))
@@ -145,7 +145,7 @@ int cli_AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText) return i;
}
-static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat, HANDLE hContact)
+static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat, HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = NULL;
WORD apparentMode;
@@ -211,7 +211,7 @@ static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat, static ClcContact *AddContactToGroup(ClcData *dat,ClcGroup *group, ClcCacheEntry *cacheEntry)
{
- HANDLE hContact;
+ HCONTACT hContact;
int i;
if (cacheEntry == NULL) return NULL;
if (group == NULL) return NULL;
@@ -259,7 +259,7 @@ void * AddTempGroup(HWND hwnd,ClcData *dat,const TCHAR *szName,DWORD flags,int g return NULL;
}
-void cli_AddContactToTree(HWND hwnd,ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline)
+void cli_AddContactToTree(HWND hwnd,ClcData *dat,HCONTACT hContact,int updateTotalCount,int checkHideOffline)
{
ClcCacheEntry *cacheEntry = pcli->pfnGetCacheEntry(hContact);
if (dat->IsMetaContactsEnabled && cacheEntry && cacheEntry->m_cache_nHiddenSubcontact)
@@ -277,7 +277,7 @@ void cli_AddContactToTree(HWND hwnd,ClcData *dat,HANDLE hContact,int updateTotal return;
}
-void cli_DeleteItemFromTree(HWND hwnd,HANDLE hItem)
+void cli_DeleteItemFromTree(HWND hwnd, HCONTACT hItem)
{
ClcData *dat = (ClcData *) GetWindowLongPtr(hwnd, 0);
ClearRowByIndexCache();
@@ -300,17 +300,16 @@ __inline BOOL CLCItems_IsShowOfflineGroup(ClcGroup* group) return (groupFlags&GROUPF_SHOWOFFLINE) != 0;
}
-HANDLE SaveSelection( ClcData *dat )
+HCONTACT SaveSelection(ClcData *dat)
{
ClcContact *selcontact = NULL;
-
- if ( pcli->pfnGetRowByIndex( dat, dat->selection, &selcontact, NULL ) == -1 )
+ if (pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) == -1)
return NULL;
- else
- return pcli->pfnContactToHItem( selcontact );
+
+ return (HCONTACT)pcli->pfnContactToHItem(selcontact);
}
-int RestoreSelection( ClcData *dat, HANDLE hSelected )
+int RestoreSelection(ClcData *dat, HCONTACT hSelected)
{
ClcContact *selcontact = NULL;
ClcGroup *selgroup = NULL;
@@ -336,7 +335,7 @@ int RestoreSelection( ClcData *dat, HANDLE hSelected ) }
-void cliRebuildEntireList(HWND hwnd,ClcData *dat)
+void cliRebuildEntireList(HWND hwnd, ClcData *dat)
{
DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
ClcContact *cont;
@@ -358,7 +357,7 @@ void cliRebuildEntireList(HWND hwnd,ClcData *dat) dat->list.cl.increment = 50;
dat->needsResort = 1;
- HANDLE hSelected = SaveSelection( dat );
+ HCONTACT hSelected = SaveSelection(dat);
dat->selection = -1;
dat->HiLightMode = db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT);
{
@@ -371,7 +370,7 @@ void cliRebuildEntireList(HWND hwnd,ClcData *dat) }
}
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cacheEntry = NULL;
cont = NULL;
cacheEntry = pcli->pfnGetCacheEntry(hContact);
@@ -430,14 +429,14 @@ void cliRebuildEntireList(HWND hwnd,ClcData *dat) }
}
- pcli->pfnSortCLC(hwnd,dat,0);
+ pcli->pfnSortCLC(hwnd, dat, 0);
- RestoreSelection( dat, hSelected );
+ RestoreSelection(dat, hSelected);
}
-void cli_SortCLC( HWND hwnd, ClcData *dat, int useInsertionSort )
+void cli_SortCLC(HWND hwnd, ClcData *dat, int useInsertionSort)
{
- HANDLE hSelected = SaveSelection( dat );
+ HCONTACT hSelected = SaveSelection(dat);
corecli.pfnSortCLC(hwnd,dat,useInsertionSort);
@@ -475,7 +474,7 @@ int GetNewSelection(ClcGroup *group, int selection, int direction) }
struct SavedContactState_t {
- HANDLE hContact;
+ HCONTACT hContact;
WORD iExtraImage[EXTRA_ICON_COUNT];
int checked;
};
@@ -584,7 +583,7 @@ void cli_SaveStateAndRebuildList(HWND hwnd, ClcData *dat) if (savedInfo[i].parentId == -1)
group = &dat->list;
else {
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) (savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)(savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL))
continue;
group = contact->group;
}
@@ -624,7 +623,7 @@ ClcContact* cliCreateClcContact() return contact;
}
-ClcCacheEntry* cliCreateCacheItem( HANDLE hContact )
+ClcCacheEntry* cliCreateCacheItem(HCONTACT hContact )
{
ClcCacheEntry *p = (ClcCacheEntry *)mir_calloc(sizeof( ClcCacheEntry ));
if (p == NULL)
@@ -639,10 +638,10 @@ ClcCacheEntry* cliCreateCacheItem( HANDLE hContact ) return p;
}
-void cliInvalidateDisplayNameCacheEntry(HANDLE hContact)
+void cliInvalidateDisplayNameCacheEntry(HCONTACT hContact)
{
if (hContact == INVALID_HANDLE_VALUE)
- corecli.pfnInvalidateDisplayNameCacheEntry(INVALID_HANDLE_VALUE);
+ corecli.pfnInvalidateDisplayNameCacheEntry((HCONTACT)INVALID_HANDLE_VALUE);
else {
ClcCacheEntry *p = pcli->pfnGetCacheEntry(hContact);
if (p)
@@ -690,7 +689,7 @@ int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly) * also cares about sub contacts (if meta is active)
*/
-int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, ClcData *dat)
+int __fastcall CLVM_GetContactHiddenStatus(HCONTACT hContact, char *szProto, ClcData *dat)
{
int dbHidden = db_get_b(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
int filterResult = 1;
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp index 26e2e403ba..047b671172 100644 --- a/plugins/Clist_modern/src/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp @@ -35,7 +35,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara switch(msg) {
case CLM_DELETEITEM:
- pcli->pfnDeleteItemFromTree(hwnd, (HANDLE) wParam);
+ pcli->pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam);
clcSetDelayTimer( TIMERID_DELAYEDRESORTCLC, hwnd, 1 ); //pcli->pfnSortCLC(hwnd, dat, 1);
clcSetDelayTimer( TIMERID_RECALCSCROLLBAR, hwnd, 2 ); //pcli->pfnRecalcScrollBar(hwnd, dat);
return 0;
@@ -108,24 +108,24 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara {
int i;
if (wParam != CLGN_ROOT) {
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) lParam, &contact, &group, NULL))
- return (LRESULT) (HANDLE) NULL;
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)lParam, &contact, &group, NULL))
+ return NULL;
i = List_IndexOf((SortedList*)&group->cl,contact);
if (i < 0) return 0;
}
switch (wParam) {
case CLGN_ROOT:
if (dat->list.cl.count)
- return (LRESULT) pcli->pfnContactToHItem(dat->list.cl.items[0]);
+ return (LRESULT)pcli->pfnContactToHItem(dat->list.cl.items[0]);
else
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
case CLGN_CHILD:
if (contact->type != CLCIT_GROUP)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
group = contact->group;
if (group->cl.count == 0)
- return (LRESULT) (HANDLE) NULL;
- return (LRESULT) pcli->pfnContactToHItem(group->cl.items[0]);
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[0]);
case CLGN_PARENT:
return group->groupId | HCONTACT_ISGROUP;
case CLGN_NEXT:
@@ -133,49 +133,49 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara if (++i >= group->cl.count)
return NULL;
}
- while (group->cl.items[i]->type == CLCIT_DIVIDER);
- return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
+ while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUS:
do {
if (--i < 0)
return NULL;
}
- while (group->cl.items[i]->type == CLCIT_DIVIDER);
- return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
+ while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_NEXTCONTACT:
for (i++; i < group->cl.count; i++)
if (group->cl.items[i]->type == CLCIT_CONTACT)
break;
if (i >= group->cl.count)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUSCONTACT:
if (i >= group->cl.count)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
for (i--; i >= 0; i--)
if (group->cl.items[i]->type == CLCIT_CONTACT)
break;
if (i < 0)
- return (LRESULT) (HANDLE) NULL;
- return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_NEXTGROUP:
for (i++; i < group->cl.count; i++)
if (group->cl.items[i]->type == CLCIT_GROUP)
break;
if (i >= group->cl.count)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUSGROUP:
if (i >= group->cl.count)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
for (i--; i >= 0; i--)
if (group->cl.items[i]->type == CLCIT_GROUP)
break;
if (i < 0)
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
}
- return (LRESULT) (HANDLE) NULL;
+ return NULL;
}
return 0;
case CLM_SELECTITEM:
@@ -183,7 +183,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara ClcGroup *tgroup;
int index = -1;
int mainindex = -1;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1);
@@ -217,7 +217,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara if (LOWORD(lParam) >= dat->extraColumnsCount)
return 0;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
return 0;
contact->iExtraImage[LOWORD(lParam)] = HIWORD(lParam);
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 327d6e4d3f..bf19a6c5c2 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -75,7 +75,7 @@ static int iconsOn; struct NotifyMenuItemExData {
- HANDLE hContact;
+ HCONTACT hContact;
int iIcon; // icon index in the image list
HICON hIcon; // corresponding icon handle
HANDLE hDbEvent;
@@ -176,7 +176,7 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle) }
-int cli_RemoveEvent(HANDLE hContact, HANDLE hDbEvent)
+int cli_RemoveEvent(HCONTACT hContact, HANDLE hDbEvent)
{
int i;
int res = 0;
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index b4c41cd20c..78d7b35238 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -94,7 +94,7 @@ static IconItem iconList[] = static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
{
- BYTE bContactRate = db_get_b((HANDLE)wParam, "CList", "Rate",0);
+ BYTE bContactRate = db_get_b((HCONTACT)wParam, "CList", "Rate", 0);
if ( bContactRate > SIZEOF(rates)-1)
bContactRate = SIZEOF(rates)-1;
@@ -149,7 +149,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) mi.hIcon = NULL;
mi.ptszName = LPGENT("Show even if offline");
- mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR | ( db_get_b((HANDLE)wParam,"CList","noOffline",0)?CMIF_CHECKED:0);
+ mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR | (db_get_b((HCONTACT)wParam, "CList", "noOffline", 0) ? CMIF_CHECKED : 0);
mi.pszService = CLUI_FAVTOGGLESHOWOFFLINE;
mi.popupPosition = i+100000000;
mi.position = -100000000;
@@ -165,7 +165,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate)
{
if (hContact)
- db_set_b((HANDLE)hContact, "CList", "Rate",(BYTE)nRate);
+ db_set_b((HCONTACT)hContact, "CList", "Rate", (BYTE)nRate);
return 0;
}
@@ -173,7 +173,7 @@ INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate) INT_PTR FAV_ToggleShowOffline(WPARAM hContact,LPARAM lParam)
{
if (hContact)
- db_set_b((HANDLE)hContact,"CList","noOffline", !db_get_b((HANDLE)hContact, "CList", "noOffline", 0));
+ db_set_b((HCONTACT)hContact, "CList", "noOffline", !db_get_b((HCONTACT)hContact, "CList", "noOffline", 0));
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index 610e801097..c8b4523352 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -42,7 +42,7 @@ int GetContactDisplayName(WPARAM wParam,LPARAM lParam); int CListOptInit(WPARAM wParam,LPARAM lParam);
int SkinOptInit(WPARAM wParam,LPARAM lParam);
int ModernSkinOptInit(WPARAM wParam,LPARAM lParam);
-int EventsProcessContactDoubleClick(HANDLE hContact);
+int EventsProcessContactDoubleClick(HCONTACT hContact);
INT_PTR TrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam);
@@ -52,7 +52,7 @@ void UninitTrayMenu(); HIMAGELIST hCListImages = NULL;
//returns normal icon or combined with status overlay. Needs to be destroyed.
-HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
+HICON cliGetIconFromStatusMode(HCONTACT hContact, const char *szProto,int status)
{
// check if options is turned on
BYTE trayOption = db_get_b(NULL,"CLUI","XStatusTray",SETTING_TRAYOPTION_DEFAULT);
@@ -81,7 +81,7 @@ HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status) return ske_ImageList_GetIcon(g_himlCListClc,pcli->pfnIconFromStatusMode(szProto,status,hContact),ILD_NORMAL);
}
-int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact)
+int cli_IconFromStatusMode(const char *szProto,int nStatus, HCONTACT hContact)
{
if (hContact && szProto) {
char *szActProto = (char*)szProto;
@@ -89,7 +89,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) HANDLE hActContact = hContact;
if (!db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) && g_szMetaModuleName && !mir_strcmp(szActProto,g_szMetaModuleName)) {
// substitute params by mostonline contact datas
- HANDLE hMostOnlineContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hActContact,0);
+ HCONTACT hMostOnlineContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hActContact, 0);
if (hMostOnlineContact) {
ClcCacheEntry *cacheEntry = pcli->pfnGetCacheEntry(hMostOnlineContact);
if (cacheEntry && cacheEntry->m_cache_cszProto) {
@@ -118,7 +118,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) return corecli.pfnIconFromStatusMode(szProto,nStatus,NULL);
}
-int cli_GetContactIcon(HANDLE hContact)
+int cli_GetContactIcon(HCONTACT hContact)
{
int res = corecli.pfnGetContactIcon(hContact);
if (res != -1)
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index a45d83705a..83c4edb7bd 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "hdr/modern_commonprototypes.h"
#include "hdr/modern_awaymsg.h"
-void InsertContactIntoTree(HANDLE hContact,int status);
+void InsertContactIntoTree(HCONTACT hContact,int status);
static ClcCacheEntry *displayNameCache;
void CListSettings_FreeCacheItemDataOption( ClcCacheEntry *pDst, DWORD flag );
@@ -36,11 +36,11 @@ static int displayNameCacheSize; BOOL CLM_AUTOREBUILD_WAS_POSTED = FALSE;
SortedList *clistCache = NULL;
-char *GetProtoForContact(HANDLE hContact);
-int GetStatusForContact(HANDLE hContact,char *szProto);
+char *GetProtoForContact(HCONTACT hContact);
+int GetStatusForContact(HCONTACT hContact,char *szProto);
TCHAR *UnknownConctactTranslatedName = NULL;
-void InvalidateDNCEbyPointer(HANDLE hContact,ClcCacheEntry *pdnce,int SettingType);
+void InvalidateDNCEbyPointer(HCONTACT hContact,ClcCacheEntry *pdnce,int SettingType);
static int handleCompare( void* c1, void* c2 )
{
@@ -86,7 +86,7 @@ void FreeDisplayNameCache() }
}
-ClcCacheEntry* cliGetCacheEntry(HANDLE hContact)
+ClcCacheEntry* cliGetCacheEntry(HCONTACT hContact)
{
if (!clistCache) return NULL;
@@ -205,7 +205,7 @@ int CListSettings_SetToCache(ClcCacheEntry *pSrc, DWORD flag) void cliFreeCacheItem( ClcCacheEntry *p )
{
- HANDLE hContact = p->hContact;
+ HCONTACT hContact = p->hContact;
TRACEVAR("cliFreeCacheItem hContact = %d",hContact);
p->freeName();
mir_free_and_nil(p->tszGroup);
@@ -299,7 +299,7 @@ void IvalidateDisplayNameCache(DWORD mode) }
}
-void InvalidateDNCEbyPointer(HANDLE hContact, ClcCacheEntry *pdnce, int SettingType)
+void InvalidateDNCEbyPointer(HCONTACT hContact, ClcCacheEntry *pdnce, int SettingType)
{
if (hContact == NULL || pdnce == NULL)
return;
@@ -344,7 +344,7 @@ void InvalidateDNCEbyPointer(HANDLE hContact, ClcCacheEntry *pdnce, int SettingT pdnce->IsExpanded = -1;
}
-char *GetContactCachedProtocol(HANDLE hContact)
+char *GetContactCachedProtocol(HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = NULL;
cacheEntry = pcli->pfnGetCacheEntry(hContact);
@@ -354,14 +354,14 @@ char *GetContactCachedProtocol(HANDLE hContact) return NULL;
}
-char* GetProtoForContact(HANDLE hContact)
+char* GetProtoForContact(HCONTACT hContact)
{
return (char*)CallService(MS_PROTO_GETCONTACTBASEACCOUNT,(WPARAM)hContact,0);
}
-int GetStatusForContact(HANDLE hContact,char *szProto)
+int GetStatusForContact(HCONTACT hContact,char *szProto)
{
- return (szProto) ? (int)(db_get_w((HANDLE)hContact,szProto,"Status",ID_STATUS_OFFLINE)) : ID_STATUS_OFFLINE;
+ return (szProto) ? (int)(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)) : ID_STATUS_OFFLINE;
}
void ClcCacheEntry::freeName()
@@ -393,7 +393,7 @@ LBL_Unknown: isUnknown = false;
}
-int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status)
+int GetContactInfosForSort(HCONTACT hContact,char **Proto,TCHAR **Name,int *Status)
{
ClcCacheEntry *cacheEntry = NULL;
cacheEntry = pcli->pfnGetCacheEntry(hContact);
@@ -407,7 +407,7 @@ int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status };
-int GetContactCachedStatus(HANDLE hContact)
+int GetContactCachedStatus(HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = NULL;
cacheEntry = pcli->pfnGetCacheEntry(hContact);
@@ -417,7 +417,7 @@ int GetContactCachedStatus(HANDLE hContact) int ContactAdded(WPARAM wParam,LPARAM lParam)
{
if (!MirandaExiting()) {
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
cli_ChangeContactIcon(hContact,pcli->pfnIconFromStatusMode((char*)GetContactCachedProtocol(hContact),ID_STATUS_OFFLINE,hContact),1); ///by FYR
pcli->pfnSortContacts();
}
@@ -426,7 +426,7 @@ int ContactAdded(WPARAM wParam,LPARAM lParam) int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (MirandaExiting() || !pcli || !clistCache || hContact == NULL)
return 0;
@@ -494,7 +494,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) else if (!strcmp(cws->szSetting,"Hidden")) {
InvalidateDNCEbyPointer(hContact,pdnce,cws->value.type);
if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) {
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
cli_ChangeContactIcon(hContact,pcli->pfnIconFromStatusMode(szProto,
szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE), hContact),1); //by FYR
}
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 586db4e522..2ed245edd2 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -188,7 +188,7 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) if ( lstrcmp( _T(CLISTCONTROL_CLASS), cls))
hwndClist = pcli->hwndContactList;
- HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
+ HCONTACT hItem = (HCONTACT)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
Menu_ShowItem(hRenameMenuItem, hItem != 0);
if (!hItem || !IsHContactContact(hItem) || !db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT)) {
@@ -240,7 +240,7 @@ INT_PTR CLUI::Service_ShowStatusMenu(WPARAM wParam,LPARAM lParam) INT_PTR CLUI::Service_Menu_ShowContactAvatar(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
db_set_b(hContact, "CList", "HideContactAvatar", 0);
@@ -250,7 +250,7 @@ INT_PTR CLUI::Service_Menu_ShowContactAvatar(WPARAM wParam,LPARAM lParam) INT_PTR CLUI::Service_Menu_HideContactAvatar(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
db_set_b(hContact, "CList", "HideContactAvatar", 1);
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index b1e297d58b..a4390b70d6 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -42,15 +42,15 @@ struct {ID_STATUS_ONTHEPHONE,150},
{ID_STATUS_OUTTOLUNCH,425}};
-static int GetContactStatus(HANDLE hContact)
+static int GetContactStatus(HCONTACT hContact)
{
return (GetContactCachedStatus(hContact));
}
-void cli_ChangeContactIcon(HANDLE hContact,int iIcon,int add)
+void cli_ChangeContactIcon(HCONTACT hContact, int iIcon, int add)
{
- corecli.pfnChangeContactIcon((HANDLE) hContact,(int)iIcon,(int)add);
+ corecli.pfnChangeContactIcon(hContact, iIcon, add);
}
static int GetStatusModeOrdering(int statusMode)
@@ -62,7 +62,7 @@ static int GetStatusModeOrdering(int statusMode) }
-DWORD CompareContacts2_getLMTime(HANDLE hContact)
+DWORD CompareContacts2_getLMTime(HCONTACT hContact)
{
HANDLE hDbEvent = db_event_last(hContact);
while(hDbEvent) {
@@ -95,16 +95,14 @@ int GetProtoIndex(char * szName) int CompareContacts2(const ClcContact *contact1,const ClcContact *contact2, int by)
{
- HANDLE a;
- HANDLE b;
TCHAR *namea, *nameb;
int statusa,statusb;
char *szProto1,*szProto2;
if ((INT_PTR)contact1 < 100 || (INT_PTR)contact2 < 100) return 0;
- a = contact1->hContact;
- b = contact2->hContact;
+ HCONTACT a = contact1->hContact;
+ HCONTACT b = contact2->hContact;
namea = (TCHAR *)contact1->szText;
statusa = GetContactCachedStatus(contact1->hContact);
@@ -118,39 +116,35 @@ int CompareContacts2(const ClcContact *contact1,const ClcContact *contact2, int int ordera,orderb;
ordera = GetStatusModeOrdering(statusa);
orderb = GetStatusModeOrdering(statusb);
- if (ordera != orderb) return ordera-orderb;
- else return 0;
+ return (ordera != orderb) ? ordera - orderb : 0;
}
-
- if (g_CluiData.fSortNoOfflineBottom == 0 && (statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE)) { //one is offline: offline goes below online
+ //one is offline: offline goes below online
+ if (g_CluiData.fSortNoOfflineBottom == 0 && (statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE))
return 2*(statusa == ID_STATUS_OFFLINE)-1;
- }
- if (by == SORTBY_NAME)
- { //name
+ if (by == SORTBY_NAME) //name
return mir_tstrcmpi(namea,nameb);
- }
- if (by == SORTBY_NAME_LOCALE)
- { //name
+
+ if (by == SORTBY_NAME_LOCALE) {
+ //name
static int LocaleId = -1;
if (LocaleId == -1) LocaleId = CallService(MS_LANGPACK_GETLOCALE, 0, 0);
return (CompareString(LocaleId,NORM_IGNORECASE,SAFETSTRING(namea),-1,SAFETSTRING(nameb),-1))-2;
}
- else if (by == SORTBY_LASTMSG)
- { //last message
+ if (by == SORTBY_LASTMSG) {
+ //last message
DWORD ta = CompareContacts2_getLMTime(a);
DWORD tb = CompareContacts2_getLMTime(b);
return tb-ta;
}
- else if (by == SORTBY_PROTO)
- {
+ if (by == SORTBY_PROTO) {
int rc = GetProtoIndex(szProto1)-GetProtoIndex(szProto2);
-
- if (rc != 0 && (szProto1 != NULL && szProto2 != NULL)) return rc;
+ if (rc != 0 && (szProto1 != NULL && szProto2 != NULL))
+ return rc;
}
- else if (by == SORTBY_RATE)
- return contact2->bContactRate-contact1->bContactRate;
+ else if (by == SORTBY_RATE)
+ return contact2->bContactRate - contact1->bContactRate;
// else :o)
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_gettextasync.cpp b/plugins/Clist_modern/src/modern_gettextasync.cpp index 45dad063b6..6194bcb3c2 100644 --- a/plugins/Clist_modern/src/modern_gettextasync.cpp +++ b/plugins/Clist_modern/src/modern_gettextasync.cpp @@ -42,7 +42,7 @@ int CLUI_SyncGetShortData(WPARAM wParam, LPARAM lParam); #define gtaunlock LeaveCriticalSection( >aCS )
typedef struct _GetTextAsyncItem {
- HANDLE hContact;
+ HCONTACT hContact;
ClcData *dat;
struct _GetTextAsyncItem *Next;
} GTACHAINITEM;
@@ -134,7 +134,7 @@ BOOL gtaWakeThread() return FALSE;
}
-int gtaAddRequest(ClcData *dat,ClcContact *contact,HANDLE hContact)
+int gtaAddRequest(ClcData *dat,ClcContact *contact,HCONTACT hContact)
{
if (MirandaExiting()) return 0;
gtalock;
@@ -159,7 +159,7 @@ int gtaAddRequest(ClcData *dat,ClcContact *contact,HANDLE hContact) return FALSE;
}
-void gtaRenewText(HANDLE hContact)
+void gtaRenewText(HCONTACT hContact)
{
gtaAddRequest(NULL,NULL, hContact);
}
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp index 66abdc832c..db2a5a4ae0 100644 --- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp @@ -165,7 +165,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i case TC_TEXT2:
{
int tmp = 0;
- HANDLE hContact = pdnce->hContact;
+ HCONTACT hContact = pdnce->hContact;
if (dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0] )
{
tmp = dat->fontModernInfo[FONTID_SECONDLINE].fontHeight;
@@ -192,7 +192,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i case TC_TEXT3:
{
- HANDLE hContact = pdnce->hContact;
+ HCONTACT hContact = pdnce->hContact;
int tmp = 0;
if (dat->third_line_show && pdnce->szThirdLineText && pdnce->szThirdLineText[0]) {
tmp = dat->fontModernInfo[FONTID_THIRDLINE].fontHeight;
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 9a73e5188a..74159b8b68 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -4081,7 +4081,7 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) #define SKINSETSECTION "SkinnedSettings"
-BOOL SkinDBGetContactSetting(HANDLE hContact, const char* szSection, const char*szKey, DBVARIANT * retdbv, BOOL * bSkinned )
+BOOL SkinDBGetContactSetting(HCONTACT hContact, const char* szSection, const char*szKey, DBVARIANT * retdbv, BOOL * bSkinned )
{
if (!hContact) { //only for not contact settings
char *szSkinKey;
@@ -4096,7 +4096,7 @@ BOOL SkinDBGetContactSetting(HANDLE hContact, const char* szSection, const char* return db_get(hContact, szSection, szKey, retdbv);
}
-BYTE SkinDBGetContactSettingByte(HANDLE hContact, const char* szSection, const char*szKey, BYTE bDefault)
+BYTE SkinDBGetContactSettingByte(HCONTACT hContact, const char* szSection, const char*szKey, BYTE bDefault)
{
DBVARIANT dbv = { 0 };
BOOL bSkinned = FALSE;
@@ -4115,7 +4115,7 @@ BYTE SkinDBGetContactSettingByte(HANDLE hContact, const char* szSection, const c return bDefault;
}
-WORD SkinDBGetContactSettingWord(HANDLE hContact, const char* szSection, const char*szKey, WORD wDefault)
+WORD SkinDBGetContactSettingWord(HCONTACT hContact, const char* szSection, const char*szKey, WORD wDefault)
{
BOOL bSkinned = FALSE;
DBVARIANT dbv = { 0 };
@@ -4132,7 +4132,7 @@ WORD SkinDBGetContactSettingWord(HANDLE hContact, const char* szSection, const c return wDefault;
}
-DWORD SkinDBGetContactSettingDword(HANDLE hContact, const char* szSection, const char*szKey, DWORD dwDefault)
+DWORD SkinDBGetContactSettingDword(HCONTACT hContact, const char* szSection, const char*szKey, DWORD dwDefault)
{
DBVARIANT dbv = { 0 };
BOOL bSkinned = FALSE;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 7cc1989376..db1f1e8b62 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -164,7 +164,7 @@ static void ShowPage(HWND hwnd, int page) }
}
-static int UpdateClistItem(HANDLE hContact, DWORD mask)
+static int UpdateClistItem(HCONTACT hContact, DWORD mask)
{
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hContact, MAKELONG(i - ID_STATUS_OFFLINE,
@@ -188,8 +188,8 @@ static void UpdateStickies() DWORD localMask;
int i;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ HCONTACT hItem = (HCONTACT)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, (BYTE)db_get_dw(hContact, CLVM_MODULE, g_szModename, 0) ? 1 : 0);
localMask = HIWORD(db_get_dw(hContact, CLVM_MODULE, g_szModename, 0));
@@ -450,7 +450,7 @@ void SaveState() ptrA szModeName(mir_utf8encodeT(szTempModeName));
DWORD dwGlobalMask = GetMaskForItem(hInfoItem);
- 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(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem == NULL)
continue;
@@ -656,7 +656,7 @@ void DeleteViewMode( char * szName ) SetWindowText(hwndSelector, TranslateT("All contacts"));
}
- 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, CLVM_MODULE, szName, -1) != -1)
db_set_dw(hContact, CLVM_MODULE, szName, 0);
}
@@ -844,7 +844,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
case IDC_CLEARALL:
{
- 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_SETCHECKMARK, (WPARAM)hItem, 0);
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp index e11b858931..b138a66c92 100644 --- a/plugins/Clist_mw/src/clc.cpp +++ b/plugins/Clist_mw/src/clc.cpp @@ -48,7 +48,7 @@ static int stopStatusUpdater = 0; void StatusUpdaterThread(void*)
{
int i,curdelay,lastcheck = 0;
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_LOWEST);
@@ -62,7 +62,7 @@ void StatusUpdaterThread(void*) if ( db_get_b(hContact,"CList","StatusMsgAuto",0)) {
for (i = 0; i<5; i++) {
if (hContact != NULL) {
- ClcCacheEntry *pdnce = (ClcCacheEntry *)pcli->pfnGetCacheEntry((HANDLE)hContact);
+ ClcCacheEntry *pdnce = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (pdnce && !pdnce->protoNotExists && pdnce->szProto)
CallContactService(hContact, PSS_GETAWAYMSG, 0, 0);
@@ -143,9 +143,9 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case INTM_ICONCHANGED:
{
int recalcScrollBar = 0,shouldShow;
- HANDLE hSelItem = NULL;
+ HCONTACT hSelItem = NULL;
struct ClcContact *selcontact = NULL;
- ClcCacheEntry *cacheEntry = GetContactFullCacheEntry((HANDLE)wParam);
+ ClcCacheEntry *cacheEntry = GetContactFullCacheEntry((HCONTACT)wParam);
WORD status;
int needsResort = 0;
@@ -158,21 +158,21 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L // this means an offline msg is flashing, so the contact should be shown
shouldShow = (GetWindowLongPtr(hwnd,GWL_STYLE) & CLS_SHOWHIDDEN || !cacheEntry->bIsHidden) &&
- (!pcli->pfnIsHiddenMode(dat,status) || cacheEntry->noHiddenOffline || pcli->pfnGetContactIcon((HANDLE)wParam) != LOWORD(lParam));
+ (!pcli->pfnIsHiddenMode(dat, status) || cacheEntry->noHiddenOffline || pcli->pfnGetContactIcon((HCONTACT)wParam) != LOWORD(lParam));
ClcContact *contact;
ClcGroup *group;
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) {
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL) != -1)
- hSelItem = pcli->pfnContactToHItem(selcontact);
- AddContactToTree(hwnd,dat,(HANDLE)wParam,0,0);
+ hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
+ AddContactToTree(hwnd, dat, (HCONTACT)wParam, 0, 0);
needsResort = 1;
recalcScrollBar = 1;
- FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL);
+ FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL);
if (contact) {
contact->iImage = (WORD)lParam;
- pcli->pfnNotifyNewContact(hwnd,(HANDLE)wParam);
+ pcli->pfnNotifyNewContact(hwnd, (HCONTACT)wParam);
dat->needsResort = 1;
}
}
@@ -185,7 +185,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if ( !shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
if (dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL) != -1)
- hSelItem = pcli->pfnContactToHItem(selcontact);
+ hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
RemoveItemFromGroup(hwnd,group,contact,0);
recalcScrollBar = 1;
dat->needsResort = 1;
@@ -220,13 +220,13 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L ClcContact *contact;
ClcGroup *group;
- if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,&group,NULL) && contact != NULL) {
+ if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL) && contact != NULL) {
contact->flags &= ~CONTACTF_STATUSMSG;
- if ( !db_get_ts((HANDLE)wParam, "CList", "StatusMsg", &dbv)) {
+ if (!db_get_ts((HCONTACT)wParam, "CList", "StatusMsg", &dbv)) {
int j;
- if (dbv.ptszVal == NULL||_tcslen(dbv.ptszVal) == 0) break;
+ if (dbv.ptszVal == NULL || _tcslen(dbv.ptszVal) == 0) break;
lstrcpyn(contact->szStatusMsg, dbv.ptszVal, SIZEOF(contact->szStatusMsg));
- for (j = (int)_tcslen(contact->szStatusMsg)-1;j>=0;j--) {
+ for (j = (int)_tcslen(contact->szStatusMsg) - 1; j >= 0; j--) {
if (contact->szStatusMsg[j] == '\r' || contact->szStatusMsg[j] == '\n' || contact->szStatusMsg[j] == '\t') {
contact->szStatusMsg[j] = ' ';
}
diff --git a/plugins/Clist_mw/src/clc.h b/plugins/Clist_mw/src/clc.h index 09b2981ccc..a64b3e055b 100644 --- a/plugins/Clist_mw/src/clc.h +++ b/plugins/Clist_mw/src/clc.h @@ -81,7 +81,7 @@ struct ClcData : public ClcDataBase //clcidents.c
int GetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex);
-int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **contact,ClcGroup **subgroup,int *isVisible);
+int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible);
int GetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,ClcGroup **subgroup);
void ClearRowByIndexCache();
@@ -92,8 +92,8 @@ int AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText); void FreeContact(struct ClcContact *p);
void RebuildEntireList(HWND hwnd,struct ClcData *dat);
ClcGroup *RemoveItemFromGroup(HWND hwnd,ClcGroup *group,struct ClcContact *contact,int updateTotalCount);
-void DeleteItemFromTree(HWND hwnd,HANDLE hItem);
-void AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int updateTotalCount,int checkHideOffline);
+void DeleteItemFromTree(HWND hwnd, HCONTACT hItem);
+void AddContactToTree(HWND hwnd, struct ClcData *dat, HCONTACT hContact, int updateTotalCount, int checkHideOffline);
void SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort);
int GetGroupContentsCount(ClcGroup *group,int visibleOnly);
int GetNewSelection(ClcGroup *group,int selection, int direction);
@@ -124,8 +124,8 @@ void UnregisterFileDropping(HWND hwnd); //cluiservices.c
void FreeProtocolData( void );
-int GetContactCachedStatus(HANDLE hContact);
-char *GetContactCachedProtocol(HANDLE hContact);
+int GetContactCachedStatus(HCONTACT hContact);
+char *GetContactCachedProtocol(HCONTACT hContact);
#define CLUI_SetDrawerService "CLUI/SETDRAWERSERVICE"
typedef struct {
diff --git a/plugins/Clist_mw/src/clcidents.cpp b/plugins/Clist_mw/src/clcidents.cpp index a5953b1046..803b7b9f6b 100644 --- a/plugins/Clist_mw/src/clcidents.cpp +++ b/plugins/Clist_mw/src/clcidents.cpp @@ -80,7 +80,7 @@ int GetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex) return -1;
}
-ClcCacheEntry *GetCLCFullCacheEntry(struct ClcData *dat,HANDLE hContact)
+ClcCacheEntry *GetCLCFullCacheEntry(struct ClcData *dat,HCONTACT hContact)
{
if (hContact == 0)
return NULL;
@@ -107,7 +107,7 @@ ClcCacheEntry *GetCLCFullCacheEntry(struct ClcData *dat,HANDLE hContact) return (pdnce);
}
-void ClearClcContactCache(struct ClcData *dat,HANDLE hContact)
+void ClearClcContactCache(struct ClcData *dat,HCONTACT hContact)
{
ClcCacheEntry *cacheEntry;
@@ -133,7 +133,7 @@ void ClearClcContactCache(struct ClcData *dat,HANDLE hContact) }
}
-void SetClcContactCacheItem(struct ClcData *dat,HANDLE hContact,void *contact)
+void SetClcContactCacheItem(struct ClcData *dat, HCONTACT hContact, void *contact)
{
ClcCacheEntry *cacheEntry;
if ( !IsHContactGroup(hContact) && !IsHContactInfo(hContact)) {
@@ -143,7 +143,7 @@ void SetClcContactCacheItem(struct ClcData *dat,HANDLE hContact,void *contact) }
}
-int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **contact,ClcGroup **subgroup,int *isVisible)
+int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible)
{
int index = 0, i;
int nowVisible = 1;
@@ -153,8 +153,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont if (isVisible == NULL && hItem != NULL && subgroup == NULL && !IsHContactGroup(hItem) && !IsHContactInfo(hItem)) {
//try use cache
- ClcCacheEntry *cacheEntry;
- cacheEntry = GetCLCFullCacheEntry(dat,hItem);
+ ClcCacheEntry *cacheEntry = GetCLCFullCacheEntry(dat, (HCONTACT)hItem);
if (cacheEntry != NULL) {
if (cacheEntry->ClcContact == NULL) {
int *isv = {0};
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp index 16e09c18c0..57b4a43fad 100644 --- a/plugins/Clist_mw/src/clcitems.cpp +++ b/plugins/Clist_mw/src/clcitems.cpp @@ -36,12 +36,11 @@ extern void (*saveFreeGroup)(ClcGroup *p); //routines for managing adding/removal of items in the list, including sorting
-extern void ClearClcContactCache(struct ClcData *dat,HANDLE hContact);
+extern void ClearClcContactCache(struct ClcData *dat,HCONTACT hContact);
void AddSubcontacts(struct ClcContact * cont)
{
int subcount,i,j;
- HANDLE hsub;
ClcCacheEntry *cacheEntry;
cacheEntry = GetContactFullCacheEntry(cont->hContact);
OutputDebugStringA("Proceed AddSubcontacts\r\n");
@@ -52,7 +51,7 @@ void AddSubcontacts(struct ClcContact * cont) cont->SubAllocated = subcount;
i = 0;
for (j = 0; j<subcount; j++) {
- hsub = (HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)cont->hContact,j);
+ HCONTACT hsub = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)cont->hContact, j);
cacheEntry = GetContactFullCacheEntry(hsub);
if ( !(db_get_b(NULL,"CLC","MetaHideOfflineSub",1) && db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) ||
cacheEntry->status != ID_STATUS_OFFLINE )
@@ -115,7 +114,7 @@ static struct ClcContact* AddContactToGroup(struct ClcData *dat,ClcGroup *group, char *szProto;
WORD apparentMode;
DWORD idleMode;
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
int i;
int img = -1;
@@ -183,7 +182,7 @@ static struct ClcContact* AddContactToGroup(struct ClcData *dat,ClcGroup *group, return group->cl.items[i];
}
-void AddContactToTree(HWND hwnd, ClcData *dat, HANDLE hContact, int updateTotalCount, int checkHideOffline)
+void AddContactToTree(HWND hwnd, ClcData *dat, HCONTACT hContact, int updateTotalCount, int checkHideOffline)
{
if ( FindItem(hwnd,dat,hContact,NULL,NULL,NULL) == 1)
return;
@@ -275,7 +274,7 @@ ClcGroup *RemoveItemFromGroup(HWND hwnd,ClcGroup *group,struct ClcContact *conta return group;
}
-void DeleteItemFromTree(HWND hwnd,HANDLE hItem)
+void DeleteItemFromTree(HWND hwnd, HCONTACT hItem)
{
struct ClcContact *contact;
ClcGroup *group;
@@ -327,7 +326,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat) int tick = GetTickCount();
ClearRowByIndexCache();
- ClearClcContactCache(dat,INVALID_HANDLE_VALUE);
+ ClearClcContactCache(dat, (HCONTACT)INVALID_HANDLE_VALUE);
dat->list.expanded = 1;
dat->list.hideOffline = db_get_b(NULL,"CLC","HideOfflineRoot",0);
@@ -349,7 +348,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat) }
}
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cacheEntry;
cont = NULL;
cacheEntry = GetContactFullCacheEntry(hContact);
@@ -417,7 +416,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat) mir_snprintf(buf, SIZEOF(buf), "RebuildEntireList %d \r\n", tick);
OutputDebugStringA(buf);
- db_set_dw((HANDLE)0,"CLUI","PF:Last RebuildEntireList Time:",tick);
+ db_set_dw(0,"CLUI","PF:Last RebuildEntireList Time:",tick);
}
}
@@ -506,7 +505,7 @@ void SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort) if (tick > 5) {
mir_snprintf(buf, SIZEOF(buf), "SortCLC %d \r\n", tick);
OutputDebugStringA(buf);
- db_set_dw((HANDLE)0,"CLUI","PF:Last SortCLC Time:",tick);
+ db_set_dw(0,"CLUI","PF:Last SortCLC Time:",tick);
}
}
#endif
@@ -514,7 +513,7 @@ void SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort) struct SavedContactState_t
{
- HANDLE hContact;
+ HCONTACT hContact;
WORD iExtraImage[EXTRA_ICON_COUNT];
int checked;
};
@@ -654,7 +653,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat) for (i = 0;i<savedInfoCount;i++) {
if (savedInfo[i].parentId == -1) group = &dat->list;
else {
- if ( !FindItem(hwnd,dat,(HANDLE)(savedInfo[i].parentId|HCONTACT_ISGROUP),&contact,NULL,NULL)) continue;
+ if (!FindItem(hwnd, dat, (HCONTACT)(savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) continue;
group = contact->group;
}
j = AddInfoItemToGroup(group,savedInfo[i].contact.flags,_T(""));
diff --git a/plugins/Clist_mw/src/clist.h b/plugins/Clist_mw/src/clist.h index e234bbdd10..7b7b2e1589 100644 --- a/plugins/Clist_mw/src/clist.h +++ b/plugins/Clist_mw/src/clist.h @@ -26,12 +26,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define _CLIST_H_
void LoadContactTree(void);
-int ExtIconFromStatusMode(HANDLE hContact, const char *szProto,int status);
-HTREEITEM GetTreeItemByHContact(HANDLE hContact);
+int ExtIconFromStatusMode(HCONTACT hContact, const char *szProto,int status);
+HTREEITEM GetTreeItemByHContact(HCONTACT hContact);
void TrayIconUpdateWithImageList(int iImage,const char *szNewTip,char *szPreferredProto);
void SortContacts(void);
-void ChangeContactIcon(HANDLE hContact,int iIcon,int add);
-int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status);
+void ChangeContactIcon(HCONTACT hContact,int iIcon,int add);
+int GetContactInfosForSort(HCONTACT hContact,char **Proto,TCHAR **Name,int *Status);
struct ClcCacheEntry : public ClcCacheEntryBase
{
@@ -50,6 +50,6 @@ struct ClcCacheEntry : public ClcCacheEntryBase boolean isUnknown;
};
-ClcCacheEntry* GetContactFullCacheEntry(HANDLE hContact);
+ClcCacheEntry* GetContactFullCacheEntry(HCONTACT hContact);
#endif
\ No newline at end of file diff --git a/plugins/Clist_mw/src/clistmod.cpp b/plugins/Clist_mw/src/clistmod.cpp index 9beb827e1d..aff0c241fe 100644 --- a/plugins/Clist_mw/src/clistmod.cpp +++ b/plugins/Clist_mw/src/clistmod.cpp @@ -42,19 +42,18 @@ extern BYTE nameOrder[]; static HANDLE hSettingChanged, hProtoAckHook;
/////////// End by FYR ////////
-int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact)
+int cli_IconFromStatusMode(const char *szProto,int nStatus, HCONTACT hContact)
{
int result = -1;
if (hContact && szProto) {
char * szActProto = (char*)szProto;
int nActStatus = nStatus;
- HANDLE hActContact = hContact;
+ HCONTACT hActContact = hContact;
if ( !db_get_b(NULL,"CLC","Meta",0) && !strcmp(szActProto,"MetaContacts")) {
// substitute params by mostonline contact datas
- HANDLE hMostOnlineContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hActContact,0);
+ HCONTACT hMostOnlineContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hActContact, 0);
if (hMostOnlineContact && hMostOnlineContact != (HANDLE)CALLSERVICE_NOTFOUND) {
- ClcCacheEntry *cacheEntry;
- cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hMostOnlineContact);
+ ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hMostOnlineContact);
if (cacheEntry && cacheEntry->szProto) {
szActProto = cacheEntry->szProto;
nActStatus = cacheEntry->status;
@@ -76,14 +75,14 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) ////////// By FYR/////////////
-int ExtIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
+int ExtIconFromStatusMode(HCONTACT hContact, const char *szProto,int status)
{
/* if ( db_get_b( NULL, "CLC", "Meta", 0 ) == 1 )
return pcli->pfnIconFromStatusMode(szProto,status,hContact);
if ( szProto != NULL ) {
if (strcmp(szProto,"MetaContacts") == 0 ) {
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(UINT)hContact,0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT,(UINT)hContact,0);
if ( hContact != 0 ) {
szProto = GetContactProto((UINT)hContact,0);
status = db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE);
@@ -129,7 +128,7 @@ static int ContactListShutdownProc(WPARAM wParam,LPARAM lParam) int LoadContactListModule(void)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
db_set_s(hContact, "CList", "StatusMsg", "");
hCListImages = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
diff --git a/plugins/Clist_mw/src/clistopts.cpp b/plugins/Clist_mw/src/clistopts.cpp index bccc015bc2..c85b67c4f2 100644 --- a/plugins/Clist_mw/src/clistopts.cpp +++ b/plugins/Clist_mw/src/clistopts.cpp @@ -51,7 +51,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
case WM_USER+1:
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBCONTACTWRITESETTING * ws = (DBCONTACTWRITESETTING *)lParam;
if ( hContact == NULL && ws != NULL && ws->szModule != NULL && ws->szSetting != NULL
&& lstrcmpiA(ws->szModule,"CList") == 0 && lstrcmpiA(ws->szSetting,"UseGroups") == 0
diff --git a/plugins/Clist_mw/src/clistsettings.cpp b/plugins/Clist_mw/src/clistsettings.cpp index ed3573d6d7..29a14487cf 100644 --- a/plugins/Clist_mw/src/clistsettings.cpp +++ b/plugins/Clist_mw/src/clistsettings.cpp @@ -25,12 +25,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h"
#include "clist.h"
-TCHAR *GetNameForContact(HANDLE hContact,int flag,boolean *isUnknown);
-char *GetProtoForContact(HANDLE hContact);
-int GetStatusForContact(HANDLE hContact,char *szProto);
+TCHAR *GetNameForContact(HCONTACT hContact,int flag,boolean *isUnknown);
+char *GetProtoForContact(HCONTACT hContact);
+int GetStatusForContact(HCONTACT hContact,char *szProto);
TCHAR *UnknownConctactTranslatedName;
extern boolean OnModulesLoadedCalled;
-void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,ClcCacheEntry *pdnce,int SettingType);
+void InvalidateDisplayNameCacheEntryByPDNE(HCONTACT hContact,ClcCacheEntry *pdnce,int SettingType);
static int handleCompare( ClcCacheEntry* c1, ClcCacheEntry* c2 )
{
@@ -46,7 +46,7 @@ void InitDisplayNameCache(SortedList *list) list->increment = CallService(MS_DB_CONTACT_GETCOUNT,0,0)+1;
i = 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)) {
ClcCacheEntry *pdnce = (ClcCacheEntry *)mir_calloc(sizeof(ClcCacheEntry));
pdnce->hContact = hContact;
InvalidateDisplayNameCacheEntryByPDNE(hContact,pdnce,0);
@@ -143,7 +143,7 @@ void CheckPDNCE(ClcCacheEntry *_pdnce) pdnce->IsExpanded = db_get_b(pdnce->hContact,"CList","Expanded",0);
}
-void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,ClcCacheEntry *pdnce,int SettingType)
+void InvalidateDisplayNameCacheEntryByPDNE(HCONTACT hContact,ClcCacheEntry *pdnce,int SettingType)
{
if ( hContact == NULL || pdnce == NULL )
return;
@@ -192,7 +192,7 @@ void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,ClcCacheEntry *pdnce, pdnce->IsExpanded = -1;
}
-char *GetContactCachedProtocol(HANDLE hContact)
+char *GetContactCachedProtocol(HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry&&cacheEntry->szProto)
@@ -201,21 +201,21 @@ char *GetContactCachedProtocol(HANDLE hContact) return NULL;
}
-char *GetProtoForContact(HANDLE hContact)
+char *GetProtoForContact(HCONTACT hContact)
{
return mir_strdup(GetContactProto(hContact));
}
-int GetStatusForContact(HANDLE hContact,char *szProto)
+int GetStatusForContact(HCONTACT hContact,char *szProto)
{
int status = ID_STATUS_OFFLINE;
if (szProto)
- status = db_get_w((HANDLE)hContact,szProto,"Status",ID_STATUS_OFFLINE);
+ status = db_get_w((HCONTACT)hContact, szProto, "Status", ID_STATUS_OFFLINE);
return (status);
}
-TCHAR* GetNameForContact(HANDLE hContact,int flag,boolean *isUnknown)
+TCHAR* GetNameForContact(HCONTACT hContact,int flag,boolean *isUnknown)
{
TCHAR* result = pcli->pfnGetContactDisplayName(hContact, flag | GCDNF_NOCACHE);
@@ -229,7 +229,7 @@ TCHAR* GetNameForContact(HANDLE hContact,int flag,boolean *isUnknown) return result;
}
-ClcCacheEntry *GetContactFullCacheEntry(HANDLE hContact)
+ClcCacheEntry *GetContactFullCacheEntry(HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry != NULL)
@@ -238,7 +238,7 @@ ClcCacheEntry *GetContactFullCacheEntry(HANDLE hContact) return NULL;
}
-int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status)
+int GetContactInfosForSort(HCONTACT hContact,char **Proto,TCHAR **Name,int *Status)
{
ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry != NULL)
@@ -250,7 +250,7 @@ int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status return 0;
}
-int GetContactCachedStatus(HANDLE hContact)
+int GetContactCachedStatus(HCONTACT hContact)
{
ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry&&cacheEntry->status != 0) return cacheEntry->status;
@@ -260,7 +260,7 @@ int GetContactCachedStatus(HANDLE hContact) int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
// Early exit
if (hContact == NULL)
@@ -281,7 +281,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) if (cws->value.type == DBVT_WORD && !strcmp(cws->szSetting, "Status")) {
if ( !(pdnce->bIsHidden == 1)) {
- if ( db_get_b((HANDLE)NULL,"CList","ShowStatusMsg",0)||db_get_b(hContact,"CList","StatusMsgAuto",0))
+ if ( db_get_b(NULL,"CList","ShowStatusMsg",0)||db_get_b(hContact,"CList","StatusMsgAuto",0))
db_set_s(hContact, "CList", "StatusMsg", "");
if ( db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) {
@@ -315,7 +315,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) if ( !strcmp(cws->szSetting,"Hidden")) {
InvalidateDisplayNameCacheEntryByPDNE(hContact,pdnce,cws->value.type);
if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) {
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
ChangeContactIcon(hContact,ExtIconFromStatusMode(hContact, szProto, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)), 1); //by FYR
}
}
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp index c87b62c6ae..1dffd90f71 100644 --- a/plugins/Clist_mw/src/clui.cpp +++ b/plugins/Clist_mw/src/clui.cpp @@ -93,7 +93,7 @@ static int CluiModulesLoaded(WPARAM wParam,LPARAM lParam) PostMessage(pcli->hwndContactList,M_CREATECLC,0,0);
OnModulesLoadedCalled = TRUE;
- pcli->pfnInvalidateDisplayNameCacheEntry(INVALID_HANDLE_VALUE);
+ pcli->pfnInvalidateDisplayNameCacheEntry((HCONTACT)INVALID_HANDLE_VALUE);
InitGroupMenus();
RegisterProtoIconsForAllProtoIconLib();
return 0;
diff --git a/plugins/Clist_mw/src/commonheaders.h b/plugins/Clist_mw/src/commonheaders.h index 2a52b421a5..70dffe6570 100644 --- a/plugins/Clist_mw/src/commonheaders.h +++ b/plugins/Clist_mw/src/commonheaders.h @@ -88,7 +88,7 @@ extern int __cdecl MyStrCmpiT(const TCHAR *a, const TCHAR *b); extern DWORD exceptFunction(LPEXCEPTION_POINTERS EP);
-extern int (*saveIconFromStatusMode)(const char *szProto, int nStatus, HANDLE hContact);
+extern int (*saveIconFromStatusMode)(const char *szProto, int nStatus, HCONTACT hContact);
//from bkg options
diff --git a/plugins/Clist_mw/src/contact.cpp b/plugins/Clist_mw/src/contact.cpp index 095998689e..a41cc99992 100644 --- a/plugins/Clist_mw/src/contact.cpp +++ b/plugins/Clist_mw/src/contact.cpp @@ -27,8 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "clist.h"
extern HANDLE hContactIconChangedEvent;
-extern int GetContactCachedStatus(HANDLE hContact);
-extern char *GetContactCachedProtocol(HANDLE hContact);
+extern int GetContactCachedStatus(HCONTACT hContact);
+extern char *GetContactCachedProtocol(HCONTACT hContact);
int sortByStatus;
static int sortByProto;
@@ -47,7 +47,7 @@ struct { {ID_STATUS_ONTHEPHONE,150},
{ID_STATUS_OUTTOLUNCH,425}};
-static int GetContactStatus(HANDLE hContact)
+static int GetContactStatus(HCONTACT hContact)
{
/*
@@ -60,7 +60,7 @@ static int GetContactStatus(HANDLE hContact) return (GetContactCachedStatus(hContact));
}
-void ChangeContactIcon(HANDLE hContact,int iIcon,int add)
+void ChangeContactIcon(HCONTACT hContact,int iIcon,int add)
{
//clui MS_CLUI_CONTACTADDED MS_CLUI_CONTACTSETICON this methods is null
//CallService(add?MS_CLUI_CONTACTADDED:MS_CLUI_CONTACTSETICON,(WPARAM)hContact,iIcon);
@@ -87,7 +87,7 @@ void LoadContactTree(void) int hideOffline = db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cacheEntry = GetContactFullCacheEntry(hContact);
if (cacheEntry == NULL) {
MessageBoxA(0,"Fail To Get CacheEntry for hContact","!!!!!",0);
@@ -114,7 +114,7 @@ void LoadContactTree(void) int CompareContacts( const struct ClcContact *contact1, const struct ClcContact *contact2 )
{
- HANDLE a = contact1->hContact, b = contact2->hContact;
+ HCONTACT a = contact1->hContact, b = contact2->hContact;
TCHAR *namea,*nameb;
int statusa,statusb;
char *szProto1,*szProto2;
@@ -167,12 +167,14 @@ void SortContacts(void) INT_PTR ContactChangeGroup(WPARAM wParam,LPARAM lParam)
{
+ HCONTACT hContact = (HCONTACT)wParam;
+
CallService(MS_CLUI_CONTACTDELETED,wParam,0);
if ((HANDLE)lParam == NULL)
- db_unset((HANDLE)wParam,"CList","Group");
+ db_unset(hContact, "CList", "Group");
else
- db_set_s((HANDLE)wParam,"CList","Group",(char*)CallService(MS_CLIST_GROUPGETNAME2,lParam,(LPARAM)(int*)NULL));
+ db_set_s(hContact, "CList", "Group", (char*)CallService(MS_CLIST_GROUPGETNAME2, lParam, (LPARAM)(int*)NULL));
- CallService(MS_CLUI_CONTACTADDED,wParam,ExtIconFromStatusMode((HANDLE)wParam, GetContactProto((HANDLE)wParam), GetContactStatus((HANDLE)wParam)));
+ CallService(MS_CLUI_CONTACTADDED, wParam, ExtIconFromStatusMode(hContact, GetContactProto(hContact), GetContactStatus(hContact)));
return 0;
}
diff --git a/plugins/Clist_mw/src/init.cpp b/plugins/Clist_mw/src/init.cpp index 52581b9f03..940927a4b3 100644 --- a/plugins/Clist_mw/src/init.cpp +++ b/plugins/Clist_mw/src/init.cpp @@ -67,8 +67,8 @@ void SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort); INT_PTR ( *saveTrayIconProcessMessage )(WPARAM wParam,LPARAM lParam);
INT_PTR TrayIconProcessMessage(WPARAM wParam,LPARAM lParam);
-int (*saveIconFromStatusMode)(const char *szProto,int nStatus, HANDLE hContact);
-int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact);
+int (*saveIconFromStatusMode)(const char *szProto,int nStatus, HCONTACT hContact);
+int cli_IconFromStatusMode(const char *szProto,int nStatus, HCONTACT hContact);
//from clcfonts
void RegisterCListFonts( void );
@@ -140,7 +140,7 @@ static struct ClcContact* fnCreateClcContact( void ) return (struct ClcContact*)mir_calloc( sizeof( struct ClcContact ));
}
-static ClcCacheEntry *fnCreateCacheItem( HANDLE hContact )
+static ClcCacheEntry *fnCreateCacheItem(HCONTACT hContact )
{
ClcCacheEntry *p = (ClcCacheEntry *)mir_calloc( sizeof( ClcCacheEntry ));
if ( p )
diff --git a/plugins/Clist_nicer/src/Include/clc.h b/plugins/Clist_nicer/src/Include/clc.h index 08a89895c9..afb5a7ece5 100644 --- a/plugins/Clist_nicer/src/Include/clc.h +++ b/plugins/Clist_nicer/src/Include/clc.h @@ -103,32 +103,32 @@ typedef struct _OrderTreeData struct TExtraCache
{
- HANDLE hContact;
- HANDLE hTimeZone;
- BYTE valid;
- TCHAR *statusMsg;
- BYTE bStatusMsgValid;
- DWORD dwCFlags;
- DWORD dwDFlags; // display flags for caching only
+ HCONTACT hContact;
+ HANDLE hTimeZone;
+ BYTE valid;
+ TCHAR *statusMsg;
+ BYTE bStatusMsgValid;
+ DWORD dwCFlags;
+ DWORD dwDFlags; // display flags for caching only
StatusItems_t *status_item, *proto_status_item;
- DWORD dwLastMsgTime;
- DWORD msgFrequency;
- BOOL isChatRoom;
+ DWORD dwLastMsgTime;
+ DWORD msgFrequency;
+ BOOL isChatRoom;
};
struct ClcContact : public ClcContactBase
{
- BOOL bIsMeta;
- BYTE xStatus;
- int xStatusIcon;
- HANDLE hSubContact;
- char *metaProto;
- DWORD codePage;
- WORD wStatus;
- int avatarLeft, extraIconRightBegin;
- int isRtl;
- DWORD cFlags;
- BYTE bSecondLine;
+ BOOL bIsMeta;
+ BYTE xStatus;
+ int xStatusIcon;
+ HCONTACT hSubContact;
+ char *metaProto;
+ DWORD codePage;
+ WORD wStatus;
+ int avatarLeft, extraIconRightBegin;
+ int isRtl;
+ DWORD cFlags;
+ BYTE bSecondLine;
avatarCacheEntry *ace;
TExtraCache* pExtra;
@@ -233,7 +233,7 @@ struct TCluiData { HMENU hMenuNotify;
int iLastEventAdded;
int wNextMenuID;
- HANDLE hUpdateContact;
+ HCONTACT hUpdateContact;
DWORD sortTimer;
TCHAR *szNoEvents;
BOOL forceResize;
@@ -329,7 +329,7 @@ struct IconDesc { };
struct NotifyMenuItemExData {
- HANDLE hContact;
+ HCONTACT hContact;
int iIcon; // icon index in the image list
HICON hIcon; // corresponding icon handle
HANDLE hDbEvent;
@@ -357,7 +357,7 @@ HANDLE ContactToItemHandle(ClcContact *contact, DWORD *nmFlags); //clcitems.c
void RebuildEntireList(HWND hwnd, struct ClcData *dat);
-DWORD INTSORT_GetLastMsgTime(HANDLE hContact);
+DWORD INTSORT_GetLastMsgTime(HCONTACT hContact);
//clcmsgs.c
LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -409,10 +409,10 @@ void ConfigureEventArea(HWND hwnd); void ClearIcons(int mode);
void SkinDrawBg(HWND hwnd, HDC hdc);
int GetBasicFontID(ClcContact * contact);
-extern int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szStatus, struct ClcData *dat);
+extern int __fastcall CLVM_GetContactHiddenStatus(HCONTACT hContact, char *szStatus, struct ClcData *dat);
void CreateViewModeFrame();
-int GetExtraCache(HANDLE hContact, char *szProto);
-void ReloadExtraInfo(HANDLE hContact);
+int GetExtraCache(HCONTACT hContact, char *szProto);
+void ReloadExtraInfo(HCONTACT hContact);
void LoadAvatarForContact(ClcContact *p);
void ApplyViewMode(const char *name);
@@ -425,7 +425,7 @@ void __inline PaintItem(HDC hdcMem, ClcGroup *group, ClcContact *contact, int in void Reload3dBevelColors();
void ReloadThemedOptions();
void SetButtonToSkinned();
-void RTL_DetectAndSet(ClcContact *contact, HANDLE hContact);
+void RTL_DetectAndSet(ClcContact *contact, HCONTACT hContact);
void RTL_DetectGroupName(ClcContact *group);
void CLN_LoadAllIcons(BOOL mode);
void ReloadSkinItemsToCache();
diff --git a/plugins/Clist_nicer/src/Include/clist.h b/plugins/Clist_nicer/src/Include/clist.h index b60b0db108..51c769d031 100644 --- a/plugins/Clist_nicer/src/Include/clist.h +++ b/plugins/Clist_nicer/src/Include/clist.h @@ -23,8 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
void LoadContactTree(void);
-int IconFromStatusMode(const char *szProto, int status, HANDLE hContact, HICON *phIcon);
-HTREEITEM GetTreeItemByHContact(HANDLE hContact);
+int IconFromStatusMode(const char *szProto, int status, HCONTACT hContact, HICON *phIcon);
+HTREEITEM GetTreeItemByHContact(HCONTACT hContact);
void SortContacts(void);
#define CLUIINTM_REDRAW (WM_USER+100)
diff --git a/plugins/Clist_nicer/src/Include/config.h b/plugins/Clist_nicer/src/Include/config.h index 2052232339..e40a92d36c 100644 --- a/plugins/Clist_nicer/src/Include/config.h +++ b/plugins/Clist_nicer/src/Include/config.h @@ -52,34 +52,34 @@ class cfg public:
static void init();
- static DWORD getDword(const HANDLE hContact, const char *szModule, const char *szSetting, DWORD uDefault);
+ static DWORD getDword(const HCONTACT hContact, const char *szModule, const char *szSetting, DWORD uDefault);
static DWORD getDword(const char *szModule, const char *szSetting, DWORD uDefault);
static DWORD getDword(const char *szSetting, DWORD uDefault);
- static WORD getWord(const HANDLE hContact, const char *szModule, const char *szSetting, WORD uDefault);
+ static WORD getWord(const HCONTACT hContact, const char *szModule, const char *szSetting, WORD uDefault);
static WORD getWord(const char *szModule, const char *szSetting, WORD uDefault);
static WORD getWord(const char *szSetting, WORD uDefault);
- static int getByte(const HANDLE hContact, const char *szModule, const char *szSetting, int uDefault);
+ static int getByte(const HCONTACT hContact, const char *szModule, const char *szSetting, int uDefault);
static int getByte(const char *szModule, const char *szSetting, int uDefault);
static int getByte(const char *szSetting, int uDefault);
- static INT_PTR getTString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
- static INT_PTR getString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
+ static INT_PTR getTString(const HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
+ static INT_PTR getString(const HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
- static INT_PTR writeDword(const HANDLE hContact, const char *szModule, const char *szSetting, DWORD value);
+ static INT_PTR writeDword(const HCONTACT hContact, const char *szModule, const char *szSetting, DWORD value);
static INT_PTR writeDword(const char *szModule, const char *szSetting, DWORD value);
- static INT_PTR writeWord(const HANDLE hContact, const char *szModule, const char *szSetting, WORD value);
+ static INT_PTR writeWord(const HCONTACT hContact, const char *szModule, const char *szSetting, WORD value);
static INT_PTR writeWord(const char *szModule, const char *szSetting, WORD value);
- static INT_PTR writeByte(const HANDLE hContact, const char *szModule, const char *szSetting, BYTE value);
+ static INT_PTR writeByte(const HCONTACT hContact, const char *szModule, const char *szSetting, BYTE value);
static INT_PTR writeByte(const char *szModule, const char *szSetting, BYTE value);
- static INT_PTR writeTString(const HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *st);
- static INT_PTR writeString(const HANDLE hContact, const char *szModule, const char *szSetting, const char *st);
+ static INT_PTR writeTString(const HCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR *st);
+ static INT_PTR writeString(const HCONTACT hContact, const char *szModule, const char *szSetting, const char *st);
- static TExtraCache* getCache(const HANDLE hContact, const char *szProto);
+ static TExtraCache* getCache(const HCONTACT hContact, const char *szProto);
public:
static TCluiData dat;
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index e8187cd572..00d7be37d2 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -46,7 +46,7 @@ static HRESULT(WINAPI *MyCloseThemeData)(HANDLE); LONG g_cxsmIcon, g_cysmIcon;
-void SetDBButtonStates(HANDLE hContact);
+void SetDBButtonStates(HCONTACT hContact);
HMENU BuildGroupPopupMenu(ClcGroup* group)
{
@@ -78,14 +78,14 @@ static int ClcEventAdded(WPARAM wParam, LPARAM lParam) DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get((HANDLE)lParam, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
- DWORD firstTime = cfg::getDword((HANDLE)wParam, "CList", "mf_firstEvent", 0);
- DWORD count = cfg::getDword((HANDLE)wParam, "CList", "mf_count", 0);
+ DWORD firstTime = cfg::getDword((HCONTACT)wParam, "CList", "mf_firstEvent", 0);
+ DWORD count = cfg::getDword((HCONTACT)wParam, "CList", "mf_count", 0);
count++;
new_freq = count ? (dbei.timestamp - firstTime) / count : 0x7fffffff;
- cfg::writeDword((HANDLE)wParam, "CList", "mf_freq", new_freq);
- cfg::writeDword((HANDLE)wParam, "CList", "mf_count", count);
+ cfg::writeDword((HCONTACT)wParam, "CList", "mf_freq", new_freq);
+ cfg::writeDword((HCONTACT)wParam, "CList", "mf_count", count);
- TExtraCache *p = cfg::getCache((HANDLE)wParam, NULL);
+ TExtraCache *p = cfg::getCache((HCONTACT)wParam, NULL);
if (p) {
p->dwLastMsgTime = dbei.timestamp;
if (new_freq)
@@ -111,9 +111,9 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) if ( !__strcmp(cws->szSetting, "ANSIcodepage"))
pcli->pfnClcBroadcast(INTM_CODEPAGECHANGED, wParam, lParam);
else if ( !__strcmp(cws->szSetting, "Timezone") || !__strcmp(cws->szSetting, "TzName"))
- ReloadExtraInfo((HANDLE)wParam);
+ ReloadExtraInfo((HCONTACT)wParam);
}
- else if (wParam != 0 && (szProto = GetContactProto((HANDLE)wParam)) != NULL) {
+ else if (wParam != 0 && (szProto = GetContactProto((HCONTACT)wParam)) != NULL) {
char *id = NULL;
if ( !__strcmp(cws->szModule, "Protocol") && !__strcmp(cws->szSetting, "p")) {
char *szProto_s;
@@ -122,24 +122,24 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) szProto_s = NULL;
else
szProto_s = cws->value.pszVal;
- pcli->pfnChangeContactIcon((HANDLE)wParam, IconFromStatusMode(szProto_s, szProto_s == NULL ? ID_STATUS_OFFLINE : cfg::getWord((HANDLE)wParam, szProto_s, "Status", ID_STATUS_OFFLINE), (HANDLE)wParam, NULL), 0);
+ pcli->pfnChangeContactIcon((HCONTACT)wParam, IconFromStatusMode(szProto_s, szProto_s == NULL ? ID_STATUS_OFFLINE : cfg::getWord((HCONTACT)wParam, szProto_s, "Status", ID_STATUS_OFFLINE), (HCONTACT)wParam, NULL), 0);
}
// something is being written to a protocol module
if ( !__strcmp(szProto, cws->szModule)) {
// was a unique setting key written?
- pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
+ pcli->pfnInvalidateDisplayNameCacheEntry((HCONTACT)wParam);
if ( !__strcmp(cws->szSetting, "Status")) {
- if ( !cfg::getByte((HANDLE)wParam, "CList", "Hidden", 0)) {
+ if (!cfg::getByte((HCONTACT)wParam, "CList", "Hidden", 0)) {
if (cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) {
// User's state is changing, and we are hideOffline-ing
if (cws->value.wVal == ID_STATUS_OFFLINE) {
- pcli->pfnChangeContactIcon((HANDLE)wParam, IconFromStatusMode(cws->szModule, cws->value.wVal, (HANDLE)wParam, NULL), 0);
+ pcli->pfnChangeContactIcon((HCONTACT)wParam, IconFromStatusMode(cws->szModule, cws->value.wVal, (HCONTACT)wParam, NULL), 0);
CallService(MS_CLUI_CONTACTDELETED, wParam, 0);
return 0;
}
- pcli->pfnChangeContactIcon((HANDLE)wParam, IconFromStatusMode(cws->szModule, cws->value.wVal, (HANDLE)wParam, NULL), 1);
+ pcli->pfnChangeContactIcon((HCONTACT)wParam, IconFromStatusMode(cws->szModule, cws->value.wVal, (HCONTACT)wParam, NULL), 1);
}
- pcli->pfnChangeContactIcon((HANDLE)wParam, IconFromStatusMode(cws->szModule, cws->value.wVal, (HANDLE)wParam, NULL), 0);
+ pcli->pfnChangeContactIcon((HCONTACT)wParam, IconFromStatusMode(cws->szModule, cws->value.wVal, (HCONTACT)wParam, NULL), 0);
}
SendMessage(pcli->hwndContactTree, INTM_STATUSCHANGED, wParam, lParam);
return 0;
@@ -149,7 +149,7 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) else if (strstr(cws->szSetting, "XStatus"))
SendMessage(pcli->hwndContactTree, INTM_XSTATUSCHANGED, wParam, lParam);
else if ( !__strcmp(cws->szSetting, "Timezone") || !__strcmp(cws->szSetting, "TzName"))
- ReloadExtraInfo((HANDLE)wParam);
+ ReloadExtraInfo((HCONTACT)wParam);
if (cfg::dat.bMetaAvail && !(cfg::dat.dwFlags & CLUI_USEMETAICONS) && !__strcmp(szProto, cfg::dat.szMetaName)) {
if ((lstrlenA(cws->szSetting) > 6 && !strncmp(cws->szSetting, "Status", 6)) || strstr("Default,ForceSend,Nick", cws->szSetting))
@@ -239,7 +239,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case WM_CREATE:
dat = (struct ClcData *)mir_alloc(sizeof(struct ClcData));
memset(dat, 0, sizeof(struct ClcData));
- SetWindowLongPtr(hwnd, 0, (LONG_PTR) dat);
+ SetWindowLongPtr(hwnd, 0, (LONG_PTR)dat);
RowHeight::Init(dat);
dat->forceScroll = 0;
@@ -255,7 +255,8 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L cfg::clcdat = dat;
if (cfg::dat.bShowLocalTime)
SetTimer(hwnd, TIMERID_REFRESH, 65000, NULL);
- } else
+ }
+ else
dat->bisEmbedded = TRUE;
}
break;
@@ -278,116 +279,116 @@ LBL_Def: return FrameNCPaint(hwnd, DefWindowProc, wParam, lParam, frameHasTitlebar);
case INTM_GROUPCHANGED:
- {
- WORD iExtraImage[EXTRA_ICON_COUNT];
- BYTE flags = 0;
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
- memset(iExtraImage, 0xFF, sizeof(iExtraImage));
- else {
- memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
- flags = contact->flags;
+ {
+ WORD iExtraImage[EXTRA_ICON_COUNT];
+ BYTE flags = 0;
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ memset(iExtraImage, 0xFF, sizeof(iExtraImage));
+ else {
+ memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
+ flags = contact->flags;
+ }
+ pcli->pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam);
+ if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus((HCONTACT)wParam, NULL, dat)) {
+ pcli->pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1);
+ if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) {
+ memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
+ if (flags & CONTACTF_CHECKED)
+ contact->flags |= CONTACTF_CHECKED;
}
- pcli->pfnDeleteItemFromTree(hwnd, (HANDLE)wParam);
- if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus((HANDLE)wParam, NULL, dat)) {
- pcli->pfnAddContactToTree(hwnd, dat, (HANDLE)wParam, 1, 1);
- if (FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
- memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
- if (flags & CONTACTF_CHECKED)
- contact->flags |= CONTACTF_CHECKED;
- }
- NMCLISTCONTROL nm;
- nm.hdr.code = CLN_CONTACTMOVED;
- nm.hdr.hwndFrom = hwnd;
- nm.hdr.idFrom = GetDlgCtrlID(hwnd);
- nm.flags = 0;
- nm.hItem = (HANDLE)wParam;
- SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM) &nm);
- }
- dat->needsResort = TRUE;
- PostMessage(hwnd, INTM_SORTCLC, 0, 1);
+ NMCLISTCONTROL nm;
+ nm.hdr.code = CLN_CONTACTMOVED;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nm.flags = 0;
+ nm.hItem = (HANDLE)wParam;
+ SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&nm);
}
+ dat->needsResort = TRUE;
+ PostMessage(hwnd, INTM_SORTCLC, 0, 1);
+ }
goto LBL_Def;
case INTM_ICONCHANGED:
- {
- int recalcScrollBar = 0;
- HANDLE hContact = (HANDLE)wParam;
- WORD status = ID_STATUS_OFFLINE;
- int contactRemoved = 0;
- HANDLE hSelItem = NULL;
- ClcContact *selcontact = NULL;
-
- char *szProto = GetContactProto(hContact);
- if (szProto == NULL)
- status = ID_STATUS_OFFLINE;
- else
- status = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
-
- int shouldShow = (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN ||
- !CLVM_GetContactHiddenStatus(hContact, szProto, dat)) && ((cfg::dat.bFilterEffective ? TRUE : !pcli->pfnIsHiddenMode(dat, status)) ||
- pcli->pfnGetContactIcon(hContact) != lParam); // XXX CLVM changed - this means an offline msg is flashing, so the contact should be shown
-
- if (!FindItem(hwnd, dat, hContact, &contact, &group, NULL)) {
- if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
- if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = pcli->pfnContactToHItem(selcontact);
- pcli->pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
- recalcScrollBar = 1;
- FindItem(hwnd, dat, hContact, &contact, NULL, NULL);
- if (contact) {
- contact->iImage = (WORD)lParam;
- pcli->pfnNotifyNewContact(hwnd, hContact);
- }
- }
- }
- else {
- //item in list already
- DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- if (contact->iImage == (WORD)lParam)
- break;
- if ( !shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline || cfg::dat.bFilterEffective)) { // CLVM changed
- if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = pcli->pfnContactToHItem(selcontact);
- pcli->pfnRemoveItemFromGroup(hwnd, group, contact, 0);
- contactRemoved = TRUE;
- recalcScrollBar = 1;
- }
- else {
+ {
+ int recalcScrollBar = 0;
+ HCONTACT hContact = (HCONTACT)wParam;
+ WORD status = ID_STATUS_OFFLINE;
+ int contactRemoved = 0;
+ HCONTACT hSelItem = NULL;
+ ClcContact *selcontact = NULL;
+
+ char *szProto = GetContactProto(hContact);
+ if (szProto == NULL)
+ status = ID_STATUS_OFFLINE;
+ else
+ status = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+
+ int shouldShow = (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN ||
+ !CLVM_GetContactHiddenStatus(hContact, szProto, dat)) && ((cfg::dat.bFilterEffective ? TRUE : !pcli->pfnIsHiddenMode(dat, status)) ||
+ pcli->pfnGetContactIcon(hContact) != lParam); // XXX CLVM changed - this means an offline msg is flashing, so the contact should be shown
+
+ if (!FindItem(hwnd, dat, hContact, &contact, &group, NULL)) {
+ if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
+ if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
+ hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
+ pcli->pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
+ recalcScrollBar = 1;
+ FindItem(hwnd, dat, hContact, &contact, NULL, NULL);
+ if (contact) {
contact->iImage = (WORD)lParam;
- if ( !pcli->pfnIsHiddenMode(dat, status))
- contact->flags |= CONTACTF_ONLINE;
- else
- contact->flags &= ~CONTACTF_ONLINE;
+ pcli->pfnNotifyNewContact(hwnd, hContact);
}
}
- if (hSelItem) {
- ClcGroup *selgroup;
- if (pcli->pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
- dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*) & selgroup->cl, selcontact));
+ }
+ else {
+ //item in list already
+ DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
+ if (contact->iImage == (WORD)lParam)
+ break;
+ if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline || cfg::dat.bFilterEffective)) { // CLVM changed
+ if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
+ hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
+ pcli->pfnRemoveItemFromGroup(hwnd, group, contact, 0);
+ contactRemoved = TRUE;
+ recalcScrollBar = 1;
+ }
+ else {
+ contact->iImage = (WORD)lParam;
+ if (!pcli->pfnIsHiddenMode(dat, status))
+ contact->flags |= CONTACTF_ONLINE;
else
- dat->selection = -1;
+ contact->flags &= ~CONTACTF_ONLINE;
}
- dat->needsResort = TRUE;
- PostMessage(hwnd, INTM_SORTCLC, 0, recalcScrollBar);
- PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)(contactRemoved ? 0 : wParam));
- if (recalcScrollBar)
- pcli->pfnRecalcScrollBar(hwnd, dat);
}
+ if (hSelItem) {
+ ClcGroup *selgroup;
+ if (pcli->pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
+ dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)& selgroup->cl, selcontact));
+ else
+ dat->selection = -1;
+ }
+ dat->needsResort = TRUE;
+ PostMessage(hwnd, INTM_SORTCLC, 0, recalcScrollBar);
+ PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)(contactRemoved ? 0 : wParam));
+ if (recalcScrollBar)
+ pcli->pfnRecalcScrollBar(hwnd, dat);
+ }
goto LBL_Def;
case INTM_METACHANGED:
- if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
break;
if (contact->bIsMeta && cfg::dat.bMetaAvail && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
- contact->hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) contact->hContact, 0);
+ contact->hSubContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)contact->hContact, 0);
contact->metaProto = GetContactProto(contact->hSubContact);
contact->iImage = pcli->pfnGetContactIcon(contact->hSubContact);
if (contact->pExtra) {
TExtraCache *pSub = cfg::getCache(contact->hSubContact, contact->metaProto);
ClcContact *subContact;
- if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE)contact->hSubContact, &subContact, NULL, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)contact->hSubContact, &subContact, NULL, NULL))
break;
contact->pExtra->proto_status_item = GetProtocolStatusItem(contact->metaProto);
@@ -401,7 +402,7 @@ LBL_Def: goto LBL_Def;
case INTM_METACHANGEDEVENT:
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
break;
if (lParam == 0)
SendMessage(hwnd, CLM_AUTOREBUILD, 0, 0);
@@ -409,9 +410,9 @@ LBL_Def: case INTM_NAMECHANGED:
ClcContact *contact;
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
break;
- lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam, 0), SIZEOF(contact->szText));
+ lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HCONTACT)wParam, 0), SIZEOF(contact->szText));
RTL_DetectAndSet(contact, 0);
@@ -420,65 +421,65 @@ LBL_Def: goto LBL_Def;
case INTM_CODEPAGECHANGED:
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
break;
- contact->codePage = cfg::getDword((HANDLE)wParam, "Tab_SRMsg", "ANSIcodepage", cfg::getDword((HANDLE)wParam, "UserInfo", "ANSIcodepage", CP_ACP));
+ contact->codePage = cfg::getDword((HCONTACT)wParam, "Tab_SRMsg", "ANSIcodepage", cfg::getDword((HCONTACT)wParam, "UserInfo", "ANSIcodepage", CP_ACP));
PostMessage(hwnd, INTM_INVALIDATE, 0, 0);
goto LBL_Def;
case INTM_AVATARCHANGED:
- {
- avatarCacheEntry *cEntry = (struct avatarCacheEntry *)lParam;
- contact = NULL;
-
- if (wParam == 0) {
- //RemoveFromImgCache(0, cEntry);
- cfg::dat.bForceRefetchOnPaint = TRUE;
- RedrawWindow(hwnd, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW);
- cfg::dat.bForceRefetchOnPaint = FALSE;
- goto LBL_Def;
- }
+ {
+ avatarCacheEntry *cEntry = (struct avatarCacheEntry *)lParam;
+ contact = NULL;
+
+ if (wParam == 0) {
+ //RemoveFromImgCache(0, cEntry);
+ cfg::dat.bForceRefetchOnPaint = TRUE;
+ RedrawWindow(hwnd, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW);
+ cfg::dat.bForceRefetchOnPaint = FALSE;
+ goto LBL_Def;
+ }
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
- return 0;
- contact->ace = cEntry;
- if (cEntry == NULL)
- contact->cFlags &= ~ECF_AVATAR;
- else {
- DWORD dwFlags;
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ return 0;
+ contact->ace = cEntry;
+ if (cEntry == NULL)
+ contact->cFlags &= ~ECF_AVATAR;
+ else {
+ DWORD dwFlags;
- if (contact->pExtra)
- dwFlags = contact->pExtra->dwDFlags;
- else
- dwFlags = cfg::getDword(contact->hContact, "CList", "CLN_Flags", 0);
- if (cfg::dat.dwFlags & CLUI_FRAME_AVATARS)
- contact->cFlags = (dwFlags & ECF_HIDEAVATAR ? contact->cFlags & ~ECF_AVATAR : contact->cFlags | ECF_AVATAR);
- else
- contact->cFlags = (dwFlags & ECF_FORCEAVATAR ? contact->cFlags | ECF_AVATAR : contact->cFlags & ~ECF_AVATAR);
- }
- PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)contact->hContact);
+ if (contact->pExtra)
+ dwFlags = contact->pExtra->dwDFlags;
+ else
+ dwFlags = cfg::getDword(contact->hContact, "CList", "CLN_Flags", 0);
+ if (cfg::dat.dwFlags & CLUI_FRAME_AVATARS)
+ contact->cFlags = (dwFlags & ECF_HIDEAVATAR ? contact->cFlags & ~ECF_AVATAR : contact->cFlags | ECF_AVATAR);
+ else
+ contact->cFlags = (dwFlags & ECF_FORCEAVATAR ? contact->cFlags | ECF_AVATAR : contact->cFlags & ~ECF_AVATAR);
}
+ PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)contact->hContact);
+ }
goto LBL_Def;
case INTM_STATUSMSGCHANGED:
- {
- TExtraCache *p;
- char *szProto = NULL;
-
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
- p = cfg::getCache((HANDLE)wParam, NULL);
- else {
- p = contact->pExtra;
- szProto = contact->proto;
- }
- GetCachedStatusMsg(p, szProto);
- PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)(contact ? contact->hContact : 0));
+ {
+ TExtraCache *p;
+ char *szProto = NULL;
+
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ p = cfg::getCache((HCONTACT)wParam, NULL);
+ else {
+ p = contact->pExtra;
+ szProto = contact->proto;
}
+ GetCachedStatusMsg(p, szProto);
+ PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)(contact ? contact->hContact : 0));
+ }
goto LBL_Def;
case INTM_STATUSCHANGED:
- if ( FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
- WORD wStatus = cfg::getWord((HANDLE)wParam, contact->proto, "Status", ID_STATUS_OFFLINE);
+ if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) {
+ WORD wStatus = cfg::getWord((HCONTACT)wParam, contact->proto, "Status", ID_STATUS_OFFLINE);
if (cfg::dat.bNoOfflineAvatars && wStatus != ID_STATUS_OFFLINE && contact->wStatus == ID_STATUS_OFFLINE) {
contact->wStatus = wStatus;
if (cfg::dat.bAvatarServiceAvail && contact->ace == NULL)
@@ -490,12 +491,12 @@ LBL_Def: break;
case INTM_PROTOCHANGED:
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
break;
- contact->proto = GetContactProto((HANDLE)wParam);
+ contact->proto = GetContactProto((HCONTACT)wParam);
CallService(MS_CLIST_INVALIDATEDISPLAYNAME, wParam, 0);
- lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam, 0), SIZEOF(contact->szText));
+ lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HCONTACT)wParam, 0), SIZEOF(contact->szText));
RTL_DetectAndSet(contact, 0);
@@ -504,7 +505,7 @@ LBL_Def: goto LBL_Def;
case INTM_INVALIDATE:
- if ( !dat->bNeedPaint) {
+ if (!dat->bNeedPaint) {
KillTimer(hwnd, TIMERID_PAINT);
SetTimer(hwnd, TIMERID_PAINT, 100, NULL);
dat->bNeedPaint = TRUE;
@@ -512,13 +513,12 @@ LBL_Def: goto LBL_Def;
case INTM_INVALIDATECONTACT:
- {
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL))
- break;
-
- if (contact == 0 || group == 0)
- break;
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL))
+ break;
+ if (contact == 0 || group == 0)
+ break;
+ {
int iItem = pcli->pfnGetRowsPriorTo(&dat->list, group, List_IndexOf((SortedList*) & group->cl, contact));
pcli->pfnInvalidateItem(hwnd, dat, iItem);
}
@@ -538,14 +538,14 @@ LBL_Def: goto LBL_Def;
case INTM_IDLECHANGED:
- if ( FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
+ if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
char *szProto = (char*)cws->szModule;
if (szProto == NULL)
break;
contact->flags &= ~CONTACTF_IDLE;
- if (cfg::getDword((HANDLE)wParam, szProto, "IdleTS", 0)) {
+ if (cfg::getDword((HCONTACT)wParam, szProto, "IdleTS", 0)) {
contact->flags |= CONTACTF_IDLE;
}
PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)contact->hContact);
@@ -557,14 +557,14 @@ LBL_Def: {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
char *szProto = (char *)cws->szModule;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
TExtraCache *p;
if (!FindItem(hwnd, dat, hContact, &contact, NULL, NULL)) {
p = cfg::getCache(hContact, szProto);
if (!dat->bisEmbedded && cfg::dat.bMetaAvail && szProto) { // may be a subcontact, forward the xstatus
if (cfg::getByte(hContact, cfg::dat.szMetaName, "IsSubcontact", 0)) {
- HANDLE hMasterContact = (HANDLE)cfg::getDword(hContact, cfg::dat.szMetaName, "Handle", 0);
+ HCONTACT hMasterContact = (HCONTACT)cfg::getDword(hContact, cfg::dat.szMetaName, "Handle", 0);
if (hMasterContact && hMasterContact != hContact) // avoid recursive call of settings handler
cfg::writeByte(hMasterContact, cfg::dat.szMetaName, "XStatusId",
(BYTE)cfg::getByte(hContact, szProto, "XStatusId", 0));
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 7b26c3cefc..4f01d00972 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -24,12 +24,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <commonheaders.h>
-extern int ( *saveAddContactToGroup )(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
+extern int ( *saveAddContactToGroup )(struct ClcData *dat, ClcGroup *group, HCONTACT hContact);
extern int ( *saveAddInfoItemToGroup )(ClcGroup *group, int flags, const TCHAR *pszText);
extern ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd, ClcGroup *group, ClcContact *contact, int updateTotalCount);
extern ClcGroup* ( *saveAddGroup )(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
-static void TZ_LoadTimeZone(HANDLE hContact, struct TExtraCache *c, const char *szProto);
+static void TZ_LoadTimeZone(HCONTACT hContact, struct TExtraCache *c, const char *szProto);
//routines for managing adding/removal of items in the list, including sorting
@@ -92,7 +92,7 @@ void LoadAvatarForContact(ClcContact *p) p->cFlags &= ~ECF_AVATAR;
}
-int AddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact)
+int AddContactToGroup(struct ClcData *dat, ClcGroup *group, HCONTACT hContact)
{
int i = saveAddContactToGroup(dat, group, hContact);
ClcContact* p = group->cl.items[i];
@@ -105,7 +105,7 @@ int AddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact) else
p->bIsMeta = FALSE;
if (p->bIsMeta && cfg::dat.bMetaAvail && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
- p->hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) hContact, 0);
+ p->hSubContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
p->metaProto = GetContactProto(p->hSubContact);
p->iImage = pcli->pfnGetContactIcon(p->hSubContact);
}
@@ -163,7 +163,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat) }
}
- 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 (style & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus(hContact, NULL, dat)) {
ZeroMemory((void *)&dbv, sizeof(dbv));
if (cfg::getTString(hContact, "CList", "Group", &dbv))
@@ -228,7 +228,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) return 0;
p->bStatusMsgValid = STATUSMSG_NOTFOUND;
- HANDLE hContact = p->hContact;
+ HCONTACT hContact = p->hContact;
int result = cfg::getTString(hContact, "CList", "StatusMsg", &dbv);
if ( !result && lstrlen(dbv.ptszVal) > 1)
@@ -322,14 +322,14 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) * differences.
*/
-static void TZ_LoadTimeZone(HANDLE hContact, struct TExtraCache *c, const char *szProto)
+static void TZ_LoadTimeZone(HCONTACT hContact, struct TExtraCache *c, const char *szProto)
{
DWORD flags = 0;
if (cfg::dat.bShowLocalTimeSelective) flags |= TZF_DIFONLY;
c->hTimeZone = tmi.createByContact(hContact, flags);
}
-void ReloadExtraInfo(HANDLE hContact)
+void ReloadExtraInfo(HCONTACT hContact)
{
if (hContact && pcli->hwndContactTree) {
TExtraCache *p = cfg::getCache(hContact, NULL);
@@ -347,7 +347,7 @@ void ReloadExtraInfo(HANDLE hContact) */
-void RTL_DetectAndSet(ClcContact *contact, HANDLE hContact)
+void RTL_DetectAndSet(ClcContact *contact, HCONTACT hContact)
{
WORD infoTypeC2[12];
int i;
@@ -425,7 +425,7 @@ void GetExtendedInfo(ClcContact *contact, ClcData *dat) void LoadSkinItemToCache(TExtraCache *cEntry, const char *szProto)
{
- HANDLE hContact = cEntry->hContact;
+ HCONTACT hContact = cEntry->hContact;
if (cfg::getByte(hContact, "EXTBK", "VALID", 0)) {
if (cEntry->status_item == NULL)
@@ -462,7 +462,7 @@ void LoadSkinItemToCache(TExtraCache *cEntry, const char *szProto) * also cares about sub contacts (if meta is active)
*/
-int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struct ClcData *dat)
+int __fastcall CLVM_GetContactHiddenStatus(HCONTACT hContact, char *szProto, struct ClcData *dat)
{
int dbHidden = cfg::getByte(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
int filterResult = 1;
diff --git a/plugins/Clist_nicer/src/clcmsgs.cpp b/plugins/Clist_nicer/src/clcmsgs.cpp index da02231308..def28802ac 100644 --- a/plugins/Clist_nicer/src/clcmsgs.cpp +++ b/plugins/Clist_nicer/src/clcmsgs.cpp @@ -35,7 +35,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM {
ClcContact *contact;
ClcGroup *group;
- if (wParam == 0 || !FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL))
+ if (wParam == 0 || !FindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL))
return 0;
if (lParam)
@@ -48,7 +48,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM case CLM_GETSTATUSMSG:
if (wParam) {
ClcContact *contact = NULL;
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
return 0;
if (contact->type != CLCIT_CONTACT)
@@ -67,7 +67,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM case CLM_TOGGLEPRIORITYCONTACT:
if (wParam) {
ClcContact *contact = NULL;
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
return 0;
if (contact->type != CLCIT_CONTACT)
return 0;
@@ -80,7 +80,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM case CLM_QUERYPRIORITYCONTACT:
if (wParam) {
ClcContact *contact = NULL;
- if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
return 0;
if (contact->type != CLCIT_CONTACT)
return 0;
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index ef42eab6bd..dd9870e7e4 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -29,7 +29,7 @@ static HWND hwndEventFrame = 0; HFONT __fastcall ChangeToFont(HDC hdc, struct ClcData *dat, int id, int *fontHeight);
extern struct CListEvent* ( *saveAddEvent )(CLISTEVENT *cle);
-extern int ( *saveRemoveEvent )(HANDLE hContact, HANDLE hDbEvent);
+extern int ( *saveRemoveEvent )(HCONTACT hContact, HANDLE hDbEvent);
extern FRAMEWND *wndFrameEventArea;
extern HPEN g_hPenCLUIFrames;
@@ -333,7 +333,7 @@ struct CListEvent* AddEvent(CLISTEVENT *cle) // wParam=(WPARAM)(HANDLE)hContact
// lParam=(LPARAM)(HANDLE)hDbEvent
// Returns 0 if the event was successfully removed, or nonzero if the event was not found
-int RemoveEvent(HANDLE hContact, HANDLE hDbEvent)
+int RemoveEvent(HCONTACT hContact, HANDLE hDbEvent)
{
HANDLE hItem;
int i;
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index 2e3c9a8f39..a5d2ca8255 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -68,7 +68,7 @@ static HANDLE hWindowListIGN = 0; static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hWnd, GWLP_USERDATA);
switch(msg) {
case WM_INITDIALOG:
@@ -78,7 +78,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA int pCaps;
HWND hwndAdd;
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)hContact);
dwMask = cfg::getDword(hContact, "Ignore", "Mask1", 0);
SendMessage(hWnd, WM_USER + 100, (WPARAM)hContact, dwMask);
@@ -367,7 +367,7 @@ static INT_PTR SetContactIgnore(WPARAM wParam, LPARAM lParam) if (hWindowListIGN == 0)
hWindowListIGN = WindowList_Create();
- hWnd = WindowList_Find(hWindowListIGN, (HANDLE)wParam);
+ hWnd = WindowList_Find(hWindowListIGN, (HCONTACT)wParam);
if ( wParam ) {
if ( hWnd == 0 )
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_QUICKIGNORE), 0, IgnoreDialogProc, (LPARAM)wParam);
diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp index 8b23d00f02..2514716017 100644 --- a/plugins/Clist_nicer/src/clistmod.cpp +++ b/plugins/Clist_nicer/src/clistmod.cpp @@ -30,7 +30,7 @@ extern int RemoveEvent(WPARAM wParam, LPARAM lParam); int InitCustomMenus(void);
void UninitCustomMenus(void);
INT_PTR GetContactStatusMessage(WPARAM wParam, LPARAM lParam);
-int EventsProcessContactDoubleClick(HANDLE hContact);
+int EventsProcessContactDoubleClick(HCONTACT hContact);
int SetHideOffline(WPARAM wParam, LPARAM lParam);
extern HIMAGELIST hCListImages;
@@ -44,9 +44,9 @@ static INT_PTR GetStatusMode(WPARAM wParam, LPARAM lParam) return(g_maxStatus == ID_STATUS_OFFLINE ? pcli->currentDesiredStatusMode : g_maxStatus);
}
-extern int ( *saveIconFromStatusMode )( const char *szProto, int status, HANDLE hContact );
+extern int ( *saveIconFromStatusMode )( const char *szProto, int status, HCONTACT hContact );
-int IconFromStatusMode(const char *szProto, int status, HANDLE hContact, HICON *phIcon)
+int IconFromStatusMode(const char *szProto, int status, HCONTACT hContact, HICON *phIcon)
{
if (phIcon != NULL)
*phIcon = NULL;
@@ -55,7 +55,7 @@ int IconFromStatusMode(const char *szProto, int status, HANDLE hContact, HICON * int finalStatus;
if (szProto != NULL && !strcmp(szProto, cfg::dat.szMetaName) && cfg::dat.bMetaAvail && hContact != 0 && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
- HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ HCONTACT hSubContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
szFinalProto = GetContactProto(hSubContact);
finalStatus = (status == 0) ? (WORD) cfg::getWord(hSubContact, szFinalProto, "Status", ID_STATUS_OFFLINE) : status;
hContact = hSubContact;
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp index 3dac5426da..5517524a5f 100644 --- a/plugins/Clist_nicer/src/clistopts.cpp +++ b/plugins/Clist_nicer/src/clistopts.cpp @@ -39,7 +39,7 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP switch (msg) {
case WM_USER+1:
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBCONTACTWRITESETTING *ws = (DBCONTACTWRITESETTING *) lParam;
if (hContact == NULL && ws != NULL && ws->szModule != NULL && ws->szSetting != NULL && lstrcmpiA(ws->szModule, "CList") == 0 && lstrcmpiA(ws->szSetting, "UseGroups") == 0 && IsWindowVisible(hwndDlg))
CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, ws->value.bVal == 0);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 9a3f756193..72a579d453 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -400,10 +400,10 @@ void ConfigureCLUIGeometry(int mode) * set the states of defined database action buttons (only if button is a toggle)
*/
-void SetDBButtonStates(HANDLE hPassedContact)
+void SetDBButtonStates(HCONTACT hPassedContact)
{
ButtonItem *buttonItem = g_ButtonItems;
- HANDLE hContact = 0, hFinalContact = 0;
+ HCONTACT hContact = 0, hFinalContact = 0;
char *szModule, *szSetting;
int sel = cfg::clcdat ? cfg::clcdat->selection : -1;
ClcContact *contact = 0;
@@ -714,7 +714,7 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd) extern LRESULT(CALLBACK *saveContactListWndProc)(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
-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)
@@ -1344,7 +1344,7 @@ skipbg: ButtonItem *item = g_ButtonItems;
WPARAM wwParam = 0;
LPARAM llParam = 0;
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
ClcContact *contact = 0;
int sel = cfg::clcdat ? cfg::clcdat->selection : -1;
int serviceFailure = FALSE;
@@ -1378,7 +1378,7 @@ skipbg: BYTE *pValue;
char *szModule = item->szModule;
char *szSetting = item->szSetting;
- HANDLE finalhContact = 0;
+ HCONTACT finalhContact = 0;
if (item->dwFlags & BUTTON_ISCONTACTDBACTION || item->dwFlags & BUTTON_DBACTIONONCONTACT) {
contactOK = ServiceParamsOK(item, &wwParam, &llParam, hContact);
@@ -1400,17 +1400,15 @@ skipbg: } else
pValue = item->bValuePush;
- if (fDelete) {
- //_DebugTraceA("delete value: %s, %s ON %d", szModule, szSetting, finalhContact);
+ if (fDelete)
db_unset(finalhContact, szModule, szSetting);
- } else {
+ else {
switch (item->type) {
case DBVT_BYTE:
cfg::writeByte(finalhContact, szModule, szSetting, pValue[0]);
break;
case DBVT_WORD:
cfg::writeWord(finalhContact, szModule, szSetting, *((WORD *)&pValue[0]));
- //_DebugTraceA("set WORD value: %s, %s, %d ON %d", szModule, item->szSetting, *((WORD *)&pValue[0]), finalhContact);
break;
case DBVT_DWORD:
cfg::writeDword(finalhContact, szModule, szSetting, *((DWORD *)&pValue[0]));
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 8e5e232b26..189471c5e1 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -52,7 +52,7 @@ void cfg::init() InitializeCriticalSection(&cachecs);
}
-DWORD cfg::getDword(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD uDefault = 0)
+DWORD cfg::getDword(const HCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD uDefault = 0)
{
return((DWORD)db_get_dw(hContact, szModule, szSetting, uDefault));
}
@@ -76,7 +76,7 @@ DWORD cfg::getDword(const char *szModule, const char *szSetting, DWORD uDefault) }
-WORD cfg::getWord(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, WORD uDefault = 0)
+WORD cfg::getWord(const HCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, WORD uDefault = 0)
{
return((WORD)db_get_w(hContact, szModule, szSetting, uDefault));
}
@@ -102,7 +102,7 @@ WORD cfg::getWord(const char *szModule, const char *szSetting, WORD uDefault) /*
* same for bytes now
*/
-int cfg::getByte(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, int uDefault = 0)
+int cfg::getByte(const HCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, int uDefault = 0)
{
return(db_get_b(hContact, szModule, szSetting, uDefault));
}
@@ -117,12 +117,12 @@ int cfg::getByte(const char *szModule, const char *szSetting, int uDefault) return(db_get_b(0, szModule, szSetting, uDefault));
}
-INT_PTR cfg::getTString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
+INT_PTR cfg::getTString(const HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
return(db_get_ts(hContact, szModule, szSetting, dbv));
}
-INT_PTR cfg::getString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
+INT_PTR cfg::getString(const HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
return(db_get_s(hContact, szModule, szSetting, dbv));
}
@@ -131,7 +131,7 @@ INT_PTR cfg::getString(const HANDLE hContact, const char *szModule, const char * * writer functions
*/
-INT_PTR cfg::writeDword(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD value = 0)
+INT_PTR cfg::writeDword(const HCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD value = 0)
{
return(db_set_dw(hContact, szModule, szSetting, value));
}
@@ -141,7 +141,7 @@ INT_PTR cfg::writeDword(const char *szModule = 0, const char *szSetting = 0, DWO return(db_set_dw(0, szModule, szSetting, value));
}
-INT_PTR cfg::writeWord(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, WORD value = 0)
+INT_PTR cfg::writeWord(const HCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, WORD value = 0)
{
return(db_set_w(hContact, szModule, szSetting, value));
}
@@ -151,7 +151,7 @@ INT_PTR cfg::writeWord(const char *szModule = 0, const char *szSetting = 0, WORD return(db_set_w(0, szModule, szSetting, value));
}
-INT_PTR cfg::writeByte(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, BYTE value = 0)
+INT_PTR cfg::writeByte(const HCONTACT hContact = 0, const char *szModule = 0, const char *szSetting = 0, BYTE value = 0)
{
return(db_set_b(hContact, szModule, szSetting, value));
}
@@ -161,17 +161,17 @@ INT_PTR cfg::writeByte(const char *szModule = 0, const char *szSetting = 0, BYTE return(db_set_b(0, szModule, szSetting, value));
}
-INT_PTR cfg::writeTString(const HANDLE hContact, const char *szModule = 0, const char *szSetting = 0, const TCHAR *str = 0)
+INT_PTR cfg::writeTString(const HCONTACT hContact, const char *szModule = 0, const char *szSetting = 0, const TCHAR *str = 0)
{
return(db_set_ts(hContact, szModule, szSetting, str));
}
-INT_PTR cfg::writeString(const HANDLE hContact, const char *szModule = 0, const char *szSetting = 0, const char *str = 0)
+INT_PTR cfg::writeString(const HCONTACT hContact, const char *szModule = 0, const char *szSetting = 0, const char *str = 0)
{
return(db_set_s(hContact, szModule, szSetting, str));
}
-TExtraCache* cfg::getCache(const HANDLE hContact, const char *szProto)
+TExtraCache* cfg::getCache(const HCONTACT hContact, const char *szProto)
{
int idx = cfg::arCache.getIndex((TExtraCache*)&hContact);
if (idx != -1)
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index c379979a79..88d2defe08 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -39,7 +39,7 @@ struct { {ID_STATUS_OUTTOLUNCH,425}
};
-static int GetContactStatus(HANDLE hContact)
+static int GetContactStatus(HCONTACT hContact)
{
char *szProto;
@@ -61,7 +61,7 @@ int __forceinline GetStatusModeOrdering(int statusMode) int mf_updatethread_running = TRUE;
HANDLE hThreadMFUpdate = 0;
-static void MF_CalcFrequency(HANDLE hContact, DWORD dwCutoffDays, int doSleep)
+static void MF_CalcFrequency(HCONTACT hContact, DWORD dwCutoffDays, int doSleep)
{
DWORD curTime = time(NULL);
DWORD frequency, eventCount;
@@ -109,7 +109,7 @@ void MF_UpdateThread(LPVOID) ResetEvent(hEvent);
while(mf_updatethread_running) {
- for (HANDLE hContact = db_find_first(); hContact && mf_updatethread_running; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact && mf_updatethread_running; hContact = db_find_next(hContact)) {
MF_CalcFrequency(hContact, 50, 1);
if (mf_updatethread_running)
WaitForSingleObject(hEvent, 5000);
@@ -140,7 +140,7 @@ void LoadContactTree(void) hideOffline = cfg::getByte("CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
status = GetContactStatus(hContact);
if ((!hideOffline || status != ID_STATUS_OFFLINE) && !CLVM_GetContactHiddenStatus(hContact, NULL, NULL))
pcli->pfnChangeContactIcon(hContact, IconFromStatusMode(GetContactProto(hContact), status, hContact, NULL), 1);
@@ -162,7 +162,7 @@ void LoadContactTree(void) CallService(MS_CLUI_LISTENDREBUILD, 0, 0);
}
-DWORD INTSORT_GetLastMsgTime(HANDLE hContact)
+DWORD INTSORT_GetLastMsgTime(HCONTACT hContact)
{
HANDLE hDbEvent = db_event_last(hContact);
while(hDbEvent) {
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index d72f0ec13d..0ed8a12036 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -1261,7 +1261,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) }
if (items) {
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
continue;
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index b657100533..683c2fd72f 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -57,8 +57,8 @@ int ClcShutdown(WPARAM wParam, LPARAM lParam); void (*saveLoadClcOptions)(HWND hwnd, struct ClcData *dat);
void LoadClcOptions(HWND hwnd, struct ClcData *dat);
-int (*saveAddContactToGroup)(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
-int AddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
+int (*saveAddContactToGroup)(struct ClcData *dat, ClcGroup *group, HCONTACT hContact);
+int AddContactToGroup(struct ClcData *dat, ClcGroup *group, HCONTACT hContact);
CListEvent* (*saveAddEvent)(CLISTEVENT *cle);
CListEvent* AddEvent(CLISTEVENT *cle);
@@ -75,13 +75,13 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT message, WPARAM wParam, LPAR LRESULT (CALLBACK *saveContactListControlWndProc)(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-int (*saveIconFromStatusMode)(const char *szProto, int status, HANDLE hContact);
+int (*saveIconFromStatusMode)(const char *szProto, int status, HCONTACT hContact);
LRESULT(*saveProcessExternalMessages)(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
-int (*saveRemoveEvent)(HANDLE hContact, HANDLE hDbEvent);
-int RemoveEvent(HANDLE hContact, HANDLE hDbEvent);
+int (*saveRemoveEvent)(HCONTACT hContact, HANDLE hDbEvent);
+int RemoveEvent(HCONTACT hContact, HANDLE hDbEvent);
INT_PTR (*saveTrayIconProcessMessage)(WPARAM wParam, LPARAM lParam);
INT_PTR TrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
@@ -194,7 +194,7 @@ static int systemModulesLoaded(WPARAM wParam, LPARAM lParam) return 0;
}
-static int fnIconFromStatusMode(const char* szProto, int status, HANDLE hContact)
+static int fnIconFromStatusMode(const char* szProto, int status, HCONTACT hContact)
{
return IconFromStatusMode(szProto, status, hContact, NULL);
}
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index db08996df5..c189db26bb 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -120,7 +120,7 @@ static void ShowPage(HWND hwnd, int page) }
}
-static int UpdateClistItem(HANDLE hContact, DWORD mask)
+static int UpdateClistItem(HCONTACT hContact, DWORD mask)
{
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hContact, MAKELONG(i - ID_STATUS_OFFLINE,
@@ -141,24 +141,21 @@ static DWORD GetMaskForItem(HANDLE hItem) static void UpdateStickies()
{
- HANDLE hItem;
- int i;
-
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ HCONTACT hItem = (HCONTACT)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, cfg::getByte(hContact, "CLVM", g_szModename, 0) ? 1 : 0);
DWORD localMask = HIWORD(cfg::getDword(hContact, "CLVM", g_szModename, 0));
UpdateClistItem(hItem, (localMask == 0 || localMask == stickyStatusMask) ? stickyStatusMask : localMask);
}
- for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
+ for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hInfoItem, MAKELONG(i - ID_STATUS_OFFLINE, (1 << (i - ID_STATUS_OFFLINE)) & stickyStatusMask ? i - ID_STATUS_OFFLINE : ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE + 1));
- hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETNEXTITEM,CLGN_ROOT,0);
+ HANDLE hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0);
hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST,CLM_GETNEXTITEM,CLGN_NEXTGROUP, (LPARAM)hItem);
while(hItem) {
- for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
+ for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELONG(i - ID_STATUS_OFFLINE, nullImage));
hItem=(HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
}
@@ -396,7 +393,7 @@ void SaveState() SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szModeName);
dwGlobalMask = GetMaskForItem(hInfoItem);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
if (SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
@@ -675,7 +672,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
SetWindowTextA(hwndSelector, Translate("No view mode"));
}
- 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 (cfg::getDword(hContact, "CLVM", szBuf, -1) != -1)
cfg::writeDword(hContact, "CLVM", szBuf, 0);
@@ -721,7 +718,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
case IDC_CLEARALL:
{
- 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_SETCHECKMARK, (WPARAM)hItem, 0);
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index cb9e8d17d8..c99ef5dc06 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1066,13 +1066,13 @@ void HandleCallServiceCommand(PCommand command, TArgument *argv, int argc, PRepl }
-HANDLE ParseContactParam(char *contact)
+HCONTACT ParseContactParam(char *contact)
{
char name[512];
char account[128];
char protocol[128];
char *p = strrchr(contact, ':');
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
if (p)
{
*p = 0;
@@ -1099,7 +1099,7 @@ void HandleMessageCommand(PCommand command, TArgument *argv, int argc, PReply re int i;
char *contact;
char buffer[1024];
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hProcess = NULL;
ACKDATA *ack = NULL;
for (i = 2; i < argc - 1; i++)
@@ -1675,7 +1675,7 @@ void HandleProxyCommand(PCommand command, TArgument *argv, int argc, PReply repl }
}
-int ContactMatchSearch(HANDLE hContact, char *contact, char *id, char *account, TArgument *argv, int argc)
+int ContactMatchSearch(HCONTACT hContact, char *contact, char *id, char *account, TArgument *argv, int argc)
{
int matches = 1;
int i;
@@ -1757,7 +1757,7 @@ int ContactMatchSearch(HANDLE hContact, char *contact, char *id, char *account, DWORD WINAPI OpenMessageWindowThread(void *data)
{
- HANDLE hContact = (HANDLE) data;
+ HCONTACT hContact = (HCONTACT) data;
if (hContact)
{
CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM) hContact, 0);
@@ -1780,7 +1780,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r int count = 0;
reply->code = MIMRES_SUCCESS;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
GetContactProto(hContact, protocol, sizeof(protocol));
char *contact = GetContactName(hContact, protocol);
@@ -1821,7 +1821,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r reply->code = MIMRES_SUCCESS;
*reply->message = 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)) {
GetContactProto(hContact, protocol, sizeof(protocol));
char *contact = GetContactName(hContact, protocol);
@@ -1840,7 +1840,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r reply->code = MIMRES_SUCCESS;
*reply->message = 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 hUnreadEvent = db_event_firstUnread(hContact);
if (hUnreadEvent != NULL) {
DWORD threadID;
@@ -1916,7 +1916,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re reply->code = MIMRES_SUCCESS;
mir_snprintf(reply->message, reply->cMessage, Translate("No unread messages found."));
- 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 hEvent = db_event_firstUnread(hContact);
if (hEvent != NULL) {
count = 0;
@@ -1958,7 +1958,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re case 4:
{
char *contact = argv[3];
- HANDLE hContact = ParseContactParam(contact);
+ HCONTACT hContact = ParseContactParam(contact);
if (hContact)
{
if (_stricmp(cmd, "unread") == 0)
@@ -1993,7 +1993,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re case 6:
{
char *contact = argv[3];
- HANDLE hContact = ParseContactParam(contact);
+ HCONTACT hContact = ParseContactParam(contact);
if (hContact)
{
@@ -2139,7 +2139,7 @@ void HandleIgnoreCommand(PCommand command, TArgument *argv, int argc, PReply rep return;
}
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
char *contact;
for (int i = 3; i < argc; i++)
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index f7f08be649..5376dfed3d 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -123,7 +123,7 @@ void HexToBin(char *inData, ULONG &size, LPBYTE &outData) i = size;
}
-int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, char *szError, char *szResult, size_t size)
+int GetStringFromDatabase(HCONTACT hContact, char *szModule, char *szSettingName, char *szError, char *szResult, size_t size)
{
DBVARIANT dbv = {0};
int res = 1;
@@ -154,7 +154,7 @@ int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, return res;
}
-int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, WCHAR *szError, WCHAR *szResult, size_t count)
+int GetStringFromDatabase(HCONTACT hContact, char *szModule, char *szSettingName, WCHAR *szError, WCHAR *szResult, size_t count)
{
DBVARIANT dbv = {0};
int res = 1;
@@ -202,7 +202,7 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, }
#pragma warning (disable: 4312)
-TCHAR *GetContactName(HANDLE hContact, char *szProto)
+TCHAR *GetContactName(HCONTACT hContact, char *szProto)
{
CONTACTINFO ctInfo;
INT_PTR ret;
@@ -244,14 +244,14 @@ TCHAR *GetContactName(HANDLE hContact, char *szProto) #pragma warning (default: 4312)
#pragma warning (disable: 4312)
-void GetContactProto(HANDLE hContact, char *szProto, size_t size)
+void GetContactProto(HCONTACT hContact, char *szProto, size_t size)
{
GetStringFromDatabase(hContact, "Protocol", "p", NULL, szProto, size);
}
#pragma warning (default: 4312)
#pragma warning (disable: 4312)
-TCHAR *GetContactID(HANDLE hContact)
+TCHAR *GetContactID(HCONTACT hContact)
{
char protocol[256];
GetContactProto(hContact, protocol, sizeof(protocol));
@@ -259,7 +259,7 @@ TCHAR *GetContactID(HANDLE hContact) return GetContactID(hContact, protocol);
}
-TCHAR *GetContactID(HANDLE hContact, char *szProto)
+TCHAR *GetContactID(HCONTACT hContact, char *szProto)
{
CONTACTINFO ctInfo;
INT_PTR ret;
@@ -326,14 +326,14 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto) #pragma warning (default: 4312)
#pragma warning (disable: 4312)
-HANDLE GetContactFromID(TCHAR *szID, char *szProto)
+HCONTACT GetContactFromID(TCHAR *szID, char *szProto)
{
TCHAR dispName[1024];
char cProtocol[256];
char *tmp;
int found = 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)) {
GetContactProto(hContact, cProtocol, sizeof(cProtocol));
TCHAR *szHandle = GetContactID(hContact, cProtocol);
@@ -353,7 +353,7 @@ HANDLE GetContactFromID(TCHAR *szID, char *szProto) #pragma warning (default: 4312)
#pragma warning (disable: 4312)
-HANDLE GetContactFromID(TCHAR *szID, wchar_t *szProto)
+HCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto)
{
char protocol[1024];
WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL);
diff --git a/plugins/CmdLine/src/utils.h b/plugins/CmdLine/src/utils.h index 5729528f04..73d92eff93 100644 --- a/plugins/CmdLine/src/utils.h +++ b/plugins/CmdLine/src/utils.h @@ -43,17 +43,17 @@ void ScreenToClient(HWND hWnd, LPRECT rect); void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors);
RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int anchors);
-int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, char *szError, char *szResult, size_t size);
-int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, WCHAR *szError, WCHAR *szResult, size_t count);
+int GetStringFromDatabase(HCONTACT hContact, char *szModule, char *szSettingName, char *szError, char *szResult, size_t size);
+int GetStringFromDatabase(HCONTACT hContact, char *szModule, char *szSettingName, WCHAR *szError, WCHAR *szResult, size_t count);
int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, size_t size);
int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, size_t count);
-TCHAR *GetContactName(HANDLE hContact, char *szProto);
-TCHAR *GetContactID(HANDLE hContact);
-TCHAR *GetContactID(HANDLE hContact, char *szProto);
-HANDLE GetContactFromID(TCHAR *szID, char *szProto);
-HANDLE GetContactFromID(TCHAR *szID, wchar_t *szProto);
-void GetContactProto(HANDLE hContact, char *szProto, size_t size);
+TCHAR *GetContactName(HCONTACT hContact, char *szProto);
+TCHAR *GetContactID(HCONTACT hContact);
+TCHAR *GetContactID(HCONTACT hContact, char *szProto);
+HCONTACT GetContactFromID(TCHAR *szID, char *szProto);
+HCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto);
+void GetContactProto(HCONTACT hContact, char *szProto, size_t size);
int MyPUShowMessage(char *lpzText, BYTE kind);
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 4fca1e528a..e412ac2200 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -893,7 +893,7 @@ extern "C" int __declspec(dllexport) Load(void) CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd);
//set all contacts to offline
- for (HANDLE hContact = db_find_first(PLUGINNAME); hContact != NULL; hContact = db_find_next(hContact,PLUGINNAME))
+ for (HCONTACT hContact = db_find_first(PLUGINNAME); hContact != NULL; hContact = db_find_next(hContact,PLUGINNAME))
db_set_w(hContact,PLUGINNAME,"status",ID_STATUS_OFFLINE);
mir_snprintf(service,sizeof(service), "%s%s", PLUGINNAME, PS_GETCAPS);
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 7b20a0ace1..5d42d3db9c 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -59,7 +59,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) static int HookDBEventAdded(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HANDLE hDbEvent = (HANDLE)lParam;
//process the event
DBEVENTINFO dbe = { sizeof(dbe) };
@@ -92,7 +92,7 @@ static int HookDBEventAdded(WPARAM wParam, LPARAM lParam) static void ProcessUnreadEvents(void)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hDbEvent = db_event_firstUnread(hContact);
while (hDbEvent) {
DBEVENTINFO dbei = { sizeof(dbei) };
@@ -117,7 +117,7 @@ static bool CheckContactsServiceSupport(const char* szProto) static int HookPreBuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
char *szProto = GetContactProto(hContact);
int bVisible = FALSE;
@@ -156,7 +156,7 @@ static int HookModulesLoaded(WPARAM wParam, LPARAM lParam) static int HookContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if (strcmpnull(cws->szModule, "CList") && strcmpnull(cws->szModule, szProto)) return 0;
@@ -167,24 +167,21 @@ static int HookContactSettingChanged(WPARAM wParam, LPARAM lParam) static int HookContactDeleted(WPARAM wParam, LPARAM lParam)
{ // if our contact gets deleted close his window
- HWND h = WindowList_Find(ghSendWindowList, (HANDLE)wParam);
+ HWND h = WindowList_Find(ghSendWindowList, (HCONTACT)wParam);
if (h)
- {
SendMessage(h, WM_CLOSE, 0, 0);
- }
- while (h = WindowList_Find(ghRecvWindowList, (HANDLE)wParam))
- { // since we hack the window list - more windows for one contact, we need to close them all
+ // since we hack the window list - more windows for one contact, we need to close them all
+ while (h = WindowList_Find(ghRecvWindowList, (HCONTACT)wParam))
SendMessage(h, WM_CLOSE, 0, 0);
- }
return 0;
}
static INT_PTR ServiceSendCommand(WPARAM wParam, LPARAM lParam)
{
//find window for hContact
- HWND hWnd = WindowList_Find(ghSendWindowList, (HANDLE)wParam);
+ HWND hWnd = WindowList_Find(ghSendWindowList, (HCONTACT)wParam);
if (!hWnd)
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SEND), NULL, SendDlgProc, wParam);
else {
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index 5e61067781..02c219edba 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -25,7 +25,7 @@ /* TRecvContactsData */
-TRecvContactsData::TRecvContactsData(HANDLE contact)
+TRecvContactsData::TRecvContactsData(HCONTACT contact)
{
mhContact = contact;
hHook = NULL;
@@ -136,7 +136,7 @@ static void RebuildGroupCombo(HWND hwndDlg) }
}
-static HANDLE CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *wndData, int iItem)
+static HCONTACT CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *wndData, int iItem)
{
TCHAR *caUIN = ListView_GetItemTextEx(GetDlgItem(hwndDlg, IDC_CONTACTS), iItem, 0);
char *szProto = GetContactProto(wndData->mhContact);
@@ -144,7 +144,7 @@ static HANDLE CreateTemporaryContactForItem(HWND hwndDlg, TRecvContactsData *wnd replaceStrT(wndData->haUin, caUIN);
for (int j = 0; j < wndData->cbReceived; j++)
if (!lstrcmp(wndData->maReceived[j]->mcaUIN, caUIN))
- return (HANDLE)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(PALF_TEMPORARY, j), (LPARAM)wndData->mhDbEvent);
+ return (HCONTACT)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(PALF_TEMPORARY, j), (LPARAM)wndData->mhDbEvent);
return NULL;
}
@@ -162,7 +162,7 @@ void RecvListView_AddColumn(HWND hList, int nWidth, TCHAR *szTitle, int nItem) INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
TRecvContactsData *wndData = (TRecvContactsData*)GetWindowLongPtr(hwndDlg, DWLP_USER);
- HANDLE hContact;
+ HCONTACT hContact;
switch (msg) {
case WM_INITDIALOG:
@@ -317,7 +317,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara for (int j = 0; j < wndData->cbReceived; j++) // determine item index in packet
if (!lstrcmp(wndData->maReceived[j]->mcaUIN, caUIN)) {
char *szProto =GetContactProto(wndData->mhContact);
- hContact = (HANDLE)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(0, j), (LPARAM)wndData->mhDbEvent);
+ hContact = (HCONTACT)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(0, j), (LPARAM)wndData->mhDbEvent);
if (hContact && caGroup) {
// use newest group API if available
if (ServiceExists(MS_CLIST_CONTACTCHANGEGROUP))
diff --git a/plugins/ContactsPlus/src/receive.h b/plugins/ContactsPlus/src/receive.h index dce1b023ac..1ad8eed542 100644 --- a/plugins/ContactsPlus/src/receive.h +++ b/plugins/ContactsPlus/src/receive.h @@ -43,21 +43,21 @@ struct TReceivedItem { struct TRecvContactsData
{
- TRecvContactsData(HANDLE contact);
+ TRecvContactsData(HCONTACT contact);
~TRecvContactsData();
- HANDLE mhDbEvent; // handle to recv DB event
- HANDLE mhContact; // from whom we received this
+ HANDLE mhDbEvent; // handle to recv DB event
+ HCONTACT mhContact; // from whom we received this
HIMAGELIST mhListIcon;// icons for listview
- HMENU mhPopup; // popup menu for listview
- HANDLE hHook; // hook to event
- HANDLE rhSearch; // handle to uin-search
- TCHAR* haUin;
- int iPopupItem;
+ HMENU mhPopup; // popup menu for listview
+ HANDLE hHook; // hook to event
+ HANDLE rhSearch; // handle to uin-search
+ TCHAR* haUin;
+ int iPopupItem;
TReceivedItem** maReceived;// received contacts
- int cbReceived;
+ int cbReceived;
TReceivedItem* AddReceivedItem();
- HICON hIcons[4]; // icons for dialog
+ HICON hIcons[4]; // icons for dialog
};
extern HANDLE ghRecvWindowList;
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index beefc0aedf..d0a2c511a3 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -60,7 +60,7 @@ void TSendProcessList::Remove(HANDLE hProcc) /* TSendContactsData */
-TSendContactsData::TSendContactsData(HANDLE contact) : uacklist()
+TSendContactsData::TSendContactsData(HCONTACT contact) : uacklist()
{
hContact = contact;
hHook = NULL;
@@ -107,14 +107,14 @@ void TSendContactsData::ClearContacts() nContacts = 0;
}
-void TSendContactsData::AddContact(HANDLE hContact)
+void TSendContactsData::AddContact(HCONTACT hContact)
{
- aContacts = (HANDLE*)mir_realloc(aContacts, (nContacts + 1)*sizeof(HANDLE));
+ aContacts = (HCONTACT*)mir_realloc(aContacts, (nContacts + 1)*sizeof(HCONTACT));
aContacts[nContacts] = hContact;
nContacts++;
}
-int TSendContactsData::SendContactsPacket(HWND hwndDlg, HANDLE *phContacts, int nContacts)
+int TSendContactsData::SendContactsPacket(HWND hwndDlg, HCONTACT *phContacts, int nContacts)
{
HANDLE hProcc = (HANDLE)CallContactService(hContact, PSS_CONTACTS, MAKEWPARAM(0, nContacts), (LPARAM)phContacts);
if (!hProcc) {
@@ -126,8 +126,8 @@ int TSendContactsData::SendContactsPacket(HWND hwndDlg, HANDLE *phContacts, int TAckData *ackData = gaAckData.Add(hProcc, new TAckData(hContact));
uacklist.Add(hProcc);
ackData->nContacts = nContacts;
- ackData->aContacts = (HANDLE*)mir_alloc(nContacts*sizeof(HANDLE));
- memmove(ackData->aContacts, phContacts, nContacts*sizeof(HANDLE)); // copy the array of hContact for ack array
+ ackData->aContacts = (HCONTACT*)mir_alloc(nContacts*sizeof(HCONTACT));
+ memmove(ackData->aContacts, phContacts, nContacts*sizeof(HCONTACT)); // copy the array of hContact for ack array
EnableDlgItem(hwndDlg, IDOK, FALSE);
EnableDlgItem(hwndDlg, IDC_LIST, FALSE);
return TRUE; // Success
@@ -179,12 +179,12 @@ static void ResetListOptions(HWND hwndList) }
}
-static HANDLE FindNextClistContact(HWND hList, HANDLE hContact, HANDLE *phItem)
+static HCONTACT FindNextClistContact(HWND hList, HCONTACT hContact, HCONTACT *phItem)
{
- HANDLE hNextContact = db_find_next(hContact);
- HANDLE hNextItem = NULL;
+ HCONTACT hNextContact = db_find_next(hContact);
+ HCONTACT hNextItem = NULL;
- while (hNextContact && !(hNextItem = (HANDLE)SendMessage(hList, CLM_FINDCONTACT, (WPARAM)hNextContact, 0)))
+ while (hNextContact && !(hNextItem = (HCONTACT)SendMessage(hList, CLM_FINDCONTACT, (WPARAM)hNextContact, 0)))
hNextContact = db_find_next(hNextContact);
if (phItem)
@@ -194,10 +194,10 @@ static HANDLE FindNextClistContact(HWND hList, HANDLE hContact, HANDLE *phItem) }
-static HANDLE FindFirstClistContact(HWND hList, HANDLE *phItem)
+static HCONTACT FindFirstClistContact(HWND hList, HCONTACT *phItem)
{
- HANDLE hContact = db_find_first();
- HANDLE hItem = (HANDLE)SendMessage(hList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ HCONTACT hContact = db_find_first();
+ HCONTACT hItem = (HCONTACT)SendMessage(hList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hContact && !hItem)
return FindNextClistContact(hList, hContact, phItem);
@@ -211,7 +211,7 @@ static HANDLE FindFirstClistContact(HWND hList, HANDLE *phItem) bool binListEvent = FALSE;
-static void SetAllContactChecks(HWND hwndList, HANDLE hReceiver) // doubtful name
+static void SetAllContactChecks(HWND hwndList, HCONTACT hReceiver) // doubtful name
{
if (binListEvent)
return;
@@ -226,7 +226,7 @@ static void SetAllContactChecks(HWND hwndList, HANDLE hReceiver) // doubtful nam else
SendMessage(hwndList, CLM_SETHIDEEMPTYGROUPS, (WPARAM)FALSE, 0);
- HANDLE hItem, hContact = FindFirstClistContact(hwndList, &hItem);
+ HCONTACT hItem, hContact = FindFirstClistContact(hwndList, &hItem);
while (hContact) {
char* szProto2 = GetContactProto(hContact);
@@ -251,9 +251,9 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TranslateDialogDefault(hwndDlg);
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONTACTS)));
ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST));
- SetAllContactChecks(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)lParam);
- WindowList_Add(ghSendWindowList, hwndDlg, (HANDLE)lParam);
- wndData = new TSendContactsData((HANDLE)lParam);
+ SetAllContactChecks(GetDlgItem(hwndDlg, IDC_LIST), (HCONTACT)lParam);
+ WindowList_Add(ghSendWindowList, hwndDlg, (HCONTACT)lParam);
+ wndData = new TSendContactsData((HCONTACT)lParam);
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG)wndData);
// new dlg init
wndData->hIcons[0] = InitMButton(hwndDlg, IDC_ADD, MAKEINTRESOURCEA(IDI_ADDCONTACT), LPGEN("Add Contact Permanently to List"));
@@ -342,7 +342,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara switch (LOWORD(wParam)) {
case IDOK:
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDOK))) {
- HANDLE hContact, hItem;
+ HCONTACT hContact, hItem;
wndData->ClearContacts(); // do not include contacts twice
HWND hList = GetDlgItem(hwndDlg, IDC_LIST);
@@ -370,7 +370,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara {
// select all contacts
HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST);
- HANDLE hItem, hContact = FindFirstClistContact(hwndList, &hItem);
+ HCONTACT hItem, hContact = FindFirstClistContact(hwndList, &hItem);
while (hContact) {
SendMessage(hwndList, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
hContact = FindNextClistContact(hwndList, hContact, &hItem);
diff --git a/plugins/ContactsPlus/src/send.h b/plugins/ContactsPlus/src/send.h index 73908b4ecf..8a8c1250ed 100644 --- a/plugins/ContactsPlus/src/send.h +++ b/plugins/ContactsPlus/src/send.h @@ -53,27 +53,27 @@ struct TSendContactsData { // hope uack is released automaticly, static propert HANDLE hHook; // hook to event
void HookProtoAck(HWND hwndDlg);
void UnhookProtoAck();
- HANDLE* aContacts; // contacts to be sent
+ HCONTACT *aContacts; // contacts to be sent
int nContacts; // now many UIDs shall we send?
void ClearContacts();
- void AddContact(HANDLE hContact);
- HANDLE hContact; // to whom shall we send?
+ void AddContact(HCONTACT hContact);
+ HCONTACT hContact; // to whom shall we send?
TSendProcessList uacklist;// ackdata - necessary for errorbox
HWND hError; // handle of error box, if any
void ShowErrorDlg(HWND hwndDlg, char* szMsg, bool bAllowRetry);
- int SendContactsPacket(HWND hwndDlg, HANDLE *phContacts, int nContacts);
+ int SendContactsPacket(HWND hwndDlg, HCONTACT *phContacts, int nContacts);
int SendContacts(HWND hwndDlg);
HICON hIcons[4]; // icons for dialog
- TSendContactsData(HANDLE contact);
+ TSendContactsData(HCONTACT contact);
~TSendContactsData();
};
struct TAckData
{
- HANDLE hContact; // to whom was it sent
- HANDLE* aContacts; // obj
+ HCONTACT hContact; // to whom was it sent
+ HCONTACT* aContacts; // obj
int nContacts; // how many
- TAckData(HANDLE contact) { hContact = contact; aContacts = NULL; nContacts = 0;};
+ TAckData(HCONTACT contact) { hContact = contact; aContacts = NULL; nContacts = 0;};
~TAckData() { mir_free(aContacts); }
};
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp index b050c28f76..9b64ae65d5 100644 --- a/plugins/ContactsPlus/src/utils.cpp +++ b/plugins/ContactsPlus/src/utils.cpp @@ -55,7 +55,7 @@ char* __fastcall null_strdup(const char *string) return NULL;
}
-TCHAR* GetContactUID(HANDLE hContact)
+TCHAR* GetContactUID(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
char *uid = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
@@ -98,7 +98,7 @@ void DialogAddContactExecute(HWND hwndDlg, HANDLE hNewContact) }
-void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, HANDLE hContact)
+void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, HCONTACT hContact)
{
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
@@ -114,7 +114,7 @@ void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, HANDLE hContact) }
-void UpdateDialogTitle(HWND hwndDlg, HANDLE hContact, TCHAR *pszTitleStart)
+void UpdateDialogTitle(HWND hwndDlg, HCONTACT hContact, TCHAR *pszTitleStart)
{
TCHAR newtitle[512];
lstrcpyn(newtitle, TranslateTS(pszTitleStart), SIZEOF(newtitle));
@@ -140,7 +140,7 @@ void UpdateDialogTitle(HWND hwndDlg, HANDLE hContact, TCHAR *pszTitleStart) }
-void UpdateDialogAddButton(HWND hwndDlg, HANDLE hContact)
+void UpdateDialogAddButton(HWND hwndDlg, HCONTACT hContact)
{
int bVisible = db_get_b(hContact, "CList", "NotOnList", 0);
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), bVisible ? SW_SHOW : SW_HIDE);
@@ -159,7 +159,7 @@ HICON InitMButton(HWND hDlg, int idButton, LPCSTR szIcon, char *szTip) }
-HICON LoadContactProtoIcon(HANDLE hContact)
+HICON LoadContactProtoIcon(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto)
diff --git a/plugins/ContactsPlus/src/utils.h b/plugins/ContactsPlus/src/utils.h index ceffbe3502..4d633d0aa5 100644 --- a/plugins/ContactsPlus/src/utils.h +++ b/plugins/ContactsPlus/src/utils.h @@ -32,17 +32,17 @@ int __fastcall strcmpnull(const char *str1, const char *str2); void __fastcall strcpynull(char *str1, const char *str2);
char* __fastcall null_strdup(const char *string);
-TCHAR* GetContactUID(HANDLE hContact);
+TCHAR* GetContactUID(HCONTACT hContact);
-void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, HANDLE hContact);
-void UpdateDialogTitle(HWND hwndDlg, HANDLE hContact, TCHAR *pszTitleStart);
-void UpdateDialogAddButton(HWND hwndDlg, HANDLE hContact);
+void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, HCONTACT hContact);
+void UpdateDialogTitle(HWND hwndDlg, HCONTACT hContact, TCHAR *pszTitleStart);
+void UpdateDialogAddButton(HWND hwndDlg, HCONTACT hContact);
HICON InitMButton(HWND hDlg, int idButton, LPCSTR szIcon, char* szTip);
void DialogAddContactExecute(HWND hwndDlg, HANDLE hNewContact);
-HICON LoadContactProtoIcon(HANDLE hContact);
+HICON LoadContactProtoIcon(HCONTACT hContact);
void EnableDlgItem(HWND hwndDlg, UINT control, int state);
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp index b816872a73..141301a970 100644 --- a/plugins/CountryFlags/src/extraimg.cpp +++ b/plugins/CountryFlags/src/extraimg.cpp @@ -27,15 +27,15 @@ static HANDLE hServiceDetectContactOrigin; static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam)
{
int countryNumber = 0xFFFF;
- char *pszProto = GetContactProto((HANDLE)wParam);
+ char *pszProto = GetContactProto((HCONTACT)wParam);
/* ip detect */
if (bUseIpToCountry)
- countryNumber = ServiceIpToCountry(db_get_dw((HANDLE)wParam,pszProto,"RealIP",0),0);
+ countryNumber = ServiceIpToCountry(db_get_dw((HCONTACT)wParam,pszProto,"RealIP",0),0);
/* fallback */
if (countryNumber == 0xFFFF)
- countryNumber = db_get_w((HANDLE)wParam,pszProto,"Country",0);
+ countryNumber = db_get_w((HCONTACT)wParam,pszProto,"Country",0);
if (countryNumber == 0 || countryNumber == 0xFFFF)
- countryNumber = db_get_w((HANDLE)wParam,pszProto,"CompanyCountry",0);
+ countryNumber = db_get_w((HCONTACT)wParam,pszProto,"CompanyCountry",0);
return (countryNumber == 0) ? 0xFFFF : countryNumber;
}
@@ -45,7 +45,7 @@ static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam) static HANDLE hExtraIcon;
-static void CALLBACK SetExtraImage(HANDLE hContact)
+static void CALLBACK SetExtraImage(HCONTACT hContact)
{
if (!bShowExtraIcon)
return;
@@ -63,14 +63,14 @@ static void CALLBACK SetExtraImage(HANDLE hContact) // always call in context of main thread
static void RemoveExtraImages(void)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
ExtraIcon_Clear(hExtraIcon, hContact);
}
// always call in context of main thread
static void EnsureExtraImages(void)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
SetExtraImage(hContact);
}
@@ -87,7 +87,7 @@ void UpdateExtraImages() #define STATUSICON_REFRESHDELAY 100 /* time for which setting changes are buffered */
// always call in context of main thread
-static void __fastcall SetStatusIcon(HANDLE hContact,int countryNumber)
+static void __fastcall SetStatusIcon(HCONTACT hContact,int countryNumber)
{
StatusIconData sid = { sizeof(sid) };
sid.szModule = MODULENAME;
@@ -106,7 +106,7 @@ static void __fastcall SetStatusIcon(HANDLE hContact,int countryNumber) }
// always call in context of main thread
-static void __fastcall UnsetStatusIcon(HANDLE hContact)
+static void __fastcall UnsetStatusIcon(HCONTACT hContact)
{
StatusIconData sid = { sizeof(sid) };
sid.szModule = MODULENAME;
@@ -167,7 +167,7 @@ static int ExtraImgSettingChanged(WPARAM wParam,LPARAM lParam) /* user details update */
if (!lstrcmpA(dbcws->szSetting,"RealIP") || !lstrcmpA(dbcws->szSetting,"Country") || !lstrcmpA(dbcws->szSetting,"CompanyCountry")) {
/* Extra Image */
- SetExtraImage((HANDLE)wParam);
+ SetExtraImage((HCONTACT)wParam);
/* Status Icon */
if (ServiceExists(MS_MSG_REMOVEICON))
CallFunctionBuffered(UpdateStatusIcons,0,FALSE,STATUSICON_REFRESHDELAY);
diff --git a/plugins/CyrTranslit/src/MirandaContact.cpp b/plugins/CyrTranslit/src/MirandaContact.cpp index ca5b6532fd..ff6da97add 100644 --- a/plugins/CyrTranslit/src/MirandaContact.cpp +++ b/plugins/CyrTranslit/src/MirandaContact.cpp @@ -47,14 +47,14 @@ void MirandaContact::initialize() //------------------------------------------------------------------------------
-bool MirandaContact::bIsActive(HANDLE hContact)
+bool MirandaContact::bIsActive(HCONTACT hContact)
{
return db_get_b(hContact, SETTINGS_MODULE, SETTING_SHOULD_TRANSLITERATE, 0) != 0;
}
//------------------------------------------------------------------------------
-void MirandaContact::save(HANDLE hContact, bool bValue)
+void MirandaContact::save(HCONTACT hContact, bool bValue)
{
db_set_b(hContact, SETTINGS_MODULE, SETTING_SHOULD_TRANSLITERATE, bValue);
}
@@ -80,7 +80,7 @@ void MirandaContact::addMenuItem() INT_PTR MirandaContact::onMenuCommandTransliterate(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
if (!CallService(MS_DB_CONTACT_IS, wParam, 0))
return 0;
@@ -93,7 +93,7 @@ INT_PTR MirandaContact::onMenuCommandTransliterate(WPARAM wParam, LPARAM lParam) int MirandaContact::onPreBuildContactMenu(WPARAM wParam, LPARAM lParam)
{
if (!hTransliterateCmdMenuItem) return 0;
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
if (!CallService(MS_DB_CONTACT_IS, wParam, 0)) return 0;
CLISTMENUITEM mi = { sizeof(mi) };
diff --git a/plugins/CyrTranslit/src/MirandaContact.h b/plugins/CyrTranslit/src/MirandaContact.h index f6e3d558e0..cad1b7f516 100644 --- a/plugins/CyrTranslit/src/MirandaContact.h +++ b/plugins/CyrTranslit/src/MirandaContact.h @@ -42,14 +42,14 @@ public: * @param hContact The handle of the contact object to be instantiated.
* @return The Miranda IM contact having the passed handle.
*/
- static bool bIsActive(HANDLE hContact);
+ static bool bIsActive(HCONTACT hContact);
/**
* Saves this object's data to the persistent storage -- the Miranda
* database. This information may be retreived later on by means of
* getContact() factory method invocation.
*/
- static void save(HANDLE hContact, bool bValue);
+ static void save(HCONTACT hContact, bool bValue);
private:
static const char* SETTINGS_MODULE;
diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index 6afab80691..472ebcdd82 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -305,17 +305,17 @@ STDMETHODIMP_(BOOL) CDb3Mmap::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent) return ret;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::GetEventContact(HANDLE hDbEvent)
+STDMETHODIMP_(MCONTACT) CDb3Mmap::GetEventContact(HANDLE hDbEvent)
{
mir_cslock lck(m_csDbAccess);
DBEvent *dbe = (DBEvent*)DBRead((DWORD)hDbEvent, sizeof(DBEvent), NULL);
if (dbe->signature != DBEVENT_SIGNATURE)
- return (HANDLE)-1;
+ return INVALID_CONTACT_ID;
while (!(dbe->flags & DBEF_FIRST))
dbe = (DBEvent*)DBRead(dbe->ofsPrev, sizeof(DBEvent), NULL);
- return (HANDLE)dbe->ofsPrev;
+ return dbe->ofsPrev;
}
STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstEvent(MCONTACT contactID)
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index 629b2972f8..633c7aa7f5 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -184,43 +184,43 @@ struct CDb3Mmap : public MIDatabase, public MIDatabaseChecker, public MZeroedObj public:
STDMETHODIMP_(void) SetCacheSafetyMode(BOOL);
- STDMETHODIMP_(LONG) GetContactCount(void);
+ STDMETHODIMP_(LONG) GetContactCount(void);
STDMETHODIMP_(MCONTACT) FindFirstContact(const char* szProto = NULL);
STDMETHODIMP_(MCONTACT) FindNextContact(MCONTACT contactID, const char* szProto = NULL);
- STDMETHODIMP_(LONG) DeleteContact(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) AddContact(void);
- STDMETHODIMP_(BOOL) IsDbContact(MCONTACT contactID);
-
- STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(LONG) GetBlobSize(HANDLE hDbEvent);
- STDMETHODIMP_(BOOL) GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) GetEventContact(HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindFirstEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindFirstUnreadEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindLastEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindNextEvent(HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindPrevEvent(HANDLE hDbEvent);
-
- STDMETHODIMP_(BOOL) EnumModuleNames(DBMODULEENUMPROC pFunc, void *pParam);
-
- STDMETHODIMP_(BOOL) GetContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
- STDMETHODIMP_(BOOL) GetContactSettingStr(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
- STDMETHODIMP_(BOOL) GetContactSettingStatic(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
- STDMETHODIMP_(BOOL) FreeVariant(DBVARIANT *dbv);
- STDMETHODIMP_(BOOL) WriteContactSetting(MCONTACT contactID, DBCONTACTWRITESETTING *dbcws);
- STDMETHODIMP_(BOOL) DeleteContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting);
- STDMETHODIMP_(BOOL) EnumContactSettings(MCONTACT contactID, DBCONTACTENUMSETTINGS* dbces);
- STDMETHODIMP_(BOOL) SetSettingResident(BOOL bIsResident, const char *pszSettingName);
- STDMETHODIMP_(BOOL) EnumResidentSettings(DBMODULEENUMPROC pFunc, void *pParam);
- STDMETHODIMP_(BOOL) IsSettingEncrypted(LPCSTR szModule, LPCSTR szSetting);
+ STDMETHODIMP_(LONG) DeleteContact(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) AddContact(void);
+ STDMETHODIMP_(BOOL) IsDbContact(MCONTACT contactID);
+
+ STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, HANDLE hDbEvent);
+ STDMETHODIMP_(LONG) GetBlobSize(HANDLE hDbEvent);
+ STDMETHODIMP_(BOOL) GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, HANDLE hDbEvent);
+ STDMETHODIMP_(MCONTACT) GetEventContact(HANDLE hDbEvent);
+ STDMETHODIMP_(HANDLE) FindFirstEvent(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) FindFirstUnreadEvent(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) FindLastEvent(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) FindNextEvent(HANDLE hDbEvent);
+ STDMETHODIMP_(HANDLE) FindPrevEvent(HANDLE hDbEvent);
+
+ STDMETHODIMP_(BOOL) EnumModuleNames(DBMODULEENUMPROC pFunc, void *pParam);
+
+ STDMETHODIMP_(BOOL) GetContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
+ STDMETHODIMP_(BOOL) GetContactSettingStr(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
+ STDMETHODIMP_(BOOL) GetContactSettingStatic(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
+ STDMETHODIMP_(BOOL) FreeVariant(DBVARIANT *dbv);
+ STDMETHODIMP_(BOOL) WriteContactSetting(MCONTACT contactID, DBCONTACTWRITESETTING *dbcws);
+ STDMETHODIMP_(BOOL) DeleteContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting);
+ STDMETHODIMP_(BOOL) EnumContactSettings(MCONTACT contactID, DBCONTACTENUMSETTINGS* dbces);
+ STDMETHODIMP_(BOOL) SetSettingResident(BOOL bIsResident, const char *pszSettingName);
+ STDMETHODIMP_(BOOL) EnumResidentSettings(DBMODULEENUMPROC pFunc, void *pParam);
+ STDMETHODIMP_(BOOL) IsSettingEncrypted(LPCSTR szModule, LPCSTR szSetting);
protected:
- STDMETHODIMP_(BOOL) Start(DBCHeckCallback *callback);
- STDMETHODIMP_(BOOL) CheckDb(int phase, int firstTime);
- STDMETHODIMP_(VOID) Destroy();
+ STDMETHODIMP_(BOOL) Start(DBCHeckCallback *callback);
+ STDMETHODIMP_(BOOL) CheckDb(int phase, int firstTime);
+ STDMETHODIMP_(VOID) Destroy();
protected:
DWORD GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc, DWORD ofsContact, DWORD ofsModuleName);
diff --git a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp index cf8587611e..0a28996127 100644 --- a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp +++ b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp @@ -1,6 +1,6 @@ #include "headers.h"
-static BOOL Convert(HANDLE hContact, char* module, char* setting, int value, int toType) // 0 = byte, 1 = word, 2 = dword, 3 = string
+static BOOL Convert(HCONTACT hContact, char* module, char* setting, int value, int toType) // 0 = byte, 1 = word, 2 = dword, 3 = string
{
int Result = 1;
char temp[64];
@@ -30,7 +30,7 @@ static BOOL Convert(HANDLE hContact, char* module, char* setting, int value, int }
-BOOL convertSetting(HANDLE hContact, char* module, char* setting, int toType) // 0 = byte, 1 = word, 2 = dword, 3 = string, 4 = unicode
+BOOL convertSetting(HCONTACT hContact, char* module, char* setting, int toType) // 0 = byte, 1 = word, 2 = dword, 3 = string, 4 = unicode
{
DBVARIANT dbv = {0};
BOOL Result = 0;
@@ -419,7 +419,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l return 0;
}
-void editSetting(HANDLE hContact, char* module, char* setting)
+void editSetting(HCONTACT hContact, char* module, char* setting)
{
DBVARIANT dbv = {0}; // freed in the dialog
if (!GetSetting(hContact,module, setting, &dbv))
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp index e3884fb123..db23d4ab21 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -1,6 +1,6 @@ #include "headers.h"
-void copyModule(char* module, HANDLE hContactFrom, HANDLE hContactTo)
+void copyModule(char* module, HCONTACT hContactFrom, HCONTACT hContactTo)
{
ModuleSettingLL msll;
@@ -44,7 +44,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara {
int index, loaded;
char szProto[256];
- 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 (GetValue(hContact,"Protocol","p",szProto,SIZEOF(szProto)))
loaded = IsProtocolLoaded(szProto);
else
@@ -100,12 +100,12 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara case IDOK:
if (!IsDlgButtonChecked(hwnd,CHK_COPY2ALL)) {
- HANDLE hContact = (HANDLE)SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETITEMDATA, SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETCURSEL, 0, 0), 0);
+ HCONTACT hContact = (HCONTACT)SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETITEMDATA, SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETCURSEL, 0, 0), 0);
copyModule(mac->module, mac->hContact, hContact);
}
else {
SetCursor(LoadCursor(NULL,IDC_WAIT));
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
copyModule(mac->module, mac->hContact, hContact);
SetCursor(LoadCursor(NULL,IDC_ARROW));
@@ -124,7 +124,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara return 0;
}
-void copyModuleMenuItem(char* module, HANDLE hContact)
+void copyModuleMenuItem(char* module, HCONTACT hContact)
{
ModuleAndContact *mac = (ModuleAndContact *)mir_calloc(sizeof(ModuleAndContact));
mac->hContact = hContact;
diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp index 188f96460d..73d277e100 100644 --- a/plugins/DbEditorPP/src/deletemodule.cpp +++ b/plugins/DbEditorPP/src/deletemodule.cpp @@ -3,7 +3,7 @@ static int working;
static HWND hwnd2Delete = NULL;
-int deleteModule(char* module, HANDLE hContact, int fromMenu)
+int deleteModule(char* module, HCONTACT hContact, int fromMenu)
{
char msg[1024];
ModuleSettingLL settinglist;
@@ -47,7 +47,7 @@ void __cdecl PopulateModuleDropListThreadFunc(LPVOID di) module = module->next;
continue;
}
- for (HANDLE hContact = db_find_first();moduleEmpty && hContact;hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first();moduleEmpty && hContact;hContact = db_find_next(hContact)) {
if (!IsModuleEmpty(hContact,module->name)) {
SendDlgItemMessage(hwnd,IDC_CONTACTS,CB_ADDSTRING,0,(LPARAM)module->name);
moduleEmpty = 0;
@@ -94,7 +94,7 @@ INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM char text[128];
GetDlgItemText(hwnd,IDC_CONTACTS,text,128);
SetCursor(LoadCursor(NULL,IDC_WAIT));
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
deleteModule(text,hContact,1);
// do the null
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index 4a438546d2..aaae21dcd1 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -81,7 +81,7 @@ char* StrReplace (char* Search, char* Replace, char* Resource) return Resource;
}
-void exportModule(HANDLE hContact, char* module, FILE* file)
+void exportModule(HCONTACT hContact, char* module, FILE* file)
{
char tmp[32];
ModuleSettingLL settinglist;
@@ -152,7 +152,7 @@ void exportModule(HANDLE hContact, char* module, FILE* file) FreeModuleSettingLL(&settinglist);
}
-char *NickFromHContact(HANDLE hContact)
+char *NickFromHContact(HCONTACT hContact)
{
static char nick[512] = "";
@@ -193,7 +193,7 @@ char *NickFromHContact(HANDLE hContact) return nick;
}
-void exportDB(HANDLE hContact, char* module) // hContact == -1 export entire db. module == NULL export entire contact.
+void exportDB(HCONTACT hContact, char* module) // hContact == -1 export entire db. module == NULL export entire contact.
{ // hContact == -1, module == "" - all contacts
FILE* file = NULL;
char fileName[MAX_PATH];
@@ -326,20 +326,20 @@ void exportDB(HANDLE hContact, char* module) // hContact == -1 export entire db. FreeModuleSettingLL(&modlist);
}
-HANDLE CheckNewContact(char *myProto, char *uid, char *myName)
+HCONTACT CheckNewContact(char *myProto, char *uid, char *myName)
{
char szProto[256], szName[256];
- 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 (DBGetContactSettingStringStatic(hContact, "Protocol", "p", szProto, 256))
if (!mir_strcmp(szProto, myProto))
if (GetValue(hContact, szProto, uid, szName, SIZEOF(szName)) && !mir_strcmp(szName, myName))
return hContact;
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
}
-void importSettings(HANDLE hContact, char *importstring )
+void importSettings(HCONTACT hContact, char *importstring )
{
char module[256] = "", setting[256] = "", *end;
int i=0, value, type;
@@ -364,7 +364,7 @@ void importSettings(HANDLE hContact, char *importstring ) else if (!strncmp(&importstring[i],"CONTACT:", strlen("CONTACT:")))
{
int len, add = 1;
- hContact = INVALID_HANDLE_VALUE;
+ hContact = (HCONTACT)INVALID_HANDLE_VALUE;
i = i + (int)strlen("CONTACT:");
len = (int)strlen(&importstring[i]);
@@ -405,7 +405,7 @@ void importSettings(HANDLE hContact, char *importstring ) if (hContact == INVALID_HANDLE_VALUE)
{
- HANDLE temp = (HANDLE)CallService(MS_DB_CONTACT_ADD,0,0);
+ HCONTACT temp = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (temp)
hContact = temp;
}
@@ -566,7 +566,7 @@ INT_PTR CALLBACK ImportDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam case IDOK:
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwnd,GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_TEXT));
char *string;
if (length)
@@ -591,7 +591,7 @@ INT_PTR CALLBACK ImportDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam return 0;
}
-void ImportSettingsMenuItem(HANDLE hContact)
+void ImportSettingsMenuItem(HCONTACT hContact)
{
if (hwnd2importWindow)
DestroyWindow(hwnd2importWindow);
@@ -625,7 +625,7 @@ BOOL Exists(LPCTSTR strName) return GetFileAttributes(strName) != INVALID_FILE_ATTRIBUTES;
}
-void ImportSettingsFromFileMenuItem(HANDLE hContact, char* FilePath)
+void ImportSettingsFromFileMenuItem(HCONTACT hContact, char* FilePath)
{
char szFileNames[MAX_PATH*10] = {0};
char szPath[MAX_PATH] = "";
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp index 6ac376233d..2f0f27e33a 100644 --- a/plugins/DbEditorPP/src/findwindow.cpp +++ b/plugins/DbEditorPP/src/findwindow.cpp @@ -178,7 +178,7 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP return 0;
}
-void ItemFound(HWND hwnd, HANDLE hContact,const char *module,const char *setting,const char* value,int type)
+void ItemFound(HWND hwnd, HCONTACT hContact,const char *module,const char *setting,const char* value,int type)
{
ItemInfo *ii = (ItemInfo*)mir_calloc(sizeof(ItemInfo));
if (!ii) return;
@@ -262,7 +262,7 @@ char* multiReplace(const char* value, const char *find, const char *replace, int return mir_tstrdup(value);
}
-int replaceValue(HWND hwnd, HANDLE hContact, const char *module, const char *setting, DBVARIANT *dbv, const char *find, const char *replace, int mode)
+int replaceValue(HWND hwnd, HCONTACT hContact, const char *module, const char *setting, DBVARIANT *dbv, const char *find, const char *replace, int mode)
{
int count = 0;
DWORD num = 0;
@@ -334,7 +334,7 @@ int replaceValue(HWND hwnd, HANDLE hContact, const char *module, const char *set return count;
}
-int replaceSetting(HWND hwnd, HANDLE hContact, const char *module, const char *setting, DBVARIANT *dbv, const char *find, const char *replace, int mode)
+int replaceSetting(HWND hwnd, HCONTACT hContact, const char *module, const char *setting, DBVARIANT *dbv, const char *find, const char *replace, int mode)
{
char *szSetting;
ptrA myreplace;
@@ -370,7 +370,7 @@ int replaceSetting(HWND hwnd, HANDLE hContact, const char *module, const char *s }
-int replaceModule(HWND hwnd, HANDLE hContact, const char *module, const char *find, const char *replace, int mode)
+int replaceModule(HWND hwnd, HCONTACT hContact, const char *module, const char *find, const char *replace, int mode)
{
ModuleSettingLL msll;
ModSetLinkLinkItem *setting;
@@ -468,7 +468,7 @@ void __cdecl FindSettings(LPVOID di) int options = ((FindInfo*)di)->options;
ModuleSettingLL ModuleList, SettingList;
ModSetLinkLinkItem *module, *setting;
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv = { 0 };
int caseSensitive = options & FW_CASE;
int exactMatch = options & FW_EXACT;
diff --git a/plugins/DbEditorPP/src/headers.h b/plugins/DbEditorPP/src/headers.h index d5bf500565..4e3a2f8b9f 100644 --- a/plugins/DbEditorPP/src/headers.h +++ b/plugins/DbEditorPP/src/headers.h @@ -57,7 +57,7 @@ HICON LoadSkinnedDBEIcon(int icon); int AddIconToList(HIMAGELIST hil, HICON hIcon);
void AddProtoIconsToList(HIMAGELIST hil, int newshift);
int GetProtoIcon(char *szProto);
-extern HANDLE hRestore;
+extern HCONTACT hRestore;
extern HGENMENU hUserMenu;
/////////////////////
@@ -109,11 +109,11 @@ extern HGENMENU hUserMenu; typedef struct {
int type; // from above types
- HANDLE hContact;
+ HCONTACT hContact;
} ModuleTreeInfoStruct;
typedef struct {
- HANDLE hContact;
+ HCONTACT hContact;
char* module;
HWND hwnd2Edit;
int selectedItem; // item that is currently selected
@@ -125,7 +125,7 @@ typedef struct { struct DBsetting {
DBVARIANT dbv;
- HANDLE hContact;
+ HCONTACT hContact;
char *module;
char *setting;
int WatchModule; // above defines
@@ -133,7 +133,7 @@ struct DBsetting { typedef struct {
char module[256];
- HANDLE hContact;
+ HCONTACT hContact;
} ModuleAndContact;
// find window
@@ -143,7 +143,7 @@ typedef struct { typedef struct {
int type; // above types
- HANDLE hContact;
+ HCONTACT hContact;
char module[256];
char setting[256];
} ItemInfo;
@@ -182,67 +182,67 @@ extern BOOL usePopups; #define HEX_DWORD 4
//main.c
-int DBGetContactSettingStringStatic(HANDLE hContact, char* szModule, char* szSetting, char* value, int maxLength);
-int WriteBlobFromString(HANDLE hContact,const char *szModule,const char *szSetting, const char *Value, int len);
-int GetSetting(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
-int GetValue(HANDLE hContact, const char* szModule, const char* szSetting, char* Value, int length);
-int GetValueW(HANDLE hContact, const char* szModule, const char* szSetting, WCHAR* Value, int length);
+int DBGetContactSettingStringStatic(HCONTACT hContact, char* szModule, char* szSetting, char* value, int maxLength);
+int WriteBlobFromString(HCONTACT hContact,const char *szModule,const char *szSetting, const char *Value, int len);
+int GetSetting(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
+int GetValue(HCONTACT hContact, const char* szModule, const char* szSetting, char* Value, int length);
+int GetValueW(HCONTACT hContact, const char* szModule, const char* szSetting, WCHAR* Value, int length);
char* u2a( wchar_t* src );
wchar_t *a2u( char* src , wchar_t *buffer, int len );
-WCHAR *GetContactName(HANDLE hContact, const char *szProto, int unicode);
+WCHAR *GetContactName(HCONTACT hContact, const char *szProto, int unicode);
BOOL IsProtocolLoaded(char* pszProtocolName);
// main_window.c
INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
// modules.c
-int deleteModule(char* module, HANDLE hContact, int fromMenu);
+int deleteModule(char* module, HCONTACT hContact, int fromMenu);
void deleteModuleGui();
-void renameModule(char* oldName, char* newName, HANDLE hContact);
+void renameModule(char* oldName, char* newName, HCONTACT hContact);
INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-int CloneContact(HANDLE hContact);
+int CloneContact(HCONTACT hContact);
// moduletree.c
-void replaceTreeItem(HWND hwnd, HANDLE hContact, const char *module, const char *newModule);
+void replaceTreeItem(HWND hwnd, HCONTACT hContact, const char *module, const char *newModule);
void refreshTree(BOOL restore);
void __cdecl PopulateModuleTreeThreadFunc(LPVOID di);
-void freeTree(HWND hwnd2Tree, HANDLE hContact);
-int findItemInTree(HWND hwnd2Tree, HANDLE hContact, char* module);
+void freeTree(HWND hwnd2Tree, HCONTACT hContact);
+int findItemInTree(HWND hwnd2Tree, HCONTACT hContact, char* module);
// settinglist.c
void setupSettingsList(HWND hwnd2List);
void saveListSettings(HWND hwnd2List);
void ClearListview(HWND hwnd2Settings);
-void DeleteSettingsFromList(HWND hSettings, HANDLE hContact, char *module, char *setting);
-void PopulateSettings(HWND hwnd2Settings, HANDLE hContact, char* module);
+void DeleteSettingsFromList(HWND hSettings, HCONTACT hContact, char *module, char *setting);
+void PopulateSettings(HWND hwnd2Settings, HCONTACT hContact, char* module);
void SelectSetting(char* setting);
// addeditsettingsdlg.c
INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-void editSetting(HANDLE hContact, char* module, char* setting);
-BOOL convertSetting(HANDLE hContact, char* module, char* setting, int toType); // 0 = byte, 1 = word, 2 = dword, 3 = string
+void editSetting(HCONTACT hContact, char* module, char* setting);
+BOOL convertSetting(HCONTACT hContact, char* module, char* setting, int toType); // 0 = byte, 1 = word, 2 = dword, 3 = string
// exportimport.c
-void exportDB(HANDLE hContact, char* module); // hContact == -1 export entire db. module == NULL export entire contact
-void ImportSettingsMenuItem(HANDLE hContact);
-void ImportSettingsFromFileMenuItem(HANDLE hContact, char* FilePath);
+void exportDB(HCONTACT hContact, char* module); // hContact == -1 export entire db. module == NULL export entire contact
+void ImportSettingsMenuItem(HCONTACT hContact);
+void ImportSettingsFromFileMenuItem(HCONTACT hContact, char* FilePath);
// find window.c
INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
// copymodule.c
-void copyModuleMenuItem(char* module, HANDLE hContact);
-void copyModule(char* module, HANDLE hContactFrom, HANDLE hContactTo);
+void copyModuleMenuItem(char* module, HCONTACT hContact);
+void copyModule(char* module, HCONTACT hContactFrom, HCONTACT hContactTo);
// options.c
int OptInit(WPARAM wParam,LPARAM lParam);
// watchlist
-int addSettingToWatchList(HANDLE hContact, char* module, char* setting);
+int addSettingToWatchList(HCONTACT hContact, char* module, char* setting);
void freeWatchListItem(int item);
void PopulateWatchedWindow(HWND hwnd);
void freeAllWatches();
INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-void popupWatchedVar(HANDLE hContact,const char* module,const char* setting);
+void popupWatchedVar(HCONTACT hContact,const char* module,const char* setting);
#endif //_COMMONHEADERS_H
\ No newline at end of file diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 642f73bb4d..0c621f7169 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -11,7 +11,7 @@ int hLangpack; BYTE nameOrder[NAMEORDERCOUNT];
HGENMENU hUserMenu;
WatchListArrayStruct WatchListArray;
-HANDLE hRestore;
+HCONTACT hRestore;
HANDLE sMenuCommand, sImport, sServicemodeLaunch;
HANDLE hModulesLoadedHook = NULL, hSettingsChangedHook=NULL, hOptInitHook=NULL, hPreShutdownHook=NULL;
@@ -51,12 +51,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE;
}
-void settingChanged(HWND hwnd2Settings, HANDLE hContact, char* module, char* setting);
+void settingChanged(HWND hwnd2Settings, HCONTACT hContact, char* module, char* setting);
int DBSettingChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
char *setting;
SettingListInfo* info;
@@ -106,7 +106,7 @@ int DBSettingChanged(WPARAM wParam,LPARAM lParam) INT_PTR DBEditorppMenuCommand(WPARAM wParam, LPARAM lParam)
{
if (!hwnd2mainWindow) { // so only opens 1 at a time
- hRestore = (HANDLE)wParam;
+ hRestore = (HCONTACT)wParam;
SetCursor(LoadCursor(NULL,IDC_WAIT));
CreateDialog(hInst, MAKEINTRESOURCE(IDD_MAIN), 0, MainDlgProc);
}
@@ -114,7 +114,7 @@ INT_PTR DBEditorppMenuCommand(WPARAM wParam, LPARAM lParam) ShowWindow(hwnd2mainWindow, SW_RESTORE);
SetForegroundWindow(hwnd2mainWindow);
if (!hRestore && wParam) {
- hRestore = (HANDLE)wParam;
+ hRestore = (HCONTACT)wParam;
refreshTree(4);
}
}
@@ -225,7 +225,7 @@ INT_PTR ServiceMode(WPARAM wParam, LPARAM lParam) INT_PTR ImportFromFile(WPARAM wParam, LPARAM lParam)
{
- ImportSettingsFromFileMenuItem((HANDLE)wParam, (char*)lParam);
+ ImportSettingsFromFileMenuItem((HCONTACT)wParam, (char*)lParam);
return 0;
}
@@ -267,7 +267,7 @@ extern "C" __declspec(dllexport) int Unload(void) // db_get_s (prob shouldnt use this unless u know how big the string is gonna be..)
//=======================================================
-int DBGetContactSettingStringStatic(HANDLE hContact, char* szModule, char* szSetting, char* value, int maxLength)
+int DBGetContactSettingStringStatic(HCONTACT hContact, char* szModule, char* szSetting, char* value, int maxLength)
{
DBVARIANT dbv;
if (!db_get(hContact, szModule, szSetting, &dbv)) {
@@ -283,7 +283,7 @@ int DBGetContactSettingStringStatic(HANDLE hContact, char* szModule, char* szSet return 0;
}
-int WriteBlobFromString(HANDLE hContact,const char *szModule,const char *szSetting, const char *szValue, int len)
+int WriteBlobFromString(HCONTACT hContact,const char *szModule,const char *szSetting, const char *szValue, int len)
{
int j=0, i = 0;
BYTE *data = NULL;
@@ -316,12 +316,12 @@ int WriteBlobFromString(HANDLE hContact,const char *szModule,const char *szSetti return 0;
}
-int GetSetting(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
+int GetSetting(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
return db_get_s(hContact, szModule, szSetting, dbv, 0);
}
-int GetValue(HANDLE hContact, const char* szModule, const char* szSetting, char* Value, int length)
+int GetValue(HCONTACT hContact, const char* szModule, const char* szSetting, char* Value, int length)
{
DBVARIANT dbv = {0};
@@ -361,7 +361,7 @@ int GetValue(HANDLE hContact, const char* szModule, const char* szSetting, char* return 0;
}
-int GetValueW(HANDLE hContact, const char* szModule, const char* szSetting, WCHAR* Value, int length)
+int GetValueW(HCONTACT hContact, const char* szModule, const char* szSetting, WCHAR* Value, int length)
{
DBVARIANT dbv = { 0 };
WCHAR *wc;
@@ -435,7 +435,7 @@ wchar_t* a2u(char* src, wchar_t *buffer, int len) return result;
}
-int GetDatabaseString(HANDLE hContact, const char *szModule, const char* szSetting, WCHAR *Value, int length, BOOL unicode)
+int GetDatabaseString(HCONTACT hContact, const char *szModule, const char* szSetting, WCHAR *Value, int length, BOOL unicode)
{
if (unicode)
return GetValueW(hContact, szModule, szSetting, Value, length);
@@ -443,7 +443,7 @@ int GetDatabaseString(HANDLE hContact, const char *szModule, const char* szSetti return GetValue(hContact, szModule, szSetting, (char*)Value, length);
}
-WCHAR* GetContactName(HANDLE hContact, const char *szProto, int unicode)
+WCHAR* GetContactName(HCONTACT hContact, const char *szProto, int unicode)
{
int i, r = 0;
static WCHAR res[512];
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index 087fd2405b..714a5cfed2 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -113,7 +113,7 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM tvi.cchTextMax = 255;
if (TreeView_GetItem(hwnd,&tvi) && tvi.lParam) {
ModuleTreeInfoStruct *mtis = (ModuleTreeInfoStruct*)tvi.lParam;
- HANDLE hContact = mtis->hContact;
+ HCONTACT hContact = mtis->hContact;
if (wParam == VK_DELETE) {
if ((mtis->type) & MODULE) {
if (deleteModule(module, hContact,0)) {
@@ -161,7 +161,7 @@ static LRESULT CALLBACK SettingListSubclassProc(HWND hwnd,UINT msg,WPARAM wParam case WM_KEYDOWN:
if (wParam == VK_DELETE || wParam == VK_F5 || (wParam == VK_F2 && ListView_GetSelectedCount(hwnd) == 1)) {
char *module, setting[256];
- HANDLE hContact;
+ HCONTACT hContact;
SettingListInfo* sli = (SettingListInfo*)GetWindowLongPtr(hwnd,GWLP_USERDATA);
if (!sli) break;
hContact = sli->hContact;
@@ -369,7 +369,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (item = TreeView_GetSelection(hwnd2Tree)) {
int type = MODULE;
TVITEM tvi = {0};
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
tvi.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT;
tvi.pszText = module;
tvi.cchTextMax = 255;
@@ -470,10 +470,10 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) freeAllWatches();
break;
case MENU_EXPORTDB: // all db
- exportDB(INVALID_HANDLE_VALUE,0);
+ exportDB((HCONTACT)INVALID_HANDLE_VALUE, 0);
break;
case MENU_EXPORTCONTACT: // all contacts
- exportDB(INVALID_HANDLE_VALUE, "");
+ exportDB((HCONTACT)INVALID_HANDLE_VALUE, "");
break;
case MENU_EXPORTMODULE: // all settings
exportDB(NULL, 0);
diff --git a/plugins/DbEditorPP/src/modsettingenum.cpp b/plugins/DbEditorPP/src/modsettingenum.cpp index 96d198b682..dfc4c82a51 100644 --- a/plugins/DbEditorPP/src/modsettingenum.cpp +++ b/plugins/DbEditorPP/src/modsettingenum.cpp @@ -56,7 +56,7 @@ int enumSettingsProc(const char *szSetting, LPARAM lParam) return enumModulesSettingsProc(szSetting, 0, lParam);
}
-int EnumSettings(HANDLE hContact, char* module, ModuleSettingLL *msll)
+int EnumSettings(HCONTACT hContact, char* module, ModuleSettingLL *msll)
{
DBCONTACTENUMSETTINGS dbces;
// enum all setting the contact has for the module
@@ -73,7 +73,7 @@ int CheckIfModuleIsEmptyProc(const char *szSetting, LPARAM lParam) return 1;
}
-int IsModuleEmpty(HANDLE hContact, char* szModule)
+int IsModuleEmpty(HCONTACT hContact, char* szModule)
{
DBCONTACTENUMSETTINGS dbces;
dbces.pfnEnumProc = CheckIfModuleIsEmptyProc;
diff --git a/plugins/DbEditorPP/src/modsettingenum.h b/plugins/DbEditorPP/src/modsettingenum.h index 633d2d1470..145202575f 100644 --- a/plugins/DbEditorPP/src/modsettingenum.h +++ b/plugins/DbEditorPP/src/modsettingenum.h @@ -11,8 +11,8 @@ struct ModuleSettingLL };
int EnumModules(ModuleSettingLL *msll);
-int EnumSettings(HANDLE hContact, char *module, ModuleSettingLL *msll);
+int EnumSettings(HCONTACT hContact, char *module, ModuleSettingLL *msll);
void FreeModuleSettingLL(ModuleSettingLL *msll);
-int IsModuleEmpty(HANDLE hContact, char *szModule);
+int IsModuleEmpty(HCONTACT hContact, char *szModule);
diff --git a/plugins/DbEditorPP/src/modules.cpp b/plugins/DbEditorPP/src/modules.cpp index 603b601307..b0765bd9b0 100644 --- a/plugins/DbEditorPP/src/modules.cpp +++ b/plugins/DbEditorPP/src/modules.cpp @@ -1,6 +1,6 @@ #include "headers.h"
-void renameModule(char* oldName, char* newName, HANDLE hContact)
+void renameModule(char* oldName, char* newName, HCONTACT hContact)
{
DBVARIANT dbv;
ModuleSettingLL settinglist;
@@ -56,10 +56,10 @@ INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam if (IsDlgButtonChecked(hwnd, CHK_ADD2ALL)) {
// null contact
db_set_b(NULL, modulename, "(Default)", 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))
db_set_b(hContact, modulename, "(Default)", 0);
}
- else db_set_b((HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA), modulename, "(Default)", 0);
+ else db_set_b((HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA), modulename, "(Default)", 0);
refreshTree(1);
}
@@ -72,9 +72,9 @@ INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam return 0;
}
-int CloneContact(HANDLE hContact)
+int CloneContact(HCONTACT hContact)
{
- HANDLE newContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT newContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (!newContact)
return 0;
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp index bcbc1ac109..2f3c1d13f4 100644 --- a/plugins/DbEditorPP/src/moduletree.cpp +++ b/plugins/DbEditorPP/src/moduletree.cpp @@ -6,7 +6,7 @@ static ModuleTreeInfoStruct contacts_mtis = {CONTACT_ROOT_ITEM, 0}; static ModuleTreeInfoStruct settings_mtis = {CONTACT, 0};
-int doContacts(HWND hwnd2Tree,HTREEITEM contactsRoot,ModuleSettingLL *modlist, HANDLE hSelectedContact, char *SelectedModule, char *SelectedSetting)
+int doContacts(HWND hwnd2Tree, HTREEITEM contactsRoot, ModuleSettingLL *modlist, HCONTACT hSelectedContact, char *SelectedModule, char *SelectedSetting)
{
TVINSERTSTRUCT tvi;
HTREEITEM contact;
@@ -23,7 +23,7 @@ int doContacts(HWND hwnd2Tree,HTREEITEM contactsRoot,ModuleSettingLL *modlist, H tvi.hInsertAfter = TVI_SORT;
tvi.item.cChildren = 1;
- for (HANDLE hContact = db_find_first(); hContact && hwnd2mainWindow; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact && hwnd2mainWindow; hContact = db_find_next(hContact)) {
char szProto[100];
if (DBGetContactSettingStringStatic(hContact, "Protocol", "p", szProto, SIZEOF(szProto))) {
icon = GetProtoIcon(szProto);
@@ -61,8 +61,7 @@ int doContacts(HWND hwnd2Tree,HTREEITEM contactsRoot,ModuleSettingLL *modlist, H else
protoW[0] = 0;
- if (!szProto || !loaded)
- {
+ if (!szProto || !loaded) {
tvi.item.iSelectedImage = (tvi.item.iImage = 4);
if (protoW) {
@@ -125,7 +124,7 @@ void doItems(HWND hwnd2Tree,ModuleSettingLL *modlist, int count) {
TVINSERTSTRUCT tvi;
TVITEM item ={0};
- HANDLE hContact;
+ HCONTACT hContact;
ModuleTreeInfoStruct *lParam;
ModSetLinkLinkItem *module;
char percent[96], title[64];
@@ -184,7 +183,7 @@ void doItems(HWND hwnd2Tree,ModuleSettingLL *modlist, int count) SetWindowText(hwnd, TranslateT("Database Editor++"));
}
-int findItemInTree(HWND hwnd2Tree, HANDLE hContact, char* module)
+int findItemInTree(HWND hwnd2Tree, HCONTACT hContact, char* module)
/* the following code to go through the whole tree is nicked from codeguru..
http://www.codeguru.com/Cpp/controls/treeview/treetraversal/comments.php/c683/?thread=7680 */
{
@@ -219,7 +218,7 @@ int findItemInTree(HWND hwnd2Tree, HANDLE hContact, char* module) return -1;
}
-void freeTree(HWND hwnd2Tree, HANDLE hContact)
+void freeTree(HWND hwnd2Tree, HCONTACT hContact)
/* the following code to go through the whole tree is nicked from codeguru..
http://www.codeguru.com/Cpp/controls/treeview/treetraversal/comments.php/c683/?thread=7680 */
{
@@ -257,7 +256,7 @@ void freeTree(HWND hwnd2Tree, HANDLE hContact) while (item.hItem);
}
-BOOL findAndRemoveDuplicates(HWND hwnd2Tree, HANDLE hContact, char* module)
+BOOL findAndRemoveDuplicates(HWND hwnd2Tree, HCONTACT hContact, char* module)
/* the following code to go through the whole tree is nicked from codeguru..
http://www.codeguru.com/Cpp/controls/treeview/treetraversal/comments.php/c683/?thread=7680 */
{
@@ -307,7 +306,7 @@ BOOL findAndRemoveDuplicates(HWND hwnd2Tree, HANDLE hContact, char* module) }
-void replaceTreeItem(HWND hwnd, HANDLE hContact, const char *module, const char *newModule)
+void replaceTreeItem(HWND hwnd, HCONTACT hContact, const char *module, const char *newModule)
{
int hItem = findItemInTree(hwnd, hContact, (char*)module);
HTREEITEM hParent;
@@ -361,8 +360,8 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di) HWND hwnd2Tree = GetDlgItem(hwnd2mainWindow,IDC_MODULES);
char SelectedModule[256] = {0};
char SelectedSetting[256] = {0};
- HANDLE hSelectedContact = hRestore;
- HANDLE hContact;
+ HCONTACT hSelectedContact = hRestore;
+ HCONTACT hContact;
HTREEITEM contact, contactsRoot;
int count;
@@ -403,7 +402,7 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di) }
case 2: // restore saved
if (GetValue(NULL,modname,"LastModule",SelectedModule,SIZEOF(SelectedModule))) {
- hSelectedContact = (HANDLE)db_get_dw(NULL,modname,"LastContact",(DWORD)INVALID_HANDLE_VALUE);
+ hSelectedContact = (HCONTACT)db_get_dw(NULL, modname, "LastContact", (DWORD)INVALID_HANDLE_VALUE);
if (hSelectedContact != INVALID_HANDLE_VALUE)
Select = 1;
GetValue(NULL,modname,"LastSetting",SelectedSetting,SIZEOF(SelectedSetting));
@@ -558,7 +557,7 @@ void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd HWND hwnd2Tree = GetDlgItem(hwnd2mainWindow,IDC_MODULES);
ModSetLinkLinkItem *module;
ModuleSettingLL modlist;
- HANDLE hContact = mtis->hContact;
+ HCONTACT hContact = mtis->hContact;
mtis->type = CONTACT;
@@ -599,7 +598,7 @@ void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam;
TVITEM tvi = {0};
char text[264];
- HANDLE hContact;
+ HCONTACT hContact;
HWND hwnd2Settings = GetDlgItem(hwnd, IDC_SETTINGS);
tvi.mask = TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT;
tvi.hItem = pnmtv->itemNew.hItem;
@@ -768,7 +767,7 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
if (tvi.lParam) {
ModuleTreeInfoStruct *mtis = (ModuleTreeInfoStruct *)tvi.lParam;
- HANDLE hContact = mtis->hContact;
+ HCONTACT hContact = mtis->hContact;
GetCursorPos(&(hti.pt));
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXTMENU));
TranslateMenu(hMenu);
@@ -830,7 +829,7 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i break;
case MENU_EXPORTDB:
- exportDB(INVALID_HANDLE_VALUE, module);
+ exportDB((HCONTACT)INVALID_HANDLE_VALUE, module);
break;
}
}
@@ -908,7 +907,7 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i case 4: // Contacts root
switch ( TrackPopupMenu(hSubMenu, TPM_RETURNCMD, hti.pt.x, hti.pt.y, 0, hwnd, NULL)) {
case MENU_EXPORTCONTACT:
- exportDB(INVALID_HANDLE_VALUE, "");
+ exportDB((HCONTACT)INVALID_HANDLE_VALUE, "");
break;
case MENU_IMPORTFROMTEXT:
ImportSettingsMenuItem(NULL);
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index fee9442032..d98f8a0144 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -53,7 +53,7 @@ void ClearListview(HWND hwnd2Settings) ListView_DeleteAllItems(hwnd2Settings);
}
-void DeleteSettingsFromList(HWND hSettings, HANDLE hContact, char *module, char *setting)
+void DeleteSettingsFromList(HWND hSettings, HCONTACT hContact, char *module, char *setting)
{
int count = ListView_GetSelectedCount(hSettings);
@@ -93,7 +93,7 @@ void DeleteSettingsFromList(HWND hSettings, HANDLE hContact, char *module, char }
}
-void additem(HWND hwnd2Settings,HANDLE hContact, char* module, char* setting, int index)
+void additem(HWND hwnd2Settings,HCONTACT hContact, char* module, char* setting, int index)
{
char *data = NULL;
LVITEM lvi;
@@ -213,7 +213,7 @@ void additem(HWND hwnd2Settings,HANDLE hContact, char* module, char* setting, in mir_free(data);
}
-void PopulateSettings(HWND hwnd2Settings, HANDLE hContact, char* module)
+void PopulateSettings(HWND hwnd2Settings, HCONTACT hContact, char* module)
{
SettingListInfo* info = (SettingListInfo*)mir_calloc(sizeof(SettingListInfo));
LVITEM lvItem;
@@ -270,7 +270,7 @@ void SelectSetting(char *setting) }
}
-void settingChanged(HWND hwnd2Settings, HANDLE hContact, char* module, char* setting)
+void settingChanged(HWND hwnd2Settings, HCONTACT hContact, char* module, char* setting)
{
LVITEM lvItem;
LVFINDINFO lvfi;
@@ -296,7 +296,7 @@ static WNDPROC SettingLabelEditSubClass; struct EditLabelInfoStruct
{
- HANDLE hContact;
+ HCONTACT hContact;
char module[256];
char setting[256];
int item;
@@ -762,7 +762,7 @@ void SettingsListRightClick(HWND hwnd, WPARAM wParam, LPARAM lParam) // hwnd her return;
char setting[256], *module;
- HANDLE hContact;
+ HCONTACT hContact;
LVHITTESTINFO hti;
POINT pt;
HMENU hMenu, hSubMenu;
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index 40d5404229..f4dc64f79e 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -1,6 +1,6 @@ #include "headers.h"
-int addSettingToWatchList(HANDLE hContact, char* module, char* setting)
+int addSettingToWatchList(HCONTACT hContact, char* module, char* setting)
{
if (WatchListArray.count == WatchListArray.size)
{
@@ -36,7 +36,7 @@ void addwatchtolist(HWND hwnd2list, struct DBsetting *lParam) int index;
char data[32], tmp[32];
DBVARIANT *dbv = &(lParam->dbv);
- HANDLE hContact = lParam->hContact;
+ HCONTACT hContact = lParam->hContact;
char *module = lParam->module;
char *setting = lParam->setting;
if (!module) return;
@@ -263,7 +263,7 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (ListView_GetItem(GetDlgItem(hwnd,IDC_VARS),&lvi))
{
ItemInfo ii;
- ii.hContact = (HANDLE)lvi.lParam;
+ ii.hContact = (HCONTACT)lvi.lParam;
ListView_GetItemText(GetDlgItem(hwnd,IDC_VARS),hti.iItem,1,ii.module,128);
ListView_GetItemText(GetDlgItem(hwnd,IDC_VARS),hti.iItem,2,ii.setting,128);
ii.type = FW_SETTINGNAME;
@@ -282,7 +282,7 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) }
-void popupWatchedVar(HANDLE hContact,const char* module,const char* setting)
+void popupWatchedVar(HCONTACT hContact,const char* module,const char* setting)
{
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGEDIT));
char lpzContactName[MAX_CONTACTNAME];
@@ -329,7 +329,7 @@ void popupWatchedVar(HANDLE hContact,const char* module,const char* setting) db_free(&dbv);
POPUPDATA ppd = { 0 };
- ppd.lchContact = (HANDLE)hContact;
+ ppd.lchContact = (HCONTACT)hContact;
ppd.lchIcon = hIcon;
lstrcpyn(ppd.lpzContactName, lpzContactName,MAX_CONTACTNAME);
lstrcpyn(ppd.lpzText, lpzText,MAX_SECONDLINE);
diff --git a/plugins/Dbx_tree/src/Compatibility.cpp b/plugins/Dbx_tree/src/Compatibility.cpp index 18b9b6571e..bc42386664 100644 --- a/plugins/Dbx_tree/src/Compatibility.cpp +++ b/plugins/Dbx_tree/src/Compatibility.cpp @@ -774,13 +774,13 @@ STDMETHODIMP_(BOOL) CDataBase::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent return res;
}
-STDMETHODIMP_(HANDLE) CDataBase::GetEventContact(HANDLE hDbEvent)
+STDMETHODIMP_(MCONTACT) CDataBase::GetEventContact(HANDLE hDbEvent)
{
TDBTEntityHandle res = DBEventGetEntity((WPARAM)hDbEvent, 0);
if (res == getEntities().getRootEntity())
res = 0;
- return (HANDLE)res;
+ return res;
}
STDMETHODIMP_(HANDLE) CDataBase::FindFirstEvent(MCONTACT contactID)
diff --git a/plugins/Dbx_tree/src/DataBase.h b/plugins/Dbx_tree/src/DataBase.h index b19ceebb1c..6f3cc07b6e 100644 --- a/plugins/Dbx_tree/src/DataBase.h +++ b/plugins/Dbx_tree/src/DataBase.h @@ -193,40 +193,40 @@ public: // services void CreateDbService(const char *szServiceName, DbServiceFunc pFunc);
protected: // to be compatible with the standard Miranda databases
- STDMETHODIMP_(void) SetCacheSafetyMode(BOOL);
+ STDMETHODIMP_(void) SetCacheSafetyMode(BOOL);
- STDMETHODIMP_(LONG) GetContactCount(void);
+ STDMETHODIMP_(LONG) GetContactCount(void);
STDMETHODIMP_(MCONTACT) FindFirstContact(const char* szProto = NULL);
STDMETHODIMP_(MCONTACT) FindNextContact(MCONTACT contactID, const char* szProto = NULL);
- STDMETHODIMP_(LONG) DeleteContact(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) AddContact(void);
- STDMETHODIMP_(BOOL) IsDbContact(MCONTACT contactID);
-
- STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(LONG) GetBlobSize(HANDLE hDbEvent);
- STDMETHODIMP_(BOOL) GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) GetEventContact(HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindFirstEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindFirstUnreadEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindLastEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindNextEvent(HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindPrevEvent(HANDLE hDbEvent);
-
- STDMETHODIMP_(BOOL) EnumModuleNames(DBMODULEENUMPROC pFunc, void *pParam);
-
- STDMETHODIMP_(BOOL) GetContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
- STDMETHODIMP_(BOOL) GetContactSettingStr(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
- STDMETHODIMP_(BOOL) GetContactSettingStatic(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
- STDMETHODIMP_(BOOL) FreeVariant(DBVARIANT *dbv);
- STDMETHODIMP_(BOOL) WriteContactSetting(MCONTACT contactID, DBCONTACTWRITESETTING *dbcws);
- STDMETHODIMP_(BOOL) DeleteContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting);
- STDMETHODIMP_(BOOL) EnumContactSettings(MCONTACT contactID, DBCONTACTENUMSETTINGS* dbces);
- STDMETHODIMP_(BOOL) SetSettingResident(BOOL bIsResident, const char *pszSettingName);
- STDMETHODIMP_(BOOL) EnumResidentSettings(DBMODULEENUMPROC pFunc, void *pParam);
- STDMETHODIMP_(BOOL) IsSettingEncrypted(LPCSTR szModule, LPCSTR szSetting);
+ STDMETHODIMP_(LONG) DeleteContact(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) AddContact(void);
+ STDMETHODIMP_(BOOL) IsDbContact(MCONTACT contactID);
+
+ STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, HANDLE hDbEvent);
+ STDMETHODIMP_(LONG) GetBlobSize(HANDLE hDbEvent);
+ STDMETHODIMP_(BOOL) GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, HANDLE hDbEvent);
+ STDMETHODIMP_(MCONTACT) GetEventContact(HANDLE hDbEvent);
+ STDMETHODIMP_(HANDLE) FindFirstEvent(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) FindFirstUnreadEvent(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) FindLastEvent(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) FindNextEvent(HANDLE hDbEvent);
+ STDMETHODIMP_(HANDLE) FindPrevEvent(HANDLE hDbEvent);
+
+ STDMETHODIMP_(BOOL) EnumModuleNames(DBMODULEENUMPROC pFunc, void *pParam);
+
+ STDMETHODIMP_(BOOL) GetContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
+ STDMETHODIMP_(BOOL) GetContactSettingStr(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
+ STDMETHODIMP_(BOOL) GetContactSettingStatic(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
+ STDMETHODIMP_(BOOL) FreeVariant(DBVARIANT *dbv);
+ STDMETHODIMP_(BOOL) WriteContactSetting(MCONTACT contactID, DBCONTACTWRITESETTING *dbcws);
+ STDMETHODIMP_(BOOL) DeleteContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting);
+ STDMETHODIMP_(BOOL) EnumContactSettings(MCONTACT contactID, DBCONTACTENUMSETTINGS* dbces);
+ STDMETHODIMP_(BOOL) SetSettingResident(BOOL bIsResident, const char *pszSettingName);
+ STDMETHODIMP_(BOOL) EnumResidentSettings(DBMODULEENUMPROC pFunc, void *pParam);
+ STDMETHODIMP_(BOOL) IsSettingEncrypted(LPCSTR szModule, LPCSTR szSetting);
int CheckProto(DBCachedContact *cc, const char *proto);
};
diff --git a/plugins/ExternalAPI/m_ContactSettings.h b/plugins/ExternalAPI/m_ContactSettings.h index 3f58d4cd39..9118a97a0f 100644 --- a/plugins/ExternalAPI/m_ContactSettings.h +++ b/plugins/ExternalAPI/m_ContactSettings.h @@ -26,7 +26,7 @@ typedef struct { int Type; // one of CSIT_ constants; value of this field depends on what settings dialog was opened: contact settings or group settings
union
{
- HANDLE hContact; // used when Type == CSIT_CONTACT
+ HCONTACT hContact; // used when Type == CSIT_CONTACT
int groupID; // used when Type == CSIT_GROUP
};
} CONTACTSETTINGSINIT;
diff --git a/plugins/ExternalAPI/m_account.h b/plugins/ExternalAPI/m_account.h index d8441578eb..88ad067239 100644 --- a/plugins/ExternalAPI/m_account.h +++ b/plugins/ExternalAPI/m_account.h @@ -187,7 +187,7 @@ typedef struct CAccount PSWMRG MessagesAccessSO;
//For clist contact notification
- HANDLE hContact;
+ HCONTACT hContact;
BOOL isCounting;
struct CAccount *Next;
diff --git a/plugins/ExternalAPI/m_flash.h b/plugins/ExternalAPI/m_flash.h index 2718e1982a..868a6cda07 100644 --- a/plugins/ExternalAPI/m_flash.h +++ b/plugins/ExternalAPI/m_flash.h @@ -79,7 +79,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // FLASHAVATAR structure
typedef struct {
- HANDLE hContact; // contact who flash avatar belongs to
+ HCONTACT hContact; // contact who flash avatar belongs to
HWND hWindow; // handle of flash avatar object
HWND hParentWindow; // handle of flash avatar's parent object
TCHAR* cUrl; // url of .swf file
diff --git a/plugins/ExternalAPI/m_ftpfile.h b/plugins/ExternalAPI/m_ftpfile.h index b5e49a0766..6bf82bb469 100644 --- a/plugins/ExternalAPI/m_ftpfile.h +++ b/plugins/ExternalAPI/m_ftpfile.h @@ -43,11 +43,11 @@ Boston, MA 02111-1307, USA. typedef struct
{
- int cbSize; // size of the structure
- HANDLE hContact; // contact handle, can be NULL
- BYTE ftpNum; // number of the FTP server which will be used for upload, can be one of FNUM_* values
- BYTE mode; // upload mode, can be one of FMODE_* values
- DWORD flags; // bitwise OR of the FUPL_* flags above
+ int cbSize; // size of the structure
+ HCONTACT hContact; // contact handle, can be NULL
+ BYTE ftpNum; // number of the FTP server which will be used for upload, can be one of FNUM_* values
+ BYTE mode; // upload mode, can be one of FMODE_* values
+ DWORD flags; // bitwise OR of the FUPL_* flags above
union {
TCHAR **pstzObjects; // pointer to the array of the object(s) to upload, content is determined by MODE value
@@ -66,7 +66,7 @@ typedef struct //
#define MS_FTPFILE_UPLOAD "FTPFile/Upload"
-__inline static INT_PTR FTPFileUploadA(HANDLE hContact, BYTE ftpNum, BYTE mode, char **pszObjects, int objCount)
+__inline static INT_PTR FTPFileUploadA(HCONTACT hContact, BYTE ftpNum, BYTE mode, char **pszObjects, int objCount)
{
FTPUPLOAD ftpu = {0};
ftpu.cbSize = sizeof(ftpu);
@@ -78,7 +78,7 @@ __inline static INT_PTR FTPFileUploadA(HANDLE hContact, BYTE ftpNum, BYTE mode, return CallService(MS_FTPFILE_UPLOAD, 0, (LPARAM)&ftpu);
}
-__inline static INT_PTR FTPFileUploadW(HANDLE hContact, BYTE ftpNum, BYTE mode, wchar_t **pswzObjects, int objCount)
+__inline static INT_PTR FTPFileUploadW(HCONTACT hContact, BYTE ftpNum, BYTE mode, wchar_t **pswzObjects, int objCount)
{
FTPUPLOAD ftpu = {0};
ftpu.cbSize = sizeof(ftpu);
diff --git a/plugins/ExternalAPI/m_ieview.h b/plugins/ExternalAPI/m_ieview.h index e8fa237900..44b8d5201d 100644 --- a/plugins/ExternalAPI/m_ieview.h +++ b/plugins/ExternalAPI/m_ieview.h @@ -161,19 +161,19 @@ typedef struct tagIEVIEWEVENTDATA { #define IEVIEWEVENT_SIZE_V3 36
typedef struct {
- int cbSize; // size of the strusture
- int iType; // one of IEE_* values
- DWORD dwFlags; // one of IEEF_* values
- HWND hwnd; // HWND returned by IEW_CREATE
- HANDLE hContact; // contact
+ int cbSize; // size of the strusture
+ int iType; // one of IEE_* values
+ DWORD dwFlags; // one of IEEF_* values
+ HWND hwnd; // HWND returned by IEW_CREATE
+ HCONTACT hContact; // contact
union {
- HANDLE hDbEventFirst; // first event to log, when IEE_LOG_EVENTS returns it will contain
+ HANDLE hDbEventFirst; // first event to log, when IEE_LOG_EVENTS returns it will contain
// the last event actually logged or NULL if no event was logged (IEE_LOG_EVENTS)
- IEVIEWEVENTDATA *eventData; // the pointer to an array of IEVIEWEVENTDATA objects (IEE_LOG_IEV_EVENTS)
+ IEVIEWEVENTDATA *eventData; // the pointer to an array of IEVIEWEVENTDATA objects (IEE_LOG_IEV_EVENTS)
};
- int count; // number of events to log
- int codepage; // ANSI codepage
- const char *pszProto; // Name of the protocol
+ int count; // number of events to log
+ int codepage; // ANSI codepage
+ const char *pszProto; // Name of the protocol
} IEVIEWEVENT;
#define IEN_NAVIGATE 1 // navigate to the given destination
diff --git a/plugins/ExternalAPI/m_msg_buttonsbar.h b/plugins/ExternalAPI/m_msg_buttonsbar.h index 31d75e84e9..e56bcafd81 100644 --- a/plugins/ExternalAPI/m_msg_buttonsbar.h +++ b/plugins/ExternalAPI/m_msg_buttonsbar.h @@ -79,13 +79,13 @@ typedef struct {
int cbSize;
- POINT pt; // screen coordinates for menus
- char* pszModule; // button owners name
- DWORD dwButtonId; // registered button ID
- HWND hwndFrom; // button parents HWND
- HANDLE hContact; //
- DWORD flags; // BBCF_ flags
- } CustomButtonClickData;
+ POINT pt; // screen coordinates for menus
+ char* pszModule; // button owners name
+ DWORD dwButtonId; // registered button ID
+ HWND hwndFrom; // button parents HWND
+ HCONTACT hContact;
+ DWORD flags; // BBCF_ flags
+} CustomButtonClickData;
//button flags
diff --git a/plugins/ExternalAPI/m_popup2.h b/plugins/ExternalAPI/m_popup2.h index 3ddd798454..c28a94cded 100644 --- a/plugins/ExternalAPI/m_popup2.h +++ b/plugins/ExternalAPI/m_popup2.h @@ -70,7 +70,7 @@ typedef struct DWORD flags;
// miranda bindings
- HANDLE lchContact;
+ HCONTACT lchContact;
HANDLE lchEvent;
// style
@@ -123,7 +123,7 @@ typedef struct // Unicode version of POPUPDATAEX_V2
typedef struct
{
- HANDLE lchContact;
+ HCONTACT lchContact;
HICON lchIcon;
union
{
diff --git a/plugins/ExternalAPI/m_smileyadd.h b/plugins/ExternalAPI/m_smileyadd.h index 1575502817..c0d9aacaa7 100644 --- a/plugins/ExternalAPI/m_smileyadd.h +++ b/plugins/ExternalAPI/m_smileyadd.h @@ -37,7 +37,7 @@ typedef struct //If not found or NULL, "Standard" will be used
unsigned flags; //Flags (SAFLRE_*) that define the behaivior
BOOL disableRedraw; //Parameter have been depricated, have no effect on operation
- HANDLE hContact; //Contact handle
+ HCONTACT hContact; //Contact handle
} SMADD_RICHEDIT3;
//Replace smileys in a rich edit control...
@@ -65,7 +65,7 @@ typedef struct LPARAM targetWParam; //Target WParam to be sent (LParam will be char* to select smiley)
//see the example file.
HWND hwndParent; //Parent window for smiley dialog
- HANDLE hContact; //Contact handle
+ HCONTACT hContact; //Contact handle
} SMADD_SHOWSEL3;
//Show smiley selection window
@@ -85,7 +85,7 @@ typedef struct //NULL if the buttonicon is not defined...
int NumberOfVisibleSmileys; //Number of visible smileys defined.
int NumberOfSmileys; //Number of total smileys defined
- HANDLE hContact; //Contact handle
+ HCONTACT hContact; //Contact handle
} SMADD_INFO2;
//get button smiley icon
@@ -131,7 +131,7 @@ typedef struct unsigned numSmileys; //Number of Smileys found, this parameter filled by SmileyAdd
unsigned oflag; //One of the SAFL_ flags specifies content of the parse results
//this parameter filled by SmileyAdd
- HANDLE hContact; //Contact handle
+ HCONTACT hContact; //Contact handle
} SMADD_BATCHPARSE2;
typedef struct
@@ -237,7 +237,7 @@ typedef struct typedef struct
{
unsigned cbSize; // size of the structure
- HANDLE hContact;
+ HCONTACT hContact;
int type; // 0 - directory, 1 - file;
TCHAR* path; // smiley category name for reference
} SMADD_CONT;
diff --git a/plugins/ExternalAPI/m_spellchecker.h b/plugins/ExternalAPI/m_spellchecker.h index 15386af5dd..d3d4378872 100644 --- a/plugins/ExternalAPI/m_spellchecker.h +++ b/plugins/ExternalAPI/m_spellchecker.h @@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. typedef struct {
int cbSize;
- HANDLE hContact; // The contact to get the settings from, or NULL
+ HCONTACT hContact; // The contact to get the settings from, or NULL
HWND hwnd; // The hwnd of the richedit
char *window_name; // A name for this richedit
} SPELLCHECKER_ITEM;
diff --git a/plugins/ExternalAPI/m_text.h b/plugins/ExternalAPI/m_text.h index a87b7d36f0..3f8007b26d 100644 --- a/plugins/ExternalAPI/m_text.h +++ b/plugins/ExternalAPI/m_text.h @@ -47,7 +47,7 @@ typedef struct _tagMTEXT_interface { #else
HANDLE (DLL_CALLCONV *CreateT) (HANDLE userHandle, char *text);
#endif
- HANDLE (DLL_CALLCONV *CreateEx) (HANDLE userHandle, HANDLE hContact, void *text, DWORD flags);
+ HANDLE (DLL_CALLCONV *CreateEx) (HANDLE userHandle, HCONTACT hContact, void *text, DWORD flags);
int (DLL_CALLCONV *Measure) (HDC dc, SIZE *sz, HANDLE text);
int (DLL_CALLCONV *Display) (HDC dc, POINT pos, SIZE sz, HANDLE text);
int (DLL_CALLCONV *SetParent) (HANDLE text, HWND hwnd, RECT rect);
@@ -109,7 +109,7 @@ enum typedef struct tagMTEXTCREATE
{
DWORD cbSize;
- HANDLE hContact;
+ HCONTACT hContact;
void *text; // this is 'char *' or 'WCHAR *'
DWORD flags;
diff --git a/plugins/ExternalAPI/m_tipper.h b/plugins/ExternalAPI/m_tipper.h index 21b6df7cef..eceb4cc573 100644 --- a/plugins/ExternalAPI/m_tipper.h +++ b/plugins/ExternalAPI/m_tipper.h @@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. // translation function type
// use hContact, module and setting to read your db value(s) and put the resulting string into buff
// return buff if the translation was successful, or return 0 for failure
-typedef TCHAR *(TranslateFunc)(HANDLE hContact, const char *module, const char *setting_or_prefix, TCHAR *buff, int bufflen);
+typedef TCHAR *(TranslateFunc)(HCONTACT hContact, const char *module, const char *setting_or_prefix, TCHAR *buff, int bufflen);
typedef struct {
TranslateFunc *transFunc; // address of your translation function (see typedef above)
diff --git a/plugins/ExternalAPI/m_userinfoex.h b/plugins/ExternalAPI/m_userinfoex.h index cc7b1dc572..9e244309bf 100644 --- a/plugins/ExternalAPI/m_userinfoex.h +++ b/plugins/ExternalAPI/m_userinfoex.h @@ -335,7 +335,7 @@ This service returns one of the results of MS_DB_CONTACT_GETSETTING_STR! static FORCEINLINE INT_PTR
DBGetContactSettingEx_Helper(
- HANDLE hContact,
+ HCONTACT hContact,
const char* pszProto,
const char* pszSetting,
DBVARIANT *dbv,
diff --git a/plugins/ExternalAPI/m_variables.h b/plugins/ExternalAPI/m_variables.h index 701ad423f7..2fc1d22c78 100644 --- a/plugins/ExternalAPI/m_variables.h +++ b/plugins/ExternalAPI/m_variables.h @@ -77,7 +77,7 @@ typedef struct { WCHAR *wszExtraText;
TCHAR *tszExtraText;
};
- HANDLE hContact; // Handle to contact (can be NULL) -> The field "subject"
+ HCONTACT hContact; // Handle to contact (can be NULL) -> The field "subject"
// represents this contact.
int pCount; // (output) Number of succesful parsed tokens, needs to be set
// to 0 before the call
@@ -110,37 +110,33 @@ typedef struct { // The returned string needs to be freed using mir_free.
#ifndef VARIABLES_NOHELPER
-__inline static TCHAR *variables_parse(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact) {
-
- FORMATINFO fi;
-
- ZeroMemory(&fi, sizeof(fi));
- fi.cbSize = sizeof(fi);
- fi.tszFormat = tszFormat;
- fi.tszExtraText = tszExtraText;
- fi.hContact = hContact;
- fi.flags = FIF_TCHAR;
-
- return (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+__inline static TCHAR *variables_parse(TCHAR *tszFormat, TCHAR *tszExtraText, HCONTACT hContact)
+{
+ FORMATINFO fi = { sizeof(fi) };
+ fi.tszFormat = tszFormat;
+ fi.tszExtraText = tszExtraText;
+ fi.hContact = hContact;
+ fi.flags = FIF_TCHAR;
+ return (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
}
#endif
-__inline static TCHAR *variables_parse_ex(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact,
+__inline static TCHAR *variables_parse_ex(TCHAR *tszFormat, TCHAR *tszExtraText, HCONTACT hContact,
TCHAR **tszaTemporaryVars, int cbTemporaryVarsSize) {
- FORMATINFO fi;
-
- ZeroMemory(&fi, sizeof(fi));
- fi.cbSize = sizeof(fi);
- fi.tszFormat = tszFormat;
- fi.tszExtraText = tszExtraText;
- fi.hContact = hContact;
- fi.flags = FIF_TCHAR;
- fi.tszaTemporaryVars = tszaTemporaryVars;
- fi.cbTemporaryVarsSize = cbTemporaryVarsSize;
-
- return (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ FORMATINFO fi = { 0 };
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.tszFormat = tszFormat;
+ fi.tszExtraText = tszExtraText;
+ fi.hContact = hContact;
+ fi.flags = FIF_TCHAR;
+ fi.tszaTemporaryVars = tszaTemporaryVars;
+ fi.cbTemporaryVarsSize = cbTemporaryVarsSize;
+ return (TCHAR *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
}
+
// Helper #2: variables_parsedup
// ------------------------
// Returns a _strdup()'ed copy of the unparsed string when Variables is not
@@ -149,9 +145,9 @@ __inline static TCHAR *variables_parse_ex(TCHAR *tszFormat, TCHAR *tszExtraText, // Note: The returned pointer needs to be released using your own free().
#ifndef VARIABLES_NOHELPER
-__inline static TCHAR *variables_parsedup(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact)
+__inline static TCHAR *variables_parsedup(TCHAR *tszFormat, TCHAR *tszExtraText, HCONTACT hContact)
{
- if ( ServiceExists(MS_VARS_FORMATSTRING)) {
+ if (ServiceExists(MS_VARS_FORMATSTRING)) {
FORMATINFO fi = { sizeof(fi) };
fi.tszFormat = tszFormat;
fi.tszExtraText = tszExtraText;
@@ -164,10 +160,10 @@ __inline static TCHAR *variables_parsedup(TCHAR *tszFormat, TCHAR *tszExtraText, return tszFormat ? mir_tstrdup(tszFormat) : tszFormat;
}
-__inline static TCHAR *variables_parsedup_ex(TCHAR *tszFormat, TCHAR *tszExtraText, HANDLE hContact,
+__inline static TCHAR *variables_parsedup_ex(TCHAR *tszFormat, TCHAR *tszExtraText, HCONTACT hContact,
TCHAR **tszaTemporaryVars, int cbTemporaryVarsSize)
{
- if ( ServiceExists(MS_VARS_FORMATSTRING)) {
+ if (ServiceExists(MS_VARS_FORMATSTRING)) {
FORMATINFO fi = { sizeof(fi) };
fi.tszFormat = tszFormat;
fi.tszExtraText = tszExtraText;
diff --git a/plugins/ExternalAPI/m_weather.h b/plugins/ExternalAPI/m_weather.h index f76ab88db1..5a290b838d 100644 --- a/plugins/ExternalAPI/m_weather.h +++ b/plugins/ExternalAPI/m_weather.h @@ -47,7 +47,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // weather conditions (added in v0.1.2.0)
typedef struct {
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR id[128];
TCHAR city[128];
TCHAR update[64];
diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index 8c8236b09b..fa6a1f6dbd 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -229,7 +229,7 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar }
case WM_COMMAND:
{
- HANDLE hContact = uDlg->tabs[uDlg->activeTab]->job->hContact;
+ HCONTACT hContact = uDlg->tabs[uDlg->activeTab]->job->hContact;
if (hContact != NULL)
{
if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam),MPCF_CONTACTMENU), (LPARAM)hContact))
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index 7f44b271e4..8e91fba3fa 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -35,7 +35,7 @@ extern Options &opt; int PrebuildContactMenu(WPARAM wParam, LPARAM lParam);
void PrebuildMainMenu();
int TabsrmmButtonPressed(WPARAM wParam, LPARAM lParam);
-int UploadFile(HANDLE hContact, int iFtpNum, UploadJob::EMode mode);
+int UploadFile(HCONTACT hContact, int iFtpNum, UploadJob::EMode mode);
static PLUGININFOEX pluginInfoEx =
{
@@ -210,7 +210,7 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) {
bool bIsContact = false;
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if (szProto) bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) ? true : false;
bool bHideRoot = opt.bHideInactive;
@@ -236,7 +236,7 @@ void PrebuildMainMenu() int TabsrmmButtonPressed(WPARAM wParam, LPARAM lParam)
{
CustomButtonClickData *cbc = (CustomButtonClickData *)lParam;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!strcmp(cbc->pszModule, MODULE) && cbc->dwButtonId == 1 && hContact)
{
@@ -292,7 +292,7 @@ int TabsrmmButtonPressed(WPARAM wParam, LPARAM lParam) return 0;
}
-int UploadFile(HANDLE hContact, int iFtpNum, GenericJob::EMode mode, void **objects, int objCount, DWORD flags)
+int UploadFile(HCONTACT hContact, int iFtpNum, GenericJob::EMode mode, void **objects, int objCount, DWORD flags)
{
if (!ftpList[iFtpNum]->isValid())
{
@@ -334,7 +334,7 @@ int UploadFile(HANDLE hContact, int iFtpNum, GenericJob::EMode mode, void **obje return 0;
}
-int UploadFile(HANDLE hContact, int iFtpNum, GenericJob::EMode mode)
+int UploadFile(HCONTACT hContact, int iFtpNum, GenericJob::EMode mode)
{
return UploadFile(hContact, iFtpNum, mode, NULL, 0, 0);
}
@@ -363,7 +363,7 @@ INT_PTR ShowManagerService(WPARAM wParam, LPARAM lParam) INT_PTR ContactMenuService(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
int ftpNum = lParam & (1|2|4);
int mode = lParam & (UploadJob::FTP_RAWFILE | UploadJob::FTP_ZIPFILE | UploadJob::FTP_ZIPFOLDER);
return UploadFile(hContact, ftpNum, (UploadJob::EMode)mode);
diff --git a/plugins/FTPFileYM/src/job_generic.cpp b/plugins/FTPFileYM/src/job_generic.cpp index a723c45931..bfac7ccf79 100644 --- a/plugins/FTPFileYM/src/job_generic.cpp +++ b/plugins/FTPFileYM/src/job_generic.cpp @@ -21,8 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. extern UploadDialog *uDlg;
extern ServerList &ftpList;
-GenericJob::GenericJob(HANDLE _hContact, int _iFtpNum, EMode _mode)
-:hContact(_hContact),iFtpNum(_iFtpNum),mode(_mode),status(STATUS_CREATED),ftp(ftpList[iFtpNum])
+GenericJob::GenericJob(HCONTACT _hContact, int _iFtpNum, EMode _mode) :
+ hContact(_hContact),iFtpNum(_iFtpNum),mode(_mode),status(STATUS_CREATED),ftp(ftpList[iFtpNum])
{
this->stzFilePath[0] = 0;
this->stzFileName[0] = 0;
diff --git a/plugins/FTPFileYM/src/job_generic.h b/plugins/FTPFileYM/src/job_generic.h index 618d891a82..0003045300 100644 --- a/plugins/FTPFileYM/src/job_generic.h +++ b/plugins/FTPFileYM/src/job_generic.h @@ -66,7 +66,7 @@ public: STATUS_COMPLETED
};
- HANDLE hContact;
+ HCONTACT hContact;
int iFtpNum, fileID;
ServerList::FTP *ftp;
TCHAR stzFilePath[1024];
@@ -79,7 +79,7 @@ public: vector<TCHAR *> files;
TCHAR * operator[] (int i) const { return files[i];}
- GenericJob(HANDLE hContact, int iFtpNum, EMode mode);
+ GenericJob(HCONTACT hContact, int iFtpNum, EMode mode);
GenericJob(GenericJob *job);
virtual ~GenericJob();
diff --git a/plugins/FTPFileYM/src/job_packer.cpp b/plugins/FTPFileYM/src/job_packer.cpp index 8002d2b0ed..a57d9dc402 100644 --- a/plugins/FTPFileYM/src/job_packer.cpp +++ b/plugins/FTPFileYM/src/job_packer.cpp @@ -25,8 +25,8 @@ int PackerJob::iRunningJobCount = 0; extern UploadDialog *uDlg;
extern Options &opt;
-PackerJob::PackerJob(HANDLE _hContact, int _iFtpNum, EMode _mode)
-:GenericJob(_hContact, _iFtpNum, _mode),uiFileSize(0),uiReaded(0),lastUpdateTick(0)
+PackerJob::PackerJob(HCONTACT _hContact, int _iFtpNum, EMode _mode) :
+ GenericJob(_hContact, _iFtpNum, _mode),uiFileSize(0),uiReaded(0),lastUpdateTick(0)
{ }
void PackerJob::getZipFilePath()
diff --git a/plugins/FTPFileYM/src/job_packer.h b/plugins/FTPFileYM/src/job_packer.h index 2c2c22ddc6..37c7edc055 100644 --- a/plugins/FTPFileYM/src/job_packer.h +++ b/plugins/FTPFileYM/src/job_packer.h @@ -46,7 +46,7 @@ private: bool isCanceled();
public:
- PackerJob(HANDLE hContact, int iFtpNum, EMode mode);
+ PackerJob(HCONTACT hContact, int iFtpNum, EMode mode);
virtual ~PackerJob() {};
virtual void start();
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp index df01b5e1aa..2d0a596da9 100644 --- a/plugins/FTPFileYM/src/job_upload.cpp +++ b/plugins/FTPFileYM/src/job_upload.cpp @@ -25,7 +25,7 @@ int UploadJob::iRunningJobCount = 0; extern UploadDialog *uDlg;
extern ServerList &ftpList;
-UploadJob::UploadJob(HANDLE _hContact, int _iFtpNum, EMode _mode) :
+UploadJob::UploadJob(HCONTACT _hContact, int _iFtpNum, EMode _mode) :
GenericJob(_hContact, _iFtpNum, _mode),fp(NULL)
{
this->szFileLink[0] = 0;
diff --git a/plugins/FTPFileYM/src/job_upload.h b/plugins/FTPFileYM/src/job_upload.h index fa29e3c640..0679773cfd 100644 --- a/plugins/FTPFileYM/src/job_upload.h +++ b/plugins/FTPFileYM/src/job_upload.h @@ -65,7 +65,7 @@ public: char szFileLink[256];
static Event jobDone;
- UploadJob(HANDLE _hContact, int _iFtpNum, EMode _mode);
+ UploadJob(HCONTACT _hContact, int _iFtpNum, EMode _mode);
UploadJob(UploadJob *job);
UploadJob(PackerJob *job);
virtual ~UploadJob();
diff --git a/plugins/FTPFileYM/src/mir_db.cpp b/plugins/FTPFileYM/src/mir_db.cpp index 13d1d645a7..bf21c1f472 100644 --- a/plugins/FTPFileYM/src/mir_db.cpp +++ b/plugins/FTPFileYM/src/mir_db.cpp @@ -18,63 +18,63 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "common.h"
-int DB::setByteF(HANDLE hContact, char *szModule, char *szSetting, int id, int iValue)
+int DB::setByteF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iValue)
{
char formSet[256];
mir_snprintf(formSet, sizeof(formSet), szSetting, id);
return db_set_b(hContact, szModule, formSet, iValue);
}
-int DB::setWordF(HANDLE hContact, char *szModule, char *szSetting, int id, int iValue)
+int DB::setWordF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iValue)
{
char formSet[256];
mir_snprintf(formSet, sizeof(formSet), szSetting, id);
return db_set_w(hContact, szModule, formSet, iValue);
}
-int DB::setDwordF(HANDLE hContact, char *szModule, char *szSetting, int id, int iValue)
+int DB::setDwordF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iValue)
{
char formSet[256];
mir_snprintf(formSet, sizeof(formSet), szSetting, id);
return db_set_dw(hContact, szModule, formSet, iValue);
}
-int DB::setAStringF(HANDLE hContact, char *szModule, char *szSetting, int id, char *szValue)
+int DB::setAStringF(HCONTACT hContact, char *szModule, char *szSetting, int id, char *szValue)
{
char formSet[256];
mir_snprintf(formSet, sizeof(formSet), szSetting, id);
return db_set_s(hContact, szModule, formSet, szValue);
}
-int DB::setStringF(HANDLE hContact, char *szModule, char *szSetting, int id, TCHAR *stzValue)
+int DB::setStringF(HCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *stzValue)
{
char formSet[256];
mir_snprintf(formSet, sizeof(formSet), szSetting, id);
return db_set_ts(hContact, szModule, formSet, stzValue);
}
-int DB::getByteF(HANDLE hContact, char *szModule, char *szSetting, int id, int iErrorValue)
+int DB::getByteF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue)
{
char formSet[256];
mir_snprintf(formSet, sizeof(formSet), szSetting, id);
return db_get_b(hContact, szModule, formSet, iErrorValue);
}
-int DB::getWordF(HANDLE hContact, char *szModule, char *szSetting, int id, int iErrorValue)
+int DB::getWordF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue)
{
char formSet[256];
mir_snprintf(formSet, sizeof(formSet), szSetting, id);
return db_get_w(hContact, szModule, formSet, iErrorValue);
}
-int DB::getDwordF(HANDLE hContact, char *szModule, char *szSetting, int id, int iErrorValue)
+int DB::getDwordF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue)
{
char formSet[256];
mir_snprintf(formSet, sizeof(formSet), szSetting, id);
return db_get_dw(hContact, szModule, formSet, iErrorValue);
}
-int DB::getAString(HANDLE hContact, char *szModule, char *szSetting, char *buff)
+int DB::getAString(HCONTACT hContact, char *szModule, char *szSetting, char *buff)
{
DBVARIANT dbv;
if (!db_get_s(hContact, szModule, szSetting, &dbv))
@@ -88,14 +88,14 @@ int DB::getAString(HANDLE hContact, char *szModule, char *szSetting, char *buff) return 1;
}
-int DB::getAStringF(HANDLE hContact, char *szModule, char *szSetting, int id, char *buff)
+int DB::getAStringF(HCONTACT hContact, char *szModule, char *szSetting, int id, char *buff)
{
char formSet[256];
mir_snprintf(formSet, sizeof(formSet), szSetting, id);
return getAString(hContact, szModule, formSet, buff);
}
-int DB::getString(HANDLE hContact, char *szModule, char *szSetting, TCHAR *buff)
+int DB::getString(HCONTACT hContact, char *szModule, char *szSetting, TCHAR *buff)
{
DBVARIANT dbv;
if (!db_get_ts(hContact, szModule, szSetting, &dbv))
@@ -109,14 +109,14 @@ int DB::getString(HANDLE hContact, char *szModule, char *szSetting, TCHAR *buff) return 1;
}
-int DB::getStringF(HANDLE hContact, char *szModule, char *szSetting, int id, TCHAR *buff)
+int DB::getStringF(HCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *buff)
{
char formSet[256];
mir_snprintf(formSet, sizeof(formSet), szSetting, id);
return getString(hContact, szModule, formSet, buff);
}
-int DB::deleteSettingF(HANDLE hContact, char *szModule, char *szSetting, int id)
+int DB::deleteSettingF(HCONTACT hContact, char *szModule, char *szSetting, int id)
{
char formSet[256];
mir_snprintf(formSet, sizeof(formSet), szSetting, id);
diff --git a/plugins/FTPFileYM/src/mir_db.h b/plugins/FTPFileYM/src/mir_db.h index d46b16fb06..e5175fdc0a 100644 --- a/plugins/FTPFileYM/src/mir_db.h +++ b/plugins/FTPFileYM/src/mir_db.h @@ -23,22 +23,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. class DB
{
public:
- static int setByteF(HANDLE hContact, char *szModule, char *szSetting, int id, int iValue);
- static int setWordF(HANDLE hContact, char *szModule, char *szSetting, int id, int iValue);
- static int setDwordF(HANDLE hContact, char *szModule, char *szSetting, int id, int iValue);
+ static int setByteF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iValue);
+ static int setWordF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iValue);
+ static int setDwordF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iValue);
- static int setAStringF(HANDLE hContact, char *szModule, char *szSetting, int id, char *szValue);
- static int setStringF(HANDLE hContact, char *szModule, char *szSetting, int id, TCHAR *stzValue);
+ static int setAStringF(HCONTACT hContact, char *szModule, char *szSetting, int id, char *szValue);
+ static int setStringF(HCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *stzValue);
- static int getByteF(HANDLE hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
- static int getWordF(HANDLE hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
- static int getDwordF(HANDLE hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
+ static int getByteF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
+ static int getWordF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
+ static int getDwordF(HCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
// !!!!!!!!!!!!!!!!!!! dangerous as hell
- static int getAString(HANDLE hContact, char *szModule, char *szSetting, char *buff);
- static int getAStringF(HANDLE hContact, char *szModule, char *szSetting, int id, char *buff);
- static int getString(HANDLE hContact, char *szModule, char *szSetting, TCHAR *buff);
- static int getStringF(HANDLE hContact, char *szModule, char *szSetting, int id, TCHAR *buff);
+ static int getAString(HCONTACT hContact, char *szModule, char *szSetting, char *buff);
+ static int getAStringF(HCONTACT hContact, char *szModule, char *szSetting, int id, char *buff);
+ static int getString(HCONTACT hContact, char *szModule, char *szSetting, TCHAR *buff);
+ static int getStringF(HCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *buff);
- static int deleteSettingF(HANDLE hContact, char *szModule, char *szSetting, int id);
+ static int deleteSettingF(HCONTACT hContact, char *szModule, char *szSetting, int id);
};
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index 0cfc3b4757..b61fc00f95 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -2,7 +2,7 @@ int __cdecl CContactCache::OnDbEventAdded(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HANDLE hEvent = (HANDLE)lParam;
DBEVENTINFO dbei = {0};
@@ -81,7 +81,7 @@ void CContactCache::Rebuild() unsigned long timestamp = time(NULL);
m_lastUpdate = time(NULL);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
TContactInfo *info = new TContactInfo;
info->hContact = hContact;
info->rate = 0;
@@ -102,7 +102,7 @@ void CContactCache::Rebuild() }
}
-HANDLE CContactCache::get(int rate)
+HCONTACT CContactCache::get(int rate)
{
if (rate >= 0 && rate < m_cache.getCount())
return m_cache[rate].hContact;
@@ -116,7 +116,7 @@ float CContactCache::getWeight(int rate) return -1;
}
-static bool AppendInfo(TCHAR *buf, int size, HANDLE hContact, int info)
+static bool AppendInfo(TCHAR *buf, int size, HCONTACT hContact, int info)
{
CONTACTINFO ci = {0};
ci.cbSize = sizeof(ci);
diff --git a/plugins/FavContacts/src/contact_cache.h b/plugins/FavContacts/src/contact_cache.h index d4a47ba477..15c3b2c81a 100644 --- a/plugins/FavContacts/src/contact_cache.h +++ b/plugins/FavContacts/src/contact_cache.h @@ -10,7 +10,7 @@ private: struct TContactInfo
{
- HANDLE hContact;
+ HCONTACT hContact;
float rate;
TCHAR info[INFOSIZE];
bool infoLoaded;
@@ -52,7 +52,7 @@ public: void Unlock() { LeaveCriticalSection(&m_cs); }
void Rebuild();
- HANDLE get(int rate);
+ HCONTACT get(int rate);
float getWeight(int rate);
bool filter(int rate, TCHAR *str);
};
diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h index 04ed0d20e2..c0ebd6e2d0 100644 --- a/plugins/FavContacts/src/favlist.h +++ b/plugins/FavContacts/src/favlist.h @@ -4,7 +4,7 @@ struct TContactInfo
{
private:
- HANDLE hContact;
+ HCONTACT hContact;
DWORD status;
TCHAR *name;
TCHAR *group;
@@ -12,7 +12,7 @@ private: float fRate;
public:
- TContactInfo(HANDLE hContact, bool bManual, float fRate = 0)
+ TContactInfo(HCONTACT hContact, bool bManual, float fRate = 0)
{
DBVARIANT dbv = {0};
@@ -41,7 +41,7 @@ public: mir_free(group);
}
- HANDLE getHandle() const
+ HCONTACT getHandle() const
{
return hContact;
}
@@ -89,7 +89,7 @@ public: return nGroups;
}
- TContactInfo *addContact(HANDLE hContact, bool bManual)
+ TContactInfo *addContact(HCONTACT hContact, bool bManual)
{
TContactInfo *info = new TContactInfo(hContact, bManual);
this->insert(info);
@@ -102,7 +102,7 @@ public: nGroups = 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))
if (db_get_b(hContact, "FavContacts", "IsFavourite", 0))
{
TCHAR *group = addContact(hContact, true)->getGroup();
@@ -113,7 +113,7 @@ public: int nRecent = 0;
for (int i = 0; nRecent < g_Options.wMaxRecent; ++i) {
- HANDLE hContact = g_contactCache->get(i);
+ HCONTACT hContact = g_contactCache->get(i);
if (!hContact) break;
if (!db_get_b(hContact, "FavContacts", "IsFavourite", 0))
{
diff --git a/plugins/FavContacts/src/http_api.cpp b/plugins/FavContacts/src/http_api.cpp index da0f9ee01c..bce57b0a7a 100644 --- a/plugins/FavContacts/src/http_api.cpp +++ b/plugins/FavContacts/src/http_api.cpp @@ -67,7 +67,7 @@ public: for (int i = 0; i < favList.getCount(); ++i)
{
- HANDLE hContact = favList[i]->getHandle();
+ HCONTACT hContact = favList[i]->getHandle();
TCHAR *name = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
AVATARCACHEENTRY *avatar = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
int status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE);
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp index 5bb306246c..b83dc2aeba 100644 --- a/plugins/FavContacts/src/main.cpp +++ b/plugins/FavContacts/src/main.cpp @@ -248,7 +248,7 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam) Hotkey_Register(&hotkey);
if (ServiceExists(MS_AV_GETAVATARBITMAP)) {
- 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_b(hContact, "FavContacts", "IsFavourite", 0))
CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
}
@@ -387,7 +387,7 @@ static BOOL sttMeasureItem_Group(LPMEASUREITEMSTRUCT lpmis, Options *options) static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options)
{
- HANDLE hContact = (HANDLE)lpmis->itemData;
+ HCONTACT hContact = (HCONTACT)lpmis->itemData;
lpmis->itemHeight = 4;
lpmis->itemWidth = 8+10;
@@ -525,7 +525,7 @@ void ImageList_DrawDimmed(HIMAGELIST himl, int i, HDC hdc, int left, int top, UI static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL)
{
- HANDLE hContact = (HANDLE)lpdis->itemData;
+ HCONTACT hContact = (HCONTACT)lpdis->itemData;
HDC hdcTemp = CreateCompatibleDC(lpdis->hDC);
HBITMAP hbmTemp = CreateCompatibleBitmap(lpdis->hDC, lpdis->rcItem.right-lpdis->rcItem.left, lpdis->rcItem.bottom-lpdis->rcItem.top);
@@ -703,7 +703,7 @@ static BOOL sttDrawItem(LPDRAWITEMSTRUCT lpdis, Options *options=NULL) static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- static HANDLE hContact = NULL;
+ static HCONTACT hContact = NULL;
switch (message) {
case WM_MEASUREITEM:
@@ -749,7 +749,7 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, int nRecent = 0;
int maxRecent = g_Options.wMaxRecent ? g_Options.wMaxRecent : 10;
for (int i = 0; nRecent < maxRecent; ++i) {
- HANDLE hContact = g_contactCache->get(i);
+ HCONTACT hContact = g_contactCache->get(i);
if (!hContact) break;
if (!g_contactCache->filter(i, g_filter)) continue;
@@ -764,7 +764,7 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_DATA;
GetMenuItemInfo((HMENU)lParam, wParam, TRUE, &mii);
- HANDLE hContact = (HANDLE)mii.dwItemData;
+ HCONTACT hContact = (HCONTACT)mii.dwItemData;
if (!CallService(MS_DB_CONTACT_IS, mii.dwItemData, 0)) return FALSE;
HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0);
@@ -793,7 +793,7 @@ int sttShowMenu(bool centered) SIZE szColumn = {0};
TCHAR *prevGroup = NULL;
int i, idItem = 100;
- HANDLE hContact;
+ HCONTACT hContact;
favList.build();
@@ -867,7 +867,7 @@ int sttShowMenu(bool centered) mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA;
GetMenuItemInfo(hMenu, res, FALSE, &mii);
- hContact = (HANDLE)mii.dwItemData;
+ hContact = (HCONTACT)mii.dwItemData;
}
SetForegroundWindow(hwndSave);
DestroyMenu(hMenu);
@@ -940,7 +940,7 @@ int ProcessSrmmIconClick( WPARAM wParam, LPARAM lParam ) StatusIconClickData *sicd = (StatusIconClickData *)lParam;
if (lstrcmpA(sicd->szModule, "FavContacts")) return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!hContact)
return 0;
@@ -1005,7 +1005,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA hSelectedContact = db_find_first();
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_SETCHECKMARK,
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0),
db_get_b(hContact, "FavContacts", "IsFavourite", 0));
@@ -1127,7 +1127,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA sttSaveOptions();
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
BYTE fav = SendDlgItemMessage(hwnd, IDC_CLIST, CLM_GETCHECKMARK,
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0), 0);
if (fav != db_get_b(hContact, "FavContacts", "IsFavourite", 0))
@@ -1145,7 +1145,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA case CLN_NEWCONTACT:
iSelection = (int)((NMCLISTCONTROL *)lParam)->hItem;
- 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 (SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0) == iSelection) {
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_SETCHECKMARK, iSelection,
db_get_b(hContact, "FavContacts", "IsFavourite", 0));
@@ -1156,7 +1156,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA case CLN_CHECKCHANGED:
iSelection = (int)((NMCLISTCONTROL *)lParam)->hItem;
- 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 (SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0) == iSelection) {
hSelectedContact = hContact;
RedrawWindow(GetDlgItem(hwnd, IDC_CANVAS), NULL, NULL, RDW_INVALIDATE);
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index ba9e2ec7c2..de324848ae 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -64,7 +64,7 @@ char cCmdList[CMD_COUNT] = static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = PUGetContact(hWnd);
+ HCONTACT hContact = PUGetContact(hWnd);
HWND hDlg = (HWND)PUGetPluginData(hWnd);
/*
if(hContact)
@@ -112,7 +112,7 @@ static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM //
// Just create simple Popup for specified contact
//
-void MakePopupMsg(HWND hDlg, HANDLE hContact, char *msg)
+void MakePopupMsg(HWND hDlg, HCONTACT hContact, char *msg)
{
HWND hFocused = GetForegroundWindow();
if(hDlg == hFocused || hDlg == GetParent(hFocused)) return;
@@ -121,7 +121,7 @@ void MakePopupMsg(HWND hDlg, HANDLE hContact, char *msg) //The text for the second line. You could even make something like: char lpzText[128]; lstrcpy(lpzText, "Hello world!"); It's your choice.
//
POPUPDATA ppd = { 0 };
- ppd.lchContact = (HANDLE)hContact;
+ ppd.lchContact = hContact;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SMALLICON));
lstrcpy(ppd.lpzContactName, (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0));
lstrcpy(ppd.lpzText, msg);
@@ -156,7 +156,7 @@ int RetrieveFileSize(char *filename) return handle;
}
-FILEECHO::FILEECHO(HANDLE Contact)
+FILEECHO::FILEECHO(HCONTACT Contact)
{
hContact = Contact;
dwSendInterval = db_get_dw(NULL, SERVICE_NAME, "SendDelay", 6000);
@@ -469,7 +469,7 @@ void FILEECHO::incomeRequest(char *param) SkinPlaySound("RecvFile");
int AutoMin = db_get_b(NULL,"SRFile","AutoMin",0);
- if(db_get_b(NULL,"SRFile","AutoAccept",0) && !db_get_b((HANDLE)hContact,"CList","NotOnList",0))
+ if(db_get_b(NULL,"SRFile","AutoAccept",0) && !db_get_b(hContact,"CList","NotOnList",0))
{
PostMessage(hDlg, WM_COMMAND, IDC_PLAY, 0);
if(AutoMin)
diff --git a/plugins/FileAsMessage/src/dialog.h b/plugins/FileAsMessage/src/dialog.h index 49099703de..e8914ef5b5 100644 --- a/plugins/FileAsMessage/src/dialog.h +++ b/plugins/FileAsMessage/src/dialog.h @@ -54,7 +54,7 @@ extern char cFECmd[CMD_COUNT]; struct FILEECHO
{
public:
- HANDLE hContact;
+ HCONTACT hContact;
HWND hDlg;
bool inSend;
@@ -90,7 +90,7 @@ public: uint overhead;
#endif
- FILEECHO(HANDLE Contact);
+ FILEECHO(HCONTACT Contact);
void setState(DWORD state);
void updateProgress();
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index 247072897c..66362e9cdb 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -54,7 +54,7 @@ int OnSettingChanged(WPARAM wParam,LPARAM lParam) {
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
- HWND hwnd = WindowList_Find(hFileList,(HANDLE)wParam);
+ HWND hwnd = WindowList_Find(hFileList,(HCONTACT)wParam);
PostMessage(hwnd, WM_FE_STATUSCHANGE, 0,0);
//OnSkinIconsChanged(0,0);
//PostMessage(hwnd, WM_FE_SKINCHANGE, 0,0);
@@ -66,7 +66,7 @@ INT_PTR OnRecvFile(WPARAM wParam, LPARAM lParam) {
CLISTEVENT *clev = (CLISTEVENT*)lParam;
- HWND hwnd = WindowList_Find(hFileList,(HANDLE)clev->hContact);
+ HWND hwnd = WindowList_Find(hFileList, clev->hContact);
if(IsWindow(hwnd))
{
ShowWindow(hwnd, SW_SHOWNORMAL);
@@ -94,7 +94,7 @@ INT_PTR OnRecvFile(WPARAM wParam, LPARAM lParam) INT_PTR OnSendFile(WPARAM wParam, LPARAM lParam)
{
- HWND hwnd = WindowList_Find(hFileList,(HANDLE)wParam);
+ HWND hwnd = WindowList_Find(hFileList, (HCONTACT)wParam);
if(IsWindow(hwnd))
{
SetForegroundWindow(hwnd);
@@ -103,7 +103,7 @@ INT_PTR OnSendFile(WPARAM wParam, LPARAM lParam) else
{
if(hwnd != 0) WindowList_Remove(hFileList, hwnd);
- FILEECHO *fe = new FILEECHO((HANDLE)wParam);
+ FILEECHO *fe = new FILEECHO((HCONTACT)wParam);
fe->inSend = TRUE;
hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, DialogProc, (LPARAM)fe);
if(hwnd == NULL)
@@ -125,11 +125,11 @@ INT_PTR OnRecvMessage(WPARAM wParam, LPARAM lParam) if(strncmp(ppre->szMessage, szServicePrefix, strlen(szServicePrefix)))
return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
- HWND hwnd = WindowList_Find(hFileList, (HANDLE)pccsd->hContact);
+ HWND hwnd = WindowList_Find(hFileList, pccsd->hContact);
if(!IsWindow(hwnd))
{
if(hwnd != 0) WindowList_Remove(hFileList, hwnd);
- FILEECHO *fe = new FILEECHO((HANDLE)pccsd->hContact);
+ FILEECHO *fe = new FILEECHO(pccsd->hContact);
fe->inSend = FALSE;
hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, DialogProc, (LPARAM)fe);
if(hwnd == NULL)
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index 63683d92d0..cf778443a1 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -140,7 +140,7 @@ void RegisterIcons() * 3)Set ExtraImage for contact
*/
-static void SetSrmmIcon(HANDLE hContact, LPTSTR ptszMirver)
+static void SetSrmmIcon(HCONTACT hContact, LPTSTR ptszMirver)
{
StatusIconData sid = { sizeof(sid) };
sid.szModule = MODULENAME;
@@ -156,7 +156,7 @@ static void SetSrmmIcon(HANDLE hContact, LPTSTR ptszMirver) Srmm_ModifyIcon(hContact, &sid);
}
-int __fastcall ApplyFingerprintImage(HANDLE hContact, LPTSTR szMirVer)
+int __fastcall ApplyFingerprintImage(HCONTACT hContact, LPTSTR szMirVer)
{
if (hContact == NULL)
return 0;
@@ -838,7 +838,7 @@ static int OnIconsChanged(WPARAM wParam, LPARAM lParam) int OnExtraImageApply(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -862,7 +862,7 @@ int OnExtraImageApply(WPARAM wParam, LPARAM lParam) static int OnContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return 0;
diff --git a/plugins/FingerprintNG/src/options.cpp b/plugins/FingerprintNG/src/options.cpp index f584d20d95..13614c5a19 100644 --- a/plugins/FingerprintNG/src/options.cpp +++ b/plugins/FingerprintNG/src/options.cpp @@ -103,7 +103,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP ClearFI();
RegisterIcons();
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
OnExtraImageApply((WPARAM)hContact, 0);
}
break;
diff --git a/plugins/FlashAvatars/src/cflash.cpp b/plugins/FlashAvatars/src/cflash.cpp index 5d8c0a70e8..b6fca56704 100644 --- a/plugins/FlashAvatars/src/cflash.cpp +++ b/plugins/FlashAvatars/src/cflash.cpp @@ -31,13 +31,13 @@ int __fastcall strcmpnull(const char *str1, const char *str2) { struct flash_avatar_item : public MZeroedObject
{
- HANDLE hContact;
+ HCONTACT hContact;
FLASHAVATAR hFA;
IShockwaveFlash* pFlash;
char* getProto() { return (hFA.cProto) ? hFA.cProto : GetContactProto(hFA.hContact); }
- flash_avatar_item(HANDLE contact, FLASHAVATAR& fa, IShockwaveFlash *flash) { hContact = contact; hFA = fa; pFlash = flash; }
+ flash_avatar_item(HCONTACT contact, FLASHAVATAR& fa, IShockwaveFlash *flash) { hContact = contact; hFA = fa; pFlash = flash; }
};
static int CompareFlashItems(const flash_avatar_item* p1, const flash_avatar_item* p2) {
@@ -542,7 +542,7 @@ static int eventAdded(WPARAM wParam, LPARAM lParam) face = AV_NORMAL;
}
- HANDLE hContact = (dbei.flags & DBEF_SENT) ? 0 : (HANDLE)wParam;
+ HCONTACT hContact = (dbei.flags & DBEF_SENT) ? 0 : (HCONTACT)wParam;
for(int i=0; i<FlashList.getCount(); i++) {
flash_avatar_item *item = FlashList[i];
if (item->hContact == hContact && !strcmpnull(dbei.szModule, item->getProto())) {
diff --git a/plugins/FloatingContacts/src/fltcont.h b/plugins/FloatingContacts/src/fltcont.h index c4e98ab498..d7d1a12bb6 100644 --- a/plugins/FloatingContacts/src/fltcont.h +++ b/plugins/FloatingContacts/src/fltcont.h @@ -140,7 +140,7 @@ static __forceinline BOOL ImageList_GetIconSize_my(HIMAGELIST himl, SIZE &sz) return res;
}
-void RegHotkey ( HANDLE hContact, HWND hwnd );
+void RegHotkey ( HCONTACT hContact, HWND hwnd );
BOOL IsStatusVisible ( int status );
BOOL HideOnFullScreen ();
void SendMsgDialog ( HWND hwnd, TCHAR *pText );
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index 9e2892a204..17e2cb089e 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -22,18 +22,18 @@ No warranty for any misbehaviour. // TODO: move to some more approriate place, probably part of Thumbs manager
static void LoadContacts(void);
-static void LoadContact(HANDLE hContact);
+static void LoadContact(HCONTACT hContact);
// Internal funcs
static void RepaintWindow(HWND hwnd, HDC hdc);
static void LoadMenus();
-static void CreateThumbWnd(TCHAR *ptszName, HANDLE hContact, int nX, int nY);
+static void CreateThumbWnd(TCHAR *ptszName, HCONTACT hContact, int nX, int nY);
static void RegisterWindowClass(void);
static void UnregisterWindowClass(void);
static void LoadDBSettings(void);
static void CreateThumbsFont(void);
static void CreateBackgroundBrush(void);
-static int GetContactStatus(HANDLE hContact);
+static int GetContactStatus(HCONTACT hContact);
static void GetScreenRect(void);
extern void SetThumbsOpacity(BYTE btAlpha);
static int ClcStatusToPf2(int status);
@@ -136,7 +136,7 @@ static LPCTSTR s_fonts[FLT_FONTIDS] = static int OnContactDeleted(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
if (pThumb) {
pThumb->DeleteContactPos();
@@ -147,7 +147,7 @@ static int OnContactDeleted(WPARAM wParam, LPARAM lParam) static int OnContactIconChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
if (pThumb) {
pThumb->RefreshContactIcon((int)lParam);
@@ -163,7 +163,7 @@ static int OnContactDrag(WPARAM wParam, LPARAM lParam) POINT pt;
GetCursorPos(&pt);
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
if (pThumb == NULL) {
int idStatus = GetContactStatus(hContact);
@@ -188,7 +188,7 @@ static int OnContactDrop(WPARAM wParam, LPARAM lParam) RECT rcMiranda;
RECT rcThumb;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
if (hNewContact == hContact && pThumb != NULL) {
@@ -204,7 +204,7 @@ static int OnContactDrop(WPARAM wParam, LPARAM lParam) static int OnContactDragStop(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
if (pThumb != NULL && hNewContact == hContact) {
thumbList.RemoveThumb(pThumb);
@@ -228,7 +228,7 @@ static int OnSkinIconsChanged(WPARAM wParam, LPARAM lParam) static int OnContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
int idStatus = ID_STATUS_OFFLINE;
BOOL bRefresh = TRUE;
@@ -292,7 +292,7 @@ static int OnStatusModeChange(WPARAM wParam, LPARAM lParam) static int OnPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- ThumbInfo *pThumb = thumbList.FindThumbByContact((HANDLE) wParam );
+ ThumbInfo *pThumb = thumbList.FindThumbByContact((HCONTACT)wParam);
Menu_ShowItem(hMenuItemRemove, pThumb != NULL);
Menu_ShowItem(hMenuItemHideAll, !fcOpt.bHideAll);
@@ -516,7 +516,7 @@ static void UnregisterWindowClass() UnregisterClass(WND_CLASS, hInst);
}
-static void CreateThumbWnd(TCHAR *ptszName, HANDLE hContact, int nX, int nY)
+static void CreateThumbWnd(TCHAR *ptszName, HCONTACT hContact, int nX, int nY)
{
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
if (pThumb != NULL)
@@ -609,7 +609,7 @@ static void CreateBackgroundBrush() SetClassLong((HWND)WND_CLASS, GCLP_HBRBACKGROUND, (LONG)hBkBrush);
}
-static int GetContactStatus(HANDLE hContact)
+static int GetContactStatus(HCONTACT hContact)
{
if (hContact == NULL) {
assert( !"Contact is NULL" );
@@ -646,7 +646,7 @@ BOOL IsStatusVisible(int status) return (0 == (dwOfflineModes & ClcStatusToPf2(status)));
}
-void RegHotkey(HANDLE hContact, HWND hwnd)
+void RegHotkey(HCONTACT hContact, HWND hwnd)
{
char szBuf[MAX_PATH] = {0};
@@ -696,7 +696,7 @@ void SaveContactsPos() static void LoadContacts()
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
LoadContact(hContact);
}
@@ -719,7 +719,7 @@ static INT_PTR OnMainMenu_HideAll(WPARAM wParam, LPARAM lParam) static INT_PTR OnContactMenu_Remove(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
if (pThumb) {
pThumb->DeleteContactPos();
@@ -777,7 +777,7 @@ static void LoadMenus() /////////////////////////////////////////////////////////////////////////////////////////
-static void LoadContact( HANDLE hContact )
+static void LoadContact( HCONTACT hContact )
{
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
if (hContact == NULL)
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index ecbe70c6bb..4e0d991496 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -768,7 +768,7 @@ ThumbList::~ThumbList() {
}
-ThumbInfo *ThumbList::AddThumb(HWND hwnd, TCHAR *ptszName, HANDLE hContact)
+ThumbInfo *ThumbList::AddThumb(HWND hwnd, TCHAR *ptszName, HCONTACT hContact)
{
if (ptszName == NULL || hContact == NULL || hwnd == NULL)
return NULL;
@@ -813,7 +813,7 @@ ThumbInfo* ThumbList::FindThumb(HWND hwnd) return NULL;
}
-ThumbInfo *ThumbList::FindThumbByContact(HANDLE hContact)
+ThumbInfo *ThumbList::FindThumbByContact(HCONTACT hContact)
{
if (!hContact) return NULL;
diff --git a/plugins/FloatingContacts/src/thumbs.h b/plugins/FloatingContacts/src/thumbs.h index 083f2bb4b3..f13251e22a 100644 --- a/plugins/FloatingContacts/src/thumbs.h +++ b/plugins/FloatingContacts/src/thumbs.h @@ -12,7 +12,7 @@ DockOpt; struct ThumbInfo
{
- HANDLE hContact;
+ HCONTACT hContact;
HWND hwnd;
TCHAR ptszName[USERNAME_LEN];
int iIcon;
@@ -60,11 +60,11 @@ public: ThumbList();
~ThumbList();
- ThumbInfo* AddThumb(HWND hwnd, TCHAR *ptszName, HANDLE hContact);
+ ThumbInfo* AddThumb(HWND hwnd, TCHAR *ptszName, HCONTACT hContact);
void RemoveThumb(ThumbInfo *pThumb);
ThumbInfo* FindThumb(HWND hwnd);
- ThumbInfo* FindThumbByContact(HANDLE hContact);
+ ThumbInfo* FindThumbByContact(HCONTACT hContact);
};
extern ThumbList thumbList;
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 3da5724ff3..1bb124b2d2 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -92,7 +92,7 @@ void ReplaceAll(string &sSrc, const char * pszReplace, const char * pszNew) { // Developer : KN
/////////////////////////////////////////////////////////////////////
-string DBGetString(HANDLE hContact, const char *szModule, const char *szSetting, const char * pszError) {
+string DBGetString(HCONTACT hContact, const char *szModule, const char *szSetting, const char * pszError) {
string ret;
DBVARIANT dbv = {0};
if (! db_get(hContact, szModule, szSetting, &dbv)) {
@@ -1014,7 +1014,7 @@ void SendLinkToUser(WPARAM wParam, char *pszSrvPath) { /////////////////////////////////////////////////////////////////////
static INT_PTR nShareNewFile(WPARAM wParam, LPARAM lParam) {
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
// used to be _MAX_PATH
// changed it since selecting multiple files requires a bigger buffer
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp index c9f96d3a29..76d3e2df02 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist.cpp @@ -123,7 +123,7 @@ int InitOptionsDlg(WPARAM wParam, LPARAM) static INT_PTR LinkList_Main(WPARAM wParam, LPARAM)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HWND hWnd = WindowList_Find(hWindowList, hContact);
if ( hWnd != NULL ) {
int len;
diff --git a/plugins/HistoryLinkListPlus/src/linklist.h b/plugins/HistoryLinkListPlus/src/linklist.h index 10fd507975..9806f72204 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.h +++ b/plugins/HistoryLinkListPlus/src/linklist.h @@ -137,7 +137,7 @@ typedef struct LISTELEMENT LISTELEMENT; // Dialogbox Parameter
typedef struct{
- HANDLE hContact;
+ HCONTACT hContact;
LISTELEMENT *listStart;
UINT findMessage;
CHARRANGE chrg;
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp index 17ebfa7af0..e9986938b6 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp @@ -38,7 +38,7 @@ INT_PTR WINAPI MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) {
case WM_INITDIALOG:
{
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR title[256];
TCHAR filter[FILTERTEXT];
RECT rc;
@@ -441,7 +441,7 @@ INT_PTR WINAPI MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) case WM_DESTROY:
{
- HANDLE hContact;
+ HCONTACT hContact;
if ( db_get_b(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, 0x00) == 0x00 )
hContact = NULL;
else
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index 3e12ced1ef..a875c3fdd8 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -1202,7 +1202,7 @@ This function is derived from his Wordlookup Plugin int DBUpdate(WPARAM wParam, LPARAM lParam)
{
HANDLE hEvent=(HANDLE)lParam;
- HWND hDlg = WindowList_Find(hWindowList, (HANDLE)wParam);
+ HWND hDlg = WindowList_Find(hWindowList, (HCONTACT)wParam);
DIALOGPARAM *DlgParam;
HMENU listMenu = GetMenu(hDlg);
int linkNum = 0;
diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.cpp b/plugins/HistorySweeperLight/src/historysweeperlight.cpp index d39293a87a..5c44ba7852 100644 --- a/plugins/HistorySweeperLight/src/historysweeperlight.cpp +++ b/plugins/HistorySweeperLight/src/historysweeperlight.cpp @@ -93,7 +93,7 @@ static int CompareBookmarks( const void* p1, const void* p2 ) return (BYTE*)((BEventData*)p1)->hDBEvent - (BYTE*)((BEventData*)p2)->hDBEvent;
}
-static void GetBookmarks(HANDLE hContact, BEventData** books, size_t* bookcnt )
+static void GetBookmarks(HCONTACT hContact, BEventData** books, size_t* bookcnt )
{
*books = NULL;
*bookcnt = 0;
@@ -132,7 +132,7 @@ static void GetBookmarks(HANDLE hContact, BEventData** books, size_t* bookcnt ) }
//Sweep history from specified contact
-void SweepHistoryFromContact(HANDLE hContact, CriteriaStruct Criteria, BOOL keepUnread)
+void SweepHistoryFromContact(HCONTACT hContact, CriteriaStruct Criteria, BOOL keepUnread)
{
int lPolicy;
if (hContact == NULL) // for system history
@@ -209,7 +209,7 @@ void ShutdownAction(void) SweepHistoryFromContact(NULL, Criteria, FALSE); // sweep system history, keepunread==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))
SweepHistoryFromContact(hContact, Criteria, TRUE); // sweep contact history, keepunread==1
}
diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp index 3f3bfa84a1..438d09c5f7 100644 --- a/plugins/HistorySweeperLight/src/main.cpp +++ b/plugins/HistorySweeperLight/src/main.cpp @@ -53,7 +53,7 @@ int OnIconPressed(WPARAM wParam, LPARAM lParam) if ( !(sicd->flags & MBCF_RIGHTBUTTON) && !lstrcmpA(sicd->szModule, ModuleName)
&& db_get_b(NULL, ModuleName, "ChangeInMW", 0))
{
- int nh = sicd->dwId; HANDLE hContact = (HANDLE)wParam;
+ int nh = sicd->dwId; HCONTACT hContact = (HCONTACT)wParam;
StatusIconData sid = { sizeof(sid) };
sid.szModule = ModuleName;
@@ -62,7 +62,7 @@ int OnIconPressed(WPARAM wParam, LPARAM lParam) Srmm_ModifyIcon(hContact, &sid);
nh = (nh + 1) % 4;
- db_set_b((HANDLE)wParam, ModuleName, "SweepHistory", (BYTE)nh);
+ db_set_b((HCONTACT)wParam, ModuleName, "SweepHistory", (BYTE)nh);
sid.dwId = nh;
sid.flags = 0;
@@ -111,7 +111,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) Srmm_AddIcon(&sid);
// for new contacts
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ZeroMemory(&sid,sizeof(sid));
sweep = db_get_b(hContact, ModuleName, "SweepHistory", 0);
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index 45541bbfa7..1d8cc4d4f0 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -107,7 +107,7 @@ static void ShowAllContactIcons(HWND hwndList) SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hSystemHistory,
MAKELPARAM(0, db_get_b(NULL, ModuleName, "SweepSHistory", 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)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem,
MAKELPARAM(0, db_get_b(hContact, ModuleName, "SweepHistory", 0)));
@@ -174,7 +174,7 @@ void SaveSettings(HWND hwndDlg) db_set_b(NULL, ModuleName, "SweepSHistory",
(BYTE)SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hSystemHistory, 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)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
st = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, 0);
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index d26272f9c2..d8ae83bc32 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -41,7 +41,7 @@ HTMLBuilder::~HTMLBuilder() mir_free((void*)lastIEViewEvent.pszProto);
}
-bool HTMLBuilder::encode(HANDLE hContact, const char *proto, const wchar_t *text, wchar_t **output, int *outputSize, int level, int flags, bool isSent)
+bool HTMLBuilder::encode(HCONTACT hContact, const char *proto, const wchar_t *text, wchar_t **output, int *outputSize, int level, int flags, bool isSent)
{
TextToken *token = NULL, *token2;
switch (level) {
@@ -86,7 +86,7 @@ bool HTMLBuilder::encode(HANDLE hContact, const char *proto, const wchar_t *text return false;
}
-wchar_t* HTMLBuilder::encode(HANDLE hContact, const char *proto, const wchar_t *text, int flags, bool isSent)
+wchar_t* HTMLBuilder::encode(HCONTACT hContact, const char *proto, const wchar_t *text, int flags, bool isSent)
{
int outputSize;
wchar_t *output = NULL;
@@ -95,7 +95,7 @@ wchar_t* HTMLBuilder::encode(HANDLE hContact, const char *proto, const wchar_t * return output;
}
-char* HTMLBuilder::encodeUTF8(HANDLE hContact, const char *proto, const wchar_t *wtext, int flags, bool isSent)
+char* HTMLBuilder::encodeUTF8(HCONTACT hContact, const char *proto, const wchar_t *wtext, int flags, bool isSent)
{
char *outputStr = NULL;
if (wtext != NULL) {
@@ -107,7 +107,7 @@ char* HTMLBuilder::encodeUTF8(HANDLE hContact, const char *proto, const wchar_t return outputStr;
}
-char* HTMLBuilder::encodeUTF8(HANDLE hContact, const char *proto, const char *text, int flags, bool isSent)
+char* HTMLBuilder::encodeUTF8(HCONTACT hContact, const char *proto, const char *text, int flags, bool isSent)
{
char *outputStr = NULL;
if (text != NULL) {
@@ -118,7 +118,7 @@ char* HTMLBuilder::encodeUTF8(HANDLE hContact, const char *proto, const char *te return outputStr;
}
-char* HTMLBuilder::encodeUTF8(HANDLE hContact, const char *proto, const char *text, int cp, int flags, bool isSent)
+char* HTMLBuilder::encodeUTF8(HCONTACT hContact, const char *proto, const char *text, int cp, int flags, bool isSent)
{
char *outputStr = NULL;
if (text != NULL) {
@@ -129,12 +129,12 @@ char* HTMLBuilder::encodeUTF8(HANDLE hContact, const char *proto, const char *te return outputStr;
}
-char* HTMLBuilder::getProto(HANDLE hContact)
+char* HTMLBuilder::getProto(HCONTACT hContact)
{
return mir_strdup(GetContactProto(hContact));
}
-char* HTMLBuilder::getProto(const char *proto, HANDLE hContact)
+char* HTMLBuilder::getProto(const char *proto, HCONTACT hContact)
{
if (proto != NULL)
return mir_strdup(proto);
@@ -142,14 +142,14 @@ char* HTMLBuilder::getProto(const char *proto, HANDLE hContact) return mir_strdup(GetContactProto(hContact));
}
-char* HTMLBuilder::getRealProto(HANDLE hContact)
+char* HTMLBuilder::getRealProto(HCONTACT hContact)
{
if (hContact == NULL)
return NULL;
char *szProto = mir_strdup(GetContactProto(hContact));
if (szProto != NULL && !strcmp(szProto, "MetaContacts")) {
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
if (hContact != NULL) {
mir_free(szProto);
szProto = mir_strdup(GetContactProto(hContact));
@@ -158,21 +158,21 @@ char* HTMLBuilder::getRealProto(HANDLE hContact) return szProto;
}
-char *HTMLBuilder::getRealProto(HANDLE hContact, const char *szProto)
+char *HTMLBuilder::getRealProto(HCONTACT hContact, const char *szProto)
{
if (szProto != NULL && !strcmp(szProto, "MetaContacts")) {
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
if (hContact != NULL)
return mir_strdup(GetContactProto(hContact));
}
return mir_strdup(szProto);
}
-HANDLE HTMLBuilder::getRealContact(HANDLE hContact)
+HCONTACT HTMLBuilder::getRealContact(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto,"MetaContacts"))
- hContact = (HANDLE) CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
return hContact;
}
@@ -208,7 +208,7 @@ bool HTMLBuilder::isSameDate(time_t time1, time_t time2) return false;
}
-void HTMLBuilder::getUINs(HANDLE hContact, char *&uinIn, char *&uinOut)
+void HTMLBuilder::getUINs(HCONTACT hContact, char *&uinIn, char *&uinOut)
{
CONTACTINFO ci;
char buf[128];
@@ -250,7 +250,7 @@ void HTMLBuilder::getUINs(HANDLE hContact, char *&uinIn, char *&uinOut) mir_free(szProto);
}
-wchar_t *HTMLBuilder::getContactName(HANDLE hContact, const char *szProto)
+wchar_t *HTMLBuilder::getContactName(HCONTACT hContact, const char *szProto)
{
CONTACTINFO ci = {0};
wchar_t *szName = NULL;
@@ -287,7 +287,7 @@ wchar_t *HTMLBuilder::getContactName(HANDLE hContact, const char *szProto) return mir_tstrdup(TranslateT("(Unknown Contact)"));
}
-char *HTMLBuilder::getEncodedContactName(HANDLE hContact, const char* szProto, const char* szSmileyProto)
+char *HTMLBuilder::getEncodedContactName(HCONTACT hContact, const char* szProto, const char* szSmileyProto)
{
char *szName = NULL;
wchar_t *name = getContactName(hContact, szProto);
@@ -432,7 +432,7 @@ ProtocolSettings* HTMLBuilder::getSRMMProtocolSettings(const char *protocolName) return protoSettings;
}
-ProtocolSettings* HTMLBuilder::getSRMMProtocolSettings(HANDLE hContact)
+ProtocolSettings* HTMLBuilder::getSRMMProtocolSettings(HCONTACT hContact)
{
return getSRMMProtocolSettings( ptrA(getRealProto(hContact)));
}
@@ -446,7 +446,7 @@ ProtocolSettings* HTMLBuilder::getHistoryProtocolSettings(const char *protocolNa return protoSettings;
}
-ProtocolSettings* HTMLBuilder::getHistoryProtocolSettings(HANDLE hContact)
+ProtocolSettings* HTMLBuilder::getHistoryProtocolSettings(HCONTACT hContact)
{
if (hContact != NULL)
return getHistoryProtocolSettings( ptrA(getRealProto(hContact)));
@@ -463,7 +463,7 @@ ProtocolSettings* HTMLBuilder::getChatProtocolSettings(const char *protocolName) return protoSettings;
}
-ProtocolSettings* HTMLBuilder::getChatProtocolSettings(HANDLE hContact)
+ProtocolSettings* HTMLBuilder::getChatProtocolSettings(HCONTACT hContact)
{
return getChatProtocolSettings( ptrA(getRealProto(hContact)));
}
diff --git a/plugins/IEView/src/HTMLBuilder.h b/plugins/IEView/src/HTMLBuilder.h index a5bdf24329..4c082c0f47 100644 --- a/plugins/IEView/src/HTMLBuilder.h +++ b/plugins/IEView/src/HTMLBuilder.h @@ -50,19 +50,19 @@ protected: ENF_CHAT_FORMATTING = 256
};
// virtual char *encode(const char *text, const char *proto, bool replaceSmiley);
- virtual char *encodeUTF8(HANDLE hContact, const char *proto, const wchar_t *text, int flags, bool isSent);
- virtual char *encodeUTF8(HANDLE hContact, const char *proto, const char *text, int flags, bool isSent);
- virtual char *encodeUTF8(HANDLE hContact, const char *proto, const char *text, int cp, int flags, bool isSent);
- virtual wchar_t *encode(HANDLE hContact, const char *proto, const wchar_t *text, int flags, bool isSent);
- virtual bool encode(HANDLE hContact, const char *proto, const wchar_t *text, wchar_t **output, int *outputSize, int level, int flags, bool isSent);
- virtual char* getProto(HANDLE hContact);
- virtual char* getProto(const char *proto, HANDLE hContact);
- virtual char* getRealProto(HANDLE hContact);
- virtual char* getRealProto(HANDLE hContact, const char *proto);
- virtual wchar_t *getContactName(HANDLE hContact, const char* szProto);
- virtual char *getEncodedContactName(HANDLE hContact, const char *szProto, const char *szSmileyProto);
- virtual void getUINs(HANDLE hContact, char *&uinIn, char *&uinOut);
- virtual HANDLE getRealContact(HANDLE hContact);
+ virtual char *encodeUTF8(HCONTACT hContact, const char *proto, const wchar_t *text, int flags, bool isSent);
+ virtual char *encodeUTF8(HCONTACT hContact, const char *proto, const char *text, int flags, bool isSent);
+ virtual char *encodeUTF8(HCONTACT hContact, const char *proto, const char *text, int cp, int flags, bool isSent);
+ virtual wchar_t *encode(HCONTACT hContact, const char *proto, const wchar_t *text, int flags, bool isSent);
+ virtual bool encode(HCONTACT hContact, const char *proto, const wchar_t *text, wchar_t **output, int *outputSize, int level, int flags, bool isSent);
+ virtual char* getProto(HCONTACT hContact);
+ virtual char* getProto(const char *proto, HCONTACT hContact);
+ virtual char* getRealProto(HCONTACT hContact);
+ virtual char* getRealProto(HCONTACT hContact, const char *proto);
+ virtual wchar_t *getContactName(HCONTACT hContact, const char* szProto);
+ virtual char *getEncodedContactName(HCONTACT hContact, const char *szProto, const char *szSmileyProto);
+ virtual void getUINs(HCONTACT hContact, char *&uinIn, char *&uinOut);
+ virtual HCONTACT getRealContact(HCONTACT hContact);
virtual DWORD getLastEventTime();
virtual void setLastEventTime(DWORD);
virtual int getLastEventType();
@@ -70,11 +70,11 @@ protected: virtual bool isSameDate(time_t time1, time_t time2);
virtual bool isDbEventShown(DBEVENTINFO * dbei)=0;
virtual ProtocolSettings *getSRMMProtocolSettings(const char *protocolName);
- virtual ProtocolSettings *getSRMMProtocolSettings(HANDLE hContact);
+ virtual ProtocolSettings *getSRMMProtocolSettings(HCONTACT hContact);
virtual ProtocolSettings *getHistoryProtocolSettings(const char *protocolName);
- virtual ProtocolSettings *getHistoryProtocolSettings(HANDLE hContact);
+ virtual ProtocolSettings *getHistoryProtocolSettings(HCONTACT hContact);
virtual ProtocolSettings *getChatProtocolSettings(const char *protocolName);
- virtual ProtocolSettings *getChatProtocolSettings(HANDLE hContact);
+ virtual ProtocolSettings *getChatProtocolSettings(HCONTACT hContact);
void setLastIEViewEvent(IEVIEWEVENT *event);
virtual void buildHead(IEView *, IEVIEWEVENT *event)=0;
public:
diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp index 1925a59f98..8e2212c6cb 100644 --- a/plugins/IEView/src/IEView.cpp +++ b/plugins/IEView/src/IEView.cpp @@ -1016,7 +1016,7 @@ HWND IEView::getHWND() return hwnd;
}
-void IEView::setContact(HANDLE hContact)
+void IEView::setContact(HCONTACT hContact)
{
this->hContact = hContact;
isContactSet = true;
diff --git a/plugins/IEView/src/IEView.h b/plugins/IEView/src/IEView.h index 156affb2c4..c552525c84 100644 --- a/plugins/IEView/src/IEView.h +++ b/plugins/IEView/src/IEView.h @@ -551,7 +551,7 @@ public: void navigate(IEVIEWNAVIGATE * nav);
void saveDocument();
- void setContact(HANDLE hContact);
+ void setContact(HCONTACT hContact);
static IEView* get(HWND);
static void init();
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index 2a090a77d0..7ab1ee59af 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -40,7 +40,7 @@ TemplateHTMLBuilder::~TemplateHTMLBuilder() mir_free(flashAvatars[i]);
}
-char *TemplateHTMLBuilder::getAvatar(HANDLE hContact, const char* szProto)
+char *TemplateHTMLBuilder::getAvatar(HCONTACT hContact, const char* szProto)
{
DBVARIANT dbv;
TCHAR tmpPath[MAX_PATH];
@@ -159,7 +159,6 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr CONTACTINFO ci;
char tempBase[1024];
char tempStr[1024];
- HANDLE hRealContact;
char *szRealProto = NULL;
char *szBase=NULL;
char *szNoAvatar=NULL;
@@ -177,7 +176,7 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr char *output;
output = NULL;
- hRealContact = getRealContact(event->hContact);
+ HCONTACT hRealContact = getRealContact(event->hContact);
szRealProto = getProto(hRealContact);
szProto = getProto(event->pszProto, event->hContact);
tempBase[0]='\0';
@@ -327,7 +326,6 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, {
DBVARIANT dbv;
CONTACTINFO ci;
- HANDLE hRealContact;
char *szRealProto = NULL;
char tempBase[1024];
char *szBase=NULL;
@@ -354,7 +352,7 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, if (protoSettings == NULL)
return;
- hRealContact = getRealContact(event->hContact);
+ HCONTACT hRealContact = getRealContact(event->hContact);
szRealProto = getProto(hRealContact);
szProto = getProto(event->pszProto, event->hContact);
tempBase[0]='\0';
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.h b/plugins/IEView/src/TemplateHTMLBuilder.h index a6193db6e1..3bde284df3 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.h +++ b/plugins/IEView/src/TemplateHTMLBuilder.h @@ -36,7 +36,7 @@ protected: time_t flashAvatarsTime[2];
char * flashAvatars[2];
const char *getFlashAvatar(const TCHAR *file, int index);
- char *getAvatar(HANDLE hContact, const char *szProto);
+ char *getAvatar(HCONTACT hContact, const char *szProto);
void buildHeadTemplate(IEView *, IEVIEWEVENT *event, ProtocolSettings* protoSettings);
void appendEventTemplate(IEView *, IEVIEWEVENT *event, ProtocolSettings* protoSettings);
virtual TemplateMap *getTemplateMap(ProtocolSettings *);
diff --git a/plugins/IEView/src/TextToken.cpp b/plugins/IEView/src/TextToken.cpp index 103fcc629c..9c69b927b1 100644 --- a/plugins/IEView/src/TextToken.cpp +++ b/plugins/IEView/src/TextToken.cpp @@ -425,7 +425,7 @@ TextToken* TextToken::tokenizeLinks(const wchar_t *text) { return firstToken;
}
-TextToken* TextToken::tokenizeSmileys(HANDLE hContact, const char *proto, const wchar_t *text, bool isSent) {
+TextToken* TextToken::tokenizeSmileys(HCONTACT hContact, const char *proto, const wchar_t *text, bool isSent) {
TextToken *firstToken = NULL, *lastToken = NULL;
SMADD_BATCHPARSE2 sp;
SMADD_BATCHPARSERES *spRes;
diff --git a/plugins/IEView/src/TextToken.h b/plugins/IEView/src/TextToken.h index ad6c46d711..1085fb75f9 100644 --- a/plugins/IEView/src/TextToken.h +++ b/plugins/IEView/src/TextToken.h @@ -82,7 +82,7 @@ public: // UNICODE
wchar_t * htmlEncode(const wchar_t *str);
static TextToken* tokenizeLinks(const wchar_t *wtext);
- static TextToken* tokenizeSmileys(HANDLE hContact, const char *proto, const wchar_t *wtext, bool isSent);
+ static TextToken* tokenizeSmileys(HCONTACT hContact, const char *proto, const wchar_t *wtext, bool isSent);
static TextToken* tokenizeBBCodes(const wchar_t *text);
static TextToken* tokenizeMath(const wchar_t *text);
static TextToken* tokenizeChatFormatting(const wchar_t *text);
diff --git a/plugins/IgnoreState/src/commonheaders.h b/plugins/IgnoreState/src/commonheaders.h index 8b019ab20d..52fa5d27e2 100644 --- a/plugins/IgnoreState/src/commonheaders.h +++ b/plugins/IgnoreState/src/commonheaders.h @@ -60,7 +60,7 @@ static byte bUseMirandaSettings; extern HINSTANCE g_hInst;
-void applyExtraImage(HANDLE hContact);
+void applyExtraImage(HCONTACT hContact);
int onOptInitialise(WPARAM wParam, LPARAM lParam);
BOOL checkState(int type);
diff --git a/plugins/IgnoreState/src/main.cpp b/plugins/IgnoreState/src/main.cpp index bff3520324..2c18b18563 100644 --- a/plugins/IgnoreState/src/main.cpp +++ b/plugins/IgnoreState/src/main.cpp @@ -79,7 +79,7 @@ inline BOOL checkState(int type) return ((currentFilter>>(type-1))&1);
}
-INT_PTR isIgnored(HANDLE hContact, int type)
+INT_PTR isIgnored(HCONTACT hContact, int type)
{
int all = 0, filtered = 0;
@@ -93,7 +93,7 @@ INT_PTR isIgnored(HANDLE hContact, int type) return (all+filtered == SIZEOF(ii)-1) ? 1 : (all > 0 ? -1 : 0) ;
}
-void applyExtraImage(HANDLE hContact)
+void applyExtraImage(HCONTACT hContact)
{
int ignore = isIgnored(hContact, IGNOREEVENT_ALL);
if (ignore == 1)
@@ -141,7 +141,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) hExtraIcon = ExtraIcon_Register("ignore", LPGEN("Ignore State"), "ignore_full");
// Set initial value for all contacts
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
applyExtraImage(hContact);
return 0;
@@ -150,7 +150,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) int onContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if ( !lstrcmpA(cws->szModule, "Ignore") && !lstrcmpA(cws->szSetting, "Mask1"))
applyExtraImage(hContact);
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index dbb6e5a02b..5a8b873fb9 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -65,8 +65,8 @@ static MCONTACT HContactFromNumericID(char *pszProtoName, char *pszSetting, DWOR {
MCONTACT hContact = dstDb->FindFirstContact();
while (hContact != NULL) {
- if ( db_get_dw((HANDLE)hContact, pszProtoName, pszSetting, 0) == dwID) {
- char* szProto = GetContactProto((HANDLE)hContact);
+ if ( db_get_dw((HCONTACT)hContact, pszProtoName, pszSetting, 0) == dwID) {
+ char* szProto = GetContactProto((HCONTACT)hContact);
if (szProto != NULL && !lstrcmpA(szProto, pszProtoName))
return hContact;
}
@@ -79,9 +79,9 @@ static MCONTACT HContactFromID(char *pszProtoName, char *pszSetting, TCHAR *pwsz {
MCONTACT hContact = dstDb->FindFirstContact();
while (hContact != NULL) {
- char* szProto = GetContactProto((HANDLE)hContact);
+ char* szProto = GetContactProto((HCONTACT)hContact);
if ( !lstrcmpA(szProto, pszProtoName)) {
- ptrW id(db_get_tsa((HANDLE)hContact, pszProtoName, pszSetting));
+ ptrW id(db_get_tsa((HCONTACT)hContact, pszProtoName, pszSetting));
if ( !lstrcmp(pwszID, id))
return hContact;
}
@@ -107,7 +107,7 @@ static MCONTACT HistoryImportFindContact(HWND hdlgProgress, char* szModuleName, hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)szModuleName);
- db_set_dw((HANDLE)hContact, szModuleName, "UIN", uin);
+ db_set_dw((HCONTACT)hContact, szModuleName, "UIN", uin);
AddMessage( LPGENT("Added contact %u (found in history)"), uin );
return hContact;
}
@@ -125,10 +125,10 @@ static MCONTACT AddContact(HWND hdlgProgress, char* szProto, char* pszUniqueSett mySet(hContact, szProto, pszUniqueSetting, id);
- CreateGroup(group, (HANDLE)hContact);
+ CreateGroup(group, (HCONTACT)hContact);
if (nick && *nick) {
- db_set_ws((HANDLE)hContact, "CList", "MyHandle", nick);
+ db_set_ws((HCONTACT)hContact, "CList", "MyHandle", nick);
AddMessage(LPGENT("Added %S contact %s, '%s'"), szProto, pszUserID, nick);
}
else AddMessage(LPGENT("Added %S contact %s"), szProto, pszUserID);
@@ -404,7 +404,7 @@ static void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoC if (!skip) {
// Check for duplicate entries
- if (!IsDuplicateEvent((HANDLE)hDst, dbei)) {
+ if (!IsDuplicateEvent((HCONTACT)hDst, dbei)) {
// Add dbevent
if (!bIsVoidContact)
dbei.flags &= ~DBEF_FIRST;
diff --git a/plugins/Import/src/import.h b/plugins/Import/src/import.h index eb8bfe696f..02fffe59d6 100644 --- a/plugins/Import/src/import.h +++ b/plugins/Import/src/import.h @@ -94,7 +94,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void AddMessage( const TCHAR* fmt, ... );
-void mySet( HANDLE hContact, const char* module, const char* var, DBVARIANT* dbv );
+void mySet(HCONTACT hContact, const char* module, const char* var, DBVARIANT* dbv );
INT_PTR CALLBACK WizardIntroPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ProgressPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
@@ -104,9 +104,9 @@ INT_PTR CALLBACK MirandaAdvOptionsPageProc(HWND hdlg,UINT message,WPARAM wParam, INT_PTR CALLBACK FinishedPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
BOOL IsProtocolLoaded(char* pszProtocolName);
-BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO dbei);
+BOOL IsDuplicateEvent(HCONTACT hContact, DBEVENTINFO dbei);
-int CreateGroup(const TCHAR* name, HANDLE hContact);
+int CreateGroup(const TCHAR* name, HCONTACT hContact);
extern HINSTANCE hInst;
extern HANDLE hIcoHandle;
diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp index 58bad9efc9..c5660133ba 100644 --- a/plugins/Import/src/utils.cpp +++ b/plugins/Import/src/utils.cpp @@ -35,7 +35,7 @@ BOOL IsProtocolLoaded(char* pszProtocolName) // If contact is specified adds it to group
// ------------------------------------------------
// Returns 1 if successful and 0 when it fails.
-int CreateGroup(const TCHAR* group, HANDLE hContact)
+int CreateGroup(const TCHAR* group, HCONTACT hContact)
{
if (group == NULL)
return 0;
@@ -55,9 +55,9 @@ int CreateGroup(const TCHAR* group, HANDLE hContact) if ( !lstrcmp(dbv.ptszVal + 1, tszGrpName + 1 )) {
if (hContact)
- db_set_ts( hContact, "CList", "Group", tszGrpName+1 );
+ db_set_ts(hContact, "CList", "Group", tszGrpName + 1);
else
- AddMessage( LPGENT("Skipping duplicate group %s."), tszGrpName + 1);
+ AddMessage(LPGENT("Skipping duplicate group %s."), tszGrpName + 1);
db_free(&dbv);
return 0;
@@ -75,7 +75,7 @@ int CreateGroup(const TCHAR* group, HANDLE hContact) }
// Returns TRUE if the event already exist in the database
-BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO dbei)
+BOOL IsDuplicateEvent(HCONTACT hContact, DBEVENTINFO dbei)
{
static DWORD dwPreviousTimeStamp = -1;
static HANDLE hPreviousContact = INVALID_HANDLE_VALUE;
diff --git a/plugins/KeyboardNotify/src/ignore.cpp b/plugins/KeyboardNotify/src/ignore.cpp index 6ce81f49cb..d32e9af102 100644 --- a/plugins/KeyboardNotify/src/ignore.cpp +++ b/plugins/KeyboardNotify/src/ignore.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX] = {PF1_IMRECV, PF1_URLRECV, PF1_FILERECV, 0xFFFFFFFF};
-static DWORD GetMask(HANDLE hContact)
+static DWORD GetMask(HCONTACT hContact)
{
DWORD mask = db_get_dw(hContact, KEYBDMODULE, "Mask1", (DWORD)(-1));
if(mask == (DWORD)(-1)) {
@@ -156,7 +156,7 @@ static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int }
}
-static void InitialiseItem(HWND hwndList, HANDLE hContact, HANDLE hItem, DWORD protoCaps)
+static void InitialiseItem(HWND hwndList, HCONTACT hContact, HANDLE hItem, DWORD protoCaps)
{
DWORD mask;
int i;
@@ -169,7 +169,7 @@ static void InitialiseItem(HWND hwndList, HANDLE hContact, HANDLE hItem, DWORD p SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX+1, 2));
}
-static void SaveItemMask(HWND hwndList, HANDLE hContact, HANDLE hItem, const char *pszSetting)
+static void SaveItemMask(HWND hwndList, HCONTACT hContact, HANDLE hItem, const char *pszSetting)
{
DWORD mask;
int i, iImage;
@@ -186,7 +186,7 @@ static void SetAllContactIcons(HWND hwndList) {
DWORD protoCaps;
- 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)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if(hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == EMPTY_EXTRA_ICON) {
char *szProto = GetContactProto(hContact);
@@ -310,7 +310,7 @@ INT_PTR CALLBACK DlgProcIgnoreOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA {
case PSN_APPLY:
{
- 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_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if(hItem)
SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), hContact, hItem, "Mask1");
@@ -336,7 +336,7 @@ INT_PTR CALLBACK DlgProcIgnoreOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA return FALSE;
}
-BOOL IsIgnored(HANDLE hContact, WORD eventType)
+BOOL IsIgnored(HCONTACT hContact, WORD eventType)
{
WORD ignoreID = 0;
DWORD mask = GetMask(hContact);
diff --git a/plugins/KeyboardNotify/src/ignore.h b/plugins/KeyboardNotify/src/ignore.h index a72df7b6f6..56c738e4da 100644 --- a/plugins/KeyboardNotify/src/ignore.h +++ b/plugins/KeyboardNotify/src/ignore.h @@ -16,5 +16,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-BOOL IsIgnored(HANDLE, WORD);
+BOOL IsIgnored(HCONTACT, WORD);
INT_PTR CALLBACK DlgProcIgnoreOptions(HWND, UINT, WPARAM, LPARAM);
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 4e47de9f8c..98dda0467d 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -121,9 +121,9 @@ static LRESULT CALLBACK KeyBoardHookFunction(int, WPARAM, LPARAM); static LRESULT CALLBACK MirandaMouseHookFunction(int, WPARAM, LPARAM);
static LRESULT CALLBACK MirandaKeyBoardHookFunction(int, WPARAM, LPARAM);
static LRESULT CALLBACK MirandaWndProcHookFunction(int, WPARAM, LPARAM);
-BOOL CheckMsgWnd(HANDLE, BOOL *);
+BOOL CheckMsgWnd(HCONTACT, BOOL *);
-BOOL isMetaContactsSubContact(HANDLE hMetaContact, HANDLE hContact)
+BOOL isMetaContactsSubContact(HCONTACT hMetaContact, HCONTACT hContact)
{
char *szProto = GetContactProto(hMetaContact);
if (szProto && !strcmp(szMetaProto, szProto)) { // Safety check
@@ -134,7 +134,7 @@ BOOL isMetaContactsSubContact(HANDLE hMetaContact, HANDLE hContact) return FALSE;
}
-BOOL checkOpenWindow(HANDLE hContact)
+BOOL checkOpenWindow(HCONTACT hContact)
{
BOOL found, focus;
@@ -143,7 +143,7 @@ BOOL checkOpenWindow(HANDLE hContact) found = CheckMsgWnd(hContact, &focus);
if (!found && szMetaProto && bMetaProtoEnabled) {
- HANDLE hMetaContact = (HANDLE)db_get_dw(hContact, szMetaProto, "Handle", 0);
+ HCONTACT hMetaContact = (HCONTACT)db_get_dw(hContact, szMetaProto, "Handle", 0);
if (hMetaContact && isMetaContactsSubContact(hMetaContact, hContact))
found = CheckMsgWnd(hMetaContact, &focus);
}
@@ -221,7 +221,7 @@ BOOL checkGlobalXstatus() return protosSupporting == 0;
}
-DBEVENTINFO createMsgEventInfo(HANDLE hContact)
+DBEVENTINFO createMsgEventInfo(HCONTACT hContact)
{
DBEVENTINFO einfo = { sizeof(einfo) };
einfo.eventType = EVENTTYPE_MESSAGE;
@@ -229,7 +229,7 @@ DBEVENTINFO createMsgEventInfo(HANDLE hContact) return einfo;
}
-DBEVENTINFO readEventInfo(HANDLE hDbEvent, HANDLE hContact)
+DBEVENTINFO readEventInfo(HANDLE hDbEvent, HCONTACT hContact)
{
if (hDbEvent == NCONVERS_BLINKID) // we need to handle nconvers' blink event
return createMsgEventInfo(hContact);
@@ -239,7 +239,7 @@ DBEVENTINFO readEventInfo(HANDLE hDbEvent, HANDLE hContact) return einfo;
}
-BOOL checkIgnore(HANDLE hContact, WORD eventType)
+BOOL checkIgnore(HCONTACT hContact, WORD eventType)
{
return !IsIgnored(hContact, eventType);
}
@@ -256,12 +256,12 @@ BOOL checkProtocol(char *szProto) return FALSE;
}
-BOOL metaCheckProtocol(char *szProto, HANDLE hContact, WORD eventType)
+BOOL metaCheckProtocol(char *szProto, HCONTACT hContact, WORD eventType)
{
- HANDLE hSubContact=NULL;
+ HCONTACT hSubContact=NULL;
if (szMetaProto && bMetaProtoEnabled && szProto && !strcmp(szMetaProto, szProto))
- if (hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0))
+ if (hSubContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0))
szProto = GetContactProto(hSubContact);
return checkProtocol(szProto) && checkIgnore(hSubContact?hSubContact:hContact, eventType);
@@ -379,10 +379,10 @@ BOOL checkMsgTimestamp(HANDLE hEventCurrent, DWORD timestampCurrent) }
-BOOL contactCheckProtocol(char *szProto, HANDLE hContact, WORD eventType)
+BOOL contactCheckProtocol(char *szProto, HCONTACT hContact, WORD eventType)
{
if (szMetaProto && bMetaProtoEnabled && hContact) {
- HANDLE hMetaContact = (HANDLE)db_get_dw(hContact, szMetaProto, "Handle", 0);
+ HCONTACT hMetaContact = (HCONTACT)db_get_dw(hContact, szMetaProto, "Handle", 0);
if (hMetaContact && isMetaContactsSubContact(hMetaContact, hContact))
return FALSE;
}
@@ -427,7 +427,7 @@ BOOL checkXstatus(char *szProto) // 'Pings' the FlashThread to keep the LEDs flashing.
static int PluginMessageEventHook(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HANDLE hEvent = (HANDLE)lParam;
//get DBEVENTINFO without pBlob
@@ -986,7 +986,7 @@ static LRESULT CALLBACK MirandaWndProcHookFunction(int code, WPARAM wParam, LPAR return CallNextHookEx(hMirandaWndProcHook, code, wParam, lParam);
}
-BOOL CheckMsgWnd(HANDLE hContact, BOOL *focus)
+BOOL CheckMsgWnd(HCONTACT hContact, BOOL *focus)
{
if (ServiceExists(MS_MSG_GETWINDOWDATA)) { // use the new message API
MessageWindowData mwd = { sizeof(MessageWindowData) };
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 7a3e844450..6817b374bd 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -67,7 +67,7 @@ INT_PTR GetParsedFormat(WPARAM wParam,LPARAM lParam); INT_PTR GetOverrideContactOption(WPARAM wParam,LPARAM lParam);
INT_PTR GetUnknownText(WPARAM wParam,LPARAM lParam);
INT_PTR SetNewSong(WPARAM wParam,LPARAM lParam);
-void SetExtraIcon(HANDLE hContact, BOOL set);
+void SetExtraIcon(HCONTACT hContact, BOOL set);
void SetListeningInfos(LISTENINGTOINFO *lti = NULL);
INT_PTR HotkeysEnable(WPARAM wParam,LPARAM lParam);
INT_PTR HotkeysDisable(WPARAM wParam,LPARAM lParam);
@@ -288,7 +288,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) // Extra icon support
hExtraIcon = ExtraIcon_Register(MODULE_NAME, LPGEN("Listening to music"), "listening_to_icon");
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *proto = GetContactProto(hContact);
if (proto != NULL) {
DBVARIANT dbv;
@@ -947,14 +947,14 @@ void HasNewListeningInfo() }
-void SetExtraIcon(HANDLE hContact, BOOL set)
+void SetExtraIcon(HCONTACT hContact, BOOL set)
{
ExtraIcon_SetIcon(hExtraIcon, hContact, set ? "listening_to_icon" : NULL);
}
int SettingChanged(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT) wParam;
if (hContact == NULL)
return 0;
diff --git a/plugins/ListeningTo/src/players/mradio.cpp b/plugins/ListeningTo/src/players/mradio.cpp index d8e23508a3..c0132d1de5 100644 --- a/plugins/ListeningTo/src/players/mradio.cpp +++ b/plugins/ListeningTo/src/players/mradio.cpp @@ -34,7 +34,7 @@ void MRadio::EnableDisable() int MRadio::GetData()
{
- for (HANDLE hContact = db_find_first("mRadio"); hContact; hContact = db_find_next(hContact, "mRadio")) {
+ for (HCONTACT hContact = db_find_first("mRadio"); hContact; hContact = db_find_next(hContact, "mRadio")) {
WORD status = db_get_w(hContact, "mRadio", "Status", ID_STATUS_OFFLINE);
if (status != ID_STATUS_ONLINE)
continue;
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index c349d8243e..6f9792b6ca 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -1634,7 +1634,7 @@ extern "C" int __declspec(dllexport) Load(void) CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
//set all contacts to offline ///TODO: are that contacts exists ?
- for(HANDLE hContact = db_find_first(PLUGINNAME); hContact; hContact = db_find_next(hContact, PLUGINNAME)){
+ for(HCONTACT hContact = db_find_first(PLUGINNAME); hContact; hContact = db_find_next(hContact, PLUGINNAME)){
db_set_w(hContact, PLUGINNAME, "status", ID_STATUS_OFFLINE);
}
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index bbed4dd6db..d2f6888f4f 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -99,7 +99,7 @@ typedef struct { struct ModSetLinkLinkItem *last;
} ModuleSettingLL;
-int GetSetting(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
+int GetSetting(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
return db_get_s(hContact, szModule, szSetting, dbv, 0);
}
@@ -155,7 +155,7 @@ void FreeModuleSettingLL(ModuleSettingLL* msll) }
}
-void RenameDbProto(HANDLE hContact, HANDLE hContactNew, char* oldName, char* newName, int delOld)
+void RenameDbProto(HCONTACT hContact, HCONTACT hContactNew, char* oldName, char* newName, int delOld)
{
DBVARIANT dbv;
ModuleSettingLL settinglist;
@@ -202,7 +202,7 @@ void RenameDbProto(HANDLE hContact, HANDLE hContactNew, char* oldName, char* new FreeModuleSettingLL(&settinglist);
} // end code from dbe++
-void ShowPopup(char* szText, TCHAR* tszText, HANDLE hContact)
+void ShowPopup(char* szText, TCHAR* tszText, HCONTACT hContact)
{
POPUPDATAT ppd = {0};
TCHAR* text = 0;
@@ -223,7 +223,7 @@ void ShowPopup(char* szText, TCHAR* tszText, HANDLE hContact) mir_free(text);
}
-BOOL DirectoryExists(HANDLE hContact)
+BOOL DirectoryExists(HCONTACT hContact)
{
int attr;
char path[MAX_PATH];
@@ -259,7 +259,7 @@ void CopyToClipboard(HWND hwnd,LPSTR pszMsg, LPTSTR ptszMsg) CloseClipboard();
}
-BOOL isMetaContact(HANDLE hContact)
+BOOL isMetaContact(HCONTACT hContact)
{
char *proto;
if (bMetaContacts) {
@@ -271,30 +271,30 @@ BOOL isMetaContact(HANDLE hContact) return FALSE;
}
-HANDLE getDefaultContact(HANDLE hContact)
+HCONTACT getDefaultContact(HCONTACT hContact)
{
if (bMetaContacts)
- return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT, (WPARAM)hContact, 0);
+ return (HCONTACT)CallService(MS_MC_GETDEFAULTCONTACT, (WPARAM)hContact, 0);
return 0;
}
-HANDLE getMostOnline(HANDLE hContact)
+HCONTACT getMostOnline(HCONTACT hContact)
{
if (bMetaContacts)
- return (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ return (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
return 0;
}
-void GetID(HANDLE hContact,LPSTR szProto,LPSTR szID)
+void GetID(HCONTACT hContact, LPSTR szProto, LPSTR szID)
{
DBVARIANT dbv_uniqueid;
- LPSTR uID = (LPSTR) CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if ( uID == (LPSTR)CALLSERVICE_NOTFOUND )
+ LPSTR uID = (LPSTR)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
+ if (uID == (LPSTR)CALLSERVICE_NOTFOUND)
uID = NULL;
*szID = '\0';
- if ( uID && db_get(hContact, szProto, uID ,&dbv_uniqueid) == 0 ) {
+ if (uID && db_get(hContact, szProto, uID, &dbv_uniqueid) == 0) {
if (dbv_uniqueid.type == DBVT_DWORD)
wsprintfA(szID, "%u", dbv_uniqueid.dVal); //!!!!!!!!!
else if (dbv_uniqueid.type == DBVT_WORD)
@@ -308,7 +308,7 @@ void GetID(HANDLE hContact,LPSTR szProto,LPSTR szID) }
}
-int StatusMsgExists(HANDLE hContact)
+int StatusMsgExists(HCONTACT hContact)
{
char par[32];
BOOL ret = 0;
@@ -332,7 +332,7 @@ int StatusMsgExists(HANDLE hContact) return ret;
}
-BOOL IPExists(HANDLE hContact)
+BOOL IPExists(HCONTACT hContact)
{
LPSTR szProto;
DWORD mIP,rIP;
@@ -346,7 +346,7 @@ BOOL IPExists(HANDLE hContact) return (mIP != 0 || rIP != 0);
}
-BOOL MirVerExists(HANDLE hContact)
+BOOL MirVerExists(HCONTACT hContact)
{
LPSTR szProto, msg;
BOOL ret = 0;
@@ -363,7 +363,7 @@ BOOL MirVerExists(HANDLE hContact) return ret;
}
-void getIP(HANDLE hContact,LPSTR szProto,LPSTR szIP)
+void getIP(HCONTACT hContact,LPSTR szProto,LPSTR szIP)
{
char szmIP[64] = {0};
char szrIP[64] = {0};
@@ -377,7 +377,7 @@ void getIP(HANDLE hContact,LPSTR szProto,LPSTR szIP) strcat(szIP, szmIP);
}
-LPTSTR getMirVer(HANDLE hContact)
+LPTSTR getMirVer(HCONTACT hContact)
{
LPSTR szProto = GetContactProto(hContact);
if (!szProto) return NULL;
@@ -414,7 +414,7 @@ static LRESULT CALLBACK AuthReqEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam INT_PTR CALLBACK AuthReqWndProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
{
- static HANDLE hcontact;
+ static HCONTACT hcontact;
switch(msg){
case WM_INITDIALOG:
@@ -422,7 +422,7 @@ INT_PTR CALLBACK AuthReqWndProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) mir_subclassWindow( GetDlgItem(hdlg, IDC_REASON), AuthReqEditSubclassProc);
SendDlgItemMessage(hdlg, IDC_REASON, EM_LIMITTEXT, (WPARAM)255, 0);
SetDlgItemText(hdlg, IDC_REASON, TranslateT("Please authorize me to add you to my contact list."));
- hcontact = (HANDLE)lparam;
+ hcontact = (HCONTACT)lparam;
break;
case WM_COMMAND:
@@ -458,11 +458,11 @@ BOOL isProtoOnline(char *szProto) INT_PTR onSendAuthRequest(WPARAM wparam,LPARAM lparam)
{
DWORD flags;
- char *szProto = GetContactProto((HANDLE)wparam);
+ char *szProto = GetContactProto((HCONTACT)wparam);
flags = CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_4,0);
if (flags&PF4_NOCUSTOMAUTH)
- CallContactService((HANDLE)wparam,PSS_AUTHREQUEST,0, (LPARAM)"");
+ CallContactService((HCONTACT)wparam, PSS_AUTHREQUEST, 0, (LPARAM)"");
else
CreateDialogParam(hinstance,MAKEINTRESOURCE(IDD_AUTHREQ),(HWND)CallService(MS_CLUI_GETHWND,0,0),AuthReqWndProc,(LPARAM)wparam);
@@ -471,27 +471,27 @@ INT_PTR onSendAuthRequest(WPARAM wparam,LPARAM lparam) INT_PTR onSendAdded(WPARAM wparam,LPARAM lparam)
{
- CallContactService((HANDLE)wparam,PSS_ADDED,0,0);
+ CallContactService((HCONTACT)wparam, PSS_ADDED, 0, 0);
return 0;
}
// set the invisible-flag in db
INT_PTR onSetInvis(WPARAM wparam,LPARAM lparam)
{
- CallContactService((HANDLE)wparam,PSS_SETAPPARENTMODE,(db_get_w((HANDLE)wparam, GetContactProto((HANDLE)wparam),"ApparentMode",0) == ID_STATUS_OFFLINE)?0:ID_STATUS_OFFLINE,0);
+ CallContactService((HCONTACT)wparam, PSS_SETAPPARENTMODE, (db_get_w((HCONTACT)wparam, GetContactProto((HCONTACT)wparam), "ApparentMode", 0) == ID_STATUS_OFFLINE) ? 0 : ID_STATUS_OFFLINE, 0);
return 0;
}
// set visible-flag in db
INT_PTR onSetVis(WPARAM wparam,LPARAM lparam)
{
- CallContactService((HANDLE)wparam,PSS_SETAPPARENTMODE,(db_get_w((HANDLE)wparam, GetContactProto((HANDLE)wparam),"ApparentMode",0) == ID_STATUS_ONLINE)?0:ID_STATUS_ONLINE,0);
+ CallContactService((HCONTACT)wparam, PSS_SETAPPARENTMODE, (db_get_w((HCONTACT)wparam, GetContactProto((HCONTACT)wparam), "ApparentMode", 0) == ID_STATUS_ONLINE) ? 0 : ID_STATUS_ONLINE, 0);
return 0;
}
INT_PTR onHide(WPARAM wparam,LPARAM lparam)
{
- db_set_b((HANDLE)wparam,"CList","Hidden",(byte)!db_get_b((HANDLE)wparam,"CList","Hidden",0));
+ db_set_b((HCONTACT)wparam, "CList", "Hidden", (BYTE)!db_get_b((HCONTACT)wparam, "CList", "Hidden", 0));
return 0;
}
@@ -504,7 +504,7 @@ void ModifyVisibleSet(int mode, BOOL alpha) Menu_ModifyItem(hmenuVis, &mi);
}
-void ModifyInvisSet(int mode,BOOL alpha)
+void ModifyInvisSet(int mode, BOOL alpha)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON;
@@ -512,14 +512,14 @@ void ModifyInvisSet(int mode,BOOL alpha) Menu_ModifyItem(hmenuOff, &mi);
}
-void ModifyCopyID(HANDLE hContact, BOOL bShowID, BOOL bTrimID)
+void ModifyCopyID(HCONTACT hContact, BOOL bShowID, BOOL bTrimID)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON | CMIM_NAME | CMIF_UNICODE;
if (isMetaContact(hContact)) {
- HANDLE hC = getMostOnline(hContact);
- if ( !hContact ) hC = getDefaultContact(hContact);
+ HCONTACT hC = getMostOnline(hContact);
+ if (!hContact) hC = getDefaultContact(hContact);
hContact = hC;
}
@@ -528,8 +528,8 @@ void ModifyCopyID(HANDLE hContact, BOOL bShowID, BOOL bTrimID) Menu_ShowItem(hmenuCopyID, false);
return;
}
-
- HICON hIconCID = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+
+ HICON hIconCID = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
mi.hIcon = BindOverlayIcon(hIconCID, "miex_copyid");
DestroyIcon(hIconCID);
hIconCID = mi.hIcon;
@@ -555,7 +555,7 @@ void ModifyCopyID(HANDLE hContact, BOOL bShowID, BOOL bTrimID) DestroyIcon(hIconCID);
}
-void ModifyStatusMsg(HANDLE hContact)
+void ModifyStatusMsg(HCONTACT hContact)
{
LPSTR szProto = GetContactProto(hContact);
if (!szProto) {
@@ -566,8 +566,8 @@ void ModifyStatusMsg(HANDLE hContact) CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON;
- HICON hIconSMsg = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
- mi.hIcon = BindOverlayIcon(hIconSMsg, (StatusMsgExists(hContact)&2) ? "miex_copysm2" : "miex_copysm1");
+ HICON hIconSMsg = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
+ mi.hIcon = BindOverlayIcon(hIconSMsg, (StatusMsgExists(hContact) & 2) ? "miex_copysm2" : "miex_copysm1");
DestroyIcon(hIconSMsg);
hIconSMsg = mi.hIcon;
@@ -575,7 +575,7 @@ void ModifyStatusMsg(HANDLE hContact) DestroyIcon(hIconSMsg);
}
-void ModifyCopyIP(HANDLE hContact)
+void ModifyCopyIP(HCONTACT hContact)
{
LPSTR szProto = GetContactProto(hContact);
if (!szProto) {
@@ -586,7 +586,7 @@ void ModifyCopyIP(HANDLE hContact) CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON;
- HICON hIconCIP = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ HICON hIconCIP = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
mi.hIcon = BindOverlayIcon(hIconCIP, "miex_copyip");
DestroyIcon(hIconCIP);
hIconCIP = mi.hIcon;
@@ -595,12 +595,12 @@ void ModifyCopyIP(HANDLE hContact) DestroyIcon(hIconCIP);
}
-void ModifyCopyMirVer(HANDLE hContact)
+void ModifyCopyMirVer(HCONTACT hContact)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON;
- if ( ServiceExists(MS_FP_GETCLIENTICONT)) {
+ if (ServiceExists(MS_FP_GETCLIENTICONT)) {
LPTSTR msg = getMirVer(hContact);
if (msg) {
mi.hIcon = Finger_GetClientIcon(msg, 1);
@@ -611,13 +611,13 @@ void ModifyCopyMirVer(HANDLE hContact) Menu_ModifyItem(hmenuCopyMirVer, &mi);
}
-INT_PTR onCopyID(WPARAM wparam,LPARAM lparam)
+INT_PTR onCopyID(WPARAM wparam, LPARAM lparam)
{
- char szID[128] = {0}, buffer[256] = {0};
+ char szID[128] = { 0 }, buffer[256] = { 0 };
- HANDLE hContact = (HANDLE)wparam;
+ HCONTACT hContact = (HCONTACT)wparam;
if (isMetaContact(hContact)) {
- HANDLE hC = getMostOnline(hContact);
+ HCONTACT hC = getMostOnline(hContact);
if (!hContact)
hC = getDefaultContact(hContact);
hContact = hC;
@@ -631,8 +631,8 @@ INT_PTR onCopyID(WPARAM wparam,LPARAM lparam) if (db_get_dw(NULL, MODULENAME, "flags", vf_default) & VF_CIDN) {
PROTOACCOUNT *pa = ProtoGetAccount(szProto);
-
- if (!pa->bOldProto)
+
+ if (!pa->bOldProto)
mir_snprintf(buffer, SIZEOF(buffer), "%s: %s", pa->szProtoName, szID);
else
mir_snprintf(buffer, SIZEOF(buffer), "%s: %s", szProto, szID);
@@ -646,31 +646,31 @@ INT_PTR onCopyID(WPARAM wparam,LPARAM lparam) return 0;
}
-INT_PTR onCopyStatusMsg(WPARAM wparam,LPARAM lparam)
+INT_PTR onCopyStatusMsg(WPARAM wparam, LPARAM lparam)
{
- LPSTR module;
+ LPSTR module;
char par[32];
TCHAR buffer[2048];
int i;
DWORD flags = db_get_dw(NULL, MODULENAME, "flags", vf_default);
- module = GetContactProto((HANDLE)wparam);
+ module = GetContactProto((HCONTACT)wparam);
if (!module)
return 0;
buffer[0] = 0;
- for(i = 0; i < SIZEOF(statusMsg); i++) {
+ for (i = 0; i < SIZEOF(statusMsg); i++) {
if (statusMsg[i].flag & 8)
mir_snprintf(par, SIZEOF(par), "%s/%s", module, statusMsg[i].name);
else
strcpy(par, statusMsg[i].name);
- LPTSTR msg = db_get_tsa((HANDLE)wparam, (statusMsg[i].module) ? statusMsg[i].module : module, par);
+ LPTSTR msg = db_get_tsa((HCONTACT)wparam, (statusMsg[i].module) ? statusMsg[i].module : module, par);
if (msg) {
if (_tcsclen(msg)) {
if (flags & VF_SMNAME) {
- _tcsncat (buffer, TranslateTS(statusMsg[i].fullName), (SIZEOF(buffer) - _tcsclen(buffer) - 1));
- _tcsncat (buffer, _T(": "), (SIZEOF(buffer) - _tcsclen(buffer) - 1));
+ _tcsncat(buffer, TranslateTS(statusMsg[i].fullName), (SIZEOF(buffer) - _tcsclen(buffer) - 1));
+ _tcsncat(buffer, _T(": "), (SIZEOF(buffer) - _tcsclen(buffer) - 1));
}
_tcsncat(buffer, msg, (SIZEOF(buffer) - _tcsclen(buffer) - 1));
_tcsncat(buffer, _T("\r\n"), (SIZEOF(buffer) - _tcsclen(buffer) - 1));
@@ -681,39 +681,39 @@ INT_PTR onCopyStatusMsg(WPARAM wparam,LPARAM lparam) CopyToClipboard((HWND)lparam, 0, buffer);
if (CTRL_IS_PRESSED && bPopupService)
- ShowPopup(0, buffer, (HANDLE)wparam);
+ ShowPopup(0, buffer, (HCONTACT)wparam);
return 0;
}
-INT_PTR onCopyIP(WPARAM wparam,LPARAM lparam)
+INT_PTR onCopyIP(WPARAM wparam, LPARAM lparam)
{
- char *szProto = GetContactProto((HANDLE)wparam);
+ char *szProto = GetContactProto((HCONTACT)wparam);
char szIP[128];
- getIP((HANDLE)wparam,szProto,(LPSTR)&szIP);
+ getIP((HCONTACT)wparam, szProto, (LPSTR)&szIP);
CopyToClipboard((HWND)lparam, szIP, 0);
if (CTRL_IS_PRESSED && bPopupService)
- ShowPopup(szIP, 0, (HANDLE)wparam);
+ ShowPopup(szIP, 0, (HCONTACT)wparam);
return 0;
}
-INT_PTR onCopyMirVer(WPARAM wparam,LPARAM lparam)
+INT_PTR onCopyMirVer(WPARAM wparam, LPARAM lparam)
{
- LPTSTR msg = getMirVer((HANDLE)wparam);
+ LPTSTR msg = getMirVer((HCONTACT)wparam);
if (msg) {
CopyToClipboard((HWND)lparam, _T2A(msg), 0);
if (CTRL_IS_PRESSED && bPopupService)
- ShowPopup( _T2A(msg), 0, (HANDLE)wparam);
+ ShowPopup(_T2A(msg), 0, (HCONTACT)wparam);
mir_free(msg);
}
return 0;
}
-INT_PTR onRecvFiles(WPARAM wparam,LPARAM lparam)
+INT_PTR onRecvFiles(WPARAM wparam, LPARAM lparam)
{
char path[MAX_PATH];
CallService(MS_FILE_GETRECEIVEDFILESFOLDER, wparam, (LPARAM)&path);
@@ -721,11 +721,11 @@ INT_PTR onRecvFiles(WPARAM wparam,LPARAM lparam) return 0;
}
-INT_PTR onChangeProto(WPARAM wparam,LPARAM lparam)
+INT_PTR onChangeProto(WPARAM wparam, LPARAM lparam)
{
- HANDLE hContact = (HANDLE)wparam, hContactNew;
+ HCONTACT hContact = (HCONTACT)wparam, hContactNew;
char* szProto = GetContactProto(hContact);
- if ( !strcmp(szProto, (char*)lparam))
+ if (!strcmp(szProto, (char*)lparam))
return 0;
if (CTRL_IS_PRESSED) {
@@ -735,7 +735,7 @@ INT_PTR onChangeProto(WPARAM wparam,LPARAM lparam) CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContactNew, lparam);
}
else {
- hContactNew = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContactNew = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (hContactNew) {
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContactNew, lparam);
RenameDbProto(hContact, hContactNew, GetContactProto(hContact), (char*)lparam, 0);
@@ -744,7 +744,7 @@ INT_PTR onChangeProto(WPARAM wparam,LPARAM lparam) else
return 0;
}
- if (MessageBox(NULL,(LPCTSTR)TranslateT("Do you want to send authorization request\nto new contact?"),
+ if (MessageBox(NULL, (LPCTSTR)TranslateT("Do you want to send authorization request\nto new contact?"),
TranslateT("Miranda NG"), MB_OKCANCEL | MB_SETFOREGROUND | MB_TOPMOST) == IDOK)
onSendAuthRequest((WPARAM)hContactNew, 0);
@@ -765,25 +765,25 @@ int isIgnored(HANDLE hContact, int type) return (all == SIZEOF(ii) - 1) ? 1 : 0; // ignoring all or not
}
-INT_PTR onIgnore(WPARAM wparam,LPARAM lparam)
+INT_PTR onIgnore(WPARAM wparam, LPARAM lparam)
{
if (db_get_b(NULL, MODULENAME, "ignorehide", 0) && (lparam == IGNOREEVENT_ALL))
- db_set_b((HANDLE)wparam, "CList", "Hidden", (isIgnored((HANDLE)wparam, lparam) ? (byte)0 : (byte)1));
+ db_set_b((HCONTACT)wparam, "CList", "Hidden", (isIgnored((HANDLE)wparam, lparam) ? (byte)0 : (byte)1));
- CallService(isIgnored((HANDLE)wparam, lparam) ? MS_IGNORE_UNIGNORE : MS_IGNORE_IGNORE, wparam, lparam);
+ CallService(isIgnored((HANDLE)wparam, lparam) ? MS_IGNORE_UNIGNORE : MS_IGNORE_IGNORE, wparam, lparam);
return 0;
}
static HGENMENU AddSubmenuItem(HGENMENU hRoot, TCHAR* name, HICON icon, DWORD flag, char* service, int pos, int param)
{
CLISTMENUITEM mi = { sizeof(mi) };
- mi.hParentMenu = hRoot;
- mi.popupPosition = param;
- mi.position = pos;
- mi.ptszName = name;
- mi.hIcon = icon;
- mi.flags = CMIF_UNICODE | CMIF_CHILDPOPUP | flag;
- mi.pszService = service;
+ mi.hParentMenu = hRoot;
+ mi.popupPosition = param;
+ mi.position = pos;
+ mi.ptszName = name;
+ mi.hIcon = icon;
+ mi.flags = CMIF_UNICODE | CMIF_CHILDPOPUP | flag;
+ mi.pszService = service;
return Menu_AddContactMenuItem(&mi);
}
@@ -800,12 +800,12 @@ static void ModifySubmenuItem(HGENMENU hItem, TCHAR *name, int checked, int hidd }
// called when the contact-menu is built
-int BuildMenu(WPARAM wparam,LPARAM lparam)
+int BuildMenu(WPARAM wparam, LPARAM lparam)
{
DWORD flags = db_get_dw(NULL, MODULENAME, "flags", vf_default);
int j = 0, all = 0, hide = 0;
BOOL bIsOnline = FALSE, bShowAll = CTRL_IS_PRESSED;
- HANDLE hContact = (HANDLE)wparam;
+ HCONTACT hContact = (HCONTACT)wparam;
char* pszProto = GetContactProto(hContact);
PROTOACCOUNT *pa = ProtoGetAccount(pszProto);
@@ -818,7 +818,7 @@ int BuildMenu(WPARAM wparam,LPARAM lparam) bEnabled = bShowAll || (flags & VF_HFL);
Menu_ShowItem(hmenuHide, bEnabled);
if (bEnabled) {
- BYTE bHidden = db_get_b((HANDLE)wparam,"CList","Hidden",0);
+ BYTE bHidden = db_get_b((HCONTACT)wparam, "CList", "Hidden", 0);
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags |= CMIM_ICON | CMIM_NAME | CMIF_UNICODE;
mi.hIcon = Skin_GetIcon(bHidden ? "miex_showil" : "miex_hidefl");
@@ -829,9 +829,9 @@ int BuildMenu(WPARAM wparam,LPARAM lparam) bEnabled = bShowAll || (flags & VF_IGN);
Menu_ShowItem(hmenuIgnore, bEnabled);
if (bEnabled) {
- for (int i=1; i < SIZEOF(ii); i++) {
+ for (int i = 1; i < SIZEOF(ii); i++) {
int check = isIgnored(hContact, ii[i].type);
- if (check)
+ if (check)
all++;
ModifySubmenuItem(hIgnoreItem[i], ii[i].name, check, 0);
@@ -845,7 +845,7 @@ int BuildMenu(WPARAM wparam,LPARAM lparam) }
if (pa && (bShowAll || (flags & VF_PROTO))) {
- for (int i=0; i < protoCount; i++) {
+ for (int i = 0; i < protoCount; i++) {
if ((!accs[i]->bIsEnabled) || (strcmp(pa->szProtoName, accs[i]->szProtoName)))
hide = 1;
else {
@@ -887,12 +887,12 @@ int BuildMenu(WPARAM wparam,LPARAM lparam) if ((bShowAll || (flags & VF_VS)) && pszProto) {
INT_PTR caps = CallProtoService(pszProto, PS_GETCAPS, PFLAGNUM_1, 0);
- int apparent = db_get_w(hContact, GetContactProto(hContact),"ApparentMode", 0);
-
+ int apparent = db_get_w(hContact, GetContactProto(hContact), "ApparentMode", 0);
+
Menu_ShowItem(hmenuVis, caps & PF1_VISLIST);
if (caps & PF1_VISLIST)
ModifyVisibleSet(apparent == ID_STATUS_ONLINE, flags & VF_SAI);
-
+
Menu_ShowItem(hmenuOff, caps & PF1_INVISLIST);
if (caps & PF1_INVISLIST)
ModifyInvisSet(apparent == ID_STATUS_OFFLINE, flags & VF_SAI);
@@ -906,7 +906,7 @@ int EnumProtoSubmenu(WPARAM wparam, LPARAM lparam) int pos = 1000;
if (protoCount) // remove old items
{
- for (i = 0; i < protoCount; i++)
+ for (i = 0; i < protoCount; i++)
{
if (hProtoItem[i])
{
@@ -915,13 +915,13 @@ int EnumProtoSubmenu(WPARAM wparam, LPARAM lparam) }
}
}
- ProtoEnumAccounts(&protoCount,&accs);
+ ProtoEnumAccounts(&protoCount, &accs);
if (protoCount > MAX_PROTOS)
protoCount = MAX_PROTOS;
- for (i = 0; i < protoCount; i++)
+ for (i = 0; i < protoCount; i++)
{
- hProtoItem[i] = AddSubmenuItem(hmenuProto, accs[i]->tszAccountName,
- LoadSkinnedProtoIcon(accs[i]->szModuleName, ID_STATUS_ONLINE), CMIF_KEEPUNTRANSLATED,
+ hProtoItem[i] = AddSubmenuItem(hmenuProto, accs[i]->tszAccountName,
+ LoadSkinnedProtoIcon(accs[i]->szModuleName, ID_STATUS_ONLINE), CMIF_KEEPUNTRANSLATED,
MS_PROTO, pos++, (int)accs[i]->szModuleName);
}
return 0;
@@ -940,8 +940,8 @@ static int TabsrmmButtonPressed(WPARAM wParam, LPARAM lParam) static int TabsrmmButtonsInit(WPARAM wParam, LPARAM lParam)
{
- BBButton bbd = {0};
-
+ BBButton bbd = { 0 };
+
bbd.cbSize = sizeof(BBButton);
bbd.pszModuleName = MODULENAME;
bbd.dwButtonID = 0;
@@ -949,33 +949,32 @@ static int TabsrmmButtonsInit(WPARAM wParam, LPARAM lParam) bbd.ptszTooltip = LPGENT("Browse Received Files");
bbd.bbbFlags = BBBF_ISLSIDEBUTTON | BBBF_CANBEHIDDEN;
bbd.hIcon = Skin_GetIconHandle("miex_recfiles");
- CallService (MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
+ CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
return 0;
-}
+}
-static void TabsrmmButtonsModify(HANDLE hContact)
-{
- if (!DirectoryExists(hContact))
+static void TabsrmmButtonsModify(HCONTACT hContact)
+{
+ if (!DirectoryExists(hContact))
{
- BBButton bbd = {0};
- bbd.cbSize = sizeof(BBButton);
+ BBButton bbd = { 0 };
+ bbd.cbSize = sizeof(BBButton);
bbd.dwButtonID = 0;
bbd.pszModuleName = MODULENAME;
bbd.bbbFlags = BBSF_DISABLED | BBSF_HIDDEN;
- CallService(MS_BB_SETBUTTONSTATE, (WPARAM)hContact, (LPARAM)&bbd);
- }
-}
+ CallService(MS_BB_SETBUTTONSTATE, (WPARAM)hContact, (LPARAM)&bbd);
+ }
+}
-static int ContactWindowOpen(WPARAM wparam,LPARAM lParam)
-{
+static int ContactWindowOpen(WPARAM wparam, LPARAM lParam)
+{
MessageWindowEventData *MWeventdata = (MessageWindowEventData*)lParam;
- if (MWeventdata->uType == MSG_WINDOW_EVT_OPENING && MWeventdata->hContact)
- {
- TabsrmmButtonsModify(MWeventdata->hContact);
- }
- return 0;
+ if (MWeventdata->uType == MSG_WINDOW_EVT_OPENING && MWeventdata->hContact)
+ TabsrmmButtonsModify(MWeventdata->hContact);
+
+ return 0;
}
static int ModuleLoad(WPARAM wParam, LPARAM lParam)
@@ -986,7 +985,7 @@ static int ModuleLoad(WPARAM wParam, LPARAM lParam) }
// called when all modules are loaded
-static int PluginInit(WPARAM wparam,LPARAM lparam)
+static int PluginInit(WPARAM wparam, LPARAM lparam)
{
int pos = 1000, i = 0;
@@ -1036,16 +1035,16 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) mi.hIcon = Skin_GetIcon("miex_ignore");
hmenuIgnore = Menu_AddContactMenuItem(&mi);
- hIgnoreItem[0] = AddSubmenuItem(hmenuIgnore, ii[0].name, LoadSkinnedIcon(ii[0].icon), 0, MS_IGNORE, pos, ii[0].type );
+ hIgnoreItem[0] = AddSubmenuItem(hmenuIgnore, ii[0].name, LoadSkinnedIcon(ii[0].icon), 0, MS_IGNORE, pos, ii[0].type);
pos += 100000; // insert separator
for (i = 1; i < SIZEOF(ii); i++)
- hIgnoreItem[i] = AddSubmenuItem(hmenuIgnore, ii[i].name, LoadSkinnedIcon(ii[i].icon), 0, MS_IGNORE, pos++, ii[i].type );
+ hIgnoreItem[i] = AddSubmenuItem(hmenuIgnore, ii[i].name, LoadSkinnedIcon(ii[i].icon), 0, MS_IGNORE, pos++, ii[i].type);
pos += 100000; // insert separator
ood.cbSize = sizeof(ood);
ood.pszGroup = "Contacts";
ood.pszPage = "Ignore";
- AddSubmenuItem(hmenuIgnore, LPGENT("Open ignore settings"), Skin_GetIcon("miex_ignore"), 0, "Opt/OpenOptions", pos, (int)&ood );
+ AddSubmenuItem(hmenuIgnore, LPGENT("Open ignore settings"), Skin_GetIcon("miex_ignore"), 0, "Opt/OpenOptions", pos, (int)&ood);
mi.pszPopupName = 0;
mi.position++;
@@ -1069,7 +1068,7 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) mi.pszService = MS_AUTHREQ;
mi.hIcon = LoadSkinnedIcon(SKINICON_AUTH_REQUEST);
hmenuAuthReq = Menu_AddContactMenuItem(&mi);
-
+
mi.position++;
mi.ptszName = LPGENT("Copy ID");
mi.pszService = MS_COPYID;
@@ -1103,12 +1102,12 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) hIcon[3] = MakeHalfAlphaIcon(hIcon[1]);
hIcon[4] = MakeHalfAlphaIcon(hIcon[2]);
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU,BuildMenu);
- HookEvent(ME_OPT_INITIALISE,OptionsInit);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, BuildMenu);
+ HookEvent(ME_OPT_INITIALISE, OptionsInit);
HookEvent(ME_PROTO_ACCLISTCHANGED, EnumProtoSubmenu);
if (HookEvent(ME_MSG_TOOLBARLOADED, TabsrmmButtonsInit)) {
HookEvent(ME_MSG_BUTTONPRESSED, TabsrmmButtonPressed);
- HookEvent(ME_MSG_WINDOWEVENT,ContactWindowOpen);
+ HookEvent(ME_MSG_WINDOWEVENT, ContactWindowOpen);
}
return 0;
@@ -1135,7 +1134,7 @@ extern "C" __declspec(dllexport) int Unload(void) return 0;
}
-BOOL WINAPI DllMain(HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved)
{
hinstance = hinst;
return 1;
diff --git a/plugins/MetaContacts/src/addto.cpp b/plugins/MetaContacts/src/addto.cpp index cd68607d51..40d3c30b86 100644 --- a/plugins/MetaContacts/src/addto.cpp +++ b/plugins/MetaContacts/src/addto.cpp @@ -56,7 +56,7 @@ int FillList(HWND list, BOOL sort) int i=0;
// The DB is searched through, to get all the metacontacts
- for (HANDLE hMetaUser = db_find_first(); hMetaUser; hMetaUser = db_find_next(hMetaUser)) {
+ for (HCONTACT hMetaUser = db_find_first(); hMetaUser; hMetaUser = db_find_next(hMetaUser)) {
// if it's not a MetaContact, go to the next
if ( db_get_dw(hMetaUser, META_PROTO, META_ID, (DWORD)-1) == (DWORD)-1)
continue;
@@ -124,7 +124,7 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_INITDIALOG:
TranslateDialogDefault( hwndDlg );
- if ( db_get_dw((HANDLE)lParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
+ if ( db_get_dw((HCONTACT)lParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
MessageBox(hwndDlg,
TranslateT("This contact is a MetaContact.\nYou can't add a MetaContact to another MetaContact.\n\nPlease choose another."),
TranslateT("MetaContact Conflict"),MB_ICONERROR);
@@ -132,7 +132,7 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP return TRUE;
}
- if ( db_get_dw((HANDLE)lParam, META_PROTO, META_LINK, (DWORD)-1) != (DWORD)-1) {
+ if ( db_get_dw((HCONTACT)lParam, META_PROTO, META_LINK, (DWORD)-1) != (DWORD)-1) {
MessageBox(hwndDlg,
TranslateT("This contact is already associated to a MetaContact.\nYou cannot add a contact to multiple MetaContacts."),
TranslateT("Multiple MetaContacts"),MB_ICONERROR);
@@ -155,7 +155,7 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
else {
// get contact display name from clist
- TCHAR *ptszCDN = pcli->pfnGetContactDisplayName((HANDLE)lParam, GCDNF_TCHAR);
+ TCHAR *ptszCDN = pcli->pfnGetContactDisplayName((HCONTACT)lParam, GCDNF_TCHAR);
if (!ptszCDN)
ptszCDN = TranslateT("a contact");
@@ -178,9 +178,9 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (item == -1)
return IDOK == MessageBox(hwndDlg, TranslateT("Please select a MetaContact"), TranslateT("No MetaContact selected"), MB_ICONHAND);
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- HANDLE hMeta = (HANDLE)SendMessage(GetDlgItem(hwndDlg, IDC_METALIST), LB_GETITEMDATA, (WPARAM)item, 0);
- if ( !Meta_Assign(hContact,hMeta, FALSE))
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hMeta = (HCONTACT)SendMessage(GetDlgItem(hwndDlg, IDC_METALIST), LB_GETITEMDATA, (WPARAM)item, 0);
+ if (!Meta_Assign(hContact, hMeta, FALSE))
MessageBox(hwndDlg, TranslateT("Assignment to the MetaContact failed."), TranslateT("Assignment failure"),MB_ICONERROR);
}
case IDCANCEL:
diff --git a/plugins/MetaContacts/src/edit.cpp b/plugins/MetaContacts/src/edit.cpp index f5977e27c2..859ad8aafd 100644 --- a/plugins/MetaContacts/src/edit.cpp +++ b/plugins/MetaContacts/src/edit.cpp @@ -29,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //! Holds the differents changes that have to made
typedef struct tag_CHANGES {
- HANDLE hMeta; //!< \c HANDLE of the MetaContact that is edited.
- HANDLE hDefaultContact; //!< \c HANDLE of the new default contact
- HANDLE hOfflineContact;
+ HCONTACT hMeta; //!< \c HANDLE of the MetaContact that is edited.
+ HCONTACT hDefaultContact; //!< \c HANDLE of the new default contact
+ HCONTACT hOfflineContact;
int num_deleted, //!< \c DWORD number of deleted contacts
num_contacts; //!< \c DWORD number of contacts
- HANDLE hDeletedContacts[MAX_CONTACTS]; //!< \c HANDLEs of the subcontacts to be removed from this metacontact
- HANDLE hContact[MAX_CONTACTS]; //!< \c HANDLEs of the subcontacts, in the order they should be in
+ HCONTACT hDeletedContacts[MAX_CONTACTS]; //!< \c HANDLEs of the subcontacts to be removed from this metacontact
+ HCONTACT hContact[MAX_CONTACTS]; //!< \c HANDLEs of the subcontacts, in the order they should be in
int force_default;
} CHANGES;
@@ -134,7 +134,6 @@ void SetListSelection(HWND hList, int sel) void ApplyChanges(CHANGES *chg)
{
- HANDLE most_online;
int i;
// remove removed contacts
@@ -168,7 +167,7 @@ void ApplyChanges(CHANGES *chg) db_set_dw(chg->hMeta, META_PROTO, "OfflineSend", (DWORD)-1);
// fix nick
- most_online = Meta_GetMostOnline(chg->hMeta);
+ HCONTACT most_online = Meta_GetMostOnline(chg->hMeta);
Meta_CopyContactNick(chg->hMeta, most_online);
// fix status
@@ -271,17 +270,17 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_UP), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_DOWN), FALSE);
- int nb_contacts = db_get_dw((HANDLE)lParam, META_PROTO, "NumContacts", 0);
- int default_contact_number = db_get_dw((HANDLE)lParam, META_PROTO, "Default", (DWORD)-1);
- int offline_contact_number = db_get_dw((HANDLE)lParam, META_PROTO, "OfflineSend", (DWORD)-1);
+ int nb_contacts = db_get_dw((HCONTACT)lParam, META_PROTO, "NumContacts", 0);
+ int default_contact_number = db_get_dw((HCONTACT)lParam, META_PROTO, "Default", (DWORD)-1);
+ int offline_contact_number = db_get_dw((HCONTACT)lParam, META_PROTO, "OfflineSend", (DWORD)-1);
- changes.hMeta = (HANDLE)lParam;
+ changes.hMeta = (HCONTACT)lParam;
changes.num_contacts = nb_contacts;
changes.num_deleted = 0;
- changes.hDefaultContact = Meta_GetContactHandle((HANDLE)lParam, default_contact_number);
- changes.hOfflineContact = Meta_GetContactHandle((HANDLE)lParam, offline_contact_number);
+ changes.hDefaultContact = Meta_GetContactHandle((HCONTACT)lParam, default_contact_number);
+ changes.hOfflineContact = Meta_GetContactHandle((HCONTACT)lParam, offline_contact_number);
for (i = 0; i < nb_contacts; i++)
- changes.hContact[i] = Meta_GetContactHandle((HANDLE)lParam, i);
+ changes.hContact[i] = Meta_GetContactHandle((HCONTACT)lParam, i);
changes.force_default = MetaAPI_GetForceState((WPARAM)lParam, 0);
SendMessage(hwndDlg, WMU_SETTITLE, 0, lParam);
@@ -294,7 +293,7 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case WMU_SETTITLE:
{
- TCHAR *ptszCDN = pcli->pfnGetContactDisplayName((HANDLE)lParam, GCDNF_TCHAR);
+ TCHAR *ptszCDN = pcli->pfnGetContactDisplayName((HCONTACT)lParam, GCDNF_TCHAR);
if (ptszCDN == NULL)
ptszCDN = TranslateT("(Unknown Contact)");
@@ -414,9 +413,9 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR hwnd = GetDlgItem(hwndDlg, IDC_LST_CONTACTS);
sel = ListView_GetNextItem(hwnd, -1, LVNI_FOCUSED | LVNI_SELECTED);
{
- HANDLE temp = changes.hContact[sel];
+ HCONTACT temp = changes.hContact[sel];
changes.hContact[sel] = changes.hContact[sel - 1];
- changes.hContact[sel - 1] = temp;
+ changes.hContact[sel-1] = temp;
}
FillContactList(hwndDlg, &changes);
sel--;
@@ -431,7 +430,7 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR hwnd = GetDlgItem(hwndDlg, IDC_LST_CONTACTS);
sel = ListView_GetNextItem(hwnd, -1, LVNI_FOCUSED | LVNI_SELECTED);
{
- HANDLE temp = changes.hContact[sel];
+ HCONTACT temp = changes.hContact[sel];
changes.hContact[sel] = changes.hContact[sel + 1];
changes.hContact[sel + 1] = temp;
}
diff --git a/plugins/MetaContacts/src/meta_api.cpp b/plugins/MetaContacts/src/meta_api.cpp index 8835733c15..77a09a6a4a 100644 --- a/plugins/MetaContacts/src/meta_api.cpp +++ b/plugins/MetaContacts/src/meta_api.cpp @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //lParam=0
//returns a handle to the parent metacontact, or null if this contact is not a subcontact
INT_PTR MetaAPI_GetMeta(WPARAM wParam, LPARAM lParam) {
- return (INT_PTR)(HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle", 0);
+ return (INT_PTR)(HANDLE)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle", 0);
}
//gets the handle for the default contact
@@ -40,9 +40,9 @@ INT_PTR MetaAPI_GetMeta(WPARAM wParam, LPARAM lParam) { //lParam=0
//returns a handle to the default contact, or null on failure
INT_PTR MetaAPI_GetDefault(WPARAM wParam, LPARAM lParam) {
- DWORD default_contact_number = db_get_dw((HANDLE)wParam, META_PROTO, "Default", -1);
+ DWORD default_contact_number = db_get_dw((HCONTACT)wParam, META_PROTO, "Default", -1);
if (default_contact_number != -1) {
- return (INT_PTR)Meta_GetContactHandle((HANDLE)wParam, default_contact_number);
+ return (INT_PTR)Meta_GetContactHandle((HCONTACT)wParam, default_contact_number);
}
return 0;
}
@@ -52,7 +52,7 @@ INT_PTR MetaAPI_GetDefault(WPARAM wParam, LPARAM lParam) { //lParam=0
//returns a DWORD contact number, or -1 on failure
INT_PTR MetaAPI_GetDefaultNum(WPARAM wParam, LPARAM lParam) {
- return db_get_dw((HANDLE)wParam, META_PROTO, "Default", -1);
+ return db_get_dw((HCONTACT)wParam, META_PROTO, "Default", -1);
}
//gets the handle for the 'most online' contact
@@ -60,7 +60,7 @@ INT_PTR MetaAPI_GetDefaultNum(WPARAM wParam, LPARAM lParam) { //lParam=0
//returns a handle to the 'most online' contact
INT_PTR MetaAPI_GetMostOnline(WPARAM wParam, LPARAM lParam) {
- return (INT_PTR)Meta_GetMostOnline((HANDLE)wParam);
+ return (INT_PTR)Meta_GetMostOnline((HCONTACT)wParam);
}
//gets the number of subcontacts for a metacontact
@@ -68,7 +68,7 @@ INT_PTR MetaAPI_GetMostOnline(WPARAM wParam, LPARAM lParam) { //lParam=0
//returns a DWORD representing the number of subcontacts for the given metacontact
INT_PTR MetaAPI_GetNumContacts(WPARAM wParam, LPARAM lParam) {
- DWORD num_contacts = db_get_dw((HANDLE)wParam, META_PROTO, "NumContacts", -1);
+ DWORD num_contacts = db_get_dw((HCONTACT)wParam, META_PROTO, "NumContacts", -1);
return num_contacts;
}
@@ -77,7 +77,7 @@ INT_PTR MetaAPI_GetNumContacts(WPARAM wParam, LPARAM lParam) { //lParam=(DWORD)contact number
//returns a handle to the specified subcontact
INT_PTR MetaAPI_GetContact(WPARAM wParam, LPARAM lParam) {
- return (INT_PTR)Meta_GetContactHandle((HANDLE)wParam, (DWORD)lParam);
+ return (INT_PTR)Meta_GetContactHandle((HCONTACT)wParam, (DWORD)lParam);
}
//sets the default contact, using the subcontact's contact number
@@ -85,15 +85,15 @@ INT_PTR MetaAPI_GetContact(WPARAM wParam, LPARAM lParam) { //lParam=(DWORD)contact number
//returns 0 on success
INT_PTR MetaAPI_SetDefaultContactNum(WPARAM wParam, LPARAM lParam) {
- DWORD num_contacts = db_get_dw((HANDLE)wParam, META_PROTO, "NumContacts", -1);
+ DWORD num_contacts = db_get_dw((HCONTACT)wParam, META_PROTO, "NumContacts", -1);
if (num_contacts == -1)
return 1;
if ((DWORD)lParam >= num_contacts || (DWORD)lParam < 0)
return 1;
- if (db_set_dw((HANDLE)wParam, META_PROTO, "Default", (DWORD)lParam))
+ if (db_set_dw((HCONTACT)wParam, META_PROTO, "Default", (DWORD)lParam))
return 1;
- NotifyEventHooks(hEventDefaultChanged, wParam, (LPARAM)Meta_GetContactHandle((HANDLE)wParam, (int)lParam));
+ NotifyEventHooks(hEventDefaultChanged, wParam, (LPARAM)Meta_GetContactHandle((HCONTACT)wParam, (int)lParam));
return 0;
}
@@ -102,8 +102,8 @@ INT_PTR MetaAPI_SetDefaultContactNum(WPARAM wParam, LPARAM lParam) { //lParam=(HANDLE)hSubcontact
//returns 0 on success
INT_PTR MetaAPI_SetDefaultContact(WPARAM wParam, LPARAM lParam) {
- HANDLE hMeta = (HANDLE)db_get_dw((HANDLE)lParam, META_PROTO, "Handle", 0);
- DWORD contact_number = Meta_GetContactNumber((HANDLE)lParam);
+ HCONTACT hMeta = (HCONTACT)db_get_dw((HCONTACT)lParam, META_PROTO, "Handle", 0);
+ DWORD contact_number = Meta_GetContactNumber((HCONTACT)lParam);
if (contact_number == -1 || !hMeta || hMeta != (HANDLE)wParam)
return 1;
if (db_set_dw(hMeta, META_PROTO, "Default", contact_number))
@@ -118,9 +118,9 @@ INT_PTR MetaAPI_SetDefaultContact(WPARAM wParam, LPARAM lParam) { //lParam=(DWORD)contact number
//returns 0 on success
INT_PTR MetaAPI_ForceSendContactNum(WPARAM wParam, LPARAM lParam) {
- HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, (int)lParam);
- HANDLE hMeta = (HANDLE)db_get_dw(hContact, META_PROTO, "Handle", 0);
- if ( !hContact || !hMeta || hMeta != (HANDLE)wParam || db_get_b(hMeta, META_PROTO, "ForceDefault", 0))
+ HCONTACT hContact = Meta_GetContactHandle((HCONTACT)wParam, (int)lParam);
+ HCONTACT hMeta = (HCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0);
+ if (!hContact || !hMeta || hMeta != (HANDLE)wParam || db_get_b(hMeta, META_PROTO, "ForceDefault", 0))
return 1;
db_set_dw(hMeta, META_PROTO, "ForceSend", (DWORD)hContact);
@@ -134,8 +134,8 @@ INT_PTR MetaAPI_ForceSendContactNum(WPARAM wParam, LPARAM lParam) { //lParam=(HANDLE)hSubcontact
//returns 0 on success (will fail if 'force default' is in effect)
INT_PTR MetaAPI_ForceSendContact(WPARAM wParam, LPARAM lParam) {
- HANDLE hContact = (HANDLE)lParam;
- HANDLE hMeta = (HANDLE)db_get_dw(hContact, META_PROTO, "Handle", 0);
+ HCONTACT hContact = (HCONTACT)lParam;
+ HCONTACT hMeta = (HCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0);
if ( !hContact || !hMeta || hMeta != (HANDLE)wParam || db_get_b(hMeta, META_PROTO, "ForceDefault", 0))
return 1;
@@ -150,10 +150,10 @@ INT_PTR MetaAPI_ForceSendContact(WPARAM wParam, LPARAM lParam) { //lParam=0
//returns 0 on success (will fail if 'force default' is in effect)
INT_PTR MetaAPI_UnforceSendContact(WPARAM wParam, LPARAM lParam) {
- if (db_get_b((HANDLE)wParam, META_PROTO, "ForceDefault", 0))
+ if (db_get_b((HCONTACT)wParam, META_PROTO, "ForceDefault", 0))
return 1;
- db_set_dw((HANDLE)wParam, META_PROTO, "ForceSend", 0);
+ db_set_dw((HCONTACT)wParam, META_PROTO, "ForceSend", 0);
NotifyEventHooks(hEventUnforceSend, wParam, lParam);
return 0;
@@ -169,7 +169,7 @@ INT_PTR MetaAPI_UnforceSendContact(WPARAM wParam, LPARAM lParam) { INT_PTR MetaAPI_ForceDefault(WPARAM wParam, LPARAM lParam) {
// forward to menu function
Meta_ForceDefault(wParam, lParam);
- return db_get_b((HANDLE)wParam, META_PROTO, "ForceDefault", 0);
+ return db_get_b((HCONTACT)wParam, META_PROTO, "ForceDefault", 0);
}
// method to get state of 'force' for a metacontact
@@ -179,18 +179,15 @@ INT_PTR MetaAPI_ForceDefault(WPARAM wParam, LPARAM lParam) { // or if none is in force, the value (DWORD)-1 will be copied
// (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above)
INT_PTR MetaAPI_GetForceState(WPARAM wParam, LPARAM lParam) {
- HANDLE hMeta = (HANDLE)wParam;
- HANDLE hContact;
-
+ HCONTACT hMeta = (HCONTACT)wParam;
if ( !hMeta) return 0;
if (db_get_b(hMeta, META_PROTO, "ForceDefault", 0)) {
- if (lParam) *(DWORD *)lParam = db_get_dw((HANDLE)wParam, META_PROTO, "Default", -1);
+ if (lParam) *(DWORD *)lParam = db_get_dw((HCONTACT)wParam, META_PROTO, "Default", -1);
return 1;
}
- hContact = (HANDLE)db_get_dw(hMeta, META_PROTO, "ForceSend", 0);
-
+ HCONTACT hContact = (HCONTACT)db_get_dw(hMeta, META_PROTO, "ForceSend", 0);
if ( !hContact) {
if (lParam) *(DWORD *)lParam = -1;
} else {
@@ -219,7 +216,7 @@ INT_PTR MetaAPI_ConvertToMeta(WPARAM wParam, LPARAM lParam) { // lParam=(HANDLE)hMeta
// add an existing contact to a metacontact
INT_PTR MetaAPI_AddToMeta(WPARAM wParam, LPARAM lParam) {
- return Meta_Assign((HANDLE)wParam, (HANDLE)lParam, FALSE);
+ return Meta_Assign((HCONTACT)wParam, (HCONTACT)lParam, FALSE);
}
// added 0.9.5.0 (22/3/05)
diff --git a/plugins/MetaContacts/src/meta_main.cpp b/plugins/MetaContacts/src/meta_main.cpp index cdd2b6f20f..f251c1020d 100644 --- a/plugins/MetaContacts/src/meta_main.cpp +++ b/plugins/MetaContacts/src/meta_main.cpp @@ -151,7 +151,7 @@ extern "C" __declspec(dllexport) int Load(void) db_set_resident(META_PROTO, "WindowOpen");
//set all contacts to 'offline', and initialize subcontact counter for db consistency check
- for (HANDLE hContact = db_find_first(META_PROTO); hContact; hContact = db_find_next(hContact, META_PROTO)) {
+ for (HCONTACT hContact = db_find_first(META_PROTO); hContact; hContact = db_find_next(hContact, META_PROTO)) {
db_set_w(hContact, META_PROTO, "Status", ID_STATUS_OFFLINE);
db_set_dw(hContact, META_PROTO, "IdleTS", 0);
db_set_b(hContact, META_PROTO, "ContactCountCheck", 0);
diff --git a/plugins/MetaContacts/src/meta_menu.cpp b/plugins/MetaContacts/src/meta_menu.cpp index fecb0520fe..53ed386ff6 100644 --- a/plugins/MetaContacts/src/meta_menu.cpp +++ b/plugins/MetaContacts/src/meta_menu.cpp @@ -42,13 +42,13 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam) char *group = 0;
// Get some information about the selected contact.
- if ( !db_get_utf((HANDLE)wParam, "CList", "Group", &dbv)) {
+ if ( !db_get_utf((HCONTACT)wParam, "CList", "Group", &dbv)) {
group = _strdup(dbv.pszVal);
db_free(&dbv);
}
// Create a new metacontact
- HANDLE hMetaContact = (HANDLE)CallService(MS_DB_CONTACT_ADD,0,0);
+ HCONTACT hMetaContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD,0,0);
if (hMetaContact) {
db_set_dw(hMetaContact, META_PROTO, META_ID,nextMetaID);
db_set_dw(hMetaContact, META_PROTO, "NumContacts",0);
@@ -61,7 +61,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam) db_set_utf(hMetaContact, "CList", "Group", group);
// Assign the contact to the MetaContact just created (and make default).
- if ( !Meta_Assign((HANDLE)wParam, hMetaContact, TRUE)) {
+ if ( !Meta_Assign((HCONTACT)wParam, hMetaContact, TRUE)) {
MessageBox(0, TranslateT("There was a problem in assigning the contact to the MetaContact"), TranslateT("Error"), MB_ICONEXCLAMATION);
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hMetaContact, 0);
return 0;
@@ -106,7 +106,7 @@ INT_PTR Meta_Edit(WPARAM wParam,LPARAM lParam) return 0;
}
-void Meta_RemoveContactNumber(HANDLE hMeta, int number)
+void Meta_RemoveContactNumber(HCONTACT hMeta, int number)
{
int num_contacts = db_get_dw(hMeta, META_PROTO, "NumContacts", 0);
int default_contact = db_get_dw(hMeta, META_PROTO, "Default", -1);
@@ -114,7 +114,7 @@ void Meta_RemoveContactNumber(HANDLE hMeta, int number) return;
// get the handle
- HANDLE hContact = Meta_GetContactHandle(hMeta, number);
+ HCONTACT hContact = Meta_GetContactHandle(hMeta, number);
// make sure this contact thinks it's part of this metacontact
if ((HANDLE)db_get_dw(hContact, META_PROTO, "Handle", 0) == hMeta) {
@@ -207,7 +207,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) DWORD metaID;
// The wParam is a metacontact
- if ((metaID = db_get_dw((HANDLE)wParam, META_PROTO, META_ID, (DWORD)-1)) != (DWORD)-1) {
+ if ((metaID = db_get_dw((HCONTACT)wParam, META_PROTO, META_ID, (DWORD)-1)) != (DWORD)-1) {
if ( !lParam) { // check from recursion - see second half of this function
if ( MessageBox((HWND)CallService(MS_CLUI_GETHWND,0,0),
TranslateT("This will remove the MetaContact permanently.\n\nProceed Anyway?"),
@@ -215,7 +215,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) 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)) {
// This contact is assigned to the MetaContact that will be deleted, clear the "MetaContacts" information
if ( db_get_dw(hContact, META_PROTO, META_LINK,(DWORD)-1) == metaID) {
db_unset(hContact, META_PROTO, "IsSubcontact");
@@ -237,7 +237,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) CallService(MS_DB_CONTACT_DELETE,wParam,0);
}
else {
- HANDLE hMeta = (HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle", 0);
+ HCONTACT hMeta = (HCONTACT)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle", 0);
DWORD num_contacts = db_get_dw(hMeta, META_PROTO, "NumContacts", -1);
if (num_contacts == 1) {
@@ -247,7 +247,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) return 0;
}
- Meta_RemoveContactNumber(hMeta, db_get_dw((HANDLE)wParam, META_PROTO, "ContactNumber", -1));
+ Meta_RemoveContactNumber(hMeta, db_get_dw((HCONTACT)wParam, META_PROTO, "ContactNumber", -1));
}
return 0;
}
@@ -262,12 +262,12 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) */
INT_PTR Meta_Default(WPARAM wParam,LPARAM lParam)
{
- HANDLE hMeta;
+ HCONTACT hMeta;
// the wParam is a subcontact
- if ((hMeta = (HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle",0)) != 0) {
- db_set_dw(hMeta, META_PROTO, "Default", (DWORD)Meta_GetContactNumber((HANDLE)wParam));
- NotifyEventHooks(hEventDefaultChanged, (WPARAM)hMeta, (LPARAM)(HANDLE)wParam);
+ if ((hMeta = (HCONTACT)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle",0)) != 0) {
+ db_set_dw(hMeta, META_PROTO, "Default", (DWORD)Meta_GetContactNumber((HCONTACT)wParam));
+ NotifyEventHooks(hEventDefaultChanged, (WPARAM)hMeta, (LPARAM)wParam);
}
return 0;
}
@@ -284,15 +284,15 @@ INT_PTR Meta_Default(WPARAM wParam,LPARAM lParam) INT_PTR Meta_ForceDefault(WPARAM wParam,LPARAM lParam)
{
// the wParam is a MetaContact
- if (db_get_dw((HANDLE)wParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
- BOOL current = db_get_b((HANDLE)wParam, META_PROTO, "ForceDefault", 0);
+ if (db_get_dw((HCONTACT)wParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
+ BOOL current = db_get_b((HCONTACT)wParam, META_PROTO, "ForceDefault", 0);
current = !current;
- db_set_b((HANDLE)wParam, META_PROTO, "ForceDefault", (BYTE)current);
+ db_set_b((HCONTACT)wParam, META_PROTO, "ForceDefault", (BYTE)current);
- db_set_dw((HANDLE)wParam, META_PROTO, "ForceSend", 0);
+ db_set_dw((HCONTACT)wParam, META_PROTO, "ForceSend", 0);
if (current)
- NotifyEventHooks(hEventForceSend, wParam, (LPARAM)Meta_GetContactHandle((HANDLE)wParam, db_get_dw((HANDLE)wParam, META_PROTO, "Default", -1)));
+ NotifyEventHooks(hEventForceSend, wParam, (LPARAM)Meta_GetContactHandle((HCONTACT)wParam, db_get_dw((HCONTACT)wParam, META_PROTO, "Default", -1)));
else
NotifyEventHooks(hEventUnforceSend, wParam, 0);
}
@@ -317,7 +317,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) WORD status;
CLISTMENUITEM mi = { sizeof(mi) };
- if (db_get_dw((HANDLE)wParam, META_PROTO, META_ID,-1) != (DWORD)-1) {
+ if (db_get_dw((HCONTACT)wParam, META_PROTO, META_ID,-1) != (DWORD)-1) {
// save the mouse pos in case they open a subcontact menu
GetCursorPos(&menuMousePoint);
@@ -333,14 +333,14 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) Menu_ModifyItem(hMenuDelete, &mi);
//show subcontact menu items
- int num_contacts = db_get_dw((HANDLE)wParam, META_PROTO, "NumContacts", 0);
+ int num_contacts = db_get_dw((HCONTACT)wParam, META_PROTO, "NumContacts", 0);
for (int i = 0; i < MAX_CONTACTS; i++) {
if (i >= num_contacts) {
Menu_ShowItem(hMenuContact[i], false);
continue;
}
- HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, i);
+ HCONTACT hContact = Meta_GetContactHandle((HCONTACT)wParam, i);
char *szProto = GetContactProto(hContact);
if ( !szProto)
status = ID_STATUS_OFFLINE;
@@ -351,7 +351,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) strcpy(buf, "Login");
strcat(buf, _itoa(i, idStr, 10));
- db_get((HANDLE)wParam, META_PROTO, buf, &dbv);
+ db_get((HCONTACT)wParam, META_PROTO, buf, &dbv);
switch(dbv.type) {
case DBVT_ASCIIZ:
mir_snprintf(buf,512,"%s",dbv.pszVal);
@@ -391,7 +391,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) // wParam = char *szProto
// lParam = BOOL show
char serviceFunc[256];
- mir_snprintf(serviceFunc, 256, "%s%s", GetContactProto( Meta_GetMostOnline((HANDLE)wParam)), PS_SEND_NUDGE);
+ mir_snprintf(serviceFunc, 256, "%s%s", GetContactProto( Meta_GetMostOnline((HCONTACT)wParam)), PS_SEND_NUDGE);
CallService(MS_NUDGE_SHOWMENU, (WPARAM)META_PROTO, (LPARAM)ServiceExists(serviceFunc));
}
else { // This is a simple contact
@@ -403,7 +403,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) Menu_ShowItem(hMenuConvert, false);
Menu_ShowItem(hMenuEdit, false);
}
- else if (db_get_dw((HANDLE)wParam, META_PROTO, META_LINK,(DWORD)-1)!=(DWORD)-1) {
+ else if (db_get_dw((HCONTACT)wParam, META_PROTO, META_LINK,(DWORD)-1)!=(DWORD)-1) {
// The contact is affected to a metacontact.
Menu_ShowItem(hMenuDefault, true);
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp index 2f5aad2654..f829412474 100755 --- a/plugins/MetaContacts/src/meta_services.cpp +++ b/plugins/MetaContacts/src/meta_services.cpp @@ -190,10 +190,10 @@ INT_PTR Meta_GetStatus(WPARAM wParam,LPARAM lParam) struct TFakeAckParams
{
- HANDLE hEvent;
- HANDLE hContact;
- LONG id;
- char msg[512];
+ HANDLE hEvent;
+ HCONTACT hContact;
+ LONG id;
+ char msg[512];
};
static DWORD CALLBACK sttFakeAckFail( LPVOID param )
@@ -202,7 +202,7 @@ static DWORD CALLBACK sttFakeAckFail( LPVOID param ) WaitForSingleObject( tParam->hEvent, INFINITE );
Sleep( 100 );
- ProtoBroadcastAck(META_PROTO, tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, ( HANDLE )tParam->id, (WPARAM)tParam->msg );
+ ProtoBroadcastAck(META_PROTO, tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)tParam->id, (WPARAM)tParam->msg );
CloseHandle( tParam->hEvent );
mir_free(tParam);
@@ -222,9 +222,9 @@ static DWORD CALLBACK sttFakeAckFail( LPVOID param ) INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam)
{
CCSDATA *ccs = (CCSDATA*)lParam;
- HANDLE hMeta;
+ HCONTACT hMeta;
- if ((hMeta = (HANDLE)db_get_dw(ccs->hContact, META_PROTO, "Handle", 0)) == 0)
+ if ((hMeta = (HCONTACT)db_get_dw(ccs->hContact, META_PROTO, "Handle", 0)) == 0)
return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // Can't find the MetaID of the metacontact linked to
// if subcontact sending, add db event to keep metacontact history correct
@@ -261,7 +261,7 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam) INT_PTR Meta_SendNudge(WPARAM wParam,LPARAM lParam)
{
- HANDLE hSubContact = Meta_GetMostOnline((HANDLE)wParam);
+ HCONTACT hSubContact = Meta_GetMostOnline((HCONTACT)wParam);
return ProtoCallService(GetContactProto(hSubContact), PS_SEND_NUDGE, (WPARAM)hSubContact, lParam);
}
@@ -289,7 +289,7 @@ INT_PTR Meta_SendMessage(WPARAM wParam,LPARAM lParam) return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
}
- HANDLE most_online = Meta_GetMostOnline(ccs->hContact);
+ HCONTACT most_online = Meta_GetMostOnline(ccs->hContact);
if ( !most_online) {
DWORD dwThreadId;
@@ -359,10 +359,10 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam) DBEVENTINFO dbei;
CCSDATA *ccs = (CCSDATA*)lParam;
PROTORECVEVENT *pre = (PROTORECVEVENT *) ccs->lParam;
- HANDLE hMeta;
+ HCONTACT hMeta;
// Can't find the MetaID of the metacontact linked to this contact, let through the protocol chain
- if ((hMeta = (HANDLE)db_get_dw(ccs->hContact, META_PROTO, "Handle", 0)) == 0)
+ if ((hMeta = (HCONTACT)db_get_dw(ccs->hContact, META_PROTO, "Handle", 0)) == 0)
return CallService(MS_PROTO_CHAINRECV, wParam, (LPARAM)ccs);
if (options.set_default_on_recv) {
@@ -404,7 +404,7 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam) // use the subcontact's protocol 'recv' service to add the meta's history (AIMOSCAR removes HTML here!) if possible
char *proto = GetContactProto(ccs->hContact);
if (proto) {
- HANDLE hSub = ccs->hContact;
+ HCONTACT hSub = ccs->hContact;
DWORD flags = pre->flags;
ccs->hContact = hMeta;
pre->flags |= (db_get_b(hMeta, META_PROTO, "WindowOpen", 0) ? 0 : PREF_CREATEREAD);
@@ -437,7 +437,7 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam) return CallService(MS_PROTO_CHAINRECV, wParam, (LPARAM)ccs);
}
- HANDLE hSub = ccs->hContact;
+ HCONTACT hSub = ccs->hContact;
ccs->hContact = hMeta; // Forward to the associated MetaContact.
CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)ccs);
ccs->hContact = hSub;
@@ -467,7 +467,7 @@ INT_PTR Meta_RecvMessage(WPARAM wParam, LPARAM lParam) if (options.use_proto_recv) {
// use the subcontact's protocol to add the db if possible (AIMOSCAR removes HTML here!)
- HANDLE most_online = Meta_GetMostOnline(ccs->hContact);
+ HCONTACT most_online = Meta_GetMostOnline(ccs->hContact);
if (char *subProto = GetContactProto(most_online))
if ( ProtoCallService(subProto, PSR_MESSAGE, wParam, lParam) != CALLSERVICE_NOTFOUND)
return 0;
@@ -503,9 +503,9 @@ information about the ACK. int Meta_HandleACK(WPARAM wParam, LPARAM lParam)
{
ACKDATA *ack = (ACKDATA*) lParam;
- HANDLE hUser;
+ HCONTACT hUser;
- if (ack->hContact == 0 || (hUser = (HANDLE)db_get_dw(ack->hContact, META_PROTO, "Handle",0)) == 0)
+ if (ack->hContact == 0 || (hUser = (HCONTACT)db_get_dw(ack->hContact, META_PROTO, "Handle",0)) == 0)
return 0; // Can't find the MetaID, let through the protocol chain
@@ -524,11 +524,10 @@ int Meta_HandleACK(WPARAM wParam, LPARAM lParam) // change the hContact in the avatar info struct, if it's the avatar we're using - else drop it
if (ack->type == ACKTYPE_AVATAR) {
if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED || ack->result == ACKRESULT_STATUS) {
- HANDLE most_online;
DBVARIANT dbv;
// change avatar if the most online supporting avatars changes, or if we don't have one
- most_online = Meta_GetMostOnlineSupporting(hUser, PFLAGNUM_4, PF4_AVATARS);
+ HCONTACT most_online = Meta_GetMostOnlineSupporting(hUser, PFLAGNUM_4, PF4_AVATARS);
//if (AI.hContact == 0 || AI.hContact != most_online) {
if (ack->hContact == 0 || ack->hContact != most_online) {
return 0;
@@ -572,7 +571,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) DBCONTACTWRITESETTING *dcws = (DBCONTACTWRITESETTING *)lParam;
char buffer[512], szId[40];
int contact_number;
- HANDLE hMeta, most_online;
+ HCONTACT hMeta, most_online;
// hide metacontacts when groups disabled
if (wParam == 0
@@ -589,7 +588,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) // import process has just been run...call startup routines...
Meta_SetHandles();
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
int meta_id;
if ((meta_id = db_get_dw(hContact, META_PROTO, META_ID,(DWORD)-1)) != (DWORD)-1)
Meta_CopyData(hContact);
@@ -602,22 +601,22 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) // from here on, we're just interested in contact settings
if (wParam == 0) return 0;
- if ((hMeta=(HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle",0))!=0 && CallService(MS_DB_CONTACT_IS, (WPARAM)hMeta, 0)) // just to be safe
+ if ((hMeta=(HCONTACT)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle",0))!=0 && CallService(MS_DB_CONTACT_IS, (WPARAM)hMeta, 0)) // just to be safe
{
// This contact is attached to a MetaContact.
- contact_number = Meta_GetContactNumber((HANDLE)wParam);
+ contact_number = Meta_GetContactNumber((HCONTACT)wParam);
if (contact_number == -1) return 0; // exit - db corruption
if ( !meta_group_hack_disabled && !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "Group") &&
- Meta_IsEnabled() && db_get_b((HANDLE)wParam, META_PROTO, "Hidden", 0) == 0 && !Miranda_Terminated()) {
+ Meta_IsEnabled() && db_get_b((HCONTACT)wParam, META_PROTO, "Hidden", 0) == 0 && !Miranda_Terminated()) {
if ((dcws->value.type == DBVT_ASCIIZ || dcws->value.type == DBVT_UTF8) && !Meta_IsHiddenGroup(dcws->value.pszVal)) {
// subcontact group reassigned - copy to saved group
- db_set((HANDLE)wParam, META_PROTO, "OldCListGroup", &dcws->value);
- db_set_s((HANDLE)wParam, "CList", "Group", META_HIDDEN_GROUP);
+ db_set((HCONTACT)wParam, META_PROTO, "OldCListGroup", &dcws->value);
+ db_set_s((HCONTACT)wParam, "CList", "Group", META_HIDDEN_GROUP);
} else if (dcws->value.type == DBVT_DELETED) {
- db_unset((HANDLE)wParam, META_PROTO, "OldCListGroup");
- db_set_s((HANDLE)wParam, "CList", "Group", META_HIDDEN_GROUP);
+ db_unset((HCONTACT)wParam, META_PROTO, "OldCListGroup");
+ db_set_s((HCONTACT)wParam, "CList", "Group", META_HIDDEN_GROUP);
}
}
else if ( !strcmp(dcws->szSetting, "IP")) {
@@ -650,15 +649,13 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) }
}
else if ( !strcmp(dcws->szSetting, "Nick") && !dcws->value.type == DBVT_DELETED) {
- HANDLE most_online;
-
// subcontact nick has changed - update metacontact
strcpy(buffer, "Nick");
strcat(buffer, _itoa(contact_number, szId, 10));
db_set(hMeta, META_PROTO, buffer, &dcws->value);
DBVARIANT dbv;
- if (Mydb_get((HANDLE)wParam, "CList", "MyHandle", &dbv)) {
+ if (Mydb_get((HCONTACT)wParam, "CList", "MyHandle", &dbv)) {
strcpy(buffer, "CListName");
strcat(buffer, _itoa(contact_number, szId, 10));
db_set(hMeta, META_PROTO, buffer, &dcws->value);
@@ -666,7 +663,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) else db_free(&dbv);
// copy nick to metacontact, if it's the most online
- most_online = Meta_GetMostOnline(hMeta);
+ HCONTACT most_online = Meta_GetMostOnline(hMeta);
Meta_CopyContactNick(hMeta, most_online);
return 0;
@@ -684,15 +681,13 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) db_set_dw(hMeta, META_PROTO, "LogonTS", 0);
}
else if ( !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "MyHandle")) {
- HANDLE most_online;
-
if (dcws->value.type == DBVT_DELETED) {
- char *proto = GetContactProto((HANDLE)wParam);
+ char *proto = GetContactProto((HCONTACT)wParam);
strcpy(buffer, "CListName");
strcat(buffer, _itoa(contact_number, szId, 10));
DBVARIANT dbv;
- if (proto && !Mydb_get((HANDLE)wParam, proto, "Nick", &dbv)) {
+ if (proto && !Mydb_get((HCONTACT)wParam, proto, "Nick", &dbv)) {
db_set(hMeta, META_PROTO, buffer, &dbv);
db_free(&dbv);
} else {
@@ -707,7 +702,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) }
// copy nick to metacontact, if it's the most online
- most_online = Meta_GetMostOnline(hMeta);
+ HCONTACT most_online = Meta_GetMostOnline(hMeta);
Meta_CopyContactNick(hMeta, most_online);
return 0;
@@ -757,11 +752,11 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) Meta_CopyData(hMeta);
}
else if ( !meta_group_hack_disabled && !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "Hidden")) {
- if ((dcws->value.type == DBVT_DELETED || db_get_b((HANDLE)wParam, "CList", "Hidden", 0) == 0)
- && db_get_b((HANDLE)wParam, META_PROTO, "Hidden", 0) == 1)
+ if ((dcws->value.type == DBVT_DELETED || db_get_b((HCONTACT)wParam, "CList", "Hidden", 0) == 0)
+ && db_get_b((HCONTACT)wParam, META_PROTO, "Hidden", 0) == 1)
{
// a subcontact we hid (e.g. jabber) has been unhidden - hide it again :(
- db_set_b((HANDLE)wParam, "CList", "Hidden", 1);
+ db_set_b((HCONTACT)wParam, "CList", "Hidden", 1);
}
}
}
@@ -772,21 +767,21 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) int Meta_ContactDeleted(WPARAM wParam, LPARAM lParam)
{
// is a subcontact - update meta contact
- HANDLE hMeta = (HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle", 0);
+ HCONTACT hMeta = (HCONTACT)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle", 0);
if (hMeta) {
- Meta_RemoveContactNumber(hMeta, db_get_dw((HANDLE)wParam, META_PROTO, "ContactNumber", -1));
+ Meta_RemoveContactNumber(hMeta, db_get_dw((HCONTACT)wParam, META_PROTO, "ContactNumber", -1));
NotifyEventHooks(hSubcontactsChanged, (WPARAM)hMeta, 0);
return 0;
}
// not a subcontact - is it a metacontact?
- int num_contacts = db_get_dw((HANDLE)wParam, META_PROTO, "NumContacts", 0);
+ int num_contacts = db_get_dw((HCONTACT)wParam, META_PROTO, "NumContacts", 0);
if (num_contacts)
NotifyEventHooks(hSubcontactsChanged, (WPARAM)wParam, 0);
// remove & restore all subcontacts
for (int i = 0; i < num_contacts; i++) {
- HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, i);
+ HCONTACT hContact = Meta_GetContactHandle((HCONTACT)wParam, i);
if (hContact && (HANDLE)db_get_dw(hContact, META_PROTO, "Handle", 0) == (HANDLE)wParam) {
if (db_get_b(hContact, META_PROTO, "IsSubcontact", 0) == 1)
db_unset(hContact, META_PROTO, "IsSubcontact");
@@ -812,13 +807,13 @@ int Meta_ContactDeleted(WPARAM wParam, LPARAM lParam) INT_PTR Meta_UserIsTyping(WPARAM wParam, LPARAM lParam)
{
// This is a simple contact, let through the stack of protocols
- if (db_get_dw((HANDLE)wParam, META_PROTO, META_ID,(DWORD)-1) == (DWORD)-1)
+ if (db_get_dw((HCONTACT)wParam, META_PROTO, META_ID,(DWORD)-1) == (DWORD)-1)
return 0;
// forward to sending protocol, if supported
- HANDLE most_online = Meta_GetMostOnline((HANDLE)wParam);
- Meta_CopyContactNick((HANDLE)wParam, most_online);
+ HCONTACT most_online = Meta_GetMostOnline((HCONTACT)wParam);
+ Meta_CopyContactNick((HCONTACT)wParam, most_online);
if ( !most_online)
return 0;
@@ -837,8 +832,8 @@ INT_PTR Meta_UserIsTyping(WPARAM wParam, LPARAM lParam) */
int Meta_ContactIsTyping(WPARAM wParam, LPARAM lParam)
{
- HANDLE hMeta;
- if ((hMeta = (HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle",0)) != 0 && Meta_IsEnabled()) {
+ HCONTACT hMeta;
+ if ((hMeta = (HCONTACT)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle",0)) != 0 && Meta_IsEnabled()) {
// This contact is attached to a MetaContact.
if ( !options.subcontact_windows) { // we don't want clicking on the clist notification icon to open the metacontact message window
// try to remove any clist events we added for subcontact
@@ -860,12 +855,12 @@ int Meta_ContactIsTyping(WPARAM wParam, LPARAM lParam) int Meta_UserInfo(WPARAM wParam, LPARAM lParam)
{
- DWORD default_contact_number = db_get_dw((HANDLE)lParam, META_PROTO, "Default", (DWORD)-1);
+ DWORD default_contact_number = db_get_dw((HCONTACT)lParam, META_PROTO, "Default", (DWORD)-1);
if (default_contact_number == -1) // not a meta contact
return 0;
- CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)Meta_GetContactHandle((HANDLE)lParam, default_contact_number), 0);
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)Meta_GetContactHandle((HCONTACT)lParam, default_contact_number), 0);
return 1;
}
@@ -873,11 +868,11 @@ int Meta_UserInfo(WPARAM wParam, LPARAM lParam) // let received messages through and add db history to metacontact, or vice versa
int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam) {
MessageWindowEventData *mwed = (MessageWindowEventData *)lParam;
- HANDLE hMeta = 0;
+ HCONTACT hMeta = 0;
message_window_api_enabled = TRUE;
- if ((hMeta = (HANDLE)db_get_dw(mwed->hContact, META_PROTO, "Handle", 0)) != 0
+ if ((hMeta = (HCONTACT)db_get_dw(mwed->hContact, META_PROTO, "Handle", 0)) != 0
|| db_get_dw(mwed->hContact, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1)
{
// contact is subcontact of metacontact, or an actual metacontact - record whether window is open or closed
@@ -912,11 +907,11 @@ int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam) { int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam)
{
- if (db_get_dw((HANDLE)wParam, META_PROTO, "Default",(WORD)-1) == (WORD)-1)
+ if (db_get_dw((HCONTACT)wParam, META_PROTO, "Default",(WORD)-1) == (WORD)-1)
return 0;
// -1 indicates no specific capability but respect 'ForceDefault'
- HANDLE most_online = Meta_GetMostOnlineSupporting((HANDLE)wParam, PFLAGNUM_1, -1);
+ HCONTACT most_online = Meta_GetMostOnlineSupporting((HCONTACT)wParam, PFLAGNUM_1, -1);
if ( !most_online)
return 0;
@@ -949,7 +944,7 @@ int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam) INT_PTR Meta_ClistMessageEventClicked(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = ((CLISTEVENT *)lParam)->hContact;
+ HCONTACT hContact = ((CLISTEVENT *)lParam)->hContact;
return Meta_ClistDoubleClicked((WPARAM)hContact, (LPARAM)((CLISTEVENT *)lParam)->hDbEvent);
}
@@ -1046,7 +1041,7 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam) // loop and copy data from subcontacts
if (options.copydata) {
int meta_id;
- 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 ((meta_id = db_get_dw(hContact, META_PROTO, META_ID,(DWORD)-1))!=(DWORD)-1)
Meta_CopyData(hContact);
}
@@ -1098,7 +1093,7 @@ static VOID CALLBACK sttMenuThread( PVOID param ) INT_PTR Meta_ContactMenuFunc(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, (int)lParam);
+ HCONTACT hContact = Meta_GetContactHandle((HCONTACT)wParam, (int)lParam);
if (options.menu_function == FT_MSG) {
// open message window if protocol supports message sending or chat, else simulate double click
@@ -1117,7 +1112,7 @@ INT_PTR Meta_ContactMenuFunc(WPARAM wParam, LPARAM lParam) if ((caps & PF1_IMSEND) || (caps & PF1_CHAT) || (proto && strcmp(proto, "IRC") == 0)) {
// set default contact for sending/status and open message window
- db_set_dw((HANDLE)wParam, META_PROTO, "Default", (DWORD)(int)lParam);
+ db_set_dw((HCONTACT)wParam, META_PROTO, "Default", (DWORD)(int)lParam);
NotifyEventHooks(hEventDefaultChanged, wParam, (LPARAM)hContact);
CallService(MS_MSG_SENDMESSAGE, wParam, 0);
} else
@@ -1157,12 +1152,7 @@ INT_PTR Meta_FileSend(WPARAM wParam, LPARAM lParam) }
else
{
- HANDLE most_online;
- //DBEVENTINFO dbei;
- //char szServiceName[100];
-
- most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_1, PF1_FILESEND);
-
+ HCONTACT most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_1, PF1_FILESEND);
if ( !most_online) {
//PUShowMessage("no most online for ft", SM_NOTIFY);
return 0;
@@ -1189,10 +1179,7 @@ INT_PTR Meta_GetAwayMsg(WPARAM wParam, LPARAM lParam) }
else
{
- HANDLE most_online;
-
- most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_1, PF1_MODEMSGRECV);
-
+ HCONTACT most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_1, PF1_MODEMSGRECV);
if ( !most_online)
return 0;
@@ -1221,8 +1208,8 @@ INT_PTR Meta_GetAvatarInfo(WPARAM wParam, LPARAM lParam) { }
else
{
- HANDLE hMeta = AI->hContact;
- HANDLE hSub = Meta_GetMostOnlineSupporting(AI->hContact, PFLAGNUM_4, PF4_AVATARS);
+ HCONTACT hMeta = AI->hContact;
+ HCONTACT hSub = Meta_GetMostOnlineSupporting(AI->hContact, PFLAGNUM_4, PF4_AVATARS);
if ( !hSub)
return GAIR_NOAVATAR;
@@ -1249,7 +1236,7 @@ INT_PTR Meta_GetInfo(WPARAM wParam, LPARAM lParam) if ((default_contact_number = db_get_dw(ccs->hContact, META_PROTO, "Default",(DWORD)-1)) == (DWORD)-1)
return 0;
- HANDLE most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_4, PF4_AVATARS);
+ HCONTACT most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_4, PF4_AVATARS);
if ( !most_online)
return 0;
@@ -1305,16 +1292,16 @@ int Meta_OptInit(WPARAM wParam, LPARAM lParam) int Meta_CallMostOnline(WPARAM wParam, LPARAM lParam)
{
- HANDLE most_online_im = Meta_GetMostOnline((HANDLE)wParam);
+ HCONTACT most_online_im = Meta_GetMostOnline((HCONTACT)wParam);
// fix nick
- Meta_CopyContactNick((HANDLE)wParam, most_online_im);
+ Meta_CopyContactNick((HCONTACT)wParam, most_online_im);
// fix status
- Meta_FixStatus((HANDLE)wParam);
+ Meta_FixStatus((HCONTACT)wParam);
// copy all other data
- Meta_CopyData((HANDLE) wParam);
+ Meta_CopyData((HCONTACT) wParam);
return 0;
}
diff --git a/plugins/MetaContacts/src/meta_utils.cpp b/plugins/MetaContacts/src/meta_utils.cpp index 5a9130b585..cc2b70ce98 100644 --- a/plugins/MetaContacts/src/meta_utils.cpp +++ b/plugins/MetaContacts/src/meta_utils.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. HANDLE invisiGroup;
POINT menuMousePoint;
-INT_PTR Mydb_get(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
+INT_PTR Mydb_get(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
memset(dbv, 0, sizeof(DBVARIANT));
return db_get_s(hContact, szModule, szSetting, dbv, 0);
@@ -86,7 +86,7 @@ int Meta_EqualDBV(DBVARIANT *dbv, DBVARIANT *id) { * @return a \c HANDLE to the specified contact or \c NULL
if no contact has been found.
*/
-HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id)
+HCONTACT Meta_GetHandle(const char *protocol, DBVARIANT *id)
{
char *field;
DBVARIANT dbv;
@@ -98,7 +98,7 @@ HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id) field = (char *)CallProtoService(protocol,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,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)) {
// Scan the database and retrieve the field for each contact
if ( !db_get(hContact, protocol, field, &dbv)) {
if (dbv.type == id->type) {
@@ -209,12 +209,12 @@ int Meta_SetNick(char *szProto) *
* @return TRUE on success, FALSE otherwise
*/
-BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default)
+BOOL Meta_Assign(HCONTACT src, HCONTACT dest, BOOL set_as_default)
{
DWORD metaID, num_contacts;
char buffer[512], szId[40];
WORD status;
- HANDLE most_online;
+ HCONTACT most_online;
if ((metaID = db_get_dw(dest, META_PROTO, META_ID,(DWORD)-1))==-1) {
MessageBox(0, TranslateT("Could not get MetaContact ID"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
@@ -377,7 +377,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default) * Convenience method - get most online contact supporting messaging
*
*/
-HANDLE Meta_GetMostOnline(HANDLE hMeta) {
+HCONTACT Meta_GetMostOnline(HCONTACT hMeta) {
return Meta_GetMostOnlineSupporting(hMeta, PFLAGNUM_1, PF1_IM);
}
/** Get the 'most online' contact for a meta contact (according to above order) which supports the specified
@@ -388,9 +388,9 @@ HANDLE Meta_GetMostOnline(HANDLE hMeta) { * @return \c HANDLE to a contact
*/
-HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long capability) {
+HCONTACT Meta_GetMostOnlineSupporting(HCONTACT hMeta, int pflagnum, unsigned long capability) {
int most_online_status = ID_STATUS_OFFLINE;
- HANDLE most_online_contact = NULL, hContact;
+ HCONTACT most_online_contact = NULL, hContact;
int i, status, default_contact_number, num_contacts;
unsigned long caps = 0;
char *szProto, *most_online_proto;
@@ -416,7 +416,7 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca return most_online_contact;
// a subcontact is being temporarily 'forced' to do sending
- if ((most_online_contact = (HANDLE)db_get_dw(hMeta, META_PROTO, "ForceSend", 0))) {
+ if ((most_online_contact = (HCONTACT)db_get_dw(hMeta, META_PROTO, "ForceSend", 0))) {
caps = szProto ? CallProtoService(szProto, PS_GETCAPS, (WPARAM)pflagnum, 0) : 0;
if (szProto && strcmp(szProto, "IRC") == 0) caps |= PF1_IM;
if (szProto && (caps & capability) == capability && capability != 0) // capability is 0 when we're working out status
@@ -477,7 +477,7 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca // no online contacts? if we're trying to message, use 'send offline' contact
if (most_online_status == ID_STATUS_OFFLINE && capability == PF1_IM) {
- HANDLE hOffline = Meta_GetContactHandle(hMeta, db_get_dw(hMeta, META_PROTO, "OfflineSend", (DWORD)-1));
+ HCONTACT hOffline = Meta_GetContactHandle(hMeta, db_get_dw(hMeta, META_PROTO, "OfflineSend", (DWORD)-1));
if (hOffline)
most_online_contact = hOffline;
}
@@ -485,7 +485,7 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca return most_online_contact;
}
-int Meta_GetContactNumber(HANDLE hContact) {
+int Meta_GetContactNumber(HCONTACT hContact) {
return db_get_dw(hContact, META_PROTO, "ContactNumber", -1);
}
@@ -509,12 +509,12 @@ BOOL dbv_same(DBVARIANT *dbv1, DBVARIANT *dbv2) { }
}
- void copy_settings_array(HANDLE hMeta, char *module, const char *settings[], int num_settings) {
+ void copy_settings_array(HCONTACT hMeta, char *module, const char *settings[], int num_settings) {
int num_contacts = db_get_dw(hMeta, META_PROTO, "NumContacts", (DWORD)-1),
default_contact = db_get_dw(hMeta, META_PROTO, "Default", (DWORD)-1),
most_online = Meta_GetContactNumber(Meta_GetMostOnline(hMeta));
- HANDLE hContact;
+ HCONTACT hContact;
int i, j;
char *used_mod;
@@ -613,12 +613,12 @@ const char *MBirthdaySettings[3] = // szProto:
// clist: "StatusMsg"
-void CopyStatusData(HANDLE hMeta)
+void CopyStatusData(HCONTACT hMeta)
{
int num_contacts = db_get_dw(hMeta, META_PROTO, "NumContacts", (DWORD)-1),
most_online = Meta_GetContactNumber(Meta_GetMostOnline(hMeta));
WORD status = db_get_w(hMeta, META_PROTO, "Status", ID_STATUS_OFFLINE);
- HANDLE hContact;
+ HCONTACT hContact;
BOOL bDoneStatus = FALSE, bDoneXStatus = FALSE;
for (int i = 0; i < num_contacts; i++) {
@@ -667,7 +667,7 @@ void CopyStatusData(HANDLE hMeta) }
}
-void Meta_CopyData(HANDLE hMeta)
+void Meta_CopyData(HCONTACT hMeta)
{
if (options.copydata) {
CopyStatusData(hMeta);
@@ -682,7 +682,7 @@ void Meta_CopyData(HANDLE hMeta) }
-HANDLE Meta_GetContactHandle(HANDLE hMeta, int contact_number)
+HCONTACT Meta_GetContactHandle(HCONTACT hMeta, int contact_number)
{
char buffer[512], buffer2[512];
int num_contacts = db_get_dw(hMeta, META_PROTO, "NumContacts", 0);
@@ -691,13 +691,13 @@ HANDLE Meta_GetContactHandle(HANDLE hMeta, int contact_number) strcpy(buffer, "Handle");
strcat(buffer, _itoa(contact_number, buffer2, 10));
- return (HANDLE)db_get_dw(hMeta, META_PROTO, buffer, 0);
+ return (HCONTACT)db_get_dw(hMeta, META_PROTO, buffer, 0);
}
int Meta_SetHandles(void)
{
DWORD meta_id, num_contacts, contact_number;
- HANDLE hContact2, hContact = db_find_first(), hNextContact;
+ HCONTACT hContact2, hContact = db_find_first(), hNextContact;
char buffer[512];
TCHAR nick_buffer[128], buffer2[40];
BOOL found;
@@ -875,7 +875,7 @@ int Meta_HideLinkedContacts(void) { char *szProto, *group_name;
int hGroup = 1;
- HANDLE hContact2, hContact = db_find_first();
+ HCONTACT hContact2, hContact = db_find_first();
// ensure the hidden group does not exist (how this occurs i wonder but there have been reports!)
// (sometimes protocol server side groups are to blame - msn and icq)
@@ -890,7 +890,7 @@ int Meta_HideLinkedContacts(void) { hGroup++;
} while(group_name);
- while ( hContact != NULL ) {
+ while (hContact != NULL) {
if ((meta_id = db_get_dw(hContact, META_PROTO, META_LINK,(DWORD)-1))!=(DWORD)-1) {
// get contact number
contact_number = db_get_dw(hContact, META_PROTO, "ContactNumber", (DWORD)-1);
@@ -961,7 +961,7 @@ int Meta_HideLinkedContacts(void) { while ( hContact != NULL ) {
if (db_get_dw(hContact, META_PROTO, META_ID,(DWORD)-1)!=(DWORD)-1) {
// is a meta contact
- HANDLE hMostOnline = Meta_GetMostOnline(hContact); // set nick
+ HCONTACT hMostOnline = Meta_GetMostOnline(hContact); // set nick
Meta_CopyContactNick(hContact, hMostOnline);
Meta_FixStatus(hContact);
@@ -979,7 +979,7 @@ int Meta_HideLinkedContacts(void) { */
int Meta_UnhideLinkedContacts(void)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (db_get_dw(hContact, META_PROTO, META_LINK,(DWORD)-1)!=(DWORD)-1) {
// has a link - unhide it
// restore old group
@@ -996,7 +996,7 @@ int Meta_HideMetaContacts(int hide) if (hide) Meta_SuppressStatus(FALSE);
else Meta_SuppressStatus(options.suppress_status);
- 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, META_PROTO, META_ID,(DWORD)-1)!=(DWORD)-1) {
// is a meta contact
if (hide)
@@ -1016,7 +1016,7 @@ int Meta_HideMetaContacts(int hide) return 0;
}
-void Meta_RestoreGroup(HANDLE hContact) {
+void Meta_RestoreGroup(HCONTACT hContact) {
if (meta_group_hack_disabled) return; // clist has called api function to disable group hack - yay!
@@ -1057,7 +1057,7 @@ void Meta_RestoreGroup(HANDLE hContact) { else {
// put back into metacontact's group
DBVARIANT dbv;
- HANDLE hMeta = (HANDLE)db_get_dw(hContact, META_PROTO, "Handle", 0);
+ HCONTACT hMeta = (HCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0);
if (hMeta && !Mydb_get(hMeta, "CList", "Group", &dbv)) {
db_set(hContact, "CList", "Group", &dbv);
db_free(&dbv);
@@ -1082,7 +1082,7 @@ void Meta_RestoreGroup(HANDLE hContact) { db_unset(hContact, "CList", "Hidden");
}
-void Meta_SetGroup(HANDLE hContact) {
+void Meta_SetGroup(HCONTACT hContact) {
char *szProto, *uid;
if (meta_group_hack_disabled) return; // clist has called api function to disable group hack - yay!
@@ -1118,7 +1118,7 @@ void Meta_SetGroup(HANDLE hContact) { int Meta_SuppressStatus(BOOL suppress)
{
- 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, META_PROTO, META_LINK,(DWORD)-1)!=(DWORD)-1) {
// is a subcontact
if (suppress)
@@ -1131,7 +1131,7 @@ int Meta_SuppressStatus(BOOL suppress) return 0;
}
-int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact) {
+int Meta_CopyContactNick(HCONTACT hMeta, HCONTACT hContact) {
DBVARIANT dbv, dbv_proto;
char *szProto;
@@ -1170,9 +1170,9 @@ int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact) { int Meta_SetAllNicks()
{
- 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, META_PROTO, META_ID,(DWORD)-1)!=(DWORD)-1) {
- HANDLE most_online = Meta_GetMostOnline(hContact);
+ HCONTACT most_online = Meta_GetMostOnline(hContact);
Meta_CopyContactNick(hContact, most_online);
Meta_FixStatus(hContact);
Meta_CopyData(hContact);
@@ -1190,10 +1190,10 @@ int Meta_IsHiddenGroup(const char *group_name) return 0;
}
-int Meta_SwapContacts(HANDLE hMeta, DWORD contact_number1, DWORD contact_number2) {
+int Meta_SwapContacts(HCONTACT hMeta, DWORD contact_number1, DWORD contact_number2) {
DBVARIANT dbv1, dbv2;
- HANDLE hContact1 = Meta_GetContactHandle(hMeta, contact_number1),
+ HCONTACT hContact1 = Meta_GetContactHandle(hMeta, contact_number1),
hContact2 = Meta_GetContactHandle(hMeta, contact_number2);
char buff1[512], buff12[512], buff2[512], buff22[512];
BOOL ok1, ok2;
@@ -1348,7 +1348,7 @@ INT_PTR CALLBACK DlgProcNull(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara }
// function to copy history from one contact to another - courtesy JdGordon (thx)
-void copyHistory(HANDLE hContactFrom,HANDLE hContactTo)
+void copyHistory(HCONTACT hContactFrom, HCONTACT hContactTo)
{
HANDLE hDbEvent;
DBEVENTINFO dbei;
@@ -1409,8 +1409,9 @@ void copyHistory(HANDLE hContactFrom,HANDLE hContactTo) //mir_free(id);
}
-void Meta_FixStatus(HANDLE hMeta) {
- HANDLE most_online = Meta_GetMostOnlineSupporting(hMeta, PFLAGNUM_1, 0);
+void Meta_FixStatus(HCONTACT hMeta)
+{
+ HCONTACT most_online = Meta_GetMostOnlineSupporting(hMeta, PFLAGNUM_1, 0);
if (most_online) {
char *szProto = GetContactProto(most_online);
if (szProto) {
diff --git a/plugins/MetaContacts/src/metacontacts.h b/plugins/MetaContacts/src/metacontacts.h index a7fb25823c..637db357d5 100644 --- a/plugins/MetaContacts/src/metacontacts.h +++ b/plugins/MetaContacts/src/metacontacts.h @@ -63,7 +63,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // I can't think of a way around this - mental block
-INT_PTR TranslateMenuFunc(HANDLE hContact, int i);
+INT_PTR TranslateMenuFunc(HCONTACT hContact, int i);
extern HGENMENU hMenuContact[MAX_CONTACTS];
extern HINSTANCE hInstance;
@@ -78,7 +78,7 @@ extern int mcStatus; INT_PTR Meta_Convert(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_AddTo(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_Edit(WPARAM wParam,LPARAM lParam);
-void Meta_RemoveContactNumber(HANDLE hMeta, int number);
+void Meta_RemoveContactNumber(HCONTACT hMeta, int number);
INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_Default(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_ForceDefault(WPARAM wParam,LPARAM lParam);
@@ -87,32 +87,32 @@ INT_PTR Meta_IsEnabled(); int Meta_EqualDBV(DBVARIANT *dbv, DBVARIANT *id);
int Meta_ModifyMenu(WPARAM wParam,LPARAM lParam);
-BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default);
-HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id);
+BOOL Meta_Assign(HCONTACT src, HCONTACT dest, BOOL set_as_default);
+HCONTACT Meta_GetHandle(const char *protocol, DBVARIANT *id);
int Meta_SetNick(char *proto);
-HANDLE Meta_GetMostOnline(HANDLE hMeta);
-HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long capability);
+HCONTACT Meta_GetMostOnline(HCONTACT hMeta);
+HCONTACT Meta_GetMostOnlineSupporting(HCONTACT hMeta, int pflagnum, unsigned long capability);
int Meta_HideLinkedContacts(void);
int Meta_SetHandles(void);
int Meta_UnhideLinkedContacts(void);
-int Meta_GetContactNumber(HANDLE hContact);
-HANDLE Meta_GetContactHandle(HANDLE hMeta, int contact_number);
-void Meta_RestoreGroup(HANDLE hContact);
-void Meta_SetGroup(HANDLE hContact);
+int Meta_GetContactNumber(HCONTACT hContact);
+HCONTACT Meta_GetContactHandle(HCONTACT hMeta, int contact_number);
+void Meta_RestoreGroup(HCONTACT hContact);
+void Meta_SetGroup(HCONTACT hContact);
int Meta_HideMetaContacts(int hide);
int Meta_SuppressStatus(int suppress);
-int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact);
-void Meta_CopyData(HANDLE hMeta);
+int Meta_CopyContactNick(HCONTACT hMeta, HCONTACT hContact);
+void Meta_CopyData(HCONTACT hMeta);
int Meta_SetAllNicks();
int Meta_IsHiddenGroup(const char *group_name);
-int Meta_SwapContacts(HANDLE hMeta, DWORD contact_number1, DWORD contact_number2);
+int Meta_SwapContacts(HCONTACT hMeta, DWORD contact_number1, DWORD contact_number2);
// function to copy history from one contact to another - courtesy JdGordon with mods (thx)
-void copyHistory(HANDLE hContactFrom,HANDLE hContactTo);
+void copyHistory(HCONTACT hContactFrom, HCONTACT hContactTo);
// inverse
//void Meta_RemoveHistory(HANDLE hContactRemoveFrom, HANDLE hContactSource);
-void Meta_FixStatus(HANDLE hMeta);
+void Meta_FixStatus(HCONTACT hMeta);
-char *Meta_GetUniqueIdentifier(HANDLE hContact, DWORD *pused);
+char *Meta_GetUniqueIdentifier(HCONTACT hContact, DWORD *pused);
INT_PTR Meta_GetCaps(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_GetName(WPARAM wParam,LPARAM lParam);
@@ -187,7 +187,7 @@ INT_PTR MetaAPI_RemoveFromMeta(WPARAM wParam, LPARAM lParam); INT_PTR MetaAPI_DisableHiddenGroup(WPARAM wParam, LPARAM lParam);
// extended db get/write setting functions, that handle unicode
-INT_PTR Mydb_get(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
+INT_PTR Mydb_get(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
// IcoLib support
void InitIcons(void);
diff --git a/plugins/MirFox/src/MirandaOptions.cpp b/plugins/MirFox/src/MirandaOptions.cpp index ea79b85297..ec6f20e952 100644 --- a/plugins/MirFox/src/MirandaOptions.cpp +++ b/plugins/MirFox/src/MirandaOptions.cpp @@ -169,7 +169,7 @@ static void setListContactIcons(HWND hwndList){ boost::ptr_list<MirandaContact>::iterator mirandaContactsIter;
for (mirandaContactsIter = mirandaContactsPtr->begin(); mirandaContactsIter != mirandaContactsPtr->end(); mirandaContactsIter++){
- HANDLE hContact = mirandaContactsIter->contactHandle;
+ HCONTACT hContact = mirandaContactsIter->contactHandle;
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if(hItem) {
//if icon on 0th extracolumn is not set
@@ -484,7 +484,7 @@ INT_PTR CALLBACK DlgProcOpts_Tab2(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case PSN_APPLY:
{
- 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, IDC2_CONTACTS_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if(hItem) {
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index c2374ab166..2fefc5b8ec 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -181,7 +181,7 @@ void MirandaUtils::sendMessage(ActionThreadArgStruct* args, MFENUM_SEND_MESSAGE_ }
logger->log_p(L"SMTC: mirandaSendModeFlag = [%d] bufSize = [%d]", mirandaSendModeFlag, bufSize);
- HANDLE hProcess = sendMessageMiranda(args->targetHandle, mirandaSendModeFlag, msgBuffer);
+ HANDLE hProcess = sendMessageMiranda((HCONTACT)args->targetHandle, mirandaSendModeFlag, msgBuffer);
logger->log_p(L"SMTC: hProcess = [" SCNuPTR L"]", hProcess);
MIRFOXACKDATA* myMfAck = NULL;
@@ -227,7 +227,7 @@ void MirandaUtils::sendMessage(ActionThreadArgStruct* args, MFENUM_SEND_MESSAGE_ if(myMfAck != NULL && myMfAck->result == ACKRESULT_SUCCESS){
- addMessageToDB(args->targetHandle, mirandaSendModeFlag, msgBuffer, bufSize, targetHandleSzProto);
+ addMessageToDB((HCONTACT)args->targetHandle, mirandaSendModeFlag, msgBuffer, bufSize, targetHandleSzProto);
if (mode == MFENUM_SMM_ONLY_SEND){
@@ -347,12 +347,12 @@ int MirandaUtils::getMirandaSendModeFlag(char* targetHandleSzProto) }
-HANDLE MirandaUtils::sendMessageMiranda(HANDLE hContact, int mirandaSendModeFlag, char* msgBuffer)
+HANDLE MirandaUtils::sendMessageMiranda(HCONTACT hContact, int mirandaSendModeFlag, char* msgBuffer)
{
return (HANDLE)CallContactService(hContact, PSS_MESSAGE, (WPARAM)mirandaSendModeFlag, (LPARAM)msgBuffer);
}
-void MirandaUtils::addMessageToDB(HANDLE hContact, int mirandaSendModeFlag, char* msgBuffer, std::size_t bufSize, char* targetHandleSzProto)
+void MirandaUtils::addMessageToDB(HCONTACT hContact, int mirandaSendModeFlag, char* msgBuffer, std::size_t bufSize, char* targetHandleSzProto)
{
DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
@@ -406,12 +406,12 @@ int MirandaUtils::on_hook_OpenMW(WPARAM wParam, LPARAM lParam) MessageWindowData mwd;
mwd.cbSize = sizeof(MessageWindowData);
- mwd.hContact = param->targetHandle;
+ mwd.hContact = (HCONTACT)param->targetHandle;
mwd.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
MessageWindowInputData mwid;
mwid.cbSize = sizeof(MessageWindowInputData);
- mwid.hContact = param->targetHandle;
+ mwid.hContact = (HCONTACT)param->targetHandle;
mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
delete param;
@@ -581,7 +581,7 @@ void MirandaUtils::translateOldDBNames() { }
//contacts "state"
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)){
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)){
logger->log_p(L"TranslateOldDBNames: found CONTACT: [" SCNuPTR L"]", hContact);
diff --git a/plugins/MirFox/src/MirandaUtils.h b/plugins/MirFox/src/MirandaUtils.h index b0a05fce6f..2c6e04afcc 100644 --- a/plugins/MirFox/src/MirandaUtils.h +++ b/plugins/MirFox/src/MirandaUtils.h @@ -80,9 +80,9 @@ private: int getMirandaSendModeFlag(char* targetHandleSzProto);
- HANDLE sendMessageMiranda(HANDLE hContact, int mirandaSendModeFlag, char* msgBuffer);
+ HANDLE sendMessageMiranda(HCONTACT hContact, int mirandaSendModeFlag, char* msgBuffer);
- void addMessageToDB(HANDLE hContact, int mirandaSendModeFlag, char* msgBuffer, std::size_t bufSize, char* targetHandleSzProto);
+ void addMessageToDB(HCONTACT hContact, int mirandaSendModeFlag, char* msgBuffer, std::size_t bufSize, char* targetHandleSzProto);
void setStatusOnAccount(ActionThreadArgStruct* args);
@@ -100,7 +100,7 @@ private: typedef struct {
const char* szModule;
- HANDLE hContact;
+ HCONTACT hContact;
int result;
const char* errorDesc;
} MIRFOXACKDATA;
diff --git a/plugins/MirFox/src/MirfoxData.cpp b/plugins/MirFox/src/MirfoxData.cpp index bef57abf04..ddb6ebdc8e 100644 --- a/plugins/MirFox/src/MirfoxData.cpp +++ b/plugins/MirFox/src/MirfoxData.cpp @@ -257,35 +257,26 @@ MirfoxData::getAccountDefaultState(MirandaAccount* account) int
MirfoxData::getContactDefaultState(MirandaContact* contact)
{
-
MFLogger* logger = MFLogger::getInstance();
- if (contact == NULL){
+ if (contact == NULL)
return 2;
- }
- if (contact->mirandaAccountPtr == NULL){
+ if (contact->mirandaAccountPtr == NULL)
return 2;
- }
- if (contact->mirandaAccountPtr->szProtoName == NULL){
+ if (contact->mirandaAccountPtr->szProtoName == NULL)
return 2;
- }
- if (!shouldProtoBeActiveByName(contact->mirandaAccountPtr->szProtoName)){
+ if (!shouldProtoBeActiveByName(contact->mirandaAccountPtr->szProtoName))
return 2;
- }
- if (db_get_b(contact->contactHandle, "CList", "Hidden", 0) == 1 ||
- db_get_b(contact->contactHandle, "CList", "NotOnList", 0) == 1 ){
+ if (db_get_b(contact->contactHandle, "CList", "Hidden", 0) == 1 || db_get_b(contact->contactHandle, "CList", "NotOnList", 0) == 1 )
return 2;
- }
return 1;
-
}
-
void
MirfoxData::initializeMirandaAccounts()
{
@@ -364,7 +355,7 @@ void MirfoxData::initializeMirandaContacts() //get contects from miranda
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)){
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)){
//add to list
MirandaContact* mirandaContactItemPtr = new MirandaContact(
hContact //handle to contact in miranda
@@ -583,7 +574,7 @@ MirandaAccount::getObjectPtr() * class functions implementation
*/
-MirandaContact::MirandaContact(HANDLE contactHandleL)
+MirandaContact::MirandaContact(HCONTACT contactHandleL)
{
contactState = MFENUM_MIRANDACONTACT_STATE_UNKNOWN;
contactHandle = contactHandleL;
diff --git a/plugins/MirFox/src/MirfoxData.h b/plugins/MirFox/src/MirfoxData.h index 3623fd2d1d..fe98ff31b4 100644 --- a/plugins/MirFox/src/MirfoxData.h +++ b/plugins/MirFox/src/MirfoxData.h @@ -256,11 +256,11 @@ class MirandaContact {
public:
- MirandaContact(HANDLE contactHandleL);
+ MirandaContact(HCONTACT contactHandleL);
~MirandaContact(void);
MirandaContact* getObjectPtr();
- HANDLE contactHandle; //HANDLE to contact in miranda (unikalne)
+ HCONTACT contactHandle; //HANDLE to contact in miranda (unikalne)
std::wstring contactNameW; //presented name
MFENUM_MIRANDACONTACT_STATE contactState; //state in options
MirandaAccount* mirandaAccountPtr; //account of hContact
diff --git a/plugins/MirOTR/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/MirOTR/src/dbfilter.cpp index e3d992817a..443c009574 100644 --- a/plugins/MirOTR/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/MirOTR/src/dbfilter.cpp @@ -5,10 +5,10 @@ static CRITICAL_SECTION RemoveChainCS={0}, *lpRemoveChainCS = &RemoveChainCS; static UINT_PTR timerId = 0;
struct DeleteEventNode {
- DeleteEventNode *next;
- time_t timestamp;
- HANDLE hContact;
- HANDLE hDbEvent;
+ DeleteEventNode *next;
+ time_t timestamp;
+ HCONTACT hContact;
+ HANDLE hDbEvent;
};
struct DeleteEventHead {
DeleteEventNode *first;
@@ -45,7 +45,7 @@ VOID CALLBACK DeleteTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTi // add prefix to sent messages
int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) {
if (!options.prefix_messages || !lParam) return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBEVENTINFO *dbei = (DBEVENTINFO *)lParam;
if ((dbei->eventType != EVENTTYPE_MESSAGE) || !(dbei->flags & DBEF_SENT) || (dbei->flags & DBEF_OTR_PREFIXED))
return 0;
@@ -58,7 +58,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { return 0;
if(g_metaproto && strcmp(proto, g_metaproto) == 0) {
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
if (!hContact) return 0;
proto = contact_get_proto(hContact);
if (!proto ) return 0;
@@ -74,9 +74,9 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { char *msg = (char *)dbei->pBlob;
char *newmsg = 0;
DWORD alloclen = 0;
- DWORD msglen = strlen(msg);
+ DWORD msglen = (DWORD)strlen(msg);
if (dbei->flags & DBEF_UTF) {
- int prefixlen = strnlen(options.prefix, 64);
+ int prefixlen = (int)strnlen(options.prefix, 64);
if (strncmp(msg, options.prefix, prefixlen) == 0) return 0;
alloclen = (msglen+prefixlen+1)*sizeof(char);
@@ -108,15 +108,15 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { // yes, unicode
wchar_t* msgw = (wchar_t *)&msg[msglen];
wchar_t *prefixw = mir_utf8decodeW(options.prefix);
- int prefixlenw = wcslen(prefixw);
+ int prefixlenw = (int)wcslen(prefixw);
if (wcsncmp(msgw, prefixw, prefixlenw) == 0) {
mir_free(prefixw);
return 0;
}
- int msglenw = wcslen(msgw);
+ int msglenw = (int)wcslen(msgw);
char *prefix = mir_utf8decodeA(options.prefix);
- int prefixlen = strlen(prefix);
+ int prefixlen = (int)strlen(prefix);
alloclen = (msglen+prefixlen+1)* sizeof(char) + (msglenw + prefixlenw +1) * sizeof(wchar_t);
// get additional data
@@ -141,7 +141,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { }
else {
char *prefix = mir_utf8decodeA(options.prefix);
- int prefixlen = strlen(prefix);
+ int prefixlen = (int)strlen(prefix);
if (strncmp(msg, prefix, prefixlen) == 0) {
mir_free(prefix);
return 0;
@@ -183,16 +183,16 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { static char* prefixutf = mir_utf8encodeT(TranslateT(LANG_INLINE_PREFIX));
static char* prefix = Translate(LANG_INLINE_PREFIX);
- static DWORD lenutf = strlen(prefixutf);
- static DWORD len = strlen(prefix);
+ static DWORD lenutf = (DWORD)strlen(prefixutf);
+ static DWORD len = (DWORD)strlen(prefix);
DBEVENTINFO info = { sizeof(info) };
info.cbBlob = lenutf*2;
info.pBlob = (PBYTE)mir_alloc(info.cbBlob);
if (!db_event_get((HANDLE)lParam, &info)) {
if(info.eventType == EVENTTYPE_MESSAGE) {
- HANDLE hContact = (HANDLE)wParam, hSub;
- if(options.bHaveMetaContacts && (hSub = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
+ HCONTACT hContact = (HCONTACT)wParam, hSub;
+ if(options.bHaveMetaContacts && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
hContact = hSub;
ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact);
@@ -223,7 +223,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { return 0;
}
-void FinishSession(HANDLE hContact) {
+void FinishSession(HCONTACT hContact) {
if (!hContact) return;
ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact);
TrustLevel level = otr_context_get_trust(context);
@@ -247,8 +247,8 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) { if(mwd->uType != MSG_WINDOW_EVT_OPEN) return 0;
- HANDLE hContact = mwd->hContact, hTemp;
- if(options.bHaveMetaContacts && (hTemp = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
+ HCONTACT hContact = mwd->hContact, hTemp;
+ if(options.bHaveMetaContacts && (hTemp = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
hContact = hTemp;
if (!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME))
@@ -271,14 +271,14 @@ int StatusModeChange(WPARAM wParam, LPARAM lParam) { if(status != ID_STATUS_OFFLINE ) return 0;
const char *proto = (char *)lParam;
- HANDLE hContact;
+ HCONTACT hContact;
lib_cs_lock();
ConnContext *context = otr_user_state->context_root;
while(context) {
if(context->msgstate == OTRL_MSGSTATE_ENCRYPTED && (proto == 0 || strcmp(proto, context->protocol) == 0)) {
- hContact = context->app_data;
+ hContact = (HCONTACT)context->app_data;
if(hContact) {
otrl_message_disconnect(otr_user_state, &ops, hContact, context->accountname, context->protocol, context->username);
@@ -296,7 +296,7 @@ int StatusModeChange(WPARAM wParam, LPARAM lParam) { int OnContactSettingChanged(WPARAM wParam, LPARAM lParam) {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
if (!lParam || strcmp(cws->szSetting, "Status") != 0) return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
int status=0;
switch (cws->value.type){
case DBVT_WORD:
diff --git a/plugins/MirOTR/MirOTR/src/dialogs.cpp b/plugins/MirOTR/MirOTR/src/dialogs.cpp index 0f16292577..b248ec0102 100644 --- a/plugins/MirOTR/MirOTR/src/dialogs.cpp +++ b/plugins/MirOTR/MirOTR/src/dialogs.cpp @@ -33,8 +33,8 @@ INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM smp_for_contact[context->app_data].responder = data->responder;
mir_free(data);
- TCHAR title[512], *proto = mir_a2t(contact_get_proto((HANDLE)context->app_data));
- const TCHAR *name =contact_get_nameT((HANDLE)context->app_data);
+ TCHAR title[512], *proto = mir_a2t(contact_get_proto((HCONTACT)context->app_data));
+ const TCHAR *name =contact_get_nameT((HCONTACT)context->app_data);
mir_sntprintf(title, 512, TranslateT(LANG_SMP_PROGRESS_TITLE), name, proto);
SendMessage(hwndDlg, WM_SETTEXT, 0, (LPARAM)title);
mir_sntprintf(title, 512, TranslateT(LANG_SMP_PROGRESS_DESC), name, proto);
@@ -168,15 +168,15 @@ INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA smp_for_contact[context->app_data].oldlevel = data->oldlevel;
smp_for_contact[context->app_data].responder = data->responder;
- TCHAR buff[512], *proto=mir_a2t(contact_get_proto(context->app_data));
- mir_sntprintf(buff, 512, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(context->app_data), proto);
+ TCHAR buff[512], *proto = mir_a2t(contact_get_proto((HCONTACT)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT((HCONTACT)context->app_data), proto);
mir_free(proto);
SendMessage(hwndDlg, WM_SETTEXT, 0, (LPARAM)buff);
SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, buff);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context);
if (data->question) {
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT(context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT((HCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA mir_free(data->question);
} else {
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT((HCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -315,8 +315,8 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA return FALSE;
}
- TCHAR title[512], *proto = mir_a2t(contact_get_proto((HANDLE)context->app_data));
- mir_sntprintf(title, 512, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT((HANDLE)context->app_data), proto);
+ TCHAR title[512], *proto = mir_a2t(contact_get_proto((HCONTACT)context->app_data));
+ mir_sntprintf(title, 512, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT((HCONTACT)context->app_data), proto);
mir_free(proto);
SendMessage(hwndDlg, WM_SETTEXT, 0, (LPARAM)title);
SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, title);
@@ -370,9 +370,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
TCHAR buff[1024];
if (!fp->trust || fp->trust[0] == '\0')
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT((HCONTACT)context->app_data));
else
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT((HCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -408,7 +408,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_QUESTION), 255)==0) {
if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) {
TCHAR msg[512];
- mir_sntprintf(msg, 512, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(msg, 512, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT((HCONTACT)context->app_data));
ShowError(msg);
}else {
int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, WM_GETTEXTLENGTH, 0, 0);
@@ -432,7 +432,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }else if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_PASSWORD), 255)==0) {
if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) {
TCHAR msg[512];
- mir_sntprintf(msg, 512, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(msg, 512, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT((HCONTACT)context->app_data));
ShowError(msg);
}else {
int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, WM_GETTEXTLENGTH, 0, 0);
@@ -477,9 +477,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, buff, 255);
if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_QUESTION), 255)==0) {
if (trusted)
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT((HCONTACT)context->app_data));
else
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT((HCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -497,9 +497,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE);
} else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_PASSWORD), 255)==0) {
if (trusted)
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT((HCONTACT)context->app_data));
else
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT((HCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -517,9 +517,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE);
} else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_FINGERPRINT), 255)==0) {
if (trusted)
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT((HCONTACT)context->app_data));
else
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT((HCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -662,9 +662,9 @@ INT_PTR CALLBACK DlgProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM wParam, LPA }
TCHAR buff[512];
if (!fp->trust || fp->trust[0] == '\0')
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT((HCONTACT)context->app_data));
else
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT((HCONTACT)context->app_data));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -729,20 +729,20 @@ unsigned int CALLBACK verify_context_thread(void *param) otrl_context_set_trust(context->active_fingerprint, "verified");
otrl_privkey_write_fingerprints(otr_user_state, g_fingerprint_store_filename);
lib_cs_unlock();
- mir_sntprintf(msg, 1024, TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(msg, 1024, TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT((HCONTACT)context->app_data));
msg[1023] = '\0';
- ShowMessage((HANDLE)context->app_data, msg);
- SetEncryptionStatus(context->app_data, otr_context_get_trust(context));
+ ShowMessage((HCONTACT)context->app_data, msg);
+ SetEncryptionStatus((HCONTACT)context->app_data, otr_context_get_trust(context));
break;
case IDNO:
lib_cs_lock();
otrl_context_set_trust(context->active_fingerprint, NULL);
otrl_privkey_write_fingerprints(otr_user_state, g_fingerprint_store_filename);
lib_cs_unlock();
- mir_sntprintf(msg, 1024, TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(msg, 1024, TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT((HCONTACT)context->app_data));
msg[1023] = '\0';
- ShowMessage((HANDLE)context->app_data, msg);
- SetEncryptionStatus(context->app_data, otr_context_get_trust(context));
+ ShowMessage((HCONTACT)context->app_data, msg);
+ SetEncryptionStatus((HCONTACT)context->app_data, otr_context_get_trust(context));
break;
}
}
diff --git a/plugins/MirOTR/MirOTR/src/dllmain.cpp b/plugins/MirOTR/MirOTR/src/dllmain.cpp index e38f2ff076..1c275c4e92 100644 --- a/plugins/MirOTR/MirOTR/src/dllmain.cpp +++ b/plugins/MirOTR/MirOTR/src/dllmain.cpp @@ -88,7 +88,7 @@ extern "C" __declspec(dllexport) int Load(void) // remove us as a filter to all contacts - fix filter type problem
if(db_get_b(0, MODULENAME, "FilterOrderFix", 0) != 2) {
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
CallService(MS_PROTO_REMOVEFROMCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME);
db_set_b(0, MODULENAME, "FilterOrderFix", 2);
}
diff --git a/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp index f886cd14e6..78fd4bf165 100644 --- a/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp @@ -49,9 +49,7 @@ static INT_PTR AddMirOTRMenuItem(WPARAM, LPARAM lParam) static INT_PTR BuildMirOTRMenu(WPARAM wParam, LPARAM)
{
- HANDLE hContact = ( HANDLE )wParam;
- //NotifyEventHooks(hPreBuildMirOTRMenuEvent,(WPARAM)hMirOTR,0);
-
+ HCONTACT hContact = (HCONTACT)wParam;
ListParam param = { 0 };
param.MenuObjectHandle = hMirOTRMenuObject;
@@ -89,10 +87,9 @@ INT_PTR MirOTRMenuCheckService(WPARAM wParam,LPARAM) if ( cmep == NULL ) //this is rootsection...build it
return TRUE;
- HANDLE hContact = (HANDLE)pcpp->wParam, hSub;
- if(options.bHaveMetaContacts && (hSub = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
+ HCONTACT hContact = (HCONTACT)pcpp->wParam, hSub;
+ if(options.bHaveMetaContacts && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
hContact = hSub;
- }
TrustLevel level = ( TrustLevel )otr_context_get_trust(otrl_context_find_miranda(otr_user_state, hContact));
@@ -181,7 +178,7 @@ LRESULT CALLBACK PopupMenuWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM return DefWindowProc(hwnd, message, wParam, lParam);
}
-void ShowOTRMenu(HANDLE hContact, POINT pt){
+void ShowOTRMenu(HCONTACT hContact, POINT pt){
HMENU menu = (HMENU) CallService(MS_MIROTR_MENUBUILDMIROTR, (WPARAM)hContact, 0);
SetWindowLongPtr(hDummyPaintWin, GWLP_USERDATA, (LONG_PTR)hContact);
TrackPopupMenu(menu, 0, pt.x, pt.y, 0, hDummyPaintWin, 0);
diff --git a/plugins/MirOTR/MirOTR/src/mirotrmenu.h b/plugins/MirOTR/MirOTR/src/mirotrmenu.h index fe070f0ba8..c92adab7fb 100644 --- a/plugins/MirOTR/MirOTR/src/mirotrmenu.h +++ b/plugins/MirOTR/MirOTR/src/mirotrmenu.h @@ -42,4 +42,4 @@ typedef struct { void InitMirOTRMenu(void);
void UninitMirOTRMenu(void);
-void ShowOTRMenu(HANDLE hContact, POINT pt);
\ No newline at end of file +void ShowOTRMenu(HCONTACT hContact, POINT pt);
diff --git a/plugins/MirOTR/MirOTR/src/options.cpp b/plugins/MirOTR/MirOTR/src/options.cpp index 04a985eccc..7ecb6051c7 100644 --- a/plugins/MirOTR/MirOTR/src/options.cpp +++ b/plugins/MirOTR/MirOTR/src/options.cpp @@ -156,10 +156,11 @@ void SaveOptions() { db_set_b(0, MODULENAME, "EndWindowClose", options.end_window_close ? 1 : 0);
}
-extern "C" void set_context_contact(void *data, ConnContext *context) {
- HANDLE hContact = find_contact(context->username, context->protocol);
- context->app_data = hContact;
- }
+extern "C" void set_context_contact(void *data, ConnContext *context)
+{
+ HCONTACT hContact = find_contact(context->username, context->protocol);
+ context->app_data = hContact;
+}
void ReadPrivkeyFiles() {
DEBUGOUT_T("READ privkey");
@@ -556,7 +557,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM const char *proto;
TCHAR *proto_t;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
proto = contact_get_proto(hContact);
if(proto && db_get_b(hContact, proto, "ChatRoom", 0) == 0 && CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME) // ignore chatrooms
&& (g_metaproto == 0 || strcmp(proto, g_metaproto) != 0)) // and MetaContacts
@@ -585,7 +586,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM switch ( LOWORD( wParam )) {
case IDC_CMB_CONT_POLICY:
{
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
int iUser = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_CONT_CONTACTS));
if (iUser == -1) break;
int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_CONT_POLICY, CB_GETCURSEL, 0, 0);
@@ -603,7 +604,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM lvi.iSubItem = 0;
ListView_GetItem(GetDlgItem(hwndDlg, IDC_LV_CONT_CONTACTS), &lvi);
ContactPolicyMap* cpm = (ContactPolicyMap*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- hContact = (HANDLE)lvi.lParam;
+ hContact = (HCONTACT)lvi.lParam;
(*cpm)[hContact].policy = policy;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}break;
@@ -649,7 +650,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM lvi.iSubItem = 0;
SendDlgItemMessage(hwndDlg, IDC_LV_CONT_CONTACTS, LVM_GETITEM, 0, (LPARAM)&lvi);
- HANDLE hContact = (HANDLE)lvi.lParam;
+ HCONTACT hContact = (HCONTACT)lvi.lParam;
ContactPolicyMap *cp = (ContactPolicyMap *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
TCHAR buff[50];
ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, buff, 50);
@@ -742,7 +743,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w Fingerprint *fp;
while (context) {
if (context->app_data) {
- user = (TCHAR*)contact_get_nameT((HANDLE)context->app_data);
+ user = (TCHAR*)contact_get_nameT((HCONTACT)context->app_data);
if (user) {
proto = mir_a2t(context->protocol);
fp = context->fingerprint_root.next;
@@ -818,7 +819,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w if (fp->context->active_fingerprint == fp) {
TCHAR buff[1024], hash[45];
otrl_privkey_hash_to_humanT(hash, fp->fingerprint);
- mir_sntprintf(buff, 1024, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT((HANDLE)fp->context->app_data));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT((HCONTACT)fp->context->app_data));
ShowError(buff);
} else {
FPModifyMap* fpm = (FPModifyMap*) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
@@ -847,7 +848,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w if (it->first->context->active_fingerprint == it->first) {
TCHAR buff[1024], hash[45];
otrl_privkey_hash_to_humanT(hash, it->first->fingerprint);
- mir_sntprintf(buff, 1024, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT((HANDLE)it->first->context->app_data));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT((HCONTACT)it->first->context->app_data));
ShowError(buff);
} else {
otrl_context_forget_fingerprint(it->first, 1);
diff --git a/plugins/MirOTR/MirOTR/src/options.h b/plugins/MirOTR/MirOTR/src/options.h index 7625eef247..a2c39a5e93 100644 --- a/plugins/MirOTR/MirOTR/src/options.h +++ b/plugins/MirOTR/MirOTR/src/options.h @@ -51,7 +51,7 @@ struct CONTACT_DATA { OtrlPolicy policy;
int htmlconv;
};
-typedef std::map<HANDLE, CONTACT_DATA> ContactPolicyMap;
+typedef std::map<HCONTACT, CONTACT_DATA> ContactPolicyMap;
typedef enum {FPM_VERIFY, FPM_NOTRUST, FPM_DELETE } FPModify;
typedef std::map<Fingerprint*, FPModify> FPModifyMap;
diff --git a/plugins/MirOTR/MirOTR/src/otr.cpp b/plugins/MirOTR/MirOTR/src/otr.cpp index e22f7adb18..dfc22f5e70 100644 --- a/plugins/MirOTR/MirOTR/src/otr.cpp +++ b/plugins/MirOTR/MirOTR/src/otr.cpp @@ -76,7 +76,7 @@ extern "C" { /* Return the OTR policy for the given context. */
OtrlPolicy otr_gui_policy(void *opdata, ConnContext *context) {
DEBUGOUT_T("OTR_GUI_POLICY")
- HANDLE hContact = (HANDLE)opdata;
+ HCONTACT hContact = (HCONTACT)opdata;
DWORD pol;
if(hContact) {
pol = db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY);
@@ -110,7 +110,7 @@ extern "C" { //DWORD tid;
//CloseHandle(CreateThread(0, 0, newKeyThread, (VOID *)nkd, 0, &tid));
//QueueUserAPC(newKeyAPC, Global::mainThread, (DWORD)nkd);
- if (opdata) protocol = contact_get_proto((HANDLE)opdata);
+ if (opdata) protocol = contact_get_proto((HCONTACT)opdata);
if (!protocol) return;
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_GENKEYNOTIFY), 0, GenKeyDlgFunc, (LPARAM)protocol );
@@ -124,7 +124,7 @@ extern "C" { * logged in" errors if you're wrong. */
int otr_gui_is_logged_in(void *opdata, const char *accountname, const char *protocol, const char *recipient) {
DEBUGOUT_T("OTR_GUI_IS_LOGGED_IN")
- HANDLE hContact = (HANDLE)opdata;
+ HCONTACT hContact = (HCONTACT)opdata;
if(hContact) {
WORD status = db_get_w(hContact, contact_get_proto(hContact), "Status", ID_STATUS_OFFLINE);
if(status == ID_STATUS_OFFLINE) return 0;
@@ -139,7 +139,7 @@ extern "C" { void otr_gui_inject_message(void *opdata, const char *accountname, const char *protocol, const char *recipient, const char *message) {
DEBUGOUT_T("OTR_GUI_INJECT_MESSAGE")
//MessageBox(0, message, "OTR Inject", MB_OK);
- HANDLE hContact = (HANDLE)opdata;
+ HCONTACT hContact = (HCONTACT)opdata;
if(protocol && db_get_w(hContact, protocol, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
CallContactService(hContact, PSS_MESSAGE, PREF_UTF|PREF_BYPASS_OTR, (LPARAM)message);
@@ -149,7 +149,7 @@ extern "C" { * protocol / username conversation. */
void otr_gui_notify(void *opdata, OtrlNotifyLevel level, const char *accountname, const char *protocol, const char *username, const char *title, const char *primary, const char *secondary) {
DEBUGOUT_T("OTR_GUI_NOTIFY")
- const TCHAR* uname = contact_get_nameT((HANDLE)opdata);
+ const TCHAR* uname = contact_get_nameT((HCONTACT)opdata);
TCHAR* title_t = mir_utf8decodeT(title);
TCHAR *notify = TranslateT(LANG_OTR_NOTIFY);
@@ -180,11 +180,11 @@ extern "C" { int otr_gui_display_otr_message(void *opdata, const char *accountname, const char *protocol, const char *username, const char *msg) {
DEBUGOUT_T("OTR_GUI_DISPLAY_OTR_MESSAGE")
if(options.msg_inline)
- ShowMessageInlineUtf((HANDLE)opdata, Translate(msg));
+ ShowMessageInlineUtf((HCONTACT)opdata, Translate(msg));
if(options.msg_popup) {
TCHAR buff[512];
TCHAR* proto = mir_a2t(protocol);
- mir_sntprintf(buff, 512, TranslateT(LANG_OTR_USERMESSAGE), contact_get_nameT((HANDLE)opdata), proto);
+ mir_sntprintf(buff, 512, TranslateT(LANG_OTR_USERMESSAGE), contact_get_nameT((HCONTACT)opdata), proto);
mir_free(proto);
TCHAR *msg_t = mir_utf8decodeT(msg);
ShowPopup(buff, TranslateTS(msg_t), 0);
@@ -237,18 +237,18 @@ extern "C" { DEBUGOUT_T("OTR_GUI_GONE_SECURE")
TrustLevel trusted = otr_context_get_trust(context);
// opdata is hContact
- SetEncryptionStatus((HANDLE)opdata, trusted);
+ SetEncryptionStatus((HCONTACT)opdata, trusted);
TCHAR buff[1024];
if(trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_START_OTR), contact_get_nameT((HANDLE)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_START_OTR), contact_get_nameT((HCONTACT)opdata));
} else if (trusted == TRUST_UNVERIFIED) {
if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context);
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT((HANDLE)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT((HCONTACT)opdata));
} else { // should never happen
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((HANDLE)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((HCONTACT)opdata));
}
// opdata is hContact
- ShowMessage((HANDLE)opdata, buff);
+ ShowMessage((HCONTACT)opdata, buff);
}
@@ -256,14 +256,14 @@ extern "C" { void otr_gui_gone_insecure(void *opdata, ConnContext *context) {
DEBUGOUT_T("OTR_GUI_GONE_INSECURE")
TCHAR buff[512];
- mir_sntprintf(buff, 512, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT((HANDLE)opdata));
+ mir_sntprintf(buff, 512, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT((HCONTACT)opdata));
//MessageBox(0, buff, Translate("OTR Information"), MB_OK);
if (!Miranda_Terminated()) {
- ShowMessage((HANDLE)opdata, buff);
+ ShowMessage((HCONTACT)opdata, buff);
}
// opdata is hContact
- SetEncryptionStatus((HANDLE)opdata, otr_context_get_trust(context));
+ SetEncryptionStatus((HCONTACT)opdata, otr_context_get_trust(context));
}
/* We have completed an authentication, using the D-H keys we
@@ -271,36 +271,36 @@ extern "C" { void otr_gui_still_secure(void *opdata, ConnContext *context, int is_reply) {
DEBUGOUT_T("OTR_GUI_STILL_SECURE")
TrustLevel trusted = otr_context_get_trust(context);
- SetEncryptionStatus((HANDLE)opdata, trusted);
+ SetEncryptionStatus((HCONTACT)opdata, trusted);
TCHAR buff[1024];
if (!is_reply) {
if(trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT((HANDLE)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT((HCONTACT)opdata));
} else if (trusted == TRUST_UNVERIFIED) {
if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context);
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT((HANDLE)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT((HCONTACT)opdata));
} else { // should never happen
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((HANDLE)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((HCONTACT)opdata));
}
// opdata is hContact
- ShowMessage((HANDLE)opdata, buff);
+ ShowMessage((HCONTACT)opdata, buff);
} else {
if(trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT((HANDLE)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT((HCONTACT)opdata));
} else if (trusted == TRUST_UNVERIFIED) {
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT((HANDLE)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT((HCONTACT)opdata));
} else { // should never happen
- mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((HANDLE)opdata));
+ mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT((HCONTACT)opdata));
}
}
- SetEncryptionStatus((HANDLE)opdata, trusted);
+ SetEncryptionStatus((HCONTACT)opdata, trusted);
}
/* Log a message. The passed message will end in "\n". */
void otr_gui_log_message(void *opdata, const char *message) {
//MessageBox(0, message, Translate("OTR Log Message"), MB_OK);
- //ShowMessageInline((HANDLE)opdata, message);
+ //ShowMessageInline((HCONTACT)opdata, message);
#ifdef _DEBUG
char* msg = strcpy((char*)mir_alloc(strlen(message)+15), "OTR message: ");
strcat(msg, message);
@@ -314,7 +314,7 @@ extern "C" { if (context && context->protocol)
proto = context->protocol;
else
- proto = contact_get_proto(opdata);
+ proto = contact_get_proto((HCONTACT)opdata);
// ugly wokaround for ICQ. ICQ protocol reports more than 7k, but in SMP this is too long.
// possibly ICQ doesn't allow single words without spaces to become longer than ~2340?
if (strcmp("ICQ", proto)==0 || strncmp("ICQ_", proto, 4)==0)
diff --git a/plugins/MirOTR/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/MirOTR/src/svcs_menu.cpp index 9a7e4a7488..762ee5adf2 100644 --- a/plugins/MirOTR/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/MirOTR/src/svcs_menu.cpp @@ -5,7 +5,7 @@ static HGENMENU hStopItem, hStartItem; ////////////////////////////////
///////// Menu Services ////////
///////////////////////////////
-int StartOTR(HANDLE hContact) {
+int StartOTR(HCONTACT hContact) {
const char *proto = contact_get_proto(hContact);
if (!proto) return 1; // error
@@ -24,8 +24,8 @@ int StartOTR(HANDLE hContact) { }
INT_PTR SVC_StartOTR(WPARAM wParam, LPARAM lParam) {
- HANDLE hContact = (HANDLE)wParam, hSub;
- if(options.bHaveMetaContacts && (hSub = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
+ HCONTACT hContact = (HCONTACT)wParam, hSub;
+ if(options.bHaveMetaContacts && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
hContact = hSub;
}
@@ -47,8 +47,8 @@ INT_PTR SVC_StartOTR(WPARAM wParam, LPARAM lParam) { }
INT_PTR SVC_RefreshOTR(WPARAM wParam, LPARAM lParam) {
- HANDLE hContact = (HANDLE)wParam, hSub;
- if(options.bHaveMetaContacts && (hSub = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
+ HCONTACT hContact = (HCONTACT)wParam, hSub;
+ if(options.bHaveMetaContacts && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
hContact = hSub;
}
@@ -68,11 +68,12 @@ INT_PTR SVC_RefreshOTR(WPARAM wParam, LPARAM lParam) { return 0;
}
-int otr_disconnect_contact(HANDLE hContact) {
- HANDLE hSub;
- if(ServiceExists(MS_MC_GETMOSTONLINECONTACT) && (hSub = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
+
+int otr_disconnect_contact(HCONTACT hContact)
+{
+ HCONTACT hSub;
+ if(ServiceExists(MS_MC_GETMOSTONLINECONTACT) && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
hContact = hSub;
- }
const char *proto = contact_get_proto(hContact);
if (!proto) return 1; // error
@@ -86,8 +87,9 @@ int otr_disconnect_contact(HANDLE hContact) { return 0;
}
-INT_PTR SVC_StopOTR(WPARAM wParam, LPARAM lParam) {
- HANDLE hContact = (HANDLE)wParam;
+INT_PTR SVC_StopOTR(WPARAM wParam, LPARAM lParam)
+{
+ HCONTACT hContact = (HCONTACT)wParam;
// prevent this filter from acting on injeceted messages for metas, when they are passed though the subcontact's proto send chain
if (otr_disconnect_contact(hContact)) return 0;
@@ -102,11 +104,11 @@ INT_PTR SVC_StopOTR(WPARAM wParam, LPARAM lParam) { }
INT_PTR SVC_VerifyOTR(WPARAM wParam, LPARAM lParam) {
- HANDLE hContact = (HANDLE)wParam, hSub;
- if(options.bHaveMetaContacts && (hSub = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
- hContact = hSub;
- }
- ConnContext *context = otrl_context_find_miranda(otr_user_state, (HANDLE)wParam);
+ HCONTACT hContact = (HCONTACT)wParam, hSub;
+ if(options.bHaveMetaContacts && (hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
+ hContact = hSub;
+
+ ConnContext *context = otrl_context_find_miranda(otr_user_state, (HCONTACT)wParam);
if (!context) return 1;
//VerifyContextDialog(context);
SMPInitDialog(context);
@@ -114,7 +116,7 @@ INT_PTR SVC_VerifyOTR(WPARAM wParam, LPARAM lParam) { }
INT_PTR SVC_ToggleHTMLOTR(WPARAM wParam, LPARAM lParam) {
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (db_get_b(hContact, MODULENAME, "HTMLConv", 0))
db_set_b(hContact, MODULENAME, "HTMLConv", 0);
else
@@ -152,7 +154,7 @@ void InitMenu() int SVC_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_TCHAR;
@@ -169,7 +171,7 @@ hide_all: if(proto && g_metaproto && strcmp(proto, g_metaproto) == 0) {
// make menu act as per most online subcontact
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
if (!hContact)
goto hide_all;
proto = contact_get_proto(hContact);
diff --git a/plugins/MirOTR/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/MirOTR/src/svcs_proto.cpp index 2f814087e2..a9841f3e6d 100644 --- a/plugins/MirOTR/MirOTR/src/svcs_proto.cpp +++ b/plugins/MirOTR/MirOTR/src/svcs_proto.cpp @@ -43,7 +43,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ }
char *tmpencode = NULL;
- ConnContext *context = otrl_context_find_miranda(otr_user_state, (void*)ccs->hContact);
+ ConnContext *context = otrl_context_find_miranda(otr_user_state, ccs->hContact);
if (db_get_b(ccs->hContact, MODULENAME, "HTMLConv", 0) && otr_context_get_trust(context) >= TRUST_UNVERIFIED) {
char *tmpencode = encode_html_entities_utf8(oldmessage_utf);
if (tmpencode != NULL) {
@@ -196,7 +196,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){ TCHAR buff[256];
mir_sntprintf(buff, 256, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact));
//MessageBox(0, buff, Translate("OTR Information"), MB_OK);
- ShowMessage((HANDLE)ccs->hContact, buff);
+ ShowMessage(ccs->hContact, buff);
//if(options.timeout_finished) ResetFinishedTimer();
}
diff --git a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp index 7f7987b7b4..6c8f36e85e 100644 --- a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp +++ b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp @@ -5,7 +5,7 @@ BBButton OTRButton; int SVC_IconPressed(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
if(sicd->cbSize < (int)sizeof(StatusIconClickData))
return 0;
@@ -21,7 +21,7 @@ int SVC_IconPressed(WPARAM wParam, LPARAM lParam) }
// set SRMM icon status, if applicable
-void SetEncryptionStatus(HANDLE hContact, TrustLevel level)
+void SetEncryptionStatus(HCONTACT hContact, TrustLevel level)
{
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0));
@@ -71,8 +71,8 @@ void SetEncryptionStatus(HANDLE hContact, TrustLevel level) db_set_dw(hContact, MODULENAME, "TrustLevel", level);
if (!chat_room && options.bHaveMetaContacts) {
- HANDLE hMeta = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
- HANDLE hMostOnline = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0);
+ HCONTACT hMeta = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ HCONTACT hMostOnline = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0);
if(hMeta && hContact == hMostOnline)
SetEncryptionStatus(hMeta, level);
else if(hMeta) {
@@ -95,7 +95,7 @@ int SVC_ButtonsBarPressed(WPARAM w, LPARAM l) {
CustomButtonClickData* cbcd = (CustomButtonClickData *)l;
if (cbcd->cbSize == (int)sizeof(CustomButtonClickData) && cbcd->dwButtonId == 0 && strcmp(cbcd->pszModule, MODULENAME)==0) {
- HANDLE hContact = (HANDLE)w;
+ HCONTACT hContact = (HCONTACT)w;
char *proto = GetContactProto(hContact);
if(proto && db_get_b(hContact, proto, "ChatRoom", 0))
diff --git a/plugins/MirOTR/MirOTR/src/svcs_srmm.h b/plugins/MirOTR/MirOTR/src/svcs_srmm.h index 4bc204656d..7c8842edc3 100644 --- a/plugins/MirOTR/MirOTR/src/svcs_srmm.h +++ b/plugins/MirOTR/MirOTR/src/svcs_srmm.h @@ -2,6 +2,6 @@ int WindowEvent(WPARAM wParam, LPARAM lParam);
int SVC_IconPressed(WPARAM wParam, LPARAM lParam);
-void SetEncryptionStatus(HANDLE hContact, TrustLevel level);
+void SetEncryptionStatus(HCONTACT hContact, TrustLevel level);
void InitSRMM();
void DeinitSRMM();
\ No newline at end of file diff --git a/plugins/MirOTR/MirOTR/src/utils.cpp b/plugins/MirOTR/MirOTR/src/utils.cpp index d6daabb294..3142c0852e 100644 --- a/plugins/MirOTR/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/MirOTR/src/utils.cpp @@ -2,23 +2,29 @@ CRITICAL_SECTION lib_cs;
-void InitUtils() {
+void InitUtils()
+{
InitializeCriticalSection(&lib_cs);
}
-void DeinitUtils() {
+
+void DeinitUtils()
+{
DeleteCriticalSection(&lib_cs);
}
-void lib_cs_lock() {
+void lib_cs_lock()
+{
EnterCriticalSection(&lib_cs);
}
-void lib_cs_unlock() {
+void lib_cs_unlock()
+{
LeaveCriticalSection(&lib_cs);
}
-HANDLE find_contact(const char* userid, const char* protocol) {
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+HCONTACT find_contact(const char* userid, const char* protocol)
+{
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
const char *proto = contact_get_proto(hContact);
if(proto && strcmp(proto, protocol) == 0) {
char *name = contact_get_id(hContact);
@@ -38,7 +44,7 @@ HANDLE find_contact(const char* userid, const char* protocol) { * context if one does not currently exist. In that event, call
* add_app_data(data, context) so that app_data and app_data_free can be
* filled in by the application, and set *addedp to 1. */
-ConnContext * otrl_context_find_miranda(OtrlUserState us, HANDLE hContact)
+ConnContext * otrl_context_find_miranda(OtrlUserState us, HCONTACT hContact)
{
ConnContext ** curp;
if (!hContact) return NULL;
@@ -78,10 +84,10 @@ void VerifyFingerprint(ConnContext *context, bool verify) { void VerifyFingerprintMessage(ConnContext *context, bool verify) {
TCHAR msg[1024];
- mir_sntprintf(msg, 1024, (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT((HANDLE)context->app_data));
+ mir_sntprintf(msg, 1024, (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT((HCONTACT)context->app_data));
msg[1023] = '\0';
- ShowMessage((HANDLE)context->app_data, msg);
- SetEncryptionStatus(context->app_data, otr_context_get_trust(context));
+ ShowMessage((HCONTACT)context->app_data, msg);
+ SetEncryptionStatus((HCONTACT)context->app_data, otr_context_get_trust(context));
}
/* Convert a 20-byte hash value to a 45-byte human-readable value */
@@ -102,7 +108,7 @@ void otrl_privkey_hash_to_humanT(TCHAR human[45], const unsigned char hash[20]) *p = '\0';
}
-char* contact_get_id(HANDLE hContact, bool bNameOnError) {
+char* contact_get_id(HCONTACT hContact, bool bNameOnError) {
char* pszUniqueID = NULL;
CONTACTINFO ci;
ZeroMemory(&ci, sizeof(ci));
@@ -135,21 +141,21 @@ char* contact_get_id(HANDLE hContact, bool bNameOnError) { return pszUniqueID;
}
-__inline const TCHAR* contact_get_nameT(HANDLE hContact) {
+__inline const TCHAR* contact_get_nameT(HCONTACT hContact) {
return (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
}
-__inline const char* contact_get_proto(HANDLE hContact) {
+__inline const char* contact_get_proto(HCONTACT hContact) {
char *uproto = GetContactProto(hContact);
return uproto;
}
-__inline const char* contact_get_account(HANDLE hContact) {
+__inline const char* contact_get_account(HCONTACT hContact) {
char *uacc = (char *)CallService(MS_PROTO_GETCONTACTBASEACCOUNT, (WPARAM)hContact, 0);
return uacc;
}
-void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const HANDLE hContact) {
+void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const HCONTACT hContact) {
if(CallService(MS_SYSTEM_TERMINATED, 0, 0)) return;
if ( !options.bHavePopups) {
@@ -157,7 +163,7 @@ void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const HANDLE mir_sntprintf(title, SIZEOF(title), _T("%s Message"), _T(MODULENAME));
if(line1 && line2) {
- int size = _tcslen(line1) + _tcslen(line2) + 3;
+ int size = int(_tcslen(line1) + _tcslen(line2) + 3);
TCHAR *message = new TCHAR[size]; // newline and null terminator
mir_sntprintf(message, size, _T("%s\r\n%s"), line1, line2);
MessageBox( NULL, message, title, MB_OK | MB_ICONINFORMATION );
@@ -214,7 +220,7 @@ void ShowWarning(TCHAR *msg) { switch(disp) {
case ED_POP:
{
- int size = _tcslen(msg) + 515;
+ int size = int(_tcslen(msg) + 515);
message = new TCHAR[size]; // newline and null terminator
mir_sntprintf(message, size, _T("%s\r\n%s"), buffer, msg);
PUShowMessageT(message, SM_WARNING);
@@ -261,7 +267,7 @@ void ShowError(TCHAR *msg) { switch(disp) {
case ED_POP:
{
- int size = _tcslen(msg) + 515;
+ int size = int(_tcslen(msg) + 515);
message = new TCHAR[size]; // newline and null terminator
mir_sntprintf(message, size, _T("%s\r\n%s"), buffer, msg);
PUShowMessageT(message, SM_WARNING);
@@ -291,7 +297,7 @@ void ShowError(TCHAR *msg) { }
-void ShowPopupUtf(const char* line1, const char* line2, int timeout, const HANDLE hContact) {
+void ShowPopupUtf(const char* line1, const char* line2, int timeout, const HCONTACT hContact) {
TCHAR* l1 = (line1) ? mir_utf8decodeT(line1) : NULL;
TCHAR* l2 = (line2) ? mir_utf8decodeT(line2) : NULL;
ShowPopup(l1, l2, timeout, hContact);
@@ -310,7 +316,7 @@ void ShowErrorUtf(char* msg) { if (m) mir_free(m);
}
-void ShowMessageInline(const HANDLE hContact, const TCHAR *msg) {
+void ShowMessageInline(const HCONTACT hContact, const TCHAR *msg) {
TCHAR buff[1024];
mir_sntprintf(buff, 1024, _T("%s%s"), TranslateT(LANG_INLINE_PREFIX), msg);
@@ -324,7 +330,7 @@ void ShowMessageInline(const HANDLE hContact, const TCHAR *msg) { mir_free(utf);
}
-void ShowMessageInlineUtf(const HANDLE hContact, const char *msg) {
+void ShowMessageInlineUtf(const HCONTACT hContact, const char *msg) {
char buff[1024];
mir_snprintf(buff, 1024, "%s%s", Translate(LANG_INLINE_PREFIX), msg);
@@ -335,14 +341,14 @@ void ShowMessageInlineUtf(const HANDLE hContact, const char *msg) { ProtoChainRecvMsg(hContact, &pre);
}
-void ShowMessageUtf(const HANDLE hContact, const char *msg) {
+void ShowMessageUtf(const HCONTACT hContact, const char *msg) {
if(options.msg_inline)
ShowMessageInlineUtf(hContact, msg);
if(options.msg_popup)
ShowPopupUtf(Translate(LANG_OTR_INFO), msg, 0, hContact);
}
-void ShowMessage(const HANDLE hContact, const TCHAR *msg) {
+void ShowMessage(const HCONTACT hContact, const TCHAR *msg) {
if(options.msg_inline)
ShowMessageInline(hContact, msg);
if(options.msg_popup)
@@ -351,7 +357,7 @@ void ShowMessage(const HANDLE hContact, const TCHAR *msg) { /*
-bool GetEncryptionStatus(HANDLE hContact) {
+bool GetEncryptionStatus(HCONTACT hContact) {
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0));
diff --git a/plugins/MirOTR/MirOTR/src/utils.h b/plugins/MirOTR/MirOTR/src/utils.h index 01c1b44f69..1e2a05c9f3 100644 --- a/plugins/MirOTR/MirOTR/src/utils.h +++ b/plugins/MirOTR/MirOTR/src/utils.h @@ -7,8 +7,8 @@ void lib_cs_lock();
void lib_cs_unlock();
-HANDLE find_contact(const char* userid, const char* protocol);
-ConnContext * otrl_context_find_miranda(OtrlUserState us, HANDLE hContact);
+HCONTACT find_contact(const char* userid, const char* protocol);
+ConnContext * otrl_context_find_miranda(OtrlUserState us, HCONTACT hContact);
typedef enum {
TRUST_NOT_PRIVATE,
@@ -22,23 +22,23 @@ void VerifyFingerprintMessage(ConnContext *context, bool verify); void otrl_privkey_hash_to_humanT(TCHAR human[45], const unsigned char hash[20]);
-char* contact_get_id(HANDLE hContact, bool bNameOnError=true);
-__inline const char* contact_get_proto(HANDLE hContact);
-__inline const char* contact_get_account(HANDLE hContact);
-extern __inline const TCHAR* contact_get_nameT(HANDLE hContact);
+char* contact_get_id(HCONTACT hContact, bool bNameOnError=true);
+__inline const char* contact_get_proto(HCONTACT hContact);
+__inline const char* contact_get_account(HCONTACT hContact);
+extern __inline const TCHAR* contact_get_nameT(HCONTACT hContact);
-void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const HANDLE hContact = NULL);
+void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const HCONTACT hContact = NULL);
void ShowWarning(TCHAR* msg);
void ShowError(TCHAR* msg);
-void ShowPopupUtf(const char* line1, const char* line2, int timeout, const HANDLE hContact = NULL);
+void ShowPopupUtf(const char* line1, const char* line2, int timeout, const HCONTACT hContact = NULL);
void ShowWarningUtf(char* msg);
void ShowErrorUtf(char* msg);
-void ShowMessageInline(const HANDLE hContact, const TCHAR *msg);
-void ShowMessageInlineUtf(const HANDLE hContact, const char *msg);
+void ShowMessageInline(const HCONTACT hContact, const TCHAR *msg);
+void ShowMessageInlineUtf(const HCONTACT hContact, const char *msg);
-void ShowMessage(const HANDLE hContact, const TCHAR *msg);
-void ShowMessageUtf(const HANDLE hContact, const char *msg);
+void ShowMessage(const HCONTACT hContact, const TCHAR *msg);
+void ShowMessageUtf(const HCONTACT hContact, const char *msg);
void InitUtils();
void DeinitUtils();
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 48f861b2c9..17399ad465 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -445,7 +445,7 @@ void CAppletManager::ActivateCListScreen() //************************************************************************
// activates the chat screen
//************************************************************************
-bool CAppletManager::ActivateChatScreen(HANDLE hContact)
+bool CAppletManager::ActivateChatScreen(HCONTACT hContact)
{
if(!m_ChatScreen.SetContact(hContact))
return false;
@@ -461,7 +461,7 @@ bool CAppletManager::ActivateChatScreen(HANDLE hContact) //************************************************************************
// returns the contacts displayname
//************************************************************************
-tstring CAppletManager::GetContactDisplayname(HANDLE hContact,bool bShortened)
+tstring CAppletManager::GetContactDisplayname(HCONTACT hContact,bool bShortened)
{
if(!bShortened || !CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF))
return (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
@@ -476,7 +476,7 @@ tstring CAppletManager::GetContactDisplayname(HANDLE hContact,bool bShortened) //************************************************************************
// returns the contacts group
//************************************************************************
-tstring CAppletManager::GetContactGroup(HANDLE hContact)
+tstring CAppletManager::GetContactGroup(HCONTACT hContact)
{
DBVARIANT dbv;
int res = db_get_ts(hContact, "CList", "Group", &dbv);
@@ -649,7 +649,7 @@ void CAppletManager::HandleEvent(CEvent *pEvent) }
}
-bool CAppletManager::IsUtfSendAvailable(HANDLE hContact) {
+bool CAppletManager::IsUtfSendAvailable(HCONTACT hContact) {
char* szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if ( szProto == NULL )
return FALSE;
@@ -660,7 +660,7 @@ bool CAppletManager::IsUtfSendAvailable(HANDLE hContact) { //************************************************************************
// returns the contacts message service name
//************************************************************************
-char *CAppletManager::GetMessageServiceName(HANDLE hContact,bool bIsUnicode)
+char *CAppletManager::GetMessageServiceName(HCONTACT hContact,bool bIsUnicode)
{
char szServiceName[100];
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
@@ -785,7 +785,7 @@ void CAppletManager::CancelMessageJob(SMessageJob *pJob) //************************************************************************
// returns wether or not a contact is a subcontact
//************************************************************************
-bool CAppletManager::IsSubContact(HANDLE hContact)
+bool CAppletManager::IsSubContact(HCONTACT hContact)
{
if(!db_get_b(0, "MetaContacts", "Enabled", 1))
return false;
@@ -798,7 +798,7 @@ bool CAppletManager::IsSubContact(HANDLE hContact) //************************************************************************
// sends typing notifications to the specified contact
//************************************************************************
-void CAppletManager::SendTypingNotification(HANDLE hContact,bool bEnable)
+void CAppletManager::SendTypingNotification(HCONTACT hContact,bool bEnable)
{
DWORD protoStatus;
DWORD protoCaps;
@@ -841,7 +841,7 @@ void CAppletManager::SendTypingNotification(HANDLE hContact,bool bEnable) //************************************************************************
// sends a message to the specified contact
//************************************************************************
-HANDLE CAppletManager::SendMessageToContact(HANDLE hContact,tstring strMessage)
+HANDLE CAppletManager::SendMessageToContact(HCONTACT hContact,tstring strMessage)
{
tstring strAscii = _A2T(toNarrowString(strMessage).c_str());
int bufSize = lstrlen(strAscii.c_str())+1;
@@ -859,7 +859,7 @@ HANDLE CAppletManager::SendMessageToContact(HANDLE hContact,tstring strMessage) GCDEST gcd = { szProto, 0, GC_EVENT_SENDMESSAGE };
DBVARIANT dbv;
- if (!db_get_ts((HANDLE)hContact, szProto, "Nick", &dbv))
+ if (!db_get_ts(hContact, szProto, "Nick", &dbv))
gcd.ptszID = dbv.ptszVal;
else
return NULL;
@@ -924,7 +924,7 @@ HANDLE CAppletManager::SendMessageToContact(HANDLE hContact,tstring strMessage) //************************************************************************
// check if a contacts message window is opened
//************************************************************************
-bool CAppletManager::IsMessageWindowOpen(HANDLE hContact)
+bool CAppletManager::IsMessageWindowOpen(HCONTACT hContact)
{
MessageWindowInputData mwid;
mwid.cbSize = sizeof(MessageWindowInputData);
@@ -942,7 +942,7 @@ bool CAppletManager::IsMessageWindowOpen(HANDLE hContact) //************************************************************************
// marks the given message as read
//************************************************************************
-void CAppletManager::MarkMessageAsRead(HANDLE hContact,HANDLE hEvent)
+void CAppletManager::MarkMessageAsRead(HCONTACT hContact,HANDLE hEvent)
{
db_event_markRead(hContact, hEvent);
CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM)hEvent);
@@ -953,7 +953,7 @@ void CAppletManager::MarkMessageAsRead(HANDLE hContact,HANDLE hEvent) //************************************************************************
bool CAppletManager::TranslateDBEvent(CEvent *pEvent,WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HANDLE hdbevent = (HANDLE)lParam;
@@ -1163,7 +1163,7 @@ CIRCConnection *CAppletManager::CreateIRCConnection(tstring strProtocol) //************************************************************************
// returns the history class for the specified IRC channel
//************************************************************************
-CIRCHistory *CAppletManager::GetIRCHistory(HANDLE hContact)
+CIRCHistory *CAppletManager::GetIRCHistory(HCONTACT hContact)
{
list<CIRCHistory*>::iterator iter = m_LIRCHistorys.begin();
while(iter != m_LIRCHistorys.end())
@@ -1190,7 +1190,7 @@ CIRCHistory *CAppletManager::GetIRCHistoryByName(tstring strProtocol,tstring str //************************************************************************
// deletes the history class for the specified IRC channel
//************************************************************************
-void CAppletManager::DeleteIRCHistory(HANDLE hContact)
+void CAppletManager::DeleteIRCHistory(HCONTACT hContact)
{
list<CIRCHistory*>::iterator iter = m_LIRCHistorys.begin();
while(iter != m_LIRCHistorys.end())
@@ -1214,7 +1214,7 @@ void CAppletManager::DeleteIRCHistory(HANDLE hContact) //************************************************************************
// creates a history class for the specified IRC channel
//************************************************************************
-CIRCHistory *CAppletManager::CreateIRCHistory(HANDLE hContact,tstring strChannel)
+CIRCHistory *CAppletManager::CreateIRCHistory(HCONTACT hContact,tstring strChannel)
{
char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if(!szProto)
@@ -1582,7 +1582,7 @@ int CAppletManager::HookMessageWindowEvent(WPARAM wParam, LPARAM lParam) //************************************************************************
int CAppletManager::HookContactIsTyping(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
int iState = (int)lParam;
CEvent Event;
@@ -1621,7 +1621,7 @@ int CAppletManager::HookStatusChanged(WPARAM wParam, LPARAM lParam) // Prepare message and append to queue
CEvent Event;
- Event.hContact = (HANDLE)wParam;
+ Event.hContact = (HCONTACT)wParam;
int iStatus = cws->value.wVal;
Event.iValue = iStatus;
@@ -1821,7 +1821,7 @@ int CAppletManager::HookContactAdded(WPARAM wParam, LPARAM lParam) {
CEvent Event;
Event.eType = EVENT_CONTACT_ADDED;
- Event.hContact = (HANDLE)wParam;
+ Event.hContact = (HCONTACT)wParam;
CAppletManager::GetInstance()->HandleEvent(&Event);
return 0;
@@ -1834,7 +1834,7 @@ int CAppletManager::HookContactDeleted(WPARAM wParam, LPARAM lParam) {
CEvent Event;
Event.eType = EVENT_CONTACT_DELETED;
- Event.hContact = (HANDLE)wParam;
+ Event.hContact = (HCONTACT)wParam;
Event.bNotification = CConfig::GetBoolSetting(NOTIFY_CONTACTS);
Event.bLog = Event.bNotification;
@@ -1854,7 +1854,7 @@ int CAppletManager::HookSettingChanged(WPARAM wParam,LPARAM lParam) DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
CEvent Event;
- Event.hContact = (HANDLE)wParam;
+ Event.hContact = (HCONTACT)wParam;
if(!lstrcmpA(dbcws->szModule,"MetaContacts"))
{
@@ -1865,7 +1865,7 @@ int CAppletManager::HookSettingChanged(WPARAM wParam,LPARAM lParam) if(!lstrcmpA(dbcws->szSetting,"IsSubcontact")) {
Event.eType = EVENT_CONTACT_GROUP;
DBVARIANT dbv;
- int res = db_get_ts((HANDLE)wParam, "CList", "Group", &dbv);
+ int res = db_get_ts((HCONTACT)wParam, "CList", "Group", &dbv);
if(!res)
Event.strValue = dbv.ptszVal;
db_free(&dbv);
@@ -1910,13 +1910,13 @@ int CAppletManager::HookSettingChanged(WPARAM wParam,LPARAM lParam) if(!lstrcmpA(dbcws->szSetting,"Hidden"))
{
Event.eType = EVENT_CONTACT_HIDDEN;
- Event.iValue = db_get_b((HANDLE)wParam,"CList","Hidden",0);
+ Event.iValue = db_get_b((HCONTACT)wParam,"CList","Hidden",0);
}
else if(!lstrcmpA(dbcws->szSetting,"Group"))
{
Event.eType = EVENT_CONTACT_GROUP;
DBVARIANT dbv;
- int res = db_get_ts((HANDLE)wParam, "CList", "Group", &dbv);
+ int res = db_get_ts((HCONTACT)wParam, "CList", "Group", &dbv);
if(!res)
Event.strValue = dbv.ptszVal;
db_free(&dbv);
diff --git a/plugins/MirandaG15/src/CAppletManager.h b/plugins/MirandaG15/src/CAppletManager.h index dee9b96a9e..f3551b41fe 100644 --- a/plugins/MirandaG15/src/CAppletManager.h +++ b/plugins/MirandaG15/src/CAppletManager.h @@ -19,7 +19,7 @@ struct SMessageJob
{
HANDLE hEvent;
- HANDLE hContact;
+ HCONTACT hContact;
DWORD dwFlags;
char *pcBuffer;
int iBufferSize;
@@ -59,7 +59,7 @@ public: void ActivateCreditsScreen();
void ActivateEventScreen();
void ActivateCListScreen();
- bool ActivateChatScreen(HANDLE hContact);
+ bool ActivateChatScreen(HCONTACT hContact);
// hook functions
static int HookMessageWindowEvent(WPARAM wParam, LPARAM lParam);
@@ -73,31 +73,31 @@ public: static int HookChatInbound(WPARAM wParam,LPARAM lParam);
// check if a contacts message window is opened
- static bool IsMessageWindowOpen(HANDLE hContact);
+ static bool IsMessageWindowOpen(HCONTACT hContact);
// marks the given event as read
- static void MarkMessageAsRead(HANDLE hContact,HANDLE hEvent);
+ static void MarkMessageAsRead(HCONTACT hContact,HANDLE hEvent);
// translates the given database event
static bool TranslateDBEvent(CEvent *pEvent,WPARAM wParam, LPARAM lParam);
// sends a message to the specified contact
- static HANDLE SendMessageToContact(HANDLE hContact,tstring strMessage);
+ static HANDLE SendMessageToContact(HCONTACT hContact,tstring strMessage);
// sends typing notifications to the specified contact
- static void SendTypingNotification(HANDLE hContact,bool bEnable);
+ static void SendTypingNotification(HCONTACT hContact,bool bEnable);
// returns the contacts message service name
- static char *GetMessageServiceName(HANDLE hContact,bool bIsUnicode);
- static bool IsUtfSendAvailable(HANDLE hContact);
+ static char *GetMessageServiceName(HCONTACT hContact,bool bIsUnicode);
+ static bool IsUtfSendAvailable(HCONTACT hContact);
// returns a formatted timestamp string
static tstring GetFormattedTimestamp(tm *time);
// returns wether or not a contact is a subcontact
- static bool IsSubContact(HANDLE hContact);
+ static bool IsSubContact(HCONTACT hContact);
// returns the contacts group
- static tstring GetContactGroup(HANDLE hContact);
+ static tstring GetContactGroup(HCONTACT hContact);
// returns the contacts displayname
- static tstring GetContactDisplayname(HANDLE hContact,bool bShortened=false);
+ static tstring GetContactDisplayname(HCONTACT hContact,bool bShortened=false);
// returns the history class for the specified IRC channel
- CIRCHistory *GetIRCHistory(HANDLE hContact);
+ CIRCHistory *GetIRCHistory(HCONTACT hContact);
CIRCHistory *GetIRCHistoryByName(tstring strProtocol,tstring strChannel);
// returns the IRC connection class for the specified protocol
@@ -118,9 +118,9 @@ public: private:
list<CIRCHistory*> m_LIRCHistorys;
// deletes the history class for the specified IRC channel
- void DeleteIRCHistory(HANDLE hContact);
+ void DeleteIRCHistory(HCONTACT hContact);
// creates a history class for the specified IRC channel
- CIRCHistory *CreateIRCHistory(HANDLE hContact,tstring strChannel);
+ CIRCHistory *CreateIRCHistory(HCONTACT hContact,tstring strChannel);
CIRCHistory *CreateIRCHistoryByName(tstring strProtocol,tstring strChannel);
// activate a screen
diff --git a/plugins/MirandaG15/src/CChatScreen.cpp b/plugins/MirandaG15/src/CChatScreen.cpp index dc87294e26..9fb9acb88b 100644 --- a/plugins/MirandaG15/src/CChatScreen.cpp +++ b/plugins/MirandaG15/src/CChatScreen.cpp @@ -224,7 +224,7 @@ HANDLE CChatScreen::GetContact() //************************************************************************
// sets the screen's chat contact
//************************************************************************
-bool CChatScreen::SetContact(HANDLE hContact)
+bool CChatScreen::SetContact(HCONTACT hContact)
{
if(hContact == NULL)
{
diff --git a/plugins/MirandaG15/src/CChatScreen.h b/plugins/MirandaG15/src/CChatScreen.h index 7af002e46c..6a29dea079 100644 --- a/plugins/MirandaG15/src/CChatScreen.h +++ b/plugins/MirandaG15/src/CChatScreen.h @@ -44,7 +44,7 @@ public: void OnSizeChanged();
// Set's the chat contact
- bool SetContact(HANDLE hContact);
+ bool SetContact(HCONTACT hContact);
// returns the chat contact
HANDLE GetContact();
@@ -92,10 +92,10 @@ protected: DWORD m_dwMaximizedTimer;
DWORD m_dwMaximizedDuration;
- HANDLE m_hContact;
- HANDLE m_hMessage;
+ HCONTACT m_hContact;
+ HANDLE m_hMessage;
- int m_iStatus;
+ int m_iStatus;
CLCDLabel m_UserProto;
CLCDLabel m_UserName;
diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index e22f1a868d..bf3469ed95 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -78,12 +78,12 @@ CContactListEntry *CContactList::GetContactData(CListEntry<CContactListEntry*,CC //************************************************************************
// returns the contacts group path
//************************************************************************
-tstring CContactList::GetContactGroupPath(HANDLE hContact)
+tstring CContactList::GetContactGroupPath(HCONTACT hContact)
{
tstring strGroup = _T("");
if(db_get_b(0, "MetaContacts", "Enabled", 1) && CAppletManager::IsSubContact(hContact))
{
- HANDLE hMetaContact = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, NULL);
+ HCONTACT hMetaContact = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, NULL);
if(CConfig::GetBoolSetting(CLIST_USEGROUPS))
strGroup = CAppletManager::GetContactGroup(hMetaContact);
@@ -98,7 +98,7 @@ tstring CContactList::GetContactGroupPath(HANDLE hContact) //************************************************************************
// adds a contact to the list
//************************************************************************
-void CContactList::AddContact(HANDLE hContact)
+void CContactList::AddContact(HCONTACT hContact)
{
CListContainer<CContactListEntry*,CContactListGroup*> *pGroup = NULL;
@@ -151,15 +151,16 @@ void CContactList::AddContact(HANDLE hContact) // check that all subcontacts exist
int numContacts = CallService(MS_MC_GETNUMCONTACTS,(WPARAM)hContact,0);
- HANDLE hSubContact = NULL;
+ HCONTACT hSubContact = NULL;
for(int i=0;i<numContacts;i++) {
- hSubContact = (HANDLE *) CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, (LPARAM)i);
+ hSubContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, (LPARAM)i);
RemoveContact(hSubContact);
AddContact(hSubContact);
}
return;
- } else if(CAppletManager::IsSubContact(hContact)) {
- HANDLE hMetaContact = (HANDLE *) CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ }
+ else if(CAppletManager::IsSubContact(hContact)) {
+ HCONTACT hMetaContact = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
// check that the metacontact exists
if(!FindContact(hMetaContact)) {
AddContact(hMetaContact);
@@ -204,11 +205,9 @@ bool CContactList::IsVisible(CContactListEntry *pEntry) { } else {
if(pEntry->iStatus == ID_STATUS_OFFLINE) {
DWORD dwNumContacts = (DWORD)CallService(MS_MC_GETNUMCONTACTS,(WPARAM)pEntry->hHandle,0);
- HANDLE hSubContact = NULL;
- char *szProto;
for(DWORD i = 0; i < dwNumContacts; i++) {
- hSubContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)pEntry->hHandle,i);
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(UINT)hSubContact,0);
+ HCONTACT hSubContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT,(WPARAM)pEntry->hHandle,i);
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(UINT)hSubContact,0);
if(db_get_w(hSubContact,szProto,"Status",ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
return true;
}
@@ -223,10 +222,9 @@ bool CContactList::IsVisible(CContactListEntry *pEntry) { if(db_get_b(pEntry->hHandle,"CList","Hidden",0))
return false;
else if(CAppletManager::IsSubContact(pEntry->hHandle)) {
- HANDLE hMetaContact = (HANDLE) CallService(MS_MC_GETMETACONTACT, (WPARAM)pEntry->hHandle, 0);
- if(db_get_b(hMetaContact,"CList","Hidden",0)) {
+ HCONTACT hMetaContact = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)pEntry->hHandle, 0);
+ if(db_get_b(hMetaContact,"CList","Hidden",0))
return false;
- }
}
}
@@ -243,7 +241,7 @@ bool CContactList::IsVisible(CContactListEntry *pEntry) { //************************************************************************
// removes a contact from the list
//************************************************************************
-void CContactList::RemoveContact(HANDLE hContact) {
+void CContactList::RemoveContact(HCONTACT hContact) {
CListContainer<CContactListEntry*,CContactListGroup*> *pGroup = NULL;
///tstring strGroup = GetContactGroupPath(hContact);
@@ -282,12 +280,10 @@ void CContactList::RemoveContact(HANDLE hContact) { pGroup->RemoveGroup(((CListContainer<CContactListEntry*,CContactListGroup*>*)pContactEntry)->GetGroupData());
// Reenumerate all subcontacts (maybe MetaContacts was disabled
int numContacts = CallService(MS_MC_GETNUMCONTACTS,(WPARAM)hContact,0);
- HANDLE hSubContact = NULL;
for(int i=0;i<numContacts;i++) {
- hSubContact = (HANDLE *) CallService(MS_MC_GETSUBCONTACT,(WPARAM)hContact, (LPARAM)i);
- if(!FindContact(hSubContact)) {
+ HCONTACT hSubContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT,(WPARAM)hContact, (LPARAM)i);
+ if(!FindContact(hSubContact))
AddContact(hSubContact);
- }
}
}
@@ -370,7 +366,7 @@ CListContainer<CContactListEntry*,CContactListGroup*> *CContactList::AddGroupByS //************************************************************************
// returns the contact's status
//************************************************************************
-int CContactList::GetContactStatus(HANDLE hContact)
+int CContactList::GetContactStatus(HCONTACT hContact)
{
CListEntry<CContactListEntry *,CContactListGroup*> *pContactEntry = FindContact(hContact);
if(!pContactEntry)
@@ -554,7 +550,7 @@ void CContactList::RefreshList() m_bUseMetaContacts = db_get_b(NULL,"MetaContacts","Enabled",1);
CListEntry<CContactListEntry*,CContactListGroup*> *pContactEntry = NULL;
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
while(hContact != NULL)
{
pContactEntry = FindContact(hContact);
@@ -623,7 +619,7 @@ CListContainer<CContactListEntry*,CContactListGroup*> *CContactList::FindGroupIn //************************************************************************
// returns the entry for the specified handle
//************************************************************************
-CListEntry<CContactListEntry*,CContactListGroup*> *CContactList::FindContact(HANDLE hContact)
+CListEntry<CContactListEntry*,CContactListGroup*> *CContactList::FindContact(HCONTACT hContact)
{
if(hContact == NULL)
return NULL;
@@ -634,7 +630,7 @@ CListEntry<CContactListEntry*,CContactListGroup*> *CContactList::FindContact(HAN //************************************************************************
// returns the entry for the specified handle
//************************************************************************
-CListEntry<CContactListEntry*,CContactListGroup*> *CContactList::FindContactInGroup(HANDLE hContact,CListContainer<CContactListEntry*,CContactListGroup*> *pGroup)
+CListEntry<CContactListEntry*,CContactListGroup*> *CContactList::FindContactInGroup(HCONTACT hContact,CListContainer<CContactListEntry*,CContactListGroup*> *pGroup)
{
if(hContact == NULL)
return NULL;
@@ -670,7 +666,7 @@ CListEntry<CContactListEntry*,CContactListGroup*> *CContactList::FindContactInGr //************************************************************************
// called when a contacts hidden flag has changed
//************************************************************************
-void CContactList::OnContactHiddenChanged(HANDLE hContact, bool bHidden)
+void CContactList::OnContactHiddenChanged(HCONTACT hContact, bool bHidden)
{
CListEntry<CContactListEntry*,CContactListGroup*> *pContactEntry = FindContact(hContact);
@@ -689,7 +685,7 @@ void CContactList::OnContactHiddenChanged(HANDLE hContact, bool bHidden) //************************************************************************
// called when a contacts nickname has changed
//************************************************************************
-void CContactList::OnContactNickChanged(HANDLE hContact, tstring strNick)
+void CContactList::OnContactNickChanged(HCONTACT hContact, tstring strNick)
{
CListEntry<CContactListEntry *,CContactListGroup*> *pContactEntry = FindContact(hContact);
if(!pContactEntry)
@@ -715,7 +711,7 @@ void CContactList::OnContactNickChanged(HANDLE hContact, tstring strNick) //************************************************************************
// called when a contacts status has changed
//************************************************************************
-void CContactList::OnStatusChange(HANDLE hContact,int iStatus)
+void CContactList::OnStatusChange(HCONTACT hContact,int iStatus)
{
// find the entry in the list
CListEntry<CContactListEntry *,CContactListGroup*> *pContactEntry = FindContact(hContact);
@@ -768,7 +764,7 @@ void CContactList::OnStatusChange(HANDLE hContact,int iStatus) //************************************************************************
// called when the contacts message count has changed
//************************************************************************
-void CContactList::OnMessageCountChanged(HANDLE hContact)
+void CContactList::OnMessageCountChanged(HCONTACT hContact)
{
CListEntry<CContactListEntry *,CContactListGroup*> *pContactEntry = FindContact(hContact);
if(!pContactEntry)
@@ -788,7 +784,7 @@ void CContactList::OnMessageCountChanged(HANDLE hContact) //************************************************************************
// called when a contact has been added
//************************************************************************
-void CContactList::OnContactAdded(HANDLE hContact)
+void CContactList::OnContactAdded(HCONTACT hContact)
{
// Update the list
AddContact(hContact);
@@ -809,7 +805,7 @@ void CContactList::OnContactAdded(HANDLE hContact) //************************************************************************
// called when a contact has been deleted
//************************************************************************
-void CContactList::OnContactDeleted(HANDLE hContact)
+void CContactList::OnContactDeleted(HCONTACT hContact)
{
// Update the list
RemoveContact(hContact);
@@ -833,7 +829,7 @@ void CContactList::OnContactDeleted(HANDLE hContact) //************************************************************************
// called when a contacts group has changed
//************************************************************************
-void CContactList::OnContactGroupChanged(HANDLE hContact,tstring strGroup)
+void CContactList::OnContactGroupChanged(HCONTACT hContact,tstring strGroup)
{
bool bMetaContact = false;
@@ -1017,7 +1013,7 @@ void CContactList::InitializeGroupObjects() int res = 0;
CContactListGroup *pGroup = NULL;
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
HANDLE hMetaContact = NULL;
char *szProto = NULL;
while(hContact != NULL)
diff --git a/plugins/MirandaG15/src/CContactList.h b/plugins/MirandaG15/src/CContactList.h index 75b129f8fc..a86d61852f 100644 --- a/plugins/MirandaG15/src/CContactList.h +++ b/plugins/MirandaG15/src/CContactList.h @@ -8,7 +8,7 @@ class CContactListEntry public:
int iMessages;
tstring strMessages;
- HANDLE hHandle;
+ HCONTACT hHandle;
tstring strName;
tstring strProto;
tstring strStatus;
@@ -25,7 +25,7 @@ public: int iOnline;
int iEvents;
- HANDLE hMetaContact;
+ HCONTACT hMetaContact;
CContactListEntry *pContactListEntry;
};
@@ -43,23 +43,23 @@ public: bool Shutdown();
// called when a contact has been added
- void OnContactAdded(HANDLE hContact);
+ void OnContactAdded(HCONTACT hContact);
// called when a contact has been deleted
- void OnContactDeleted(HANDLE hContact);
+ void OnContactDeleted(HCONTACT hContact);
// called when the configuration has changed
void OnConfigChanged();
// called when a contacts group has changed
- void OnContactGroupChanged(HANDLE hContact,tstring strGroup);
+ void OnContactGroupChanged(HCONTACT hContact,tstring strGroup);
// called when a contacts hidden flag has changed
- void OnContactHiddenChanged(HANDLE hContact, bool bVisibility);
+ void OnContactHiddenChanged(HCONTACT hContact, bool bVisibility);
// called when a contacts nickname has changed
- void OnContactNickChanged(HANDLE hContact, tstring strNick);
+ void OnContactNickChanged(HCONTACT hContact, tstring strNick);
// called when a contacts status has changed
- void OnStatusChange(HANDLE hContact,int iStatus);
+ void OnStatusChange(HCONTACT hContact,int iStatus);
// called when the contacts message count has changed
- void OnMessageCountChanged(HANDLE hContact);
+ void OnMessageCountChanged(HCONTACT hContact);
// returns the contact's status
- int GetContactStatus(HANDLE hContact);
+ int GetContactStatus(HCONTACT hContact);
// Called to compare two entrys
static bool CompareEntries(CListEntry<CContactListEntry*,CContactListGroup*> *pLeft,CListEntry<CContactListEntry*,CContactListGroup*> *pRight);
@@ -72,12 +72,12 @@ public: bool SetFont(LOGFONT &lf);
protected:
// returns the contacts group path
- tstring GetContactGroupPath(HANDLE hContact);
+ tstring GetContactGroupPath(HCONTACT hContact);
// adds a contact to the list
- void AddContact(HANDLE hContact);
+ void AddContact(HCONTACT hContact);
// removes a contact from the list
- void RemoveContact(HANDLE hContact);
+ void RemoveContact(HCONTACT hContact);
// uninitializes the group objects
void UninitializeGroupObjects();
@@ -101,7 +101,7 @@ protected: void SortGroup(CListContainer<CContactListEntry*,CContactListGroup*> *pGroup);
// tries to find a contact in the specified group
- CListEntry<CContactListEntry*,CContactListGroup*> *FindContactInGroup(HANDLE hContact,CListContainer<CContactListEntry*,CContactListGroup*> *pGroup);
+ CListEntry<CContactListEntry*,CContactListGroup*> *FindContactInGroup(HCONTACT hContact,CListContainer<CContactListEntry*,CContactListGroup*> *pGroup);
// tries to find a group in the specified group
CListContainer<CContactListEntry*,CContactListGroup*> *FindGroupInGroup(tstring strGroup,CListContainer<CContactListEntry*,CContactListGroup*> *pGroup);
@@ -117,7 +117,7 @@ protected: void RefreshList();
// returns the entry for the specified handle
- CListEntry<CContactListEntry*,CContactListGroup*> *FindContact(HANDLE hContact);
+ CListEntry<CContactListEntry*,CContactListGroup*> *FindContact(HCONTACT hContact);
// returns the entry for the specified group name
CListContainer<CContactListEntry*,CContactListGroup*> *FindGroup(tstring strGroup);
diff --git a/plugins/MirandaG15/src/CContactlistScreen.cpp b/plugins/MirandaG15/src/CContactlistScreen.cpp index b9cbebf5b2..d6e733f651 100644 --- a/plugins/MirandaG15/src/CContactlistScreen.cpp +++ b/plugins/MirandaG15/src/CContactlistScreen.cpp @@ -85,7 +85,7 @@ bool CContactlistScreen::Draw(CLCDGfx *pGfx) //************************************************************************
// returns the online status of the specified contact
//************************************************************************
-int CContactlistScreen::GetContactStatus(HANDLE hContact)
+int CContactlistScreen::GetContactStatus(HCONTACT hContact)
{
return m_ContactList.GetContactStatus(hContact);
}
@@ -182,7 +182,7 @@ void CContactlistScreen::OnEventReceived(CEvent *pEvent) //************************************************************************
// Called when a chat session was opened
//************************************************************************
-void CContactlistScreen::OnSessionOpened(HANDLE hContact)
+void CContactlistScreen::OnSessionOpened(HCONTACT hContact)
{
m_ContactList.OnMessageCountChanged(hContact);
}
@@ -253,11 +253,10 @@ void CContactlistScreen::OnLCDButtonUp(int iButton) if(pEntry->GetType() == CONTAINER) {
CListContainer<CContactListEntry*,CContactListGroup*> *pContainer = (CListContainer<CContactListEntry*,CContactListGroup*>*)pEntry;
if(pContainer->GetGroupData()->hMetaContact != NULL) {
- if(m_bLongPress) {
+ if(m_bLongPress)
pContainer->ToggleOpen();
- } else {
+ else
CAppletManager::GetInstance()->ActivateChatScreen(pContainer->GetGroupData()->hMetaContact);
- }
}
}
}
diff --git a/plugins/MirandaG15/src/CContactlistScreen.h b/plugins/MirandaG15/src/CContactlistScreen.h index 3b9a5f6f95..f3ce140267 100644 --- a/plugins/MirandaG15/src/CContactlistScreen.h +++ b/plugins/MirandaG15/src/CContactlistScreen.h @@ -26,10 +26,10 @@ public: void ResetPosition();
// returns the online status of the specified contact
- int GetContactStatus(HANDLE hContact);
+ int GetContactStatus(HCONTACT hContact);
// Called when a chat session was opened
- void OnSessionOpened(HANDLE hContact);
+ void OnSessionOpened(HCONTACT hContact);
// Called when the configuration has changed
void OnConfigChanged();
diff --git a/plugins/MirandaG15/src/CEvent.h b/plugins/MirandaG15/src/CEvent.h index cf23af037e..81d3b40833 100644 --- a/plugins/MirandaG15/src/CEvent.h +++ b/plugins/MirandaG15/src/CEvent.h @@ -53,7 +53,7 @@ public: enum EventType eType;
DWORD dwFlags;
- HANDLE hContact;
+ HCONTACT hContact;
tm Time;
bool bTime;
diff --git a/plugins/MirandaG15/src/CEventLog.h b/plugins/MirandaG15/src/CEventLog.h index e5953f92c7..e70d3f6a43 100644 --- a/plugins/MirandaG15/src/CEventLog.h +++ b/plugins/MirandaG15/src/CEventLog.h @@ -6,7 +6,7 @@ class CEventLogEntry
{
public:
- HANDLE hContact;
+ HCONTACT hContact;
tstring strValue;
tstring strTimestamp;
tm Time;
diff --git a/plugins/MirandaG15/src/CEventScreen.cpp b/plugins/MirandaG15/src/CEventScreen.cpp index cda38b07b4..b5656a3188 100644 --- a/plugins/MirandaG15/src/CEventScreen.cpp +++ b/plugins/MirandaG15/src/CEventScreen.cpp @@ -187,7 +187,7 @@ void CEventScreen::OnLCDButtonDown(int iButton) CIRCConnection *pIRCCon = CAppletManager::GetInstance()->GetIRCConnection(toTstring(szProto));
if(pIRCCon && db_get_b(pEntry->hContact, szProto, "ChatRoom", 0) != 0 &&
- db_get_b((HANDLE)pEntry->hContact,"CList","Hidden",0))
+ db_get_b(pEntry->hContact,"CList","Hidden",0))
return;
CAppletManager::GetInstance()->ActivateChatScreen(pEntry->hContact);
diff --git a/plugins/MirandaG15/src/CIRCHistory.h b/plugins/MirandaG15/src/CIRCHistory.h index 299a80544b..bba2c40fb4 100644 --- a/plugins/MirandaG15/src/CIRCHistory.h +++ b/plugins/MirandaG15/src/CIRCHistory.h @@ -14,7 +14,7 @@ class CIRCHistory public:
tstring strChannel;
tstring strProtocol;
- HANDLE hContact;
+ HCONTACT hContact;
list<SIRCMessage> LMessages;
list<tstring> LUsers;
};
diff --git a/plugins/MirandaG15/src/CNotificationScreen.h b/plugins/MirandaG15/src/CNotificationScreen.h index 837398238a..7404832205 100644 --- a/plugins/MirandaG15/src/CNotificationScreen.h +++ b/plugins/MirandaG15/src/CNotificationScreen.h @@ -14,7 +14,7 @@ public: tm Time;
tstring strText;
tstring strTitle;
- HANDLE hContact;
+ HCONTACT hContact;
EventType eType;
};
diff --git a/plugins/MirandaG15/src/Miranda.h b/plugins/MirandaG15/src/Miranda.h index 5b35db47cd..f11db5f7b8 100644 --- a/plugins/MirandaG15/src/Miranda.h +++ b/plugins/MirandaG15/src/Miranda.h @@ -1,3 +1,3 @@ extern HINSTANCE hInstance;
-extern char *MsgServiceName(HANDLE hContact,bool bIsUnicode);
+extern char *MsgServiceName(HCONTACT hContact,bool bIsUnicode);
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp index 17de9672af..745622593a 100644 --- a/plugins/MobileState/src/main.cpp +++ b/plugins/MobileState/src/main.cpp @@ -50,7 +50,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda return &pluginInfo;
}
-bool hasMobileClient(HANDLE hContact, LPARAM lParam)
+bool hasMobileClient(HCONTACT hContact, LPARAM lParam)
{
char *proto = GetContactProto(hContact);
@@ -71,10 +71,10 @@ int ExtraIconsApply(WPARAM wParam, LPARAM lParam) if (wParam == NULL)
return 0;
- if (hasMobileClient((HANDLE)wParam, lParam))
- ExtraIcon_SetIcon(hExtraIcon, (HANDLE)wParam, "mobile_icon");
+ if (hasMobileClient((HCONTACT)wParam, lParam))
+ ExtraIcon_SetIcon(hExtraIcon, (HCONTACT)wParam, "mobile_icon");
else
- ExtraIcon_Clear(hExtraIcon, (HANDLE)wParam);
+ ExtraIcon_Clear(hExtraIcon, (HCONTACT)wParam);
return 0;
}
@@ -82,7 +82,7 @@ int ExtraIconsApply(WPARAM wParam, LPARAM lParam) int onContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
- char *proto = GetContactProto((HANDLE)wParam);
+ char *proto = GetContactProto((HCONTACT)wParam);
if (!proto)
return 0;
@@ -102,7 +102,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) hExtraIcon = ExtraIcon_Register("mobilestate", LPGEN("Mobile State"), "mobile_icon");
// Set initial value for all contacts
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
ExtraIconsApply((WPARAM)hContact, 1);
return 0;
diff --git a/plugins/ModernOpt/src/mopt_ignore.cpp b/plugins/ModernOpt/src/mopt_ignore.cpp index 19d6df1a7b..fadd516b7e 100644 --- a/plugins/ModernOpt/src/mopt_ignore.cpp +++ b/plugins/ModernOpt/src/mopt_ignore.cpp @@ -49,7 +49,7 @@ static void ResetListOptions(HWND hwndList) static void SetAllContactIcons(HWND hwndList, int count)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
DWORD hItem = SendMessage(hwndList,CLM_FINDCONTACT,(WPARAM)hContact,0);
for (int i = 0; i < count; ++i)
SendMessage(hwndList,CLM_SETEXTRAIMAGE,hItem,MAKELPARAM(i, i+1));
diff --git a/plugins/MsgPopup/src/options.cpp b/plugins/MsgPopup/src/options.cpp index e9b5eca13d..8920eb4bbe 100644 --- a/plugins/MsgPopup/src/options.cpp +++ b/plugins/MsgPopup/src/options.cpp @@ -28,7 +28,7 @@ int idOptionControls[4][3] = { IDC_QUESTION_FG,IDC_QUESTION_BG,IDC_TIMEOUT4
};
-static int __inline DBWriteContactSettingDwordDef(HANDLE hContact,const char *szModule,const char *szSetting,DWORD val, DWORD defValue)
+static int __inline DBWriteContactSettingDwordDef(HCONTACT hContact,const char *szModule,const char *szSetting,DWORD val, DWORD defValue)
{
if(val == db_get_dw(hContact, szModule, szSetting, defValue))
return 0;
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index c993b3299e..4c42c78ba3 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -103,7 +103,7 @@ class CLHistoryDlg public:
HWND hWnd;
- HANDLE hContact;
+ HCONTACT hContact;
tstring sPath;
HWND hFindDlg;
@@ -113,7 +113,7 @@ class CLHistoryDlg bool bFirstLoad;
bool bUtf8File;
- CLHistoryDlg( HANDLE hContact) : hContact( hContact )
+ CLHistoryDlg( HCONTACT hContact) : hContact( hContact )
{
hFindDlg = NULL;
acFindStr[0] = 0;
@@ -489,7 +489,7 @@ void UpdateFileViews( const TCHAR *pszFile ) // Developer : KN
/////////////////////////////////////////////////////////////////////
-bool bOpenExternaly( HANDLE hContact )
+bool bOpenExternaly( HCONTACT hContact )
{
tstring sPath = GetFilePathFromUser( hContact);
@@ -1232,7 +1232,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, // Developer : KN
/////////////////////////////////////////////////////////////////////
-bool bShowFileViewer(HANDLE hContact)
+bool bShowFileViewer(HCONTACT hContact)
{
HWND hInternalWindow = WindowList_Find(hInternalWindowList,hContact);
if(hInternalWindow) {
diff --git a/plugins/Msg_Export/src/FileViewer.h b/plugins/Msg_Export/src/FileViewer.h index d76509e4de..fb060a2c50 100755 --- a/plugins/Msg_Export/src/FileViewer.h +++ b/plugins/Msg_Export/src/FileViewer.h @@ -24,8 +24,8 @@ void Uninitilize(); void UpdateFileViews( const TCHAR *pszFile);
-bool bOpenExternaly( HANDLE hContact);
-bool bShowFileViewer( HANDLE hContact);
+bool bOpenExternaly( HCONTACT hContact);
+bool bShowFileViewer( HCONTACT hContact);
bool bUseInternalViewer( bool bNew);
bool bUseInternalViewer();
diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp index 898eb2c5c6..1aafecbf02 100755 --- a/plugins/Msg_Export/src/main.cpp +++ b/plugins/Msg_Export/src/main.cpp @@ -62,10 +62,10 @@ static INT_PTR ShowExportHistory(WPARAM wParam, LPARAM /*lParam*/) {
if (bUseInternalViewer())
{
- bShowFileViewer((HANDLE)wParam);
+ bShowFileViewer((HCONTACT)wParam);
return 0;
}
- bOpenExternaly((HANDLE)wParam);
+ bOpenExternaly((HCONTACT)wParam);
return 0;
}
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 4f6cd64214..30b37937d8 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -92,29 +92,15 @@ class CLDBEvent int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
if (lParamSort == 1 )
- {
- return _tcsicmp( NickFromHandle((HANDLE)lParam1), NickFromHandle((HANDLE)lParam2));
- }
+ return _tcsicmp( NickFromHandle((HCONTACT)lParam1), NickFromHandle((HCONTACT)lParam2));
if (lParamSort == 2 )
- {
- return _DBGetString( (HANDLE)lParam1, "Protocol", "p", _T("")).compare(
- _DBGetString( (HANDLE)lParam2, "Protocol", "p", _T(""))
- );
- }
+ return _DBGetString((HCONTACT)lParam1, "Protocol", "p", _T("")).compare(_DBGetString((HCONTACT)lParam2, "Protocol", "p", _T("")));
+
if (lParamSort == 3 )
{
- DWORD dwUin1 = db_get_dw(
- (HANDLE)lParam1,
- _DBGetStringA( (HANDLE)lParam1, "Protocol", "p", "" ).c_str(),
- "UIN",
- 0);
- DWORD dwUin2 = db_get_dw(
- (HANDLE)lParam2,
- _DBGetStringA( (HANDLE)lParam2, "Protocol", "p", "" ).c_str(),
- "UIN",
- 0);
-
+ DWORD dwUin1 = db_get_dw((HCONTACT)lParam1, _DBGetStringA((HCONTACT)lParam1, "Protocol", "p", "" ).c_str(), "UIN", 0);
+ DWORD dwUin2 = db_get_dw((HCONTACT)lParam2, _DBGetStringA((HCONTACT)lParam2, "Protocol", "p", "" ).c_str(), "UIN", 0);
if (dwUin1 == dwUin2 )
return 0;
if (dwUin1 > dwUin2 )
@@ -235,7 +221,7 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) continue;
}
- HANDLE hContact = (HANDLE)sItem.lParam;
+ HCONTACT hContact = (HCONTACT)sItem.lParam;
list< CLDBEvent > & rclCurList = AllEvents[ GetFilePathFromUser( hContact) ];
@@ -329,7 +315,7 @@ void SetToDefault( HWND hParent ) continue;
tstring sFileName = szTemp;
- ReplaceDefines( (HANDLE)sItem.lParam, sFileName);
+ ReplaceDefines((HCONTACT)sItem.lParam, sFileName);
ReplaceTimeVariables( sFileName);
sItem.mask = LVIF_TEXT;
@@ -414,16 +400,16 @@ BOOL bApplyChanges( HWND hwndDlg ) if (ListView_GetItem( hMapUser, &sItem))
{
- HANDLE hUser = (HANDLE)sItem.lParam;
+ HCONTACT hUser = (HCONTACT)sItem.lParam;
if (_tcslen( szTemp) > 0 )
- db_set_ts( hUser, MODULE, "FileName", szTemp);
+ db_set_ts(hUser, MODULE, "FileName", szTemp);
else
- db_unset( hUser, MODULE, "FileName");
+ db_unset(hUser, MODULE, "FileName");
if (sItem.iImage )
- db_unset( hUser, MODULE, "EnableLog"); // default is Enabled !!
+ db_unset(hUser, MODULE, "EnableLog"); // default is Enabled !!
else
- db_set_b( hUser, MODULE, "EnableLog",0);
+ db_set_b(hUser, MODULE, "EnableLog",0);
}
}
UpdateFileToColWidth();
@@ -507,7 +493,7 @@ void AutoFindeFileNames(HWND hwndDlg) }
int nShortestMatch = 0xFFFF;
- HANDLE hStortest = 0;
+ HCONTACT hStortest = 0;
int nStortestIndex = -1;
for (int nSubCur = 0 ; nSubCur < nCount ; nSubCur++ )
{
@@ -528,7 +514,7 @@ void AutoFindeFileNames(HWND hwndDlg) {
nShortestMatch = (int)nLen;
nStortestIndex = nSubCur;
- hStortest = (HANDLE)sItem.lParam;
+ hStortest = (HCONTACT)sItem.lParam;
}
}
}
@@ -551,7 +537,7 @@ void AutoFindeFileNames(HWND hwndDlg) if (sFileName.empty())
{
sFileName = szDefaultFile;
- ReplaceDefines( hStortest, sFileName);
+ ReplaceDefines(hStortest, sFileName);
ReplaceTimeVariables( sFileName);
}
@@ -692,7 +678,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar {
tstring sTmp;
LVITEM sItem = { 0 };
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
for (int nUser = 0; /*hContact*/ ; nUser++ )
{
sItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 64fbf69bb9..c7b03b5e3b 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -255,7 +255,7 @@ void DisplayLastError(const TCHAR *pszError) // Developer : KN
/////////////////////////////////////////////////////////////////////
-const TCHAR* NickFromHandle(HANDLE hContact)
+const TCHAR* NickFromHandle(HCONTACT hContact)
{
const TCHAR *psz = (const TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
if (psz )
@@ -279,7 +279,7 @@ const TCHAR* NickFromHandle(HANDLE hContact) // Developer : KN
/////////////////////////////////////////////////////////////////////
-tstring _DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting, const TCHAR *pszError )
+tstring _DBGetStringW(HCONTACT hContact,const char *szModule,const char *szSetting, const TCHAR *pszError )
{
tstring ret;
DBVARIANT dbv = {0};
@@ -302,7 +302,7 @@ tstring _DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting return ret;
}
-string _DBGetStringA(HANDLE hContact,const char *szModule,const char *szSetting, const char *pszError )
+string _DBGetStringA(HCONTACT hContact,const char *szModule,const char *szSetting, const char *pszError )
{
string ret;
DBVARIANT dbv = {0};
@@ -596,7 +596,7 @@ void ReplaceDBPath( tstring &sRet ) // Developer : KN
/////////////////////////////////////////////////////////////////////
-tstring GetFilePathFromUser( HANDLE hContact )
+tstring GetFilePathFromUser( HCONTACT hContact )
{
tstring sFilePath = sExportDir + _DBGetString( hContact, MODULE, "FileName", sDefaultFile.c_str());
@@ -707,7 +707,7 @@ tstring GetFilePathFromUser( HANDLE hContact ) // Developer : KN
/////////////////////////////////////////////////////////////////////
-tstring FileNickFromHandle( HANDLE hContact)
+tstring FileNickFromHandle( HCONTACT hContact)
{
tstring ret = NickFromHandle( hContact);
string::size_type nCur = 0;
@@ -754,7 +754,7 @@ void ReplaceAllNoColon( tstring &sSrc, const TCHAR *pszReplace, tstring &sNew) // Developer : KN
/////////////////////////////////////////////////////////////////////
-void ReplaceDefines( HANDLE hContact, tstring & sTarget )
+void ReplaceDefines( HCONTACT hContact, tstring & sTarget )
{
if (sTarget.find( _T("%nick%")) != string::npos )
{
@@ -899,7 +899,7 @@ void UpdateFileToColWidth() {
clFileTo1ColWidth.clear();
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
tstring sNick = NickFromHandle( hContact);
string::size_type &rnValue = clFileTo1ColWidth[ GetFilePathFromUser( hContact) ];
if (rnValue < sNick.size())
@@ -997,7 +997,7 @@ void DisplayErrorDialog( const TCHAR *pszError, tstring& sFilePath, DBEVENTINFO // Developer : KN
/////////////////////////////////////////////////////////////////////
-void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei )
+void ExportDBEventInfo(HCONTACT hContact, DBEVENTINFO &dbei )
{
TCHAR szTemp[500];
tstring sFilePath = GetFilePathFromUser( hContact);
@@ -1410,7 +1410,8 @@ void ExportDBEventInfo(HANDLE hContact, DBEVENTINFO &dbei ) int nExportEvent(WPARAM wparam,LPARAM lparam)
{
- HANDLE hContact = (HANDLE)wparam, hDbEvent = (HANDLE)lparam;
+ HCONTACT hContact = (HCONTACT)wparam;
+ HANDLE hDbEvent = (HANDLE)lparam;
if ( !db_get_b(hContact,MODULE,"EnableLog",1))
return 0;
@@ -1582,7 +1583,7 @@ SuperBreak: int nContactDeleted(WPARAM wparam,LPARAM /*lparam*/)
{
- HANDLE hContact = (HANDLE)wparam;
+ HCONTACT hContact = (HCONTACT)wparam;
HWND hInternalWindow = WindowList_Find(hInternalWindowList,hContact);
if(hInternalWindow)
@@ -1594,7 +1595,7 @@ int nContactDeleted(WPARAM wparam,LPARAM /*lparam*/) tstring sFilePath = GetFilePathFromUser( hContact);
// Test if there is another user using this file
- for(HANDLE hOtherContact = db_find_first();hOtherContact;hOtherContact = db_find_next(hOtherContact))
+ for(HCONTACT hOtherContact = db_find_first();hOtherContact;hOtherContact = db_find_next(hOtherContact))
if (hContact != hOtherContact && sFilePath == GetFilePathFromUser( hOtherContact))
return 0; // we found another contact abort mission :-)
diff --git a/plugins/Msg_Export/src/utils.h b/plugins/Msg_Export/src/utils.h index ffb67d2ea0..023e32cce4 100755 --- a/plugins/Msg_Export/src/utils.h +++ b/plugins/Msg_Export/src/utils.h @@ -57,10 +57,10 @@ void ShowDebugInfo(); int nExportEvent(WPARAM wparam,LPARAM lparam);
int nContactDeleted(WPARAM wparam,LPARAM lparam);
-const TCHAR *NickFromHandle(HANDLE hContact);
+const TCHAR *NickFromHandle(HCONTACT hContact);
-tstring __inline _DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting, const TCHAR *pszError);
-string __inline _DBGetStringA(HANDLE hContact,const char *szModule,const char *szSetting, const char *pszError);
+tstring __inline _DBGetStringW(HCONTACT hContact,const char *szModule,const char *szSetting, const TCHAR *pszError);
+string __inline _DBGetStringA(HCONTACT hContact,const char *szModule,const char *szSetting, const char *pszError);
void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const tstring &sNew);
void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew);
@@ -68,9 +68,9 @@ void ReplaceAll( tstring &sSrc, const TCHAR *pszReplace, const TCHAR *pszNew); void UpdateFileToColWidth();
bool bReadMirandaDirAndPath();
-tstring GetFilePathFromUser( HANDLE hContact);
+tstring GetFilePathFromUser( HCONTACT hContact);
-void ReplaceDefines( HANDLE hContact, tstring & sTarget);
+void ReplaceDefines( HCONTACT hContact, tstring & sTarget);
void ReplaceTimeVariables( tstring &sRet);
bool bCreatePathToFile( tstring sFilePath);
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp index e6ccc52c73..c1d12aee4e 100644 --- a/plugins/NewEventNotify/src/main.cpp +++ b/plugins/NewEventNotify/src/main.cpp @@ -62,7 +62,7 @@ HANDLE hHookedDeletedEvent; int HookedNewEvent(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
PLUGIN_DATA* pdata;
//are popups currently enabled?
@@ -181,7 +181,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) // 1 - Split-mode window found
// 2 - Single-mode window found
-int CheckMsgWnd(HANDLE hContact)
+int CheckMsgWnd(HCONTACT hContact)
{
if (g_IsSrmmWindowAPI) {
MessageWindowData mwd;
diff --git a/plugins/NewEventNotify/src/neweventnotify.h b/plugins/NewEventNotify/src/neweventnotify.h index 0a32d8652f..1cc9baf2e3 100644 --- a/plugins/NewEventNotify/src/neweventnotify.h +++ b/plugins/NewEventNotify/src/neweventnotify.h @@ -193,7 +193,7 @@ struct EVENT_DATA_EX struct PLUGIN_DATA
{
UINT eventType;
- HANDLE hContact;
+ HCONTACT hContact;
PLUGIN_OPTIONS* pluginOptions;
HWND hWnd;
struct EVENT_DATA_EX* firstEventData;
@@ -207,8 +207,8 @@ struct PLUGIN_DATA //---------------------------
//---External Procedure Definitions
-int PopupShow(PLUGIN_OPTIONS* pluginOptions, HANDLE hContact, HANDLE hEvent, UINT eventType);
-int PopupUpdate(HANDLE hContact, HANDLE hEvent);
+int PopupShow(PLUGIN_OPTIONS* pluginOptions, HCONTACT hContact, HANDLE hEvent, UINT eventType);
+int PopupUpdate(HCONTACT hContact, HANDLE hEvent);
int PopupPreview(PLUGIN_OPTIONS* pluginOptions);
int PopupAct(HWND hWnd, UINT mask, PLUGIN_DATA* pdata);
int OptionsInit(PLUGIN_OPTIONS* pluginOptions);
@@ -216,7 +216,7 @@ int OptionsAdd(HINSTANCE hInst, WPARAM addInfo); int Opt_DisableNEN(BOOL Status);
int MenuitemInit(BOOL bStatus);
int MenuitemUpdate(BOOL bStatus);
-int NumberPopupData(HANDLE hContact, int eventType);
-int CheckMsgWnd(HANDLE hContact);
+int NumberPopupData(HCONTACT hContact, int eventType);
+int CheckMsgWnd(HCONTACT hContact);
extern HINSTANCE hInst;
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 026ce4897c..7ab6e944ee 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -30,7 +30,7 @@ static int PopupCount = 0; PLUGIN_DATA* PopupList[MAX_POPUPS];
-int NumberPopupData(HANDLE hContact, int eventType)
+int NumberPopupData(HCONTACT hContact, int eventType)
{
for (int n=0; n < MAX_POPUPS; n++) {
if (!PopupList[n] && !hContact && eventType == -1)
@@ -369,7 +369,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) return TranslateTS( mir_a2t(commentFix));
}
-int PopupShow(PLUGIN_OPTIONS* pluginOptions, HANDLE hContact, HANDLE hEvent, UINT eventType)
+int PopupShow(PLUGIN_OPTIONS* pluginOptions, HCONTACT hContact, HANDLE hEvent, UINT eventType)
{
TCHAR* sampleEvent;
long iSeconds;
@@ -486,7 +486,7 @@ int PopupShow(PLUGIN_OPTIONS* pluginOptions, HANDLE hContact, HANDLE hEvent, UIN }
-int PopupUpdate(HANDLE hContact, HANDLE hEvent)
+int PopupUpdate(HCONTACT hContact, HANDLE hEvent)
{
// merge only message popups
PLUGIN_DATA *pdata = (PLUGIN_DATA*)PopupList[NumberPopupData(hContact, EVENTTYPE_MESSAGE)];
diff --git a/plugins/NewXstatusNotify/src/common.h b/plugins/NewXstatusNotify/src/common.h index a779892e40..3e56ed0fb0 100644 --- a/plugins/NewXstatusNotify/src/common.h +++ b/plugins/NewXstatusNotify/src/common.h @@ -122,7 +122,7 @@ typedef struct tagPLUGINDATA } PLUGINDATA;
typedef struct {
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR *cust;
TCHAR *oldstatusmsg;
TCHAR *newstatusmsg;
@@ -131,7 +131,7 @@ typedef struct { } STATUSMSGINFO;
/*
-HANDLE hContact = (HANDLE)wParam;
+HCONTACT hContact = (HCONTACT)wParam;
WORD oldStatus = LOWORD(lParam);
WORD newStatus = HIWORD(lParam);
oldStatus is the status the contact was before the change.
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index 88754c3a99..c21bb6f940 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -107,24 +107,23 @@ HIMAGELIST GetStatusIconsImgList(char *szProto) INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- static HANDLE hContact = NULL;
- switch (msg)
- {
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
+ static HCONTACT hContact = NULL;
+ HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
- hContact = (HANDLE)lParam;
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ {
+ hContact = (HCONTACT)lParam;
char *szProto = GetContactProto(hContact);
- HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
-
+
ListView_SetImageList(hList, GetStatusIconsImgList(szProto), LVSIL_SMALL);
ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP, LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
- RECT rc = {0};
+ RECT rc = { 0 };
GetClientRect(hList, &rc);
- LV_COLUMN lvc = {0};
+ LV_COLUMN lvc = { 0 };
lvc.mask = LVCF_WIDTH | LVCF_TEXT;
lvc.cx = STATUS_COLUMN;
lvc.pszText = TranslateT("Status");
@@ -134,20 +133,17 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvc.pszText = TranslateT("Sound for the status");
ListView_InsertColumn(hList, 1, &lvc);
- if (szProto)
- {
+ if (szProto) {
DBVARIANT dbv;
TCHAR buff[MAX_PATH];
- for (int i = ID_STATUS_MAX; i >= ID_STATUS_MIN; i--)
- {
+ for (int i = ID_STATUS_MAX; i >= ID_STATUS_MIN; i--) {
int flags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_2, 0);
- if (flags == 0)
- flags = PF2_ONLINE|PF2_INVISIBLE|PF2_SHORTAWAY|PF2_LONGAWAY|PF2_LIGHTDND|PF2_HEAVYDND|PF2_FREECHAT|PF2_OUTTOLUNCH|PF2_ONTHEPHONE;
-
- if ((flags & Proto_Status2Flag(i)) || i == ID_STATUS_OFFLINE)
- {
- LV_ITEM lvi = {0};
+ if (flags == 0)
+ flags = PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE;
+
+ if ((flags & Proto_Status2Flag(i)) || i == ID_STATUS_OFFLINE) {
+ LV_ITEM lvi = { 0 };
lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
lvi.iItem = 0;
lvi.iSubItem = 0;
@@ -156,8 +152,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvi.pszText = TranslateTS(StatusList[Index(i)].lpzStandardText);
lvi.iItem = ListView_InsertItem(hList, &lvi);
- if (!db_get_ts(hContact, MODULE, StatusList[Index(i)].lpzSkinSoundName, &dbv))
- {
+ if (!db_get_ts(hContact, MODULE, StatusList[Index(i)].lpzSkinSoundName, &dbv)) {
_tcscpy(buff, dbv.ptszVal);
db_free(&dbv);
}
@@ -168,7 +163,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
}
- LV_ITEM lvi = {0};
+ LV_ITEM lvi = { 0 };
lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
lvi.iItem = 0;
lvi.iSubItem = 0;
@@ -177,148 +172,119 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvi.pszText = TranslateT("From offline");
lvi.iItem = ListView_InsertItem(hList, &lvi);
- if (!db_get_ts(hContact, MODULE, "UserFromOffline", &dbv))
- {
+ if (!db_get_ts(hContact, MODULE, "UserFromOffline", &dbv)) {
_tcscpy(buff, dbv.ptszVal);
db_free(&dbv);
}
- else
- _tcscpy(buff, TranslateT(DEFAULT_SOUND));
+ else _tcscpy(buff, TranslateT(DEFAULT_SOUND));
ListView_SetItemText(hList, lvi.iItem, 1, buff);
}
CheckDlgButton(hwndDlg, IDC_CHECK_NOTIFYSOUNDS, db_get_b(hContact, MODULE, "EnableSounds", 1));
- CheckDlgButton(hwndDlg, IDC_CHECK_NOTIFYPOPUPS, db_get_b(hContact, MODULE, "EnablePopups", 1));
-
+ CheckDlgButton(hwndDlg, IDC_CHECK_NOTIFYPOPUPS, db_get_b(hContact, MODULE, "EnablePopups", 1));
+
ShowWindow(GetDlgItem(hwndDlg, IDC_INDSNDLIST), opt.UseIndSnd ? SW_SHOW : SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_TEXT_ENABLE_IS), opt.UseIndSnd ? SW_HIDE : SW_SHOW);
ShowWindow(GetDlgItem(hwndDlg, IDC_CHANGE), opt.UseIndSnd ? SW_SHOW : SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), opt.UseIndSnd ? SW_SHOW : SW_HIDE);
ShowWindow(GetDlgItem(hwndDlg, IDC_DELETE), opt.UseIndSnd ? SW_SHOW : SW_HIDE);
-
- return TRUE;
}
- case WM_COMMAND:
- {
- switch (LOWORD(wParam))
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_PREVIEW:
+ if (ListView_GetSelectionMark(hList) != -1)
+ PreviewSound(hList);
+ break;
+
+ case IDC_CHANGE:
{
- case IDC_PREVIEW:
- {
- HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
- if (ListView_GetSelectionMark(hList) != -1)
- PreviewSound(hList);
- break;
- }
- case IDC_CHANGE:
- {
- HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
- int iSel = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_INDSNDLIST), -1, LVNI_SELECTED);
- if (iSel != -1)
- {
- TCHAR stzFilePath[MAX_PATH];
- if (SelectSound(hwndDlg, stzFilePath) != NULL)
- {
- iSel = -1;
- while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
- ListView_SetItemText(hList, iSel, 1, stzFilePath);
+ int iSel = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_INDSNDLIST), -1, LVNI_SELECTED);
+ if (iSel != -1) {
+ TCHAR stzFilePath[MAX_PATH];
+ if (SelectSound(hwndDlg, stzFilePath) != NULL) {
+ iSel = -1;
+ while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
+ ListView_SetItemText(hList, iSel, 1, stzFilePath);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- break;
- }
- case IDC_DELETE:
- {
- HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
- if (ListView_GetSelectionMark(hList) != -1)
- {
- if (RemoveSoundFromList(GetDlgItem(hwndDlg, IDC_INDSNDLIST)))
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
- break;
- }
- case IDC_CHECK_NOTIFYSOUNDS:
- {
- db_set_b(hContact, MODULE, "EnableSounds", IsDlgButtonChecked(hwndDlg, IDC_CHECK_NOTIFYSOUNDS) ? 1 : 0);
- break;
}
- case IDC_CHECK_NOTIFYPOPUPS:
- {
- db_set_b(hContact, MODULE, "EnablePopups", IsDlgButtonChecked(hwndDlg, IDC_CHECK_NOTIFYPOPUPS) ? 1 : 0);
- break;
- }
- }
+ }
+ break;
+ case IDC_DELETE:
+ if (ListView_GetSelectionMark(hList) != -1)
+ if (RemoveSoundFromList(GetDlgItem(hwndDlg, IDC_INDSNDLIST)))
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_CHECK_NOTIFYSOUNDS:
+ db_set_b(hContact, MODULE, "EnableSounds", IsDlgButtonChecked(hwndDlg, IDC_CHECK_NOTIFYSOUNDS) ? 1 : 0);
+ break;
+
+ case IDC_CHECK_NOTIFYPOPUPS:
+ db_set_b(hContact, MODULE, "EnablePopups", IsDlgButtonChecked(hwndDlg, IDC_CHECK_NOTIFYPOPUPS) ? 1 : 0);
break;
}
- case WM_NOTIFY:
- {
- LPNMHDR pParam = (LPNMHDR)lParam;
- if (pParam->code == PSN_APPLY)
- {
- TCHAR buff[MAX_PATH];
- HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
+ break;
- LVITEM lvi = {0};
- lvi.mask = LVIF_PARAM;
- //Cycle through the list reading the text associated to each status.
- for (lvi.iItem = ListView_GetItemCount(hList) - 1; lvi.iItem >= 0; lvi.iItem--)
- {
- ListView_GetItem(hList, &lvi);
- ListView_GetItemText(hList, lvi.iItem, 1, buff, SIZEOF(buff));
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->code == PSN_APPLY) {
+ TCHAR buff[MAX_PATH];
+ HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
- if (!_tcscmp(buff, TranslateT(DEFAULT_SOUND)))
- {
- if (lvi.lParam == ID_STATUS_FROMOFFLINE)
- db_unset(hContact, MODULE, "UserFromOffline");
- else
- db_unset(hContact, MODULE, StatusList[Index(lvi.lParam)].lpzSkinSoundName);
- }
- else
- {
- TCHAR stzSoundPath[MAX_PATH] = { 0 };
- PathToRelativeT(buff, stzSoundPath);
- if (lvi.lParam == ID_STATUS_FROMOFFLINE)
- db_set_ws(hContact, MODULE, "UserFromOffline", stzSoundPath);
- else
- db_set_ws(hContact, MODULE, StatusList[Index(lvi.lParam)].lpzSkinSoundName, stzSoundPath);
- }
+ LVITEM lvi = { 0 };
+ lvi.mask = LVIF_PARAM;
+ //Cycle through the list reading the text associated to each status.
+ for (lvi.iItem = ListView_GetItemCount(hList) - 1; lvi.iItem >= 0; lvi.iItem--) {
+ ListView_GetItem(hList, &lvi);
+ ListView_GetItemText(hList, lvi.iItem, 1, buff, SIZEOF(buff));
+
+ if (!_tcscmp(buff, TranslateT(DEFAULT_SOUND))) {
+ if (lvi.lParam == ID_STATUS_FROMOFFLINE)
+ db_unset(hContact, MODULE, "UserFromOffline");
+ else
+ db_unset(hContact, MODULE, StatusList[Index(lvi.lParam)].lpzSkinSoundName);
+ }
+ else {
+ TCHAR stzSoundPath[MAX_PATH] = { 0 };
+ PathToRelativeT(buff, stzSoundPath);
+ if (lvi.lParam == ID_STATUS_FROMOFFLINE)
+ db_set_ws(hContact, MODULE, "UserFromOffline", stzSoundPath);
+ else
+ db_set_ws(hContact, MODULE, StatusList[Index(lvi.lParam)].lpzSkinSoundName, stzSoundPath);
}
-
- return TRUE;
}
- int hlpControlID = (int)wParam;
- switch (hlpControlID)
- {
- case IDC_INDSNDLIST:
- {
- if (pParam->code == NM_DBLCLK)
- {
- TCHAR stzFilePath[MAX_PATH];
- if (SelectSound(hwndDlg, stzFilePath) != NULL)
- {
- int iSel = -1;
- HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
- while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
- ListView_SetItemText(hList, iSel, 1, stzFilePath);
+ return TRUE;
+ }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- return TRUE;
- }
- else if (pParam->code == LVN_KEYDOWN)
- {
- LPNMLVKEYDOWN pnkd = (LPNMLVKEYDOWN)lParam;
- if (pnkd->wVKey == VK_DELETE)
- RemoveSoundFromList(GetDlgItem(hwndDlg, IDC_INDSNDLIST));
- }
+ int hlpControlID = (int)wParam;
+ switch (hlpControlID) {
+ case IDC_INDSNDLIST:
+ if (((LPNMHDR)lParam)->code == NM_DBLCLK) {
+ TCHAR stzFilePath[MAX_PATH];
+ if (SelectSound(hwndDlg, stzFilePath) != NULL) {
+ int iSel = -1;
+ HWND hList = GetDlgItem(hwndDlg, IDC_INDSNDLIST);
+ while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
+ ListView_SetItemText(hList, iSel, 1, stzFilePath);
- break;
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
+ return TRUE;
+ }
+ else if (((LPNMHDR)lParam)->code == LVN_KEYDOWN) {
+ LPNMLVKEYDOWN pnkd = (LPNMLVKEYDOWN)lParam;
+ if (pnkd->wVKey == VK_DELETE)
+ RemoveSoundFromList(GetDlgItem(hwndDlg, IDC_INDSNDLIST));
}
+
break;
}
+ break;
}
return FALSE;
}
@@ -365,7 +331,7 @@ void SetAllContactsIcons(HWND hwndList) {
BYTE EnableSounds, EnablePopups, EnableXStatus, EnableLogging;
- 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)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
char *szProto = GetContactProto(hContact);
@@ -604,7 +570,7 @@ INT_PTR CALLBACK DlgProcFiltering(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- 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)SendMessage(hList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
if (GetExtraImage(hList, hItem, EXTRA_IMAGE_SOUND) == EXTRA_IMAGE_SOUND)
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 3c01e6802a..5616832ce7 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -60,7 +60,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_USERONLINE, MIID_LAST};
-BYTE GetGender(HANDLE hContact)
+BYTE GetGender(HCONTACT hContact)
{
char *szProto =GetContactProto(hContact);
if (szProto) {
@@ -84,7 +84,7 @@ HANDLE GetIconHandle(char *szIcon) return Skin_GetIconHandle(szSettingName);
}
-bool IsNewExtraStatus(HANDLE hContact, char *szSetting, TCHAR *newStatusTitle)
+bool IsNewExtraStatus(HCONTACT hContact, char *szSetting, TCHAR *newStatusTitle)
{
DBVARIANT dbv;
bool result = true;
@@ -97,7 +97,7 @@ bool IsNewExtraStatus(HANDLE hContact, char *szSetting, TCHAR *newStatusTitle) return result;
}
-int ProcessExtraStatus(DBCONTACTWRITESETTING *cws, HANDLE hContact)
+int ProcessExtraStatus(DBCONTACTWRITESETTING *cws, HCONTACT hContact)
{
XSTATUSCHANGE *xsc;
char *szProto = GetContactProto(hContact);
@@ -408,12 +408,12 @@ TCHAR* GetStr(STATUSMSGINFO *n, const TCHAR *tmplt) return str;
}
-bool SkipHiddenContact(HANDLE hContact)
+bool SkipHiddenContact(HCONTACT hContact)
{
return (!opt.HiddenContactsToo && (db_get_b(hContact, "CList", "Hidden", 0) == 1));
}
-int ProcessStatus(DBCONTACTWRITESETTING *cws, HANDLE hContact)
+int ProcessStatus(DBCONTACTWRITESETTING *cws, HCONTACT hContact)
{
if ( !strcmp(cws->szSetting, "Status")) {
WORD newStatus = cws->value.wVal;
@@ -543,7 +543,7 @@ int ProcessStatus(DBCONTACTWRITESETTING *cws, HANDLE hContact) int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -612,7 +612,7 @@ int StatusModeChanged(WPARAM wParam, LPARAM lParam) return 0;
}
-void ShowStatusChangePopup(HANDLE hContact, char *szProto, WORD oldStatus, WORD newStatus)
+void ShowStatusChangePopup(HCONTACT hContact, char *szProto, WORD oldStatus, WORD newStatus)
{
TCHAR stzStatusText[MAX_SECONDLINE] = {0};
WORD myStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
@@ -686,7 +686,7 @@ void ShowStatusChangePopup(HANDLE hContact, char *szProto, WORD oldStatus, WORD PUAddPopupT(&ppd);
}
-void BlinkIcon(HANDLE hContact, char* szProto, WORD status)
+void BlinkIcon(HCONTACT hContact, char* szProto, WORD status)
{
CLISTEVENT cle = {0};
TCHAR stzTooltip[256];
@@ -704,7 +704,7 @@ void BlinkIcon(HANDLE hContact, char* szProto, WORD status) CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
-void PlayChangeSound(HANDLE hContact, WORD oldStatus, WORD newStatus)
+void PlayChangeSound(HCONTACT hContact, WORD oldStatus, WORD newStatus)
{
DBVARIANT dbv;
if (opt.UseIndSnd) {
@@ -751,7 +751,7 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam) {
WORD oldStatus = LOWORD(lParam);
WORD newStatus = HIWORD(lParam);
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
bool bEnablePopup = true, bEnableSound = true;
char *hlpProto = GetContactProto(hContact);
@@ -777,7 +777,7 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam) }
if (strcmp(szProto, szMetaModuleName) == 0) { //this contact is Meta
- HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ HCONTACT hSubContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
hlpProto = GetContactProto(hSubContact);
if (hlpProto == NULL)
return 0;
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index 211b4f6956..2a35c7f8ed 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -38,7 +38,7 @@ static int AwayMsgHook(WPARAM wParam, LPARAM lParam, LPARAM pObj) if (ack->result != ACKRESULT_SUCCESS)
return 0;
- HANDLE hContact = PUGetContact(pdp->hWnd);
+ HCONTACT hContact = PUGetContact(pdp->hWnd);
ptrT pstzLast( db_get_tsa(hContact, MODULE, "LastPopupText"));
TCHAR *tszStatus = (TCHAR*)ack->lParam;
@@ -58,7 +58,7 @@ static int AwayMsgHook(WPARAM wParam, LPARAM lParam, LPARAM pObj) void QueryAwayMessage(HWND hWnd, PLUGINDATA *pdp)
{
- HANDLE hContact = PUGetContact(hWnd);
+ HCONTACT hContact = PUGetContact(hWnd);
char *szProto = GetContactProto(hContact);
if (szProto)
{
@@ -76,7 +76,7 @@ void QueryAwayMessage(HWND hWnd, PLUGINDATA *pdp) void PopupAction(HWND hWnd, BYTE action)
{
- HANDLE hContact = PUGetContact(hWnd);
+ HCONTACT hContact = PUGetContact(hWnd);
if (hContact && hContact != INVALID_HANDLE_VALUE) {
switch (action) {
case PCA_OPENMESSAGEWND:
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp index ecbcb36a79..7e1f988ab1 100644 --- a/plugins/NewXstatusNotify/src/utils.cpp +++ b/plugins/NewXstatusNotify/src/utils.cpp @@ -39,7 +39,7 @@ TCHAR *db2t(DBVARIANT *dbv) return buff;
}
-int DBGetStringDefault(HANDLE hContact, const char *szModule, const char *szSetting, TCHAR *setting, int size, const TCHAR *defaultValue)
+int DBGetStringDefault(HCONTACT hContact, const char *szModule, const char *szSetting, TCHAR *setting, int size, const TCHAR *defaultValue)
{
DBVARIANT dbv;
if ( !db_get_ts(hContact, szModule, szSetting, &dbv)) {
diff --git a/plugins/NewXstatusNotify/src/utils.h b/plugins/NewXstatusNotify/src/utils.h index 384b01c511..55e97a0ddc 100644 --- a/plugins/NewXstatusNotify/src/utils.h +++ b/plugins/NewXstatusNotify/src/utils.h @@ -23,7 +23,7 @@ #define UTILS_H
TCHAR *db2t(DBVARIANT *dbv);
-int DBGetStringDefault(HANDLE hContact, const char *szModule, const char *szSetting, TCHAR *setting, int size, const TCHAR *defaultValue);
+int DBGetStringDefault(HCONTACT hContact, const char *szModule, const char *szSetting, TCHAR *setting, int size, const TCHAR *defaultValue);
void HigherLower(int maxValue, int minValue);
void ShowLog(TCHAR *file);
BOOL StatusHasAwayMessage(char *szProto, int status);
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 1ca031ac7a..e1d6313bb1 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -19,7 +19,7 @@ #include "common.h"
-XSTATUSCHANGE *NewXSC(HANDLE hContact, char *szProto, int xstatusType, int action, TCHAR *stzTitle, TCHAR *stzText)
+XSTATUSCHANGE *NewXSC(HCONTACT hContact, char *szProto, int xstatusType, int action, TCHAR *stzTitle, TCHAR *stzText)
{
XSTATUSCHANGE *xsc = (XSTATUSCHANGE *)mir_alloc(sizeof(XSTATUSCHANGE));
xsc->hContact = hContact;
@@ -41,7 +41,7 @@ void FreeXSC(XSTATUSCHANGE *xsc) }
}
-void RemoveLoggedEvents(HANDLE hContact)
+void RemoveLoggedEvents(HCONTACT hContact)
{
for (int i = eventList.getCount()-1; i >= 0; i--) {
DBEVENT *dbevent = eventList[i];
@@ -351,7 +351,7 @@ TCHAR *GetDefaultXstatusName(int statusID, char *szProto, TCHAR *buff, int buffl return buff;
}
-TCHAR *GetIcqXStatus(HANDLE hContact, char *szProto, char *szValue, TCHAR *buff, int bufflen)
+TCHAR *GetIcqXStatus(HCONTACT hContact, char *szProto, char *szValue, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
buff[0] = 0;
@@ -372,7 +372,7 @@ TCHAR *GetIcqXStatus(HANDLE hContact, char *szProto, char *szValue, TCHAR *buff, return buff;
}
-TCHAR *GetJabberAdvStatusText(HANDLE hContact, char *szProto, char *szSlot, char *szValue, TCHAR *buff, int bufflen)
+TCHAR *GetJabberAdvStatusText(HCONTACT hContact, char *szProto, char *szSlot, char *szValue, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
char szSetting[128];
@@ -388,7 +388,7 @@ TCHAR *GetJabberAdvStatusText(HANDLE hContact, char *szProto, char *szSlot, char return buff;
}
-void LogXstatusChange(HANDLE hContact, char *szProto, int xstatusType, TCHAR *stzTitle, TCHAR *stzText)
+void LogXstatusChange(HCONTACT hContact, char *szProto, int xstatusType, TCHAR *stzTitle, TCHAR *stzText)
{
XSTATUSCHANGE *xsc =
NewXSC(
@@ -406,7 +406,7 @@ void LogXstatusChange(HANDLE hContact, char *szProto, int xstatusType, TCHAR *st void AddEventThread(void *arg)
{
- HANDLE hContact = (HANDLE)arg;
+ HCONTACT hContact = (HCONTACT)arg;
TCHAR stzTitle[MAX_TITLE_LEN], stzText[MAX_TEXT_LEN];
char *szProto = GetContactProto(hContact);
diff --git a/plugins/NewXstatusNotify/src/xstatus.h b/plugins/NewXstatusNotify/src/xstatus.h index 5468d2c5ff..b5ba28e71f 100644 --- a/plugins/NewXstatusNotify/src/xstatus.h +++ b/plugins/NewXstatusNotify/src/xstatus.h @@ -75,7 +75,7 @@ typedef struct tagXSTATUSCHANGE
{
- HANDLE hContact;
+ HCONTACT hContact;
char *szProto;
int type;
int action;
@@ -85,7 +85,7 @@ typedef struct tagXSTATUSCHANGE typedef struct tagDBEVENT
{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hDBEvent;
} DBEVENT;
@@ -96,7 +96,7 @@ typedef struct tagPROTOTEMPLATE } PROTOTEMPLATE;
TCHAR *GetDefaultXstatusName(int statusID, char *szProto, TCHAR *buff, int bufflen);
-XSTATUSCHANGE *NewXSC(HANDLE hContact, char *szProto, int xstatusType, int action, TCHAR *stzTitle, TCHAR *stzText);
+XSTATUSCHANGE *NewXSC(HCONTACT hContact, char *szProto, int xstatusType, int action, TCHAR *stzTitle, TCHAR *stzText);
void ExtraStatusChanged(XSTATUSCHANGE *xsc);
void FreeXSC(XSTATUSCHANGE *xsc);
int OnWindowEvent(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/New_GPG/src/clist.cpp b/plugins/New_GPG/src/clist.cpp index 4533a464c2..9a2322023d 100644 --- a/plugins/New_GPG/src/clist.cpp +++ b/plugins/New_GPG/src/clist.cpp @@ -17,7 +17,6 @@ #include "commonheaders.h"
void RefreshContactListIcons(void);
-void setClistIcon(HANDLE);
int onExtraImageListRebuilding(WPARAM, LPARAM)
{
@@ -27,6 +26,6 @@ int onExtraImageListRebuilding(WPARAM, LPARAM) int onExtraImageApplying(WPARAM wParam, LPARAM)
{
- setClistIcon((HANDLE)wParam);
+ setClistIcon((HCONTACT)wParam);
return 0;
}
diff --git a/plugins/New_GPG/src/globals.h b/plugins/New_GPG/src/globals.h index 9942e16e96..744bcad389 100644 --- a/plugins/New_GPG/src/globals.h +++ b/plugins/New_GPG/src/globals.h @@ -19,4 +19,12 @@ extern bool bAppendTags, bPresenceSigning, bStripTags, gpg_valid, gpg_keyexist, tabsrmm_used, bSameAction, bFileTransfers, bDebugLog;
extern TCHAR *inopentag, *inclosetag, *outopentag, *outclosetag;
extern logtofile debuglog;
+
+extern map<int, HCONTACT> user_data; +extern int item_num; +
+extern bool _terminate;
+extern wstring new_key;
+extern HCONTACT new_key_hcnt;
+extern boost::mutex new_key_hcnt_mutex;
#endif
diff --git a/plugins/New_GPG/src/icons.cpp b/plugins/New_GPG/src/icons.cpp index 4c7b100023..65ddc26b0a 100644 --- a/plugins/New_GPG/src/icons.cpp +++ b/plugins/New_GPG/src/icons.cpp @@ -44,11 +44,11 @@ HANDLE IconLibHookIconsChanged(MIRANDAHOOK hook) return HookEvent(ME_SKIN2_ICONSCHANGED, hook);
}
-void setClistIcon(HANDLE hContact)
+void setClistIcon(HCONTACT hContact)
{
bool enabled = isContactSecured(hContact);
extern HANDLE g_hCLIcon;
- HANDLE hMC = hContact;
+ HCONTACT hMC = hContact;
if(metaIsSubcontact(hContact))
hMC = metaGetContact(hContact);
else if(metaIsProtoMetaContacts(hContact))
@@ -59,11 +59,11 @@ void setClistIcon(HANDLE hContact) ExtraIcon_SetIcon(g_hCLIcon, hMC, szIconId);
}
-void setSrmmIcon(HANDLE h)
+void setSrmmIcon(HCONTACT h)
{
- HANDLE hContact = metaIsProtoMetaContacts(h)?metaGetMostOnline(h):h;
+ HCONTACT hContact = metaIsProtoMetaContacts(h) ? metaGetMostOnline(h) : h;
bool enabled = isContactSecured(hContact);
- HANDLE hMC = NULL;
+ HCONTACT hMC = NULL;
if(metaIsSubcontact(hContact))
hMC = metaGetContact(hContact);
else if(metaIsProtoMetaContacts(hContact))
@@ -91,7 +91,7 @@ void RefreshContactListIcons() {
CallService(MS_CLUI_LISTBEGINREBUILD,0,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))
setClistIcon(hContact);
CallService(MS_CLUI_LISTENDREBUILD,0,0);
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index 5f1b61f782..2230a26ebd 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -362,7 +362,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR } delete [] name; } - bAutoExchange = CheckStateStoreDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange"); + bAutoExchange = CheckStateStoreDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange") != 0; gpg_valid = isGPGValid(); gpg_keyexist = isGPGKeyExist(); DestroyWindow(hwndDlg); @@ -370,8 +370,6 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR case IDC_OTHER: { void ShowLoadPublicKeyDialog(); - extern map<int, HANDLE> user_data; - extern int item_num; item_num = 0; //black magic here user_data[1] = 0; ShowLoadPublicKeyDialog(); @@ -1247,7 +1245,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, SetWindowText(hwndCurKey_p, path.c_str()); } } - bAutoExchange = CheckStateStoreDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange"); + bAutoExchange = CheckStateStoreDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange") != 0; gpg_valid = true; db_set_b(NULL, szGPGModuleName, "FirstRun", 0); DestroyWindow(hwndDlg); @@ -1283,84 +1281,68 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, static INT_PTR CALLBACK DlgProcNewKeyDialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - extern HANDLE new_key_hcnt; - extern boost::mutex new_key_hcnt_mutex; - static HANDLE hContact = INVALID_HANDLE_VALUE; + static HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE; void ImportKey(); TCHAR *tmp = NULL; - switch (msg) - { - case WM_INITDIALOG: - { - hContact = new_key_hcnt; - //new_key_hcnt_mutex.unlock(); - SetWindowPos(hwndDlg, 0, new_key_rect.left, new_key_rect.top, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW); - TranslateDialogDefault(hwndDlg); - TCHAR *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); - SetDlgItemText(hwndDlg, IDC_MESSAGE, tmp[0]?TranslateT("There is existing key for contact, would you like to replace it with new key?"):TranslateT("New public key was received, do you want to import it?")); - EnableWindow(GetDlgItem(hwndDlg, IDC_IMPORT_AND_USE), db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0)?0:1); - SetDlgItemText(hwndDlg, ID_IMPORT, tmp[0]?TranslateT("Replace"):TranslateT("Accept")); - mir_free(tmp); - tmp = new TCHAR [256]; - _tcscpy(tmp, TranslateT("Received key from ")); - _tcscat(tmp, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, (LPARAM)GCDNF_TCHAR)); - SetDlgItemText(hwndDlg, IDC_KEY_FROM, tmp); - delete [] tmp; - return TRUE; - } - - - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - case ID_IMPORT: - ImportKey(); - DestroyWindow(hwndDlg); - break; - case IDC_IMPORT_AND_USE: - ImportKey(); - db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1); - void setSrmmIcon(HANDLE hContact); - void setClistIcon(HANDLE hContact); - setSrmmIcon(hContact); - setClistIcon(hContact); - DestroyWindow(hwndDlg); - break; - case IDC_IGNORE_KEY: - DestroyWindow(hwndDlg); - break; - default: + switch (msg) + { + case WM_INITDIALOG: + { + hContact = new_key_hcnt; + //new_key_hcnt_mutex.unlock(); + SetWindowPos(hwndDlg, 0, new_key_rect.left, new_key_rect.top, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW); + TranslateDialogDefault(hwndDlg); + TCHAR *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); + SetDlgItemText(hwndDlg, IDC_MESSAGE, tmp[0]?TranslateT("There is existing key for contact, would you like to replace it with new key?"):TranslateT("New public key was received, do you want to import it?")); + EnableWindow(GetDlgItem(hwndDlg, IDC_IMPORT_AND_USE), db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0)?0:1); + SetDlgItemText(hwndDlg, ID_IMPORT, tmp[0]?TranslateT("Replace"):TranslateT("Accept")); + mir_free(tmp); + tmp = new TCHAR [256]; + _tcscpy(tmp, TranslateT("Received key from ")); + _tcscat(tmp, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, (LPARAM)GCDNF_TCHAR)); + SetDlgItemText(hwndDlg, IDC_KEY_FROM, tmp); + delete [] tmp; + } + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case ID_IMPORT: + ImportKey(); + DestroyWindow(hwndDlg); + break; + case IDC_IMPORT_AND_USE: + ImportKey(); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1); + void setSrmmIcon(HCONTACT hContact); + void setClistIcon(HCONTACT hContact); + setSrmmIcon(hContact); + setClistIcon(hContact); + DestroyWindow(hwndDlg); + break; + case IDC_IGNORE_KEY: + DestroyWindow(hwndDlg); + break; + } break; - } - - break; - } - - case WM_NOTIFY: - { -/* switch (((LPNMHDR)lParam)->code) - { - default: - break; - }*/ - } - break; - case WM_CLOSE: - DestroyWindow(hwndDlg); - break; - case WM_DESTROY: - { - GetWindowRect(hwndDlg, &new_key_rect); - db_set_dw(NULL, szGPGModuleName, "NewKeyWindowX", new_key_rect.left); - db_set_dw(NULL, szGPGModuleName, "NewKeyWindowY", new_key_rect.top); - } - hwndNewKey = NULL; - break; - } - return FALSE; + case WM_CLOSE: + DestroyWindow(hwndDlg); + break; + + case WM_DESTROY: + { + GetWindowRect(hwndDlg, &new_key_rect); + db_set_dw(NULL, szGPGModuleName, "NewKeyWindowX", new_key_rect.left); + db_set_dw(NULL, szGPGModuleName, "NewKeyWindowY", new_key_rect.top); + } + hwndNewKey = NULL; + break; + + } + return FALSE; } + static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) @@ -1914,84 +1896,61 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wPar return FALSE; } + static INT_PTR CALLBACK DlgProcImportKeyDialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - extern HANDLE new_key_hcnt; - extern boost::mutex new_key_hcnt_mutex; - HANDLE hContact = INVALID_HANDLE_VALUE; - switch (msg) - { - case WM_INITDIALOG: - { - hContact = new_key_hcnt; - new_key_hcnt_mutex.unlock(); - SetWindowPos(hwndDlg, 0 , import_key_rect.left, import_key_rect.top, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW); - TranslateDialogDefault(hwndDlg); - ComboBoxAddStringUtf(GetDlgItem(hwndDlg, IDC_KEYSERVER), _T("subkeys.pgp.net"), 0); - ComboBoxAddStringUtf(GetDlgItem(hwndDlg, IDC_KEYSERVER), _T("keys.gnupg.net"), 0); - return TRUE; - } - - - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - case IDC_IMPORT: - { - string out; - DWORD code; - std::vector<wstring> cmd; - cmd.push_back(L"--keyserver"); - TCHAR *server= new TCHAR [128]; - GetDlgItemText(hwndDlg, IDC_KEYSERVER, server, 128); - cmd.push_back(server); - delete [] server; - cmd.push_back(L"--recv-keys"); -// char *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID_Prescense", ""); -// TCHAR *tmp2 = mir_a2t(tmp); -// mir_free(tmp); - cmd.push_back(toUTF16(hcontact_data[hContact].key_in_prescense)); -// mir_free(tmp2); - gpg_execution_params params(cmd); - pxResult result; - params.out = &out; - params.code = &code; - params.result = &result; - gpg_launcher(params); - MessageBoxA(0, out.c_str(), "GPG output", MB_OK); - } - break; - default: + HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE; + + switch (msg) { + case WM_INITDIALOG: + { + hContact = new_key_hcnt; + new_key_hcnt_mutex.unlock(); + SetWindowPos(hwndDlg, 0 , import_key_rect.left, import_key_rect.top, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW); + TranslateDialogDefault(hwndDlg); + ComboBoxAddStringUtf(GetDlgItem(hwndDlg, IDC_KEYSERVER), _T("subkeys.pgp.net"), 0); + ComboBoxAddStringUtf(GetDlgItem(hwndDlg, IDC_KEYSERVER), _T("keys.gnupg.net"), 0); + } + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDC_IMPORT: + { + string out; + DWORD code; + std::vector<wstring> cmd; + cmd.push_back(L"--keyserver"); + TCHAR *server= new TCHAR [128]; + GetDlgItemText(hwndDlg, IDC_KEYSERVER, server, 128); + cmd.push_back(server); + delete [] server; + cmd.push_back(L"--recv-keys"); + cmd.push_back(toUTF16(hcontact_data[hContact].key_in_prescense)); + gpg_execution_params params(cmd); + pxResult result; + params.out = &out; + params.code = &code; + params.result = &result; + gpg_launcher(params); + MessageBoxA(0, out.c_str(), "GPG output", MB_OK); + } + break; + } break; - } - break; - } - - case WM_NOTIFY: - { -/* switch (((LPNMHDR)lParam)->code) - { - default: - break; - } */ - } - break; - case WM_CLOSE: - DestroyWindow(hwndDlg); - break; - case WM_DESTROY: - { - GetWindowRect(hwndDlg, &import_key_rect); - db_set_dw(NULL, szGPGModuleName, "ImportKeyWindowX", import_key_rect.left); - db_set_dw(NULL, szGPGModuleName, "ImportKeyWindowY", import_key_rect.top); - } - break; - } - return FALSE; -} + case WM_CLOSE: + DestroyWindow(hwndDlg); + break; + case WM_DESTROY: + GetWindowRect(hwndDlg, &import_key_rect); + db_set_dw(NULL, szGPGModuleName, "ImportKeyWindowX", import_key_rect.left); + db_set_dw(NULL, szGPGModuleName, "ImportKeyWindowY", import_key_rect.top); + break; + } + return FALSE; +} extern HINSTANCE hInst; @@ -2315,10 +2274,7 @@ void InitCheck() void ImportKey() { - extern wstring new_key; - extern HANDLE new_key_hcnt; - extern boost::mutex new_key_hcnt_mutex; - HANDLE hContact = new_key_hcnt; + HCONTACT hContact = new_key_hcnt; new_key_hcnt_mutex.unlock(); bool for_all_sub = false; if(metaIsProtoMetaContacts(hContact)) @@ -2326,13 +2282,12 @@ void ImportKey() for_all_sub = true; if(metaIsProtoMetaContacts(hContact)) { - HANDLE hcnt = NULL; if(for_all_sub) { int count = metaGetContactsNum(hContact); for(int i = 0; i < count; i++) { - hcnt = metaGetSubcontact(hContact, i); + HCONTACT hcnt = metaGetSubcontact(hContact, i); if(hcnt) db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", new_key.c_str()); } @@ -2381,13 +2336,12 @@ void ImportKey() { if(metaIsProtoMetaContacts(hContact)) { - HANDLE hcnt = NULL; if(for_all_sub) { int count = metaGetContactsNum(hContact); for(int i = 0; i < count; i++) { - hcnt = metaGetSubcontact(hContact, i); + HCONTACT hcnt = metaGetSubcontact(hContact, i); if(hcnt) { char *tmp = NULL; diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index cff898dae5..b9deb63655 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -18,14 +18,14 @@ wstring new_key; -HANDLE new_key_hcnt = NULL; +HCONTACT new_key_hcnt = NULL; boost::mutex new_key_hcnt_mutex; bool _terminate = false; -int returnNoError(HANDLE hContact); +int returnNoError(HCONTACT hContact); std::list<HANDLE> sent_msgs; -void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, DWORD timestamp) +void RecvMsgSvc_func(HCONTACT hContact, std::wstring str, char *msg, DWORD flags, DWORD timestamp) { DWORD dbflags = DBEF_UTF; { //check for gpg related data @@ -35,9 +35,6 @@ void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, s2 = str.find(_T("-----END PGP MESSAGE-----")); if((s2 != wstring::npos) && (s1 != wstring::npos)) { //this is generic encrypted data block - void setSrmmIcon(HANDLE); - void setClistIcon(HANDLE); - bool isContactHaveKey(HANDLE hContact); if(!isContactSecured(hContact)) { if(bDebugLog) @@ -47,8 +44,6 @@ void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, if(!isContactHaveKey(hContact)) { void ShowLoadPublicKeyDialog(); - extern map<int, HANDLE> user_data; - extern int item_num; item_num = 0; //black magic here user_data[1] = hContact; ShowLoadPublicKeyDialog(); @@ -601,11 +596,11 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) } if(!strstr(msg, "-----BEGIN PGP MESSAGE-----")) return CallService(MS_PROTO_CHAINRECV, w, l); - boost::thread *thr = new boost::thread(boost::bind(RecvMsgSvc_func, ccs->hContact, str, msg, ccs->wParam, pre->timestamp)); + boost::thread *thr = new boost::thread(boost::bind(RecvMsgSvc_func, ccs->hContact, str, msg, (DWORD)ccs->wParam, pre->timestamp)); return 0; } -void SendMsgSvc_func(HANDLE hContact, char *msg, DWORD flags) +void SendMsgSvc_func(HCONTACT hContact, char *msg, DWORD flags) { bool isansi = false; DWORD dbflags = 0; @@ -845,7 +840,7 @@ int HookSendMsg(WPARAM w, LPARAM l) DBEVENTINFO * dbei = (DBEVENTINFO*)l; if(dbei->eventType != EVENTTYPE_MESSAGE) return 0; - HANDLE hContact = (HANDLE)w; + HCONTACT hContact = (HCONTACT)w; if(dbei->flags & DBEF_SENT) { if(isContactSecured(hContact) && strstr((char*)dbei->pBlob, "-----BEGIN PGP MESSAGE-----")) //our service data, can be double added by metacontacts e.t.c. @@ -872,7 +867,6 @@ int HookSendMsg(WPARAM w, LPARAM l) { if(bDebugLog) debuglog<<std::string(time_str()+": info: checking for autoexchange possibility, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR))); - void send_encrypted_msgs_thread(HANDLE hContact); LPSTR proto = GetContactProto(hContact); DWORD uin = db_get_dw(hContact, proto, "UIN", 0); if(uin) @@ -994,7 +988,7 @@ int HookSendMsg(WPARAM w, LPARAM l) debuglog<<std::string(time_str()+": event message: \""+(char*)dbei->pBlob+"\" passed event filter, contact "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR))+" is unsecured"); return 0; } - if(!(dbei->flags & DBEF_SENT) && metaIsProtoMetaContacts((HANDLE)w)) + if(!(dbei->flags & DBEF_SENT) && metaIsProtoMetaContacts((HCONTACT)w)) { char tmp[29]; strncpy(tmp, (char*)dbei->pBlob, 27); @@ -1013,94 +1007,77 @@ int HookSendMsg(WPARAM w, LPARAM l) static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { char *inkeyid = NULL; - switch (msg) - { - case WM_INITDIALOG: - { - inkeyid = UniGetContactSettingUtf(new_key_hcnt, szGPGModuleName, "InKeyID", ""); - new_key_hcnt_mutex.unlock(); - TCHAR *tmp = NULL; + switch (msg) + { + case WM_INITDIALOG: + { + inkeyid = UniGetContactSettingUtf(new_key_hcnt, szGPGModuleName, "InKeyID", ""); + new_key_hcnt_mutex.unlock(); + TCHAR *tmp = NULL; - SetWindowPos(hwndDlg, 0, key_password_rect.left, key_password_rect.top, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW); - TranslateDialogDefault(hwndDlg); - string questionstr = "Please enter password for key with ID: "; - questionstr += inkeyid; - mir_free(inkeyid); - SetDlgItemTextA(hwndDlg, IDC_KEYID, questionstr.c_str()); - EnableWindow(GetDlgItem(hwndDlg, IDC_DEFAULT_PASSWORD), 0); - return TRUE; - } - - - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - case IDOK: - { - TCHAR tmp[64]; - GetDlgItemText(hwndDlg, IDC_KEY_PASSWORD, tmp, 64); - if(tmp[0]) + SetWindowPos(hwndDlg, 0, key_password_rect.left, key_password_rect.top, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW); + TranslateDialogDefault(hwndDlg); + string questionstr = "Please enter password for key with ID: "; + questionstr += inkeyid; + mir_free(inkeyid); + SetDlgItemTextA(hwndDlg, IDC_KEYID, questionstr.c_str()); + EnableWindow(GetDlgItem(hwndDlg, IDC_DEFAULT_PASSWORD), 0); + return TRUE; + } + + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: { - extern TCHAR *password; - if(IsDlgButtonChecked(hwndDlg, IDC_SAVE_PASSWORD)) + TCHAR tmp[64]; + GetDlgItemText(hwndDlg, IDC_KEY_PASSWORD, tmp, 64); + if(tmp[0]) { - if(inkeyid && inkeyid[0] && !IsDlgButtonChecked(hwndDlg, IDC_DEFAULT_PASSWORD)) + extern TCHAR *password; + if(IsDlgButtonChecked(hwndDlg, IDC_SAVE_PASSWORD)) { - string dbsetting = "szKey_"; - dbsetting += inkeyid; - dbsetting += "_Password"; - db_set_ts(NULL, szGPGModuleName, dbsetting.c_str(), tmp); + if(inkeyid && inkeyid[0] && !IsDlgButtonChecked(hwndDlg, IDC_DEFAULT_PASSWORD)) + { + string dbsetting = "szKey_"; + dbsetting += inkeyid; + dbsetting += "_Password"; + db_set_ts(NULL, szGPGModuleName, dbsetting.c_str(), tmp); + } + else + db_set_ts(NULL, szGPGModuleName, "szKeyPassword", tmp); } - else - db_set_ts(NULL, szGPGModuleName, "szKeyPassword", tmp); + if(password) + mir_free(password); + password = (TCHAR*)mir_alloc(sizeof(TCHAR)*(_tcslen(tmp)+1)); + _tcscpy(password, tmp); } - if(password) - mir_free(password); - password = (TCHAR*)mir_alloc(sizeof(TCHAR)*(_tcslen(tmp)+1)); - _tcscpy(password, tmp); + mir_free(tmp); + mir_free(inkeyid); + DestroyWindow(hwndDlg); } - mir_free(tmp); + break; + + case IDCANCEL: mir_free(inkeyid); + _terminate = true; DestroyWindow(hwndDlg); - break; - } - case IDCANCEL: - mir_free(inkeyid); - _terminate = true; - DestroyWindow(hwndDlg); - break; - default: + break; + } break; - } - - break; - } - - case WM_NOTIFY: - { -/* switch (((LPNMHDR)lParam)->code) - { - default: - EnableWindow(GetDlgItem(hwndDlg, IDC_DEFAULT_PASSWORD), IsDlgButtonChecked(hwndDlg, IDC_SAVE_PASSWORD)?1:0); - break; - }*/ - } - break; - case WM_CLOSE: - mir_free(inkeyid); - DestroyWindow(hwndDlg); - break; - case WM_DESTROY: - { - GetWindowRect(hwndDlg, &key_password_rect); - db_set_dw(NULL, szGPGModuleName, "PasswordWindowX", key_password_rect.left); - db_set_dw(NULL, szGPGModuleName, "PasswordWindowY", key_password_rect.top); - } - break; - } - return FALSE; + case WM_CLOSE: + mir_free(inkeyid); + DestroyWindow(hwndDlg); + break; + + case WM_DESTROY: + GetWindowRect(hwndDlg, &key_password_rect); + db_set_dw(NULL, szGPGModuleName, "PasswordWindowX", key_password_rect.left); + db_set_dw(NULL, szGPGModuleName, "PasswordWindowY", key_password_rect.top); + break; + } + return FALSE; } void ShowLoadKeyPasswordWindow() diff --git a/plugins/New_GPG/src/metacontacts.cpp b/plugins/New_GPG/src/metacontacts.cpp index b466cc65f0..dcf7667f4f 100644 --- a/plugins/New_GPG/src/metacontacts.cpp +++ b/plugins/New_GPG/src/metacontacts.cpp @@ -18,69 +18,65 @@ extern bool bMetaContacts;
-bool metaIsProtoMetaContacts(HANDLE hContact)
+bool metaIsProtoMetaContacts(HCONTACT hContact)
{
- if(bMetaContacts) {
- LPSTR proto = GetContactProto(hContact);
- if( proto && strcmp(proto,"MetaContacts")==0 ) {
- return true;
- }
- }
- return false;
+ if(bMetaContacts) {
+ LPSTR proto = GetContactProto(hContact);
+ if( proto && strcmp(proto,"MetaContacts")==0 ) {
+ return true;
+ }
+ }
+ return false;
}
-bool metaIsDefaultSubContact(HANDLE hContact)
+bool metaIsDefaultSubContact(HCONTACT hContact)
{
- if(bMetaContacts)
+ if(bMetaContacts)
return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0)==hContact;
- return false;
+ return false;
}
-HANDLE metaGetContact(HANDLE hContact)
+HCONTACT metaGetContact(HCONTACT hContact)
{
- if(bMetaContacts)
+ if(bMetaContacts)
if(metaIsSubcontact(hContact))
- return (HANDLE)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0);
- return NULL;
+ return (HCONTACT)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0);
+ return NULL;
}
-bool metaIsSubcontact(HANDLE hContact)
+bool metaIsSubcontact(HCONTACT hContact)
{
if(bMetaContacts)
return CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0) != 0;
- return false;
+ return false;
}
-HANDLE metaGetMostOnline(HANDLE hContact)
+HCONTACT metaGetMostOnline(HCONTACT hContact)
{
-
- if(bMetaContacts)
+ if(bMetaContacts)
if(metaIsProtoMetaContacts(hContact))
- return (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hContact,0);
- return NULL;
+ return (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hContact,0);
+ return NULL;
}
-HANDLE metaGetDefault(HANDLE hContact)
+HCONTACT metaGetDefault(HCONTACT hContact)
{
-
- if(bMetaContacts)
+ if(bMetaContacts)
if(metaIsProtoMetaContacts(hContact))
- return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)hContact,0);
- return NULL;
+ return (HCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)hContact,0);
+ return NULL;
}
-DWORD metaGetContactsNum(HANDLE hContact)
+DWORD metaGetContactsNum(HCONTACT hContact)
{
if(bMetaContacts)
return CallService(MS_MC_GETNUMCONTACTS, (WPARAM)hContact, 0);
return 0;
}
-HANDLE metaGetSubcontact(HANDLE hContact, int num)
+HCONTACT metaGetSubcontact(HCONTACT hContact, int num)
{
if(bMetaContacts)
- return (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, (LPARAM)num);
+ return (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, (LPARAM)num);
return 0;
}
-
-
diff --git a/plugins/New_GPG/src/metacontacts.h b/plugins/New_GPG/src/metacontacts.h index 8b8873edcc..9dba2943c0 100644 --- a/plugins/New_GPG/src/metacontacts.h +++ b/plugins/New_GPG/src/metacontacts.h @@ -14,11 +14,11 @@ // along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-bool metaIsProtoMetaContacts(HANDLE hContact);
-bool metaIsDefaultSubContact(HANDLE hContact) ;
-HANDLE metaGetContact(HANDLE hContact);
-bool metaIsSubcontact(HANDLE hContact);
-HANDLE metaGetMostOnline(HANDLE hContact);
-HANDLE metaGetDefault(HANDLE hContact);
-DWORD metaGetContactsNum(HANDLE hContact);
-HANDLE metaGetSubcontact(HANDLE hContact, int num);
\ No newline at end of file +bool metaIsProtoMetaContacts(HCONTACT hContact);
+bool metaIsDefaultSubContact(HCONTACT hContact) ;
+HCONTACT metaGetContact(HCONTACT hContact);
+bool metaIsSubcontact(HCONTACT hContact);
+HCONTACT metaGetMostOnline(HCONTACT hContact);
+HCONTACT metaGetDefault(HCONTACT hContact);
+DWORD metaGetContactsNum(HCONTACT hContact);
+HCONTACT metaGetSubcontact(HCONTACT hContact, int num);
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 8418e49bf9..75279c7e96 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -66,7 +66,7 @@ int GpgOptInit(WPARAM wParam,LPARAM lParam) return 0;
}
-map<int, HANDLE> user_data;
+map<int, HCONTACT> user_data;
int item_num = 0;
HWND hwndList_p = NULL;
@@ -120,8 +120,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP ListView_InsertColumn(hwndList, 4, &col);
ListView_SetExtendedListViewStyleEx(hwndList, 0, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
int i = 1, iRow = 0;
- bool isContactHaveKey(HANDLE);
- for(HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
+ for(HCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
if(isContactHaveKey(hContact)) {
TCHAR *name = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
item.mask = LVIF_TEXT;
@@ -193,16 +192,16 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP switch (LOWORD(wParam))
{
case IDC_DELETE_KEY_BUTTON:
- void setClistIcon(HANDLE hContact);
- void setSrmmIcon(HANDLE hContact);
+ void setClistIcon(HCONTACT hContact);
+ void setSrmmIcon(HCONTACT hContact);
{ //gpg execute block
TCHAR tmp2[MAX_PATH] = {0};
TCHAR *ptmp;
char *tmp;
bool keep = false;
bool ismetacontact = false;
- HANDLE meta = NULL;
- HANDLE hContact = user_data[item_num+1];
+ HCONTACT meta = NULL;
+ HCONTACT hContact = user_data[item_num+1];
if(metaIsProtoMetaContacts(hContact))
{
meta = hContact;
@@ -215,7 +214,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP ismetacontact = true;
}
tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", "");
- for(HANDLE hcnttmp = db_find_first(); hcnttmp != NULL; hcnttmp = db_find_next(hcnttmp)) {
+ for(HCONTACT hcnttmp = db_find_first(); hcnttmp != NULL; hcnttmp = db_find_next(hcnttmp)) {
if(hcnttmp != hContact) {
char *tmp2 = UniGetContactSettingUtf(hcnttmp, szGPGModuleName, "KeyID", "");
if(!strcmp(tmp, tmp2)) {
@@ -263,7 +262,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
if(MessageBox(0, TranslateT("Do you want to remove key from entire metacontact (all subcontacts)?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES)
{
- HANDLE hcnt = NULL;
+ HCONTACT hcnt = NULL;
int count = metaGetContactsNum(meta);
for(int i = 0; i < count; i++)
{
@@ -408,8 +407,8 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
else if(hdr->hdr.code == LVN_ITEMCHANGED)
{
- void setClistIcon(HANDLE hContact);
- void setSrmmIcon(HANDLE hContact);
+ void setClistIcon(HCONTACT hContact);
+ void setSrmmIcon(HCONTACT hContact);
if(ListView_GetCheckState(hwndList, item_num))
db_set_b(user_data[item_num+1], szGPGModuleName, "GPGEncryption", 1);
else
@@ -424,18 +423,18 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case PSN_APPLY:
{
extern bool bJabberAPI, bFileTransfers;
- bDebugLog = CheckStateStoreDB(hwndDlg, IDC_DEBUG_LOG, "bDebugLog");
+ bDebugLog = CheckStateStoreDB(hwndDlg, IDC_DEBUG_LOG, "bDebugLog") != 0;
if(bDebugLog)
debuglog.init();
- bJabberAPI = CheckStateStoreDB(hwndDlg, IDC_JABBER_API, "bJabberAPI");
- bool old_bFileTransfers = db_get_b(NULL, szGPGModuleName, "bFileTransfers", 0);
- bFileTransfers = CheckStateStoreDB(hwndDlg, IDC_FILE_TRANSFERS, "bFileTransfers");
+ bJabberAPI = CheckStateStoreDB(hwndDlg, IDC_JABBER_API, "bJabberAPI") != 0;
+ bool old_bFileTransfers = db_get_b(NULL, szGPGModuleName, "bFileTransfers", 0) != 0;
+ bFileTransfers = CheckStateStoreDB(hwndDlg, IDC_FILE_TRANSFERS, "bFileTransfers") != 0;
if(bFileTransfers != old_bFileTransfers)
{
db_set_b(NULL, szGPGModuleName, "bSameAction", 0);
bSameAction = false;
}
- bAutoExchange = CheckStateStoreDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange");
+ bAutoExchange = CheckStateStoreDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange") != 0;
{
TCHAR tmp[512];
GetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, tmp, 512);
@@ -630,8 +629,8 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case PSN_APPLY:
{
- bAppendTags = CheckStateStoreDB(hwndDlg, IDC_APPEND_TAGS, "bAppendTags");
- bStripTags = CheckStateStoreDB(hwndDlg, IDC_STRIP_TAGS, "bStripTags");
+ bAppendTags = CheckStateStoreDB(hwndDlg, IDC_APPEND_TAGS, "bAppendTags") != 0;
+ bStripTags = CheckStateStoreDB(hwndDlg, IDC_STRIP_TAGS, "bStripTags") != 0;
{
TCHAR tmp[128];
GetDlgItemText(hwndDlg, IDC_IN_OPEN_TAG, tmp, 128);
@@ -666,58 +665,43 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, static INT_PTR CALLBACK DlgProcGpgAdvOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
- {
+ switch (msg) {
+ case WM_INITDIALOG:
extern bool bJabberAPI;
TranslateDialogDefault(hwndDlg);
CheckStateLoadDB(hwndDlg, IDC_PRESCENSE_SUBSCRIPTION, "bPresenceSigning", 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_PRESCENSE_SUBSCRIPTION), bJabberAPI);
- return TRUE;
- }
-
-
- case WM_COMMAND:
- {
- switch (LOWORD(wParam))
- {
- case IDC_EXPORT:
- {
- INT_PTR ExportGpGKeys(WPARAM w, LPARAM l);
- ExportGpGKeys(NULL, NULL);
- }
- break;
- case IDC_IMPORT:
- {
- INT_PTR ImportGpGKeys(WPARAM w, LPARAM l);
- ImportGpGKeys(NULL, NULL);
- }
- break;
- default:
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_EXPORT:
+ {
+ INT_PTR ExportGpGKeys(WPARAM w, LPARAM l);
+ ExportGpGKeys(NULL, NULL);
+ }
+ break;
+ case IDC_IMPORT:
+ {
+ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l);
+ ImportGpGKeys(NULL, NULL);
+ }
+ break;
+ }
+
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- }
-
- case WM_NOTIFY:
- {
- switch (((LPNMHDR)lParam)->code)
- {
-
- case PSN_APPLY:
- {
- bPresenceSigning = CheckStateStoreDB(hwndDlg, IDC_PRESCENSE_SUBSCRIPTION, "bPresenceSigning");
- return TRUE;
- }
- }
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ bPresenceSigning = CheckStateStoreDB(hwndDlg, IDC_PRESCENSE_SUBSCRIPTION, "bPresenceSigning") != 0;
+ return TRUE;
+ }
+ break;
}
- break;
- }
- return FALSE;
+ return FALSE;
}
HWND hPubKeyEdit = NULL;
@@ -735,7 +719,7 @@ static LRESULT CALLBACK editctrl_ctrl_a(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
{
- static HANDLE hContact;
+ static HCONTACT hContact;
TCHAR *tmp = NULL;
wstring key_buf;
wstring::size_type ws1 = 0, ws2 = 0;
@@ -745,7 +729,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam hContact = user_data[1];
SetWindowPos(hwndDlg, 0, load_key_rect.left, load_key_rect.top, 0, 0, SWP_NOSIZE|SWP_SHOWWINDOW);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_PUBLIC_KEY_EDIT), editctrl_ctrl_a);
- HANDLE hcnt = hContact;
+ HCONTACT hcnt = hContact;
if(metaIsProtoMetaContacts(hcnt))
hcnt = metaGetMostOnline(hcnt);
TranslateDialogDefault(hwndDlg);
@@ -894,14 +878,13 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam {
if(metaIsProtoMetaContacts(hContact))
{
- HANDLE hcnt = NULL;
if(MessageBox(0, TranslateT("Do you want to load key for all subcontacts?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES)
{
allsubcontacts = true;
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- hcnt = metaGetSubcontact(hContact, i);
+ HCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1,ws2-ws1).c_str());
}
@@ -921,7 +904,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam string output;
DWORD exitcode;
{
- HANDLE hcnt = hContact;
+ HCONTACT hcnt = hContact;
if(metaIsProtoMetaContacts(hcnt))
hcnt = metaGetMostOnline(hcnt);
ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
@@ -960,22 +943,19 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam {
if(metaIsProtoMetaContacts(hContact))
{
- HANDLE hcnt = NULL;
if(allsubcontacts)
{
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- hcnt = metaGetSubcontact(hContact, i);
+ HCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_unset(hcnt, szGPGModuleName, "bAlwatsTrust");
}
}
- else
- db_unset(metaGetMostOnline(hContact), szGPGModuleName, "bAlwatsTrust");
+ else db_unset(metaGetMostOnline(hContact), szGPGModuleName, "bAlwatsTrust");
}
- else
- db_unset(hContact, szGPGModuleName, "bAlwatsTrust");
+ else db_unset(hContact, szGPGModuleName, "bAlwatsTrust");
}
{
TCHAR *tmp;
@@ -994,13 +974,12 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam {
if(metaIsProtoMetaContacts(hContact))
{
- HANDLE hcnt = NULL;
if(allsubcontacts)
{
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- hcnt = metaGetSubcontact(hContact, i);
+ HCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyID", tmp2);
}
@@ -1044,13 +1023,12 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam {
if(metaIsProtoMetaContacts(hContact))
{
- HANDLE hcnt = NULL;
if(allsubcontacts)
{
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- hcnt = metaGetSubcontact(hContact, i);
+ HCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str());
}
@@ -1082,13 +1060,12 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam {
if(metaIsProtoMetaContacts(hContact))
{
- HANDLE hcnt = NULL;
if(allsubcontacts)
{
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- hcnt = metaGetSubcontact(hContact, i);
+ HCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str());
}
@@ -1109,22 +1086,19 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam {
if(metaIsProtoMetaContacts(hContact))
{
- HANDLE hcnt = NULL;
if(allsubcontacts)
{
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- hcnt = metaGetSubcontact(hContact, i);
+ HCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str());
}
}
- else
- db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str());
+ else db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str());
}
- else
- db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str());
+ else db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str());
}
mir_free(tmp2);
tmp = mir_wstrdup(toUTF16(output.substr(s,s2-s)).c_str());
@@ -1141,22 +1115,19 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam {
if(metaIsProtoMetaContacts(hContact))
{
- HANDLE hcnt = NULL;
if(allsubcontacts)
{
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- hcnt = metaGetSubcontact(hContact, i);
+ HCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
}
}
- else
- db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
+ else db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
}
- else
- db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
+ else db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
}
mir_free(tmp2);
tmp = mir_wstrdup(toUTF16(output.substr(s2,s-s2)).c_str());
@@ -1217,13 +1188,12 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam {
if(metaIsProtoMetaContacts(hContact))
{
- HANDLE hcnt = NULL;
if(allsubcontacts)
{
int count = metaGetContactsNum(hContact);
for(int i = 0; i < count; i++)
{
- hcnt = metaGetSubcontact(hContact, i);
+ HCONTACT hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
{
if(!isContactSecured(hcnt))
@@ -1299,8 +1269,6 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam }
break;
case IDC_IMPORT:
- extern HANDLE new_key_hcnt;
- extern boost::mutex new_key_hcnt_mutex;
new_key_hcnt_mutex.lock();
new_key_hcnt = hContact;
void ShowImportKeyDialog();
diff --git a/plugins/New_GPG/src/srmm.cpp b/plugins/New_GPG/src/srmm.cpp index 85e149214e..542312213d 100644 --- a/plugins/New_GPG/src/srmm.cpp +++ b/plugins/New_GPG/src/srmm.cpp @@ -18,8 +18,8 @@ #include "commonheaders.h"
-void ShowStatusIcon(HANDLE hContact);
-void setSrmmIcon(HANDLE hContact);
+void ShowStatusIcon(HCONTACT hContact);
+void setSrmmIcon(HCONTACT hContact);
int __cdecl onWindowEvent(WPARAM wParam, LPARAM lParam) {
@@ -32,9 +32,10 @@ int __cdecl onWindowEvent(WPARAM wParam, LPARAM lParam) { }
-int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) {
- HANDLE hContact = (HANDLE)wParam;
- HANDLE hMeta = NULL;
+int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam)
+{
+ HCONTACT hContact = (HCONTACT)wParam;
+ HCONTACT hMeta = NULL;
if(metaIsProtoMetaContacts(hContact))
{
hMeta = hContact;
@@ -46,9 +47,6 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) { if(strcmp(sicd->szModule, szGPGModuleName))
return 0; // not our event
- void setSrmmIcon(HANDLE);
- void setClistIcon(HANDLE);
- bool isContactHaveKey(HANDLE hContact);
BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0);
if(enc)
{
@@ -62,8 +60,6 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) { if(!isContactHaveKey(hContact))
{
void ShowLoadPublicKeyDialog();
- extern map<int, HANDLE> user_data;
- extern int item_num;
item_num = 0; //black magic here
user_data[1] = hContact;
ShowLoadPublicKeyDialog();
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index bd2e4ec45e..d1122dca94 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -18,7 +18,7 @@ #include "commonheaders.h" -TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,const char* szSetting, TCHAR* szDef) +TCHAR* __stdcall UniGetContactSettingUtf(HCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef) { DBVARIANT dbv = {DBVT_DELETED}; TCHAR* szRes = NULL; @@ -33,7 +33,7 @@ TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,c return szRes; } -char* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,const char* szSetting, char* szDef) +char* __stdcall UniGetContactSettingUtf(HCONTACT hContact, const char *szModule,const char* szSetting, char* szDef) { DBVARIANT dbv = {DBVT_DELETED}; char* szRes = NULL; @@ -138,15 +138,14 @@ void GetFolderPath(TCHAR *WindowTittle, char *szSetting) INT_PTR LoadKey(WPARAM w, LPARAM l) { void ShowLoadPublicKeyDialog(); - extern map<int, HANDLE> user_data; - user_data[1] = (HANDLE)w; + user_data[1] = (HCONTACT)w; ShowLoadPublicKeyDialog(); return 0; } INT_PTR SendKey(WPARAM w, LPARAM l) { - HANDLE hContact = (HANDLE)w; + HCONTACT hContact = (HCONTACT)w; if(metaIsProtoMetaContacts(hContact)) hContact = metaGetMostOnline(hContact); char *szMessage; @@ -202,7 +201,7 @@ extern HGENMENU hToggleEncryption, hSendKey; INT_PTR ToggleEncryption(WPARAM w, LPARAM l) { - HANDLE hContact = (HANDLE)w; + HCONTACT hContact = (HCONTACT)w; BYTE enc = 0; if(metaIsProtoMetaContacts(hContact)) enc = db_get_b(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 0); @@ -210,13 +209,12 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l) enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); if(metaIsProtoMetaContacts(hContact)) { - HANDLE hcnt = NULL; if(MessageBox(0, TranslateT("Do you want to toggle encryption for all subcontacts?"), TranslateT("Metacontact detected"), MB_YESNO) == IDYES) { int count = metaGetContactsNum(hContact); for(int i = 0; i < count; i++) { - hcnt = metaGetSubcontact(hContact, i); + HCONTACT hcnt = metaGetSubcontact(hContact, i); if(hcnt) db_set_b(hcnt, szGPGModuleName, "GPGEncryption", enc?0:1); } @@ -225,8 +223,8 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l) } else db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc?0:1); - void setSrmmIcon(HANDLE hContact); - void setClistIcon(HANDLE hContact); + void setSrmmIcon(HCONTACT hContact); + void setClistIcon(HCONTACT hContact); setSrmmIcon(hContact); setClistIcon(hContact); enc = enc?0:1; @@ -239,7 +237,7 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l) int OnPreBuildContactMenu(WPARAM w, LPARAM l) { - HANDLE hContact = (HANDLE)w; + HCONTACT hContact = (HCONTACT)w; if(metaIsProtoMetaContacts(hContact)) hContact = metaGetMostOnline(hContact); @@ -396,9 +394,6 @@ int onProtoAck(WPARAM w, LPARAM l) return 0; while(out.find("public key decryption failed: bad passphrase") != string::npos) { - extern bool _terminate; - extern HANDLE new_key_hcnt; - extern boost::mutex new_key_hcnt_mutex; if(bDebugLog) debuglog<<std::string(time_str()+": info: failed to decrypt messaage from "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ack->hContact, GCDNF_TCHAR))+" password needed, trying to get one"); if(_terminate) @@ -478,12 +473,12 @@ int onProtoAck(WPARAM w, LPARAM l) return 0; } -std::wstring encrypt_file(HANDLE hContact, TCHAR *filename) +std::wstring encrypt_file(HCONTACT hContact, TCHAR *filename) { string out; DWORD code; pxResult result; - HANDLE hcnt = metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact; + HCONTACT hcnt = metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact; std::vector<wstring> cmd; cmd.push_back(L"--batch"); cmd.push_back(L"--tes"); @@ -643,7 +638,7 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) } -void HistoryLog(HANDLE hContact, db_event evt) +void HistoryLog(HCONTACT hContact, db_event evt) { DBEVENTINFO Event = { sizeof(Event) }; Event.szModule = szGPGModuleName; @@ -724,7 +719,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU LPCTSTR attr = xi.getAttrValue(local_node, _T("to")); if(attr) { - HANDLE hContact = ji->ContactFromJID(attr); + HCONTACT hContact = ji->ContactFromJID(attr); if(hContact) if(!isContactSecured(hContact)) return FALSE; @@ -1014,7 +1009,7 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi string::size_type p2 = out.find("\n", p1); if(p1 != string::npos && p2 != string::npos) { - HANDLE hContact = NULL; + HCONTACT hContact = NULL; { extern list <JabberAccount*> Accounts; list <JabberAccount*>::iterator p = Accounts.begin(); @@ -1075,7 +1070,7 @@ void AddHandlers() } } -bool isContactSecured(HANDLE hContact) +bool isContactSecured(HCONTACT hContact) { BYTE gpg_enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); if(!gpg_enc) @@ -1101,7 +1096,7 @@ bool isContactSecured(HANDLE hContact) return true; } -bool isContactHaveKey(HANDLE hContact) +bool isContactHaveKey(HCONTACT hContact) { TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); if(_tcslen(key) > 0) @@ -1220,7 +1215,7 @@ const bool StriStr(const char *str, const char *substr) return i; } -bool IsOnline(HANDLE hContact) +bool IsOnline(HCONTACT hContact) { if(db_get_b(hContact, szGPGModuleName, "Status", 0) == ID_STATUS_OFFLINE) return false; @@ -1231,34 +1226,34 @@ bool IsOnline(HANDLE hContact) #include <process.h> struct TFakeAckParams { - inline TFakeAckParams( HANDLE p1, HANDLE p2, LONG p3, LPCSTR p4 ) : + inline TFakeAckParams( HANDLE p1, HCONTACT p2, LONG p3, LPCSTR p4 ) : hEvent( p1 ), hContact( p2 ), id( p3 ), msg( p4 ) {} - HANDLE hEvent; - HANDLE hContact; - LONG id; - LPCSTR msg; + HANDLE hEvent; + HCONTACT hContact; + LONG id; + LPCSTR msg; }; -__forceinline int SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam) +__forceinline int SendBroadcast(HCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam) { return ProtoBroadcastAck( GetContactProto(hContact), hContact, type, result, hProcess, lParam); } -unsigned __stdcall sttFakeAck( LPVOID param ) { - +unsigned __stdcall sttFakeAck( LPVOID param ) +{ TFakeAckParams* tParam = ( TFakeAckParams* )param; WaitForSingleObject( tParam->hEvent, INFINITE ); Sleep( 100 ); if ( tParam->msg == NULL ) - SendBroadcast( tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, ( HANDLE )tParam->id, 0 ); + SendBroadcast(tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)tParam->id, 0 ); else - SendBroadcast( tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, ( HANDLE )tParam->id, LPARAM( tParam->msg )); + SendBroadcast(tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)tParam->id, LPARAM(tParam->msg)); CloseHandle( tParam->hEvent ); delete tParam; @@ -1267,7 +1262,7 @@ unsigned __stdcall sttFakeAck( LPVOID param ) { } -int returnNoError(HANDLE hContact) { +int returnNoError(HCONTACT hContact) { HANDLE hEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); unsigned int tID; CloseHandle( (HANDLE) _beginthreadex(NULL, 0, sttFakeAck, new TFakeAckParams(hEvent,hContact,777,0), 0, &tID) ); @@ -1323,8 +1318,9 @@ string get_random(int length) return data; } -void send_encrypted_msgs_thread(HANDLE hContact) +void send_encrypted_msgs_thread(void *param) { + HCONTACT hContact = (HCONTACT)param; while(true) { //char *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", ""); @@ -1398,7 +1394,7 @@ void ExportGpGKeysFunc(int type) if(!file.is_open()) return; //TODO: handle error if(!type || type == 2) { - for(HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { + for(HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { char *k = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", ""); std::string key; if(!k[0]) @@ -1685,7 +1681,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) if(acc.length()) { const char * uid = (const char*)CallProtoService(acc.c_str(), PS_GETCAPS, (WPARAM)PFLAG_UNIQUEIDSETTING, 0); - for(HANDLE hContact = db_find_first(acc.c_str()); hContact; hContact = db_find_next(hContact, acc.c_str())) { + for(HCONTACT hContact = db_find_first(acc.c_str()); hContact; hContact = db_find_next(hContact, acc.c_str())) { DBVARIANT dbv = {0}; db_get(hContact, acc.c_str(), uid, &dbv); std::string id; diff --git a/plugins/New_GPG/src/utilities.h b/plugins/New_GPG/src/utilities.h index ef3fbced23..3b884a3846 100644 --- a/plugins/New_GPG/src/utilities.h +++ b/plugins/New_GPG/src/utilities.h @@ -16,17 +16,22 @@ #ifndef UTILITIES_H
#define UTILITIES_H
-TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,const char* szSetting, TCHAR* szDef);
-char* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,const char* szSetting, char* szDef);
+TCHAR* __stdcall UniGetContactSettingUtf(HCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef);
+char* __stdcall UniGetContactSettingUtf(HCONTACT hContact, const char *szModule,const char* szSetting, char* szDef);
void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szExtDesc);
TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool save_file = false);
void GetFolderPath(TCHAR *WindowTittle, char *szSetting);
void storeOutput(HANDLE ahandle, string *output);
+void setSrmmIcon(HCONTACT);
+void setClistIcon(HCONTACT);
+
+void send_encrypted_msgs_thread(void*); +
int ComboBoxAddStringUtf(HWND hCombo, const TCHAR *szString, DWORD data);
-bool isContactSecured(HANDLE hContact);
-bool isContactHaveKey(HANDLE hContact);
+bool isContactSecured(HCONTACT hContact);
+bool isContactHaveKey(HCONTACT hContact);
bool isTabsrmmUsed();
bool isGPGKeyExist();
bool isGPGValid();
@@ -99,7 +104,7 @@ public: cbSize = 0;
}
};
-void HistoryLog(HANDLE, db_event);
+void HistoryLog(HCONTACT, db_event);
void fix_line_term(std::string &s);
void fix_line_term(std::wstring &s);
void strip_line_term(std::wstring &s);
diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp index ce45f95cff..baacf5ac69 100644 --- a/plugins/NewsAggregator/Src/Authentication.cpp +++ b/plugins/NewsAggregator/Src/Authentication.cpp @@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA. #include "common.h"
-void CreateAuthString(char *auth, HANDLE hContact, HWND hwndDlg)
+void CreateAuthString(char *auth, HCONTACT hContact, HWND hwndDlg)
{
DBVARIANT dbv;
char *user = NULL, *pass = NULL;
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index eef9ba2b79..18a42881ef 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -77,7 +77,7 @@ TCHAR * CheckFeed(TCHAR *tszURL, HWND hwndDlg) return NULL;
}
-VOID CheckCurrentFeed(HANDLE hContact)
+VOID CheckCurrentFeed(HCONTACT hContact)
{
char *szData = NULL;
DBVARIANT dbURL = {0};
@@ -599,7 +599,7 @@ VOID CheckCurrentFeed(HANDLE hContact) }
}
-VOID CheckCurrentFeedAvatar(HANDLE hContact)
+VOID CheckCurrentFeedAvatar(HCONTACT hContact)
{
char *szData = NULL;
DBVARIANT dbURL = {0};
diff --git a/plugins/NewsAggregator/Src/Common.h b/plugins/NewsAggregator/Src/Common.h index ed19e6b132..50241d3234 100644 --- a/plugins/NewsAggregator/Src/Common.h +++ b/plugins/NewsAggregator/Src/Common.h @@ -62,7 +62,7 @@ extern TCHAR tszRoot[MAX_PATH]; struct ItemInfo
{
HWND hwndList;
- HANDLE hContact;
+ HCONTACT hContact;
int SelNumber;
TCHAR nick[MAX_PATH];
TCHAR url[MAX_PATH];
@@ -71,7 +71,7 @@ struct ItemInfo //============ STRUCT USED TO MAKE AN UPDATE LIST ============
struct NEWSCONTACTLIST {
- HANDLE hContact;
+ HCONTACT hContact;
struct NEWSCONTACTLIST *next;
};
@@ -80,7 +80,7 @@ typedef struct NEWSCONTACTLIST UPDATELIST; extern UPDATELIST *UpdateListHead;
extern UPDATELIST *UpdateListTail;
-void UpdateListAdd(HANDLE hContact);
+void UpdateListAdd(HCONTACT hContact);
void UpdateThreadProc(LPVOID AvatarCheck);
void DestroyUpdateList(void);
@@ -119,26 +119,26 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP VOID CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
VOID CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
-BOOL IsMyContact(HANDLE hContact);
-VOID GetNewsData(TCHAR *szUrl, char** szData, HANDLE hContact, HWND hwndDlg);
+BOOL IsMyContact(HCONTACT hContact);
+VOID GetNewsData(TCHAR *szUrl, char** szData, HCONTACT hContact, HWND hwndDlg);
VOID CreateList(HWND hwndList);
VOID UpdateList(HWND hwndList);
VOID DeleteAllItems(HWND hwndList);
time_t __stdcall DateToUnixTime(TCHAR *stamp, BOOL FeedType);
-VOID CheckCurrentFeed(HANDLE hContact);
-VOID CheckCurrentFeedAvatar(HANDLE hContact);
+VOID CheckCurrentFeed(HCONTACT hContact);
+VOID CheckCurrentFeedAvatar(HCONTACT hContact);
TCHAR* CheckFeed(TCHAR* tszURL, HWND hwndDlg);
void UpdateMenu(BOOL State);
int ImportFeedsDialog();
VOID ClearText(TCHAR *&message);
BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal);
int StrReplace(TCHAR *lpszOld, TCHAR *lpszNew, TCHAR *&lpszStr);
-void CreateAuthString(char *auth, HANDLE hContact, HWND hwndDlg);
+void CreateAuthString(char *auth, HCONTACT hContact, HWND hwndDlg);
INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-HANDLE GetContactByNick(const TCHAR *nick);
-HANDLE GetContactByURL(const TCHAR *url);
+HCONTACT GetContactByNick(const TCHAR *nick);
+HCONTACT GetContactByURL(const TCHAR *url);
// =============== NewsAggregator SERVICES ================
// Check all Feeds info
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index 17d16bdee0..02c84365e0 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -148,7 +148,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM isGroupUTF = 1;
}
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)MODULE);
db_set_ts(hContact, MODULE, "Nick", title);
db_set_ts(hContact, MODULE, "URL", url);
@@ -468,7 +468,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
Utils_RestoreWindowPositionNoSize(hwndDlg, NULL, MODULE, "ExportDlg");
- for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
DBVARIANT dbVar = {0};
if (!db_get_ts(hContact, MODULE, "Nick", &dbVar)) {
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)dbVar.ptszVal);
@@ -516,7 +516,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM for (int i = 0; i < count; i++) {
TCHAR item[MAX_PATH];
SendMessage(FeedsExportList, LB_GETTEXT, i, (LPARAM)item);
- HANDLE hContact = GetContactByNick(item);
+ HCONTACT hContact = GetContactByNick(item);
TCHAR *title = NULL, *url = NULL, *siteurl = NULL, *group = NULL;
DBVARIANT dbv = {0};
if (!db_get_ts(hContact, MODULE, "Nick", &dbv)) {
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index db787541dd..52dc11f066 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -57,7 +57,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break;
}
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)MODULE);
GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, SIZEOF(str));
db_set_ts(hContact, MODULE, "Nick", str);
@@ -154,7 +154,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_CHECKTIME, EM_LIMITTEXT, 3, 0);
SendDlgItemMessage(hwndDlg, IDC_TIMEOUT_VALUE_SPIN, UDM_SETRANGE32, 0, 999);
- HANDLE hContact;
+ HCONTACT hContact;
for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
ptrT dbNick( db_get_tsa(hContact, MODULE, "Nick"));
if (dbNick == NULL)
@@ -305,7 +305,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case WM_DESTROY:
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
Utils_SaveWindowPosition(hwndDlg, hContact, MODULE, "ChangeDlg");
WindowList_Remove(hChangeFeedDlgList, hwndDlg);
ItemInfo *SelItem = (ItemInfo *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
@@ -325,7 +325,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetWindowText(hwndDlg, TranslateT("Change Feed"));
SendDlgItemMessage(hwndDlg, IDC_CHECKTIME, UDM_SETRANGE32, 0, 999);
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
WindowList_Add(hChangeFeedDlgList, hwndDlg, hContact);
Utils_RestoreWindowPositionNoSize(hwndDlg, hContact, MODULE, "ChangeDlg");
DBVARIANT dbv;
@@ -361,7 +361,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP switch (LOWORD(wParam)) {
case IDOK:
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
TCHAR str[MAX_PATH];
char passw[MAX_PATH];
if (!GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, SIZEOF(str))) {
@@ -460,7 +460,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case WM_DESTROY:
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
Utils_SaveWindowPosition(hwndDlg, hContact, MODULE, "ChangeDlg");
WindowList_Remove(hChangeFeedDlgList, hwndDlg);
}
@@ -505,7 +505,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ListView_GetItemText(hwndList, sel, 0, nick, MAX_PATH);
ListView_GetItemText(hwndList, sel, 1, url, MAX_PATH);
- for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
ptrT dbNick( db_get_tsa(hContact, MODULE, "Nick"));
if (dbNick == NULL)
break;
@@ -547,7 +547,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA {
db_set_b(NULL, MODULE, "StartupRetrieve", IsDlgButtonChecked(hwndDlg, IDC_STARTUPRETRIEVE));
int i = 0;
- for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
db_set_b(hContact, MODULE, "CheckState", ListView_GetCheckState(hwndList, i));
if (!ListView_GetCheckState(hwndList, i))
db_set_b(hContact, "CList", "Hidden", 1);
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index 7e18296860..ee03c41900 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -23,7 +23,7 @@ int g_nStatus = ID_STATUS_ONLINE; UINT_PTR timerId = 0;
HANDLE hTBButton = NULL, hNewsAggregatorFolder = NULL;
-void SetContactStatus(HANDLE hContact, int nNewStatus)
+void SetContactStatus(HCONTACT hContact, int nNewStatus)
{
if(db_get_w(hContact, MODULE, "Status", ID_STATUS_ONLINE) != nNewStatus)
db_set_w(hContact, MODULE, "Status", nNewStatus);
@@ -33,7 +33,7 @@ static void __cdecl WorkingThread(void* param) {
int nStatus = (int)param;
- for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE))
+ for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE))
SetContactStatus(hContact, nStatus);
}
@@ -51,7 +51,7 @@ int NewsAggrInit(WPARAM wParam, LPARAM lParam) else
lstrcpyn(tszRoot, VARST( _T("%miranda_userdata%\\Avatars\\"_T(DEFAULT_AVATARS_FOLDER))), SIZEOF(tszRoot));
- for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1))
db_set_dw(hContact, MODULE, "LastCheck", time(NULL));
SetContactStatus(hContact, ID_STATUS_ONLINE);
@@ -136,10 +136,10 @@ INT_PTR NewsAggrLoadIcon(WPARAM wParam, LPARAM lParam) return (LOWORD(wParam) == PLI_PROTOCOL) ? (INT_PTR)CopyIcon(LoadIconEx("main", FALSE)) : 0;
}
-static void __cdecl AckThreadProc(HANDLE param)
+static void __cdecl AckThreadProc(void *param)
{
Sleep(100);
- ProtoBroadcastAck(MODULE, param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ ProtoBroadcastAck(MODULE, (HCONTACT)param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
INT_PTR NewsAggrGetInfo(WPARAM wParam, LPARAM lParam)
@@ -151,7 +151,7 @@ INT_PTR NewsAggrGetInfo(WPARAM wParam, LPARAM lParam) INT_PTR CheckAllFeeds(WPARAM wParam, LPARAM lParam)
{
- for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
if (lParam && db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME))
UpdateListAdd(hContact);
else if (!lParam)
@@ -172,7 +172,7 @@ INT_PTR AddFeed(WPARAM wParam, LPARAM lParam) INT_PTR ChangeFeed(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HWND hChangeFeedDlg = WindowList_Find(hChangeFeedDlgList, hContact);
if (!hChangeFeedDlg) {
hChangeFeedDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDFEED), NULL, DlgProcChangeFeedMenu, (LPARAM)hContact);
@@ -198,7 +198,7 @@ INT_PTR ExportFeeds(WPARAM wParam, LPARAM lParam) INT_PTR CheckFeed(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if(IsMyContact(hContact))
UpdateListAdd(hContact);
if ( !ThreadRunning)
diff --git a/plugins/NewsAggregator/Src/Update.cpp b/plugins/NewsAggregator/Src/Update.cpp index c104a7d949..be1d71be92 100644 --- a/plugins/NewsAggregator/Src/Update.cpp +++ b/plugins/NewsAggregator/Src/Update.cpp @@ -30,7 +30,7 @@ VOID CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) // only run if it is not current updating and the auto update option is enabled
if (!ThreadRunning && !Miranda_Terminated()) {
BOOL HaveUpdates = FALSE;
- for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
if (db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME)) {
double diff = difftime(time(NULL), db_get_dw(hContact, MODULE, "LastCheck", 0));
if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && diff >= db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME) * 60) {
@@ -58,7 +58,7 @@ VOID CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) }
}
-void UpdateListAdd(HANDLE hContact)
+void UpdateListAdd(HCONTACT hContact)
{
UPDATELIST *newItem = (UPDATELIST*)mir_alloc(sizeof(UPDATELIST));
newItem->hContact = hContact;
@@ -74,9 +74,9 @@ void UpdateListAdd(HANDLE hContact) ReleaseMutex(hUpdateMutex);
}
-HANDLE UpdateGetFirst()
+HCONTACT UpdateGetFirst()
{
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
WaitForSingleObject(hUpdateMutex, INFINITE);
@@ -123,11 +123,12 @@ void UpdateThreadProc(LPVOID AvatarCheck) ReleaseMutex(hUpdateMutex);
// update news by getting the first station from the queue until the queue is empty
- while (UpdateListHead != NULL && !Miranda_Terminated())
+ while (UpdateListHead != NULL && !Miranda_Terminated()) {
if ((BOOL)AvatarCheck)
CheckCurrentFeedAvatar(UpdateGetFirst());
else
CheckCurrentFeed(UpdateGetFirst());
+ }
// exit the update thread
ThreadRunning = FALSE;
diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index ff794bd369..c361b08485 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -22,7 +22,7 @@ Boston, MA 02111-1307, USA. HANDLE hNetlibUser = NULL, hNetlibHttp;
BOOL UpdateListFlag = FALSE;
-BOOL IsMyContact(HANDLE hContact)
+BOOL IsMyContact(HCONTACT hContact)
{
const char *szProto = GetContactProto(hContact);
return szProto != NULL && strcmp(MODULE, szProto) == 0;
@@ -58,7 +58,7 @@ static void arrayToHex(BYTE *data, size_t datasz, char *res) *resptr = '\0';
}
-VOID GetNewsData(TCHAR *tszUrl, char **szData, HANDLE hContact, HWND hwndDlg)
+VOID GetNewsData(TCHAR *tszUrl, char **szData, HCONTACT hContact, HWND hwndDlg)
{
NETLIBHTTPREQUEST nlhr = {0};
@@ -155,7 +155,7 @@ VOID UpdateList(HWND hwndList) // Initialize LVITEM members that are common to all
// items.
int i = 0;
- for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ for (HCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
UpdateListFlag = TRUE;
lvI.mask = LVIF_TEXT;
lvI.iSubItem = 0;
@@ -562,9 +562,9 @@ VOID ClearText(TCHAR *&message) CoUninitialize();
}
-HANDLE GetContactByNick(const TCHAR *nick)
+HCONTACT GetContactByNick(const TCHAR *nick)
{
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
ptrW contactNick(::db_get_wsa(hContact, MODULE, "Nick"));
@@ -574,9 +574,9 @@ HANDLE GetContactByNick(const TCHAR *nick) return hContact;
}
-HANDLE GetContactByURL(const TCHAR *url)
+HCONTACT GetContactByURL(const TCHAR *url)
{
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
ptrW contactURL(::db_get_wsa(hContact, MODULE, "URL"));
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index 22c6dde6e6..49c30e0f5a 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -4,7 +4,7 @@ HINSTANCE hInst; int hLangpack = 0;
// add icon to srmm status icons
-static void SrmmMenu_UpdateIcon(HANDLE hContact);
+static void SrmmMenu_UpdateIcon(HCONTACT hContact);
static int SrmmMenu_ProcessEvent(WPARAM wParam, LPARAM lParam);
static int SrmmMenu_ProcessIconClick(WPARAM wParam, LPARAM lParam);
@@ -20,7 +20,8 @@ CRITICAL_SECTION list_cs; // a list of db events - we'll check them for the 'read' flag periodically and delete them whwen marked as read
struct EventListNode {
- HANDLE hContact, hDBEvent;
+ HCONTACT hContact;
+ HANDLE hDBEvent;
EventListNode *next;
};
@@ -53,7 +54,7 @@ extern "C" __declspec (dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirand return &pluginInfo;
}
-void RemoveReadEvents(HANDLE hContact = 0)
+void RemoveReadEvents(HCONTACT hContact = 0)
{
DBEVENTINFO info = { sizeof(info) };
bool remove;
@@ -96,7 +97,7 @@ void RemoveReadEvents(HANDLE hContact = 0) LeaveCriticalSection(&list_cs);
}
-void RemoveAllEvents(HANDLE hContact)
+void RemoveAllEvents(HCONTACT hContact)
{
HANDLE hDBEvent = db_event_first(hContact);
while(hDBEvent) {
@@ -113,7 +114,8 @@ void CALLBACK TimerProc(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) int OnDatabaseEventAdd(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam, hDBEvent = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)wParam;
+ HANDLE hDBEvent = (HANDLE)lParam;
// history not disabled for this contact
if (db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) == 0)
@@ -139,7 +141,7 @@ int OnDatabaseEventAdd(WPARAM wParam, LPARAM lParam) INT_PTR ServiceClear(WPARAM wParam, LPARAM lParam)
{
if (MessageBox(0, TranslateT("This operation will PERMANENTLY REMOVE all history for this contact.\nAre you sure you want to do this?"), TranslateT("Clear History"), MB_YESNO | MB_ICONWARNING) == IDYES) {
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
RemoveAllEvents(hContact);
}
@@ -148,7 +150,7 @@ INT_PTR ServiceClear(WPARAM wParam, LPARAM lParam) int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
bool remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0;
char *proto = GetContactProto(hContact);
@@ -170,7 +172,7 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) INT_PTR ServiceToggle(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
int remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0;
remove = !remove;
@@ -190,7 +192,7 @@ INT_PTR ServiceToggle(WPARAM wParam, LPARAM lParam) int WindowEvent(WPARAM wParam, LPARAM lParam)
{
MessageWindowEventData *mwd = (MessageWindowEventData *)lParam;
- HANDLE hContact = mwd->hContact;
+ HCONTACT hContact = mwd->hContact;
switch(mwd->uType) {
case MSG_WINDOW_EVT_CLOSE:
@@ -216,7 +218,7 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) int IconPressed(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
if (sicd->cbSize < (int)sizeof(StatusIconClickData))
return 0;
diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp index ea790bd978..14fa6d0d10 100644 --- a/plugins/NoHistory/src/options.cpp +++ b/plugins/NoHistory/src/options.cpp @@ -84,7 +84,7 @@ static void ResetListOptions(HWND hwndList) static void SetAllContactIcons(HWND hwndList)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
@@ -198,7 +198,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
diff --git a/plugins/Non-IM Contact/src/commonheaders.h b/plugins/Non-IM Contact/src/commonheaders.h index ca593df8ab..f40bdb8649 100644 --- a/plugins/Non-IM Contact/src/commonheaders.h +++ b/plugins/Non-IM Contact/src/commonheaders.h @@ -101,13 +101,13 @@ INT_PTR exportContacts(WPARAM wParam,LPARAM lParam) ; INT_PTR CALLBACK DlgProcContactInfo(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-void ExportContact(HANDLE hContact);
+void ExportContact(HCONTACT hContact);
INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam);
// stringreplacer.c
-int stringReplacer(const char* oldString, char* newString, HANDLE hContact);
-void replaceAllStrings(HANDLE hContact);
-void WriteSetting(HANDLE hContact, char* module1, char* setting1 , char* module12, char* setting2);
+int stringReplacer(const char* oldString, char* newString, HCONTACT hContact);
+void replaceAllStrings(HCONTACT hContact);
+void WriteSetting(HCONTACT hContact, char* module1, char* setting1 , char* module12, char* setting2);
//timer.c
extern UINT_PTR timerId;
@@ -122,7 +122,7 @@ extern char *szInfo; extern char *szData;
extern HANDLE hNetlibUser;
-int db_get_static(HANDLE hContact, const char *moduleName, const char *fn, char *buf);
+int db_get_static(HCONTACT hContact, const char *moduleName, const char *fn, char *buf);
#endif
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index abb04ea98b..19f58a58d6 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -5,7 +5,7 @@ INT_PTR CALLBACK DlgProcContactInfo(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l switch(msg) {
case WM_INITDIALOG:
{
- HANDLE hContact = (HANDLE)((PROPSHEETPAGE*)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((PROPSHEETPAGE*)lParam)->lParam;
char name[2048];
TranslateDialogDefault(hwnd);
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)(HANDLE)hContact);
@@ -26,7 +26,7 @@ INT_PTR CALLBACK DlgProcContactInfo(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (GetWindowTextLength(GetDlgItem(hwnd,IDC_DISPLAY_NAME))) {
char text[512];
GetDlgItemTextA(hwnd,IDC_DISPLAY_NAME,text,sizeof(text));
@@ -112,7 +112,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP switch(msg) {
case WM_INITDIALOG:
{
- HANDLE hContact = (HANDLE)((PROPSHEETPAGE*)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((PROPSHEETPAGE*)lParam)->lParam;
TranslateDialogDefault(hwnd);
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)hContact);
if (!hContact)
@@ -180,7 +180,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP switch(LOWORD(wParam)) {
case IDC_ALWAYS_VISIBLE:
if (IsDlgButtonChecked(hwnd, IDC_ALWAYS_VISIBLE)) {
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
EnableWindow(GetDlgItem(hwnd, IDC_VISIBLE_UNLESS_OFFLINE),1);
CheckDlgButton(hwnd, IDC_VISIBLE_UNLESS_OFFLINE, db_get_b(hContact, MODNAME ,"VisibleUnlessOffline", 1));
}
@@ -189,7 +189,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case CHK_USE_TIMER:
if (IsDlgButtonChecked(hwnd, CHK_USE_TIMER)) {
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
char string[4];
EnableWindow(GetDlgItem(hwnd, IDC_TIMER), 1);
SetDlgItemTextA(hwnd, IDC_TIMER, _itoa(db_get_w(hContact, MODNAME ,"Timer", 15), string, 10));
@@ -223,7 +223,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
int status = GetLCStatus(0,0);
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (GetWindowTextLength(GetDlgItem(hwnd,IDC_LINK))) {
char text[512];
@@ -304,9 +304,9 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) switch(msg) {
case WM_INITDIALOG:
{
- HANDLE hContact = (HANDLE)((PROPSHEETPAGE*)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((PROPSHEETPAGE*)lParam)->lParam;
TranslateDialogDefault(hwnd);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)(HANDLE)hContact);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LPARAM)hContact);
}
return TRUE;
@@ -314,7 +314,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
switch(LOWORD(wParam)) {
case IDC_EXPORT:
- ExportContact((HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA));
+ ExportContact((HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA));
break;
case IDC_DOIT:
@@ -324,7 +324,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) char dbVar1[2000], dbVar2[2000];
int i=0,j=0, k=0;
char *string = oldString[k];
- HANDLE hContact1 = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA), hContact2;
+ HCONTACT hContact1 = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA), hContact2;
GetDlgItemTextA(hwnd, IDC_STRING_REPLACE, replace, GetWindowTextLength(GetDlgItem(hwnd, IDC_STRING_REPLACE)) +1);
if (db_get_static(hContact1, MODNAME, "Name", dbVar1)) {
// get the list of replace strings
@@ -347,7 +347,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) }
i++;
}
- hContact2 =(HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact2 =(HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact2,(LPARAM)MODNAME);
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact2, IGNOREEVENT_USERONLINE);
db_set_s(hContact2, MODNAME, "Nick", Translate("New Non-IM Contact"));
@@ -401,9 +401,9 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) }
else {
char dbVar1[2000];
- HANDLE hContact1 = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA), hContact2;
+ HCONTACT hContact1 = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA), hContact2;
if (db_get_static(hContact1, MODNAME, "Name", dbVar1)) {
- if (!(hContact2 =(HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0))) {
+ if (!(hContact2 = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0))) {
msg("contact did not get created","");
return 0;
}
@@ -452,7 +452,7 @@ INT_PTR CALLBACK DlgProcCopy(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return FALSE;
}
-void ExportContact(HANDLE hContact)
+void ExportContact(HCONTACT hContact)
{
char szFileName[MAX_PATH];
char DBVar[1024];
@@ -495,7 +495,7 @@ void ExportContact(HANDLE hContact) INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
char name[256] = "", program[256] = "", programparam[256] = "", group[256] = "", tooltip[3000] = "", line[2001] = "";
int icon = 40072, usetimer = 0, minutes = 1, timer = 0;
char fn[MAX_PATH];
@@ -631,7 +631,7 @@ INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam) }
if (MessageBoxA(0,msg,modFullname,MB_YESNO) == IDYES) {
- if (!(hContact =(HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0))) {
+ if (!(hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0))) {
msg("contact did get created","");
continue;
}
diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp index eea83fd93c..6e12327403 100644 --- a/plugins/Non-IM Contact/src/dialog.cpp +++ b/plugins/Non-IM Contact/src/dialog.cpp @@ -239,7 +239,7 @@ static int CALLBACK PropSheetProc(HWND hwnd, UINT uMsg, LPARAM lParam) return 0;
}
-void DoPropertySheet(HANDLE hContact, HINSTANCE hInst)
+void DoPropertySheet(HCONTACT hContact, HINSTANCE hInst)
{
char title[256], nick[256];
PROPSHEETPAGEA psp[4] = { 0 };
@@ -307,7 +307,7 @@ void DoPropertySheet(HANDLE hContact, HINSTANCE hInst) INT_PTR addContact(WPARAM wParam,LPARAM lParam)
{
char tmp[256];
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)MODNAME);
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, IGNOREEVENT_USERONLINE);
db_set_ts(hContact, MODNAME, "Nick", TranslateT("New Non-IM Contact"));
@@ -320,10 +320,10 @@ INT_PTR addContact(WPARAM wParam,LPARAM lParam) INT_PTR editContact(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
char tmp[256];
if (!hContact) {
- hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)MODNAME);
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, IGNOREEVENT_USERONLINE);
db_set_s(hContact, MODNAME, "Nick", Translate("New Non-IM Contact"));
diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp index 70db1be310..81f4dc3ca6 100644 --- a/plugins/Non-IM Contact/src/files.cpp +++ b/plugins/Non-IM Contact/src/files.cpp @@ -14,7 +14,7 @@ INT_PTR exportContacts(WPARAM wParam,LPARAM lParam) if (!file)
return 0;
- for (HANDLE hContact = db_find_first(MODNAME); hContact; hContact = db_find_next(hContact, MODNAME)) {
+ for (HCONTACT hContact = db_find_first(MODNAME); hContact; hContact = db_find_next(hContact, MODNAME)) {
int tmp;
char DBVar[1024];
if (db_get_static(hContact, MODNAME, "Name", DBVar)) {
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp index 912f9c08ab..3aecdbb073 100644 --- a/plugins/Non-IM Contact/src/main.cpp +++ b/plugins/Non-IM Contact/src/main.cpp @@ -28,13 +28,13 @@ INT_PTR doubleClick(WPARAM wParam,LPARAM lParam) {
char program[MAX_PATH], params[MAX_PATH];
int shellEXEerror = 0;
- char* proto = GetContactProto((HANDLE)wParam);
+ char* proto = GetContactProto((HCONTACT)wParam);
if (proto && !strcmp(proto, MODNAME)) {
if (GetKeyState(VK_CONTROL)&0x8000) // ctrl is pressed
editContact((WPARAM)(HANDLE)wParam, (LPARAM)NULL); // for later when i add a second double click setting
- else if (db_get_static((HANDLE)wParam, MODNAME, "Program", program) && strcmp(program, ""))
+ else if (db_get_static((HCONTACT)wParam, MODNAME, "Program", program) && strcmp(program, ""))
{
- if (!db_get_static((HANDLE)wParam, MODNAME, "ProgramParams", params) )
+ if (!db_get_static((HCONTACT)wParam, MODNAME, "ProgramParams", params) )
strcpy(params, "");
if (strstr(program, "http://") || strstr(program, "https://"))
CallService(MS_UTILS_OPENURL,1,(LPARAM)program);
diff --git a/plugins/Non-IM Contact/src/namereplacing.cpp b/plugins/Non-IM Contact/src/namereplacing.cpp index ad0748ffbe..428e4a912b 100644 --- a/plugins/Non-IM Contact/src/namereplacing.cpp +++ b/plugins/Non-IM Contact/src/namereplacing.cpp @@ -232,7 +232,7 @@ void checkStringForcompare(char *str) }
// do save("A","B") A is DBVar name, B is value
-void checkStringForSave(HANDLE hContact, char* str)
+void checkStringForSave(HCONTACT hContact, char* str)
{
char *A,*B,*newStr = (char*)malloc(strlen(str)),*copyOfStr = _strdup(str);
unsigned int i, j=0, s = (int)strlen(str);
@@ -258,7 +258,7 @@ void checkStringForSave(HANDLE hContact, char* str) }
// do load("A") A is DBVar name
-void checkStringForLoad(HANDLE hContact, char* str)
+void checkStringForLoad(HCONTACT hContact, char* str)
{
char *A,*newStr = (char*)malloc(strlen(str)),*copyOfStr = _strdup(str);
unsigned int i, j=0, s = (int)strlen(str);
@@ -432,7 +432,7 @@ int lastChecked(char *newStr, const char *str) // do icon(x) 0=offline, 1=online, 10=lunch
-void checkIcon(HANDLE hContact, char* string)
+void checkIcon(HCONTACT hContact, char* string)
{
char* str = strstr(string,"icon(");
if (str) {
@@ -442,7 +442,7 @@ void checkIcon(HANDLE hContact, char* string) }
}
-int stringReplacer(const char* oldString, char* newString, HANDLE hContact)
+int stringReplacer(const char* oldString, char* newString, HCONTACT hContact)
{
char var_file[8];
int tempInt;
@@ -602,7 +602,7 @@ void stripWhiteSpace(char* string) i++;
}
}
-void WriteSetting(HANDLE hContact, char* module1, char* setting1 , char* module2, char* setting2)
+void WriteSetting(HCONTACT hContact, char* module1, char* setting1 , char* module2, char* setting2)
{
char text[MAX_STRING_LENGTH], newString[MAX_STRING_LENGTH];
int error = 0, status = GetLCStatus(0,0);
@@ -641,7 +641,7 @@ void WriteSetting(HANDLE hContact, char* module1, char* setting1 , char* module2 else db_set_w(hContact, MODNAME, "Status", ID_STATUS_OFFLINE);
}
-void replaceAllStrings(HANDLE hContact)
+void replaceAllStrings(HCONTACT hContact)
{
char tmp1[256], tmp2[256], tmp3[256];
WriteSetting(hContact, MODNAME, "Name", MODNAME, "Nick");
diff --git a/plugins/Non-IM Contact/src/services.cpp b/plugins/Non-IM Contact/src/services.cpp index b81372adb9..4cfb8138df 100644 --- a/plugins/Non-IM Contact/src/services.cpp +++ b/plugins/Non-IM Contact/src/services.cpp @@ -3,7 +3,7 @@ //=======================================================
//db_get_static
//=======================================================
-int db_get_static(HANDLE hContact, const char *szModule, const char *szSetting, char *value)
+int db_get_static(HCONTACT hContact, const char *szModule, const char *szSetting, char *value)
{
DBVARIANT dbv;
if (!db_get(hContact, szModule, szSetting, &dbv))
@@ -79,7 +79,7 @@ int SetLCStatus(WPARAM wParam,LPARAM lParam) else if (db_get_w(NULL, MODNAME, "Timer",1))
startTimer(TIMER);
- for (HANDLE hContact = db_find_first(MODNAME); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(MODNAME); hContact; hContact = db_find_next(hContact)) {
char *proto = GetContactProto(hContact);
if (proto == NULL || strcmp(proto, MODNAME))
continue;
diff --git a/plugins/Non-IM Contact/src/timer.cpp b/plugins/Non-IM Contact/src/timer.cpp index 68d91c7c3d..5b2af5798b 100644 --- a/plugins/Non-IM Contact/src/timer.cpp +++ b/plugins/Non-IM Contact/src/timer.cpp @@ -40,7 +40,7 @@ void timerFunc(LPVOID di) }
/* update all the contacts */
- for (HANDLE hContact = db_find_first(MODNAME); hContact; hContact = db_find_next(hContact, MODNAME)) {
+ for (HCONTACT hContact = db_find_first(MODNAME); hContact; hContact = db_find_next(hContact, MODNAME)) {
int timer = db_get_w(hContact, MODNAME, "Timer", 15);
if (timer && !(timerCount % timer))
if (db_get_static(hContact, MODNAME, "Name", text))
diff --git a/plugins/NotesAndReminders/src/miscutils.cpp b/plugins/NotesAndReminders/src/miscutils.cpp index 71dc3644dd..3212495f2f 100644 --- a/plugins/NotesAndReminders/src/miscutils.cpp +++ b/plugins/NotesAndReminders/src/miscutils.cpp @@ -27,7 +27,7 @@ void FreeSettingBlob(WORD pSize,void *pbBlob) db_free(&dbv);
}
-void ReadSettingBlob(HANDLE hContact, char *ModuleName, char *SettingName, WORD *pSize, void **pbBlob)
+void ReadSettingBlob(HCONTACT hContact, char *ModuleName, char *SettingName, WORD *pSize, void **pbBlob)
{
DBVARIANT dbv = {0};
dbv.type = DBVT_BLOB;
@@ -41,12 +41,12 @@ void ReadSettingBlob(HANDLE hContact, char *ModuleName, char *SettingName, WORD }
}
-void WriteSettingIntArray(HANDLE hContact,char *ModuleName,char *SettingName,const int *Value, int Size)
+void WriteSettingIntArray(HCONTACT hContact,char *ModuleName,char *SettingName,const int *Value, int Size)
{
db_set_blob(hContact, ModuleName, SettingName, (void*)Value, sizeof(int)*Size);
}
-bool ReadSettingIntArray(HANDLE hContact,char *ModuleName,char *SettingName,int *Value, int Size)
+bool ReadSettingIntArray(HCONTACT hContact,char *ModuleName,char *SettingName,int *Value, int Size)
{
WORD sz = 4096;
int *pData;
diff --git a/plugins/NotesAndReminders/src/miscutils.h b/plugins/NotesAndReminders/src/miscutils.h index 2b7c779b9e..e1fb803c0e 100644 --- a/plugins/NotesAndReminders/src/miscutils.h +++ b/plugins/NotesAndReminders/src/miscutils.h @@ -1,13 +1,13 @@ -void ReadSettingBlob(HANDLE hContact, char *ModuleName,
+void ReadSettingBlob(HCONTACT hContact, char *ModuleName,
char *SettingName, WORD *pSize, void **pbBlob);
void FreeSettingBlob(WORD pSize,void * pbBlob);
-BOOL ReadSettingBool(HANDLE hContact,char *ModuleName,
+BOOL ReadSettingBool(HCONTACT hContact,char *ModuleName,
char *SettingName,BOOL Default);
-void WriteSettingBool(HANDLE hContact,char *ModuleName,
+void WriteSettingBool(HCONTACT hContact,char *ModuleName,
char *SettingName,BOOL Value);
-void WriteSettingIntArray(HANDLE hContact,char *ModuleName,
+void WriteSettingIntArray(HCONTACT hContact,char *ModuleName,
char *SettingName,const int *Value, int Size);
-bool ReadSettingIntArray(HANDLE hContact,char *ModuleName,
+bool ReadSettingIntArray(HCONTACT hContact,char *ModuleName,
char *SettingName,int *Value, int Size);
WORD ConvertHotKeyToControl(WORD HK);
diff --git a/plugins/Nudge/src/headers.h b/plugins/Nudge/src/headers.h index 451afb77f5..a481e613b4 100644 --- a/plugins/Nudge/src/headers.h +++ b/plugins/Nudge/src/headers.h @@ -66,22 +66,22 @@ int Preview(); /*
*
****************************/
-HANDLE Nudge_GethContact(HANDLE);
+HCONTACT Nudge_GethContact(HCONTACT);
/*
*
****************************/
-void Nudge_ShowPopup(CNudgeElement, HANDLE, TCHAR *);
+void Nudge_ShowPopup(CNudgeElement, HCONTACT, TCHAR *);
/*
*
****************************/
-void Nudge_ShowStatus(CNudgeElement, HANDLE, DWORD timestamp);
+void Nudge_ShowStatus(CNudgeElement, HCONTACT, DWORD timestamp);
/*
*
****************************/
-void Nudge_SentStatus(CNudgeElement, HANDLE);
+void Nudge_SentStatus(CNudgeElement, HCONTACT);
/*
*
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index d8cefa3bd2..2dffab3d52 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -41,31 +41,32 @@ INT_PTR NudgeShowMenu(WPARAM wParam,LPARAM lParam) INT_PTR NudgeSend(WPARAM wParam, LPARAM lParam)
{
- char *protoName = GetContactProto((HANDLE)wParam);
- int diff = time(NULL) - db_get_dw((HANDLE)wParam, "Nudge", "LastSent", time(NULL) - 30);
+ HCONTACT hContact = (HCONTACT)wParam;
+ char *protoName = GetContactProto(hContact);
+ int diff = time(NULL) - db_get_dw(hContact, "Nudge", "LastSent", time(NULL) - 30);
if (diff < GlobalNudge.sendTimeSec) {
TCHAR msg[500];
mir_sntprintf(msg, 500, TranslateT("You are not allowed to send too much nudge (only 1 each %d sec, %d sec left)"), GlobalNudge.sendTimeSec, 30 - diff);
if (GlobalNudge.useByProtocol) {
for (NudgeElementList *n = NudgeList; n != NULL; n = n->next)
if (!strcmp(protoName, n->item.ProtocolName))
- Nudge_ShowPopup(n->item, (HANDLE)wParam, msg);
+ Nudge_ShowPopup(n->item, hContact, msg);
}
- else Nudge_ShowPopup(DefaultNudge, (HANDLE)wParam, msg);
+ else Nudge_ShowPopup(DefaultNudge, hContact, msg);
return 0;
}
- db_set_dw((HANDLE)wParam, "Nudge", "LastSent", time(NULL));
+ db_set_dw(hContact, "Nudge", "LastSent", time(NULL));
if (GlobalNudge.useByProtocol) {
for (NudgeElementList *n = NudgeList; n != NULL; n = n->next)
if (!strcmp(protoName, n->item.ProtocolName))
if (n->item.showStatus)
- Nudge_SentStatus(n->item, (HANDLE)wParam);
+ Nudge_SentStatus(n->item, hContact);
}
else if (DefaultNudge.showStatus)
- Nudge_SentStatus(DefaultNudge, (HANDLE)wParam);
+ Nudge_SentStatus(DefaultNudge, hContact);
CallProtoService(protoName, PS_SEND_NUDGE, wParam, lParam);
return 0;
@@ -80,18 +81,19 @@ void OpenContactList() int NudgeReceived(WPARAM wParam, LPARAM lParam)
{
- char *protoName = GetContactProto((HANDLE)wParam);
+ HCONTACT hContact = (HCONTACT)wParam;
+ char *protoName = GetContactProto(hContact);
DWORD currentTimestamp = time(NULL);
DWORD nudgeSentTimestamp = lParam ? (DWORD)lParam : currentTimestamp;
- int diff = currentTimestamp - db_get_dw((HANDLE)wParam, "Nudge", "LastReceived", currentTimestamp - 30);
- int diff2 = nudgeSentTimestamp - db_get_dw((HANDLE)wParam, "Nudge", "LastReceived2", nudgeSentTimestamp - 30);
+ int diff = currentTimestamp - db_get_dw(hContact, "Nudge", "LastReceived", currentTimestamp - 30);
+ int diff2 = nudgeSentTimestamp - db_get_dw(hContact, "Nudge", "LastReceived2", nudgeSentTimestamp - 30);
if (diff >= GlobalNudge.recvTimeSec)
- db_set_dw((HANDLE)wParam, "Nudge", "LastReceived", currentTimestamp);
+ db_set_dw(hContact, "Nudge", "LastReceived", currentTimestamp);
if (diff2 >= GlobalNudge.recvTimeSec)
- db_set_dw((HANDLE)wParam, "Nudge", "LastReceived2", nudgeSentTimestamp);
+ db_set_dw(hContact, "Nudge", "LastReceived2", nudgeSentTimestamp);
if (GlobalNudge.useByProtocol) {
for (NudgeElementList *n = NudgeList; n != NULL; n = n->next) {
@@ -116,7 +118,7 @@ int NudgeReceived(WPARAM wParam, LPARAM lParam) {
if (diff >= GlobalNudge.recvTimeSec) {
if (n->item.showPopup)
- Nudge_ShowPopup(n->item, (HANDLE)wParam, n->item.recText);
+ Nudge_ShowPopup(n->item, hContact, n->item.recText);
if (n->item.openContactList)
OpenContactList();
if (n->item.shakeClist)
@@ -134,7 +136,7 @@ int NudgeReceived(WPARAM wParam, LPARAM lParam) if (diff2 >= GlobalNudge.recvTimeSec)
if (n->item.showStatus)
- Nudge_ShowStatus(n->item, (HANDLE)wParam, nudgeSentTimestamp);
+ Nudge_ShowStatus(n->item, hContact, nudgeSentTimestamp);
}
break;
}
@@ -159,7 +161,7 @@ int NudgeReceived(WPARAM wParam, LPARAM lParam) {
if (diff >= GlobalNudge.recvTimeSec) {
if (DefaultNudge.showPopup)
- Nudge_ShowPopup(DefaultNudge, (HANDLE)wParam, DefaultNudge.recText);
+ Nudge_ShowPopup(DefaultNudge, hContact, DefaultNudge.recText);
if (DefaultNudge.openContactList)
OpenContactList();
if (DefaultNudge.shakeClist)
@@ -177,7 +179,7 @@ int NudgeReceived(WPARAM wParam, LPARAM lParam) if (diff2 >= GlobalNudge.recvTimeSec)
if (DefaultNudge.showStatus)
- Nudge_ShowStatus(DefaultNudge, (HANDLE)wParam, nudgeSentTimestamp);
+ Nudge_ShowStatus(DefaultNudge, hContact, nudgeSentTimestamp);
}
}
return 0;
@@ -251,7 +253,7 @@ static int TabsrmmButtonInit(WPARAM wParam, LPARAM lParam) return 0;
}
-void HideNudgeButton(HANDLE hContact)
+void HideNudgeButton(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (!ProtoServiceExists(szProto, PS_SEND_NUDGE)) {
@@ -377,7 +379,7 @@ void LoadPopupClass() int Preview()
{
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
if (GlobalNudge.useByProtocol) {
for (NudgeElementList *n = NudgeList; n != NULL; n = n->next) {
if (n->item.enabled) {
@@ -413,7 +415,7 @@ int Preview() return 0;
}
-void Nudge_ShowPopup(CNudgeElement n, HANDLE hContact, TCHAR * Message)
+void Nudge_ShowPopup(CNudgeElement n, HCONTACT hContact, TCHAR * Message)
{
hContact = Nudge_GethContact(hContact);
TCHAR * lpzContactName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
@@ -447,7 +449,7 @@ void Nudge_ShowPopup(CNudgeElement n, HANDLE hContact, TCHAR * Message) else MessageBox(NULL, Message, lpzContactName, 0);
}
-void Nudge_SentStatus(CNudgeElement n, HANDLE hContact)
+void Nudge_SentStatus(CNudgeElement n, HCONTACT hContact)
{
char *buff = mir_utf8encodeT(n.senText);
@@ -461,7 +463,7 @@ void Nudge_SentStatus(CNudgeElement n, HANDLE hContact) INT_PTR res = CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0); //try to retrieve the metacontact if some
if (res != CALLSERVICE_NOTFOUND) {
- HANDLE hMetaContact = (HANDLE)res;
+ HCONTACT hMetaContact = (HCONTACT)res;
if (hMetaContact != NULL) // metacontact
db_event_add(hMetaContact, &dbei);
}
@@ -470,7 +472,7 @@ void Nudge_SentStatus(CNudgeElement n, HANDLE hContact) mir_free(buff);
}
-void Nudge_ShowStatus(CNudgeElement n, HANDLE hContact, DWORD timestamp)
+void Nudge_ShowStatus(CNudgeElement n, HCONTACT hContact, DWORD timestamp)
{
char *buff = mir_utf8encodeT(n.recText);
@@ -484,7 +486,7 @@ void Nudge_ShowStatus(CNudgeElement n, HANDLE hContact, DWORD timestamp) INT_PTR res = CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0); //try to retrieve the metacontact if some
if (res != CALLSERVICE_NOTFOUND) {
- HANDLE hMetaContact = (HANDLE)res;
+ HCONTACT hMetaContact = (HCONTACT)res;
if (hMetaContact != NULL) { //metacontact
db_event_add(hMetaContact, &dbei);
dbei.flags |= DBEF_READ;
@@ -495,11 +497,11 @@ void Nudge_ShowStatus(CNudgeElement n, HANDLE hContact, DWORD timestamp) mir_free(buff);
}
-HANDLE Nudge_GethContact(HANDLE hContact)
+HCONTACT Nudge_GethContact(HCONTACT hContact)
{
INT_PTR res = CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
if (res != CALLSERVICE_NOTFOUND) {
- HANDLE hMetaContact = (HANDLE)res;
+ HCONTACT hMetaContact = (HCONTACT)res;
if (hMetaContact != NULL)
return hMetaContact;
}
diff --git a/plugins/Nudge/src/shake.cpp b/plugins/Nudge/src/shake.cpp index 3998327e89..f42d028aba 100644 --- a/plugins/Nudge/src/shake.cpp +++ b/plugins/Nudge/src/shake.cpp @@ -50,7 +50,7 @@ INT_PTR ShakeChat(WPARAM wParam, LPARAM lParam) MessageWindowInputData mwid;
mwd.cbSize = sizeof(MessageWindowData);
- mwd.hContact = Nudge_GethContact((HANDLE)wParam);
+ mwd.hContact = Nudge_GethContact((HCONTACT)wParam);
mwd.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
mwid.cbSize = sizeof(MessageWindowInputData);
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 50f87f2319..10fba85cac 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -94,7 +94,7 @@ std::wstring GetFile() return L"";
}
-void PasteIt(HANDLE hContact, int mode)
+void PasteIt(HCONTACT hContact, int mode)
{
PasteToWeb* pasteToWeb = pasteToWebs[Options::instance->defWeb];
if(mode == FROM_CLIPBOARD)
@@ -152,7 +152,7 @@ void PasteIt(HANDLE hContact, int mode) {
gci.iItem = i;
gci.pszModule = szProto;
- gci.Flags = BYINDEX | HCONTACT | ID;
+ gci.Flags = GCF_BYINDEX | GCF_HCONTACT | GCF_ID;
CallService(MS_GC_GETINFO, 0, (LPARAM)&gci);
if (gci.hContact == hContact)
{
@@ -212,7 +212,7 @@ void PasteIt(HANDLE hContact, int mode) int TabsrmmButtonPressed(WPARAM wParam, LPARAM lParam)
{
CustomButtonClickData *cbc = (CustomButtonClickData *)lParam;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!strcmp(cbc->pszModule, MODULE) && cbc->dwButtonId == 1 && hContact)
{
@@ -274,7 +274,7 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) {
bool bIsContact = false;
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND)
bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) != 0;
@@ -287,7 +287,7 @@ INT_PTR ContactMenuService(WPARAM wParam, LPARAM lParam) if(lParam >= DEF_PAGES_START)
Options::instance->SetDefWeb(lParam - DEF_PAGES_START);
else {
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
PasteIt(hContact, lParam);
}
return 0;
diff --git a/plugins/Popup/src/avatars.cpp b/plugins/Popup/src/avatars.cpp index e7d90a396f..79dd9d2b38 100644 --- a/plugins/Popup/src/avatars.cpp +++ b/plugins/Popup/src/avatars.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "headers.h"
-PopupAvatar *PopupAvatar::create(HANDLE hContact)
+PopupAvatar *PopupAvatar::create(HCONTACT hContact)
{
if (hContact)
{
diff --git a/plugins/Popup/src/avatars.h b/plugins/Popup/src/avatars.h index 3b44fab739..369940611f 100644 --- a/plugins/Popup/src/avatars.h +++ b/plugins/Popup/src/avatars.h @@ -31,7 +31,7 @@ protected: bool bIsAnimated, bIsValid;
public:
- PopupAvatar(HANDLE hContact) {}
+ PopupAvatar(HANDLE h) {}
virtual ~PopupAvatar() {}
virtual int activeFrameDelay() = 0;
virtual void draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *options) = 0;
@@ -42,7 +42,7 @@ public: inline int getWidth() { return width; }
inline int getHeight() { return height; }
- static PopupAvatar *create(HANDLE hContact);
+ static PopupAvatar *create(HCONTACT hContact);
};
#endif // __avatars_h__
diff --git a/plugins/Popup/src/avatars_flash.h b/plugins/Popup/src/avatars_flash.h index cc9d49c707..a01919f242 100644 --- a/plugins/Popup/src/avatars_flash.h +++ b/plugins/Popup/src/avatars_flash.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class FlashAvatar: public PopupAvatar
{
public:
- FlashAvatar(HANDLE hContact);
+ FlashAvatar(HCONTACT hContact);
virtual ~FlashAvatar();
virtual int activeFrameDelay() = 0;
virtual void draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *options) = 0;
diff --git a/plugins/Popup/src/avatars_gif.cpp b/plugins/Popup/src/avatars_gif.cpp index 0641c94a57..5526f9cef3 100644 --- a/plugins/Popup/src/avatars_gif.cpp +++ b/plugins/Popup/src/avatars_gif.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "headers.h"
-GifAvatar::GifAvatar(HANDLE hContact): PopupAvatar(hContact)
+GifAvatar::GifAvatar(HCONTACT hContact): PopupAvatar(hContact)
{
av = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
bIsAnimated = true;
diff --git a/plugins/Popup/src/avatars_gif.h b/plugins/Popup/src/avatars_gif.h index 14bf35b45e..51d6a6a7a0 100644 --- a/plugins/Popup/src/avatars_gif.h +++ b/plugins/Popup/src/avatars_gif.h @@ -37,7 +37,7 @@ protected: SIZE frameSize;
public:
- GifAvatar(HANDLE hContact);
+ GifAvatar(HCONTACT hContact);
virtual ~GifAvatar();
virtual int activeFrameDelay();
virtual void draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *options);
diff --git a/plugins/Popup/src/avatars_simple.cpp b/plugins/Popup/src/avatars_simple.cpp index 8852d008cf..86c9b6dd15 100644 --- a/plugins/Popup/src/avatars_simple.cpp +++ b/plugins/Popup/src/avatars_simple.cpp @@ -23,7 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "headers.h"
-SimpleAvatar::SimpleAvatar(HANDLE hContact, bool bUseBitmap): PopupAvatar(bUseBitmap ? 0 : hContact)
+SimpleAvatar::SimpleAvatar(HANDLE h, bool bUseBitmap) :
+ PopupAvatar((bUseBitmap) ? 0 : h)
{
bIsAnimated = false;
bIsValid = true;
@@ -31,7 +32,7 @@ SimpleAvatar::SimpleAvatar(HANDLE hContact, bool bUseBitmap): PopupAvatar(bUseBi if (bUseBitmap)
{
BITMAP bmp;
- GetObject((HBITMAP)hContact, sizeof(bmp), &bmp);
+ GetObject((HBITMAP)h, sizeof(bmp), &bmp);
width = abs(bmp.bmWidth);
height = abs(bmp.bmHeight);
@@ -39,15 +40,15 @@ SimpleAvatar::SimpleAvatar(HANDLE hContact, bool bUseBitmap): PopupAvatar(bUseBi av = new avatarCacheEntry;
av->bmHeight = abs(bmp.bmHeight);
av->bmWidth = abs(bmp.bmWidth);
- av->hbmPic = (HBITMAP)hContact;
+ av->hbmPic = (HBITMAP)h;
av->dwFlags = AVS_BITMAP_VALID;
return;
}
- if (hContact && ServiceExists(MS_AV_GETAVATARBITMAP))
+ if (h && ServiceExists(MS_AV_GETAVATARBITMAP))
{
avNeedFree = false;
- av = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
+ av = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)h, 0);
if (av)
{
if (av->hbmPic && (av->dwFlags&AVS_BITMAP_VALID) && !(av->dwFlags&AVS_HIDEONCLIST) && !(av->dwFlags&AVS_NOTREADY))
diff --git a/plugins/Popup/src/avatars_simple.h b/plugins/Popup/src/avatars_simple.h index a919d168d9..25ae0e702a 100644 --- a/plugins/Popup/src/avatars_simple.h +++ b/plugins/Popup/src/avatars_simple.h @@ -31,7 +31,7 @@ private: bool avNeedFree;
public:
- SimpleAvatar(HANDLE hContact, bool bUseBitmap = false);
+ SimpleAvatar(HANDLE h, bool bUseBitmap = false);
virtual ~SimpleAvatar();
virtual int activeFrameDelay();
virtual void draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *options);
diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index 5700f7f55f..11bf939fd4 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -51,7 +51,7 @@ inline int Byte2Percentile(int vByte) { return (vByte*100)/255; } inline int Percentile2Byte(int vPerc) { return (vPerc*255)/100; }
//===== Strings & MirandaDB ==================
-inline char *db_get_s(HANDLE hContact, const char *ModuleName, const char *SettingName, const char *Default)
+inline char *db_get_s(HCONTACT hContact, const char *ModuleName, const char *SettingName, const char *Default)
{
DBVARIANT dbv;
db_get(hContact, ModuleName, SettingName, &dbv);
@@ -66,7 +66,7 @@ inline char *db_get_s(HANDLE hContact, const char *ModuleName, const char *Setti return result;
}
-inline INT_PTR DBGetContactSettingStringX(HANDLE hContact, const char *ModuleName, const char *SettingName, const char *Default, const int retType)
+inline INT_PTR DBGetContactSettingStringX(HCONTACT hContact, const char *ModuleName, const char *SettingName, const char *Default, const int retType)
{
INT_PTR ret = NULL;
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp index da4b535f21..5e7f3494e7 100644 --- a/plugins/Popup/src/opt_contacts.cpp +++ b/plugins/Popup/src/opt_contacts.cpp @@ -85,7 +85,7 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
HWND hwndList = GetDlgItem(hwnd, IDC_LIST);
- 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)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
for (int i=0; i < 4 /*SIZEOF(sttIcons)*/; ++i) {
if (SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0))) {
@@ -117,7 +117,7 @@ static void sttResetListOptions(HWND hwndList) static void sttSetAllContactIcons(HWND hwndList)
{
- 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)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
DWORD dwMode = db_get_b(hContact, MODULNAME, "ShowMode", 0);
for (int i=0; i < 4 /*SIZEOF(sttIcons)*/; ++i)
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index f6d493138d..5f0f2e65f3 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -744,7 +744,7 @@ void PopupWnd2::setIcon(HICON hNewIcon) void PopupWnd2::updateData(POPUPDATAW_V2 *ppd)
{
- m_hContact = ppd->lchContact;
+ m_hContact = ppd->lchContact;
m_clBack = ppd->colorBack;
m_clClock = m_clTitle = m_clText = ppd->colorText;
@@ -774,11 +774,11 @@ void PopupWnd2::updateData(POPUPDATAW_V2 *ppd) void PopupWnd2::updateData(POPUPDATA2 *ppd)
{
- m_hContact = ppd->lchContact;
+ m_hContact = ppd->lchContact;
m_clBack = ppd->colorBack;
- m_clClock = m_clTitle = m_clText = ppd->colorText;
- m_iTimeout = ppd->iSeconds;
+ m_clClock = m_clTitle = m_clText = ppd->colorText;
+ m_iTimeout = ppd->iSeconds;
mir_free(m_lpzText); mir_free(m_lpzTitle);
mir_free(m_lpwzText); mir_free(m_lpwzTitle);
@@ -930,27 +930,28 @@ LRESULT CALLBACK NullWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l return DefWindowProc(hwnd, message, wParam, lParam);
}
-struct ReplyEditData
+struct ReplyEditData
{
- HWND hwndPopup;
- HANDLE hContact;
- WNDPROC oldWndProc;
+ HWND hwndPopup;
+ HCONTACT hContact;
+ WNDPROC oldWndProc;
};
-BOOL IsUtfSendAvailable(HANDLE hContact)
+BOOL IsUtfSendAvailable(HCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
if (szProto == NULL) return FALSE;
//check for MetaContact and get szProto from subcontact
if (strcmp(szProto, gszMetaProto)==0) {
- HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT, (WPARAM)hContact, 0);
- if (!hSubContact) return FALSE;
+ HCONTACT hSubContact = (HCONTACT)CallService(MS_MC_GETDEFAULTCONTACT, (WPARAM)hContact, 0);
+ if (!hSubContact)
+ return FALSE;
szProto = GetContactProto(hSubContact);
}
return(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDUTF) ? TRUE : FALSE;
}
-void AddMessageToDB(HANDLE hContact, char *msg, int flag/*bool utf*/)
+void AddMessageToDB(HCONTACT hContact, char *msg, int flag/*bool utf*/)
{
DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
@@ -1491,13 +1492,13 @@ void WindowThread(void *arg) // Menu Host
LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- static HANDLE hContact = NULL;
+ static HCONTACT hContact = NULL;
switch (message)
{
case UM_SHOWMENU:
{
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
POINT pt = {0};
HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT,(WPARAM)hContact,0);
GetCursorPos(&pt);
diff --git a/plugins/Popup/src/popup_wnd2.h b/plugins/Popup/src/popup_wnd2.h index ef4760d496..4c851275d9 100644 --- a/plugins/Popup/src/popup_wnd2.h +++ b/plugins/Popup/src/popup_wnd2.h @@ -68,7 +68,7 @@ private: // other data
Formula::Args m_args;
- HANDLE m_hContact, m_hContactPassed;
+ HCONTACT m_hContact, m_hContactPassed;
WNDPROC m_PluginWindowProc;
void *m_PluginData;
diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp index ae757444a3..655ab46604 100644 --- a/plugins/Popup/src/srmm_menu.cpp +++ b/plugins/Popup/src/srmm_menu.cpp @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static HANDLE hDialogsList = NULL;
-static void SrmmMenu_UpdateIcon(HANDLE hContact)
+static void SrmmMenu_UpdateIcon(HCONTACT hContact)
{
if (!hContact)
return;
@@ -73,7 +73,7 @@ static int SrmmMenu_ProcessIconClick(WPARAM wParam, LPARAM lParam) if (lstrcmpA(sicd->szModule, MODULNAME))
return 0;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (!hContact)
return 0;
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 98683402c5..6d35216f40 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -238,7 +238,7 @@ int EventAdded(WPARAM wparam, LPARAM lparam) struct c_struct {
TCHAR szname[120];
TCHAR szgroup[50];
- HANDLE hcontact;
+ HCONTACT hcontact;
TCHAR proto[20];
c_struct()
@@ -321,7 +321,7 @@ void SortArray(void) }
-int GetStatus(HANDLE hContact, char *proto = NULL)
+int GetStatus(HCONTACT hContact, char *proto = NULL)
{
if (proto == NULL)
proto = GetContactProto(hContact);
@@ -356,17 +356,17 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) // item data of listbox-strings is the array position
FreeContacts();
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *pszProto = GetContactProto(hContact);
if(pszProto == NULL)
continue;
// Get meta
- HANDLE hMeta = NULL;
+ HCONTACT hMeta = NULL;
if (metacontactsEnabled)
{
if ((!show_all && opts.hide_subcontacts) || opts.group_append)
- hMeta = (HANDLE) CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ hMeta = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
}
else
{
@@ -457,7 +457,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) // Enable buttons for the selected contact
-void EnableButtons(HWND hwndDlg, HANDLE hContact)
+void EnableButtons(HWND hwndDlg, HCONTACT hContact)
{
if (hContact == NULL)
{
@@ -476,7 +476,7 @@ void EnableButtons(HWND hwndDlg, HANDLE hContact) // Is a meta?
if (ServiceExists(MS_MC_GETMOSTONLINECONTACT))
{
- HANDLE hSub = (HANDLE) CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) hContact, 0);
+ HCONTACT hSub = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) hContact, 0);
if (hSub != NULL)
hContact = hSub;
}
@@ -544,7 +544,7 @@ int CheckText(HWND hdlg, TCHAR *sztext, BOOL only_enable = FALSE) return 0;
}
-HANDLE GetSelectedContact(HWND hwndDlg)
+HCONTACT GetSelectedContact(HWND hwndDlg)
{
// First try selection
int sel = SendDlgItemMessage(hwndDlg, IDC_USERNAME, CB_GETCURSEL, 0, 0);
@@ -846,7 +846,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_ENTER:
{
- HANDLE hContact = GetSelectedContact(hwndDlg);
+ HCONTACT hContact = GetSelectedContact(hwndDlg);
if (hContact == NULL)
break;
@@ -858,7 +858,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break;
case IDC_MESSAGE:
{
- HANDLE hContact = GetSelectedContact(hwndDlg);
+ HCONTACT hContact = GetSelectedContact(hwndDlg);
if (hContact == NULL)
{
SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
@@ -879,7 +879,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case HOTKEY_VOICE:
case IDC_VOICE:
{
- HANDLE hContact = GetSelectedContact(hwndDlg);
+ HCONTACT hContact = GetSelectedContact(hwndDlg);
if (hContact == NULL)
{
SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
@@ -903,7 +903,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case HOTKEY_FILE:
case IDC_FILE:
{
- HANDLE hContact = GetSelectedContact(hwndDlg);
+ HCONTACT hContact = GetSelectedContact(hwndDlg);
if (hContact == NULL)
{
SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
@@ -924,7 +924,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case HOTKEY_URL:
case IDC_URL:
{
- HANDLE hContact = GetSelectedContact(hwndDlg);
+ HCONTACT hContact = GetSelectedContact(hwndDlg);
if (hContact == NULL)
{
SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
@@ -945,7 +945,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case HOTKEY_INFO:
case IDC_USERINFO:
{
- HANDLE hContact = GetSelectedContact(hwndDlg);
+ HCONTACT hContact = GetSelectedContact(hwndDlg);
if (hContact == NULL)
{
SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
@@ -966,7 +966,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case HOTKEY_HISTORY:
case IDC_HISTORY:
{
- HANDLE hContact = GetSelectedContact(hwndDlg);
+ HCONTACT hContact = GetSelectedContact(hwndDlg);
if (hContact == NULL)
{
SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
@@ -987,7 +987,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case HOTKEY_MENU:
case IDC_MENU:
{
- HANDLE hContact = GetSelectedContact(hwndDlg);
+ HCONTACT hContact = GetSelectedContact(hwndDlg);
if (hContact == NULL)
{
SetDlgItemText(hwndDlg, IDC_USERNAME, _T(""));
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index b0c40e1f7b..66c4af7657 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -396,7 +396,7 @@ int RegisterCustomButton(WPARAM wParam,LPARAM lParam) return 0;
}
-TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptszClip,int QVSize,int TextSize ,int ClipSize)
+TCHAR* ParseString(HCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptszClip,int QVSize,int TextSize ,int ClipSize)
{
int i=0,iOffset=0,iCount=0;
TCHAR* tempPointer=NULL;
diff --git a/plugins/QuickMessages/src/Utils.h b/plugins/QuickMessages/src/Utils.h index c136459239..61faf79b31 100644 --- a/plugins/QuickMessages/src/Utils.h +++ b/plugins/QuickMessages/src/Utils.h @@ -75,4 +75,4 @@ void DestroyButton(int listnum); void SaveModuleSettings(int buttonnum,ButtonData* bd);
void CleanSettings(int buttonnum,int from);
DWORD BalanceButtons(int buttonsWas,int buttonsNow);
-TCHAR* ParseString(HANDLE hContact,TCHAR* ptszQValueIn,TCHAR* ptszText,TCHAR* ptszClip,int QVSize,int TextSize ,int ClipSize);
\ No newline at end of file +TCHAR* ParseString(HCONTACT hContact,TCHAR* ptszQValueIn,TCHAR* ptszText,TCHAR* ptszClip,int QVSize,int TextSize ,int ClipSize);
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index 8162c110d5..a98de39b1e 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -117,7 +117,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) if (dbv.ptszVal == NULL)
replyList.push_back(_T(""));
else
- replyList.push_back((TCHAR*)variables_parsedup(dbv.ptszVal, 0, (HANDLE)wParam));
+ replyList.push_back((TCHAR*)variables_parsedup(dbv.ptszVal, 0, (HCONTACT)wParam));
if (_tcscmp(dbv.ptszVal, _T("---")))
AppendMenu((HMENU)hMenu, MF_STRING, i + 1, replyList[i].c_str());
diff --git a/plugins/Quotes/src/DBUtils.cpp b/plugins/Quotes/src/DBUtils.cpp index d85f85c282..3fe5690273 100644 --- a/plugins/Quotes/src/DBUtils.cpp +++ b/plugins/Quotes/src/DBUtils.cpp @@ -1,6 +1,6 @@ #include "StdAfx.h"
-std::string Quotes_DBGetStringA(HANDLE hContact,const char* szModule,const char* szSetting,const char* pszDefValue /*= NULL*/)
+std::string Quotes_DBGetStringA(HCONTACT hContact,const char* szModule,const char* szSetting,const char* pszDefValue /*= NULL*/)
{
std::string sResult;
char* pszSymbol = db_get_sa(hContact,szModule,szSetting);
@@ -17,7 +17,7 @@ std::string Quotes_DBGetStringA(HANDLE hContact,const char* szModule,const char* return sResult;
}
-std::wstring Quotes_DBGetStringW(HANDLE hContact,const char* szModule,const char* szSetting,const wchar_t* pszDefValue/* = NULL*/)
+std::wstring Quotes_DBGetStringW(HCONTACT hContact,const char* szModule,const char* szSetting,const wchar_t* pszDefValue/* = NULL*/)
{
std::wstring sResult;
wchar_t* pszSymbol = db_get_wsa(hContact,szModule,szSetting);
@@ -34,12 +34,12 @@ std::wstring Quotes_DBGetStringW(HANDLE hContact,const char* szModule,const char return sResult;
}
-bool Quotes_DBWriteDouble(HANDLE hContact,const char* szModule,const char* szSetting,double dValue)
+bool Quotes_DBWriteDouble(HCONTACT hContact,const char* szModule,const char* szSetting,double dValue)
{
return 0 == db_set_blob(hContact, szModule, szSetting, &dValue, sizeof(dValue));
}
-bool Quotes_DBReadDouble(HANDLE hContact,const char* szModule,const char* szSetting,double& rdValue)
+bool Quotes_DBReadDouble(HCONTACT hContact,const char* szModule,const char* szSetting,double& rdValue)
{
DBVARIANT dbv = {0};
dbv.type = DBVT_BLOB;
diff --git a/plugins/Quotes/src/DBUtils.h b/plugins/Quotes/src/DBUtils.h index 27e3de5038..330b953d27 100644 --- a/plugins/Quotes/src/DBUtils.h +++ b/plugins/Quotes/src/DBUtils.h @@ -1,13 +1,13 @@ #ifndef __54294385_3fdd_4f0c_98c3_c583a96e7fb4_DBUtils_h__
#define __54294385_3fdd_4f0c_98c3_c583a96e7fb4_DBUtils_h__
-std::string Quotes_DBGetStringA(HANDLE hContact,const char* szModule,const char* szSetting,const char* pszDefValue = NULL);
-std::wstring Quotes_DBGetStringW(HANDLE hContact,const char* szModule,const char* szSetting,const wchar_t* pszDefValue = NULL);
+std::string Quotes_DBGetStringA(HCONTACT hContact,const char* szModule,const char* szSetting,const char* pszDefValue = NULL);
+std::wstring Quotes_DBGetStringW(HCONTACT hContact,const char* szModule,const char* szSetting,const wchar_t* pszDefValue = NULL);
#define Quotes_DBGetStringT Quotes_DBGetStringW
-bool Quotes_DBWriteDouble(HANDLE hContact,const char* szModule,const char* szSetting,double dValue);
-bool Quotes_DBReadDouble(HANDLE hContact,const char* szModule,const char* szSetting,double& rdValue);
+bool Quotes_DBWriteDouble(HCONTACT hContact,const char* szModule,const char* szSetting,double dValue);
+bool Quotes_DBReadDouble(HCONTACT hContact,const char* szModule,const char* szSetting,double& rdValue);
#endif //__54294385_3fdd_4f0c_98c3_c583a96e7fb4_DBUtils_h__
diff --git a/plugins/Quotes/src/ExtraImages.cpp b/plugins/Quotes/src/ExtraImages.cpp index 2a6c95b10d..ad2ac5e54a 100644 --- a/plugins/Quotes/src/ExtraImages.cpp +++ b/plugins/Quotes/src/ExtraImages.cpp @@ -23,7 +23,7 @@ void CExtraImages::RebuildExtraImages() {
}
-bool CExtraImages::SetContactExtraImage(HANDLE hContact,EImageIndex nIndex)const
+bool CExtraImages::SetContactExtraImage(HCONTACT hContact,EImageIndex nIndex)const
{
if (!m_hExtraIcons)
return false;
@@ -47,7 +47,7 @@ bool CExtraImages::SetContactExtraImage(HANDLE hContact,EImageIndex nIndex)const int QuotesEventFunc_onExtraImageApply(WPARAM wp,LPARAM lp)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wp);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wp);
const CModuleInfo::TQuotesProvidersPtr& pProviders = CModuleInfo::GetQuoteProvidersPtr();
CQuotesProviders::TQuotesProviderPtr pProvider = pProviders->GetContactProviderPtr(hContact);
diff --git a/plugins/Quotes/src/ExtraImages.h b/plugins/Quotes/src/ExtraImages.h index ca9cfd7c42..f02bfbacf9 100644 --- a/plugins/Quotes/src/ExtraImages.h +++ b/plugins/Quotes/src/ExtraImages.h @@ -21,7 +21,7 @@ public: static CExtraImages& GetInstance();
void RebuildExtraImages();
- bool SetContactExtraImage(HANDLE hContact,EImageIndex nIndex)const;
+ bool SetContactExtraImage(HCONTACT hContact,EImageIndex nIndex)const;
private:
mutable CLightMutex m_lmExtraImages;
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 4d61bd793b..1536bf8e9f 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -191,7 +191,7 @@ namespace int QuotesEventFunc_OnContactDeleted(WPARAM wParam, LPARAM)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wParam);
const CModuleInfo::TQuotesProvidersPtr& pProviders = CModuleInfo::GetQuoteProvidersPtr();
CQuotesProviders::TQuotesProviderPtr pProvider = pProviders->GetContactProviderPtr(hContact);
diff --git a/plugins/Quotes/src/IQuotesProvider.h b/plugins/Quotes/src/IQuotesProvider.h index 1317a115f6..a6359097b7 100644 --- a/plugins/Quotes/src/IQuotesProvider.h +++ b/plugins/Quotes/src/IQuotesProvider.h @@ -22,13 +22,13 @@ public: virtual bool Init() = 0;
virtual const CProviderInfo& GetInfo()const = 0;
- virtual void AddContact(HANDLE hContact) = 0;
- virtual void DeleteContact(HANDLE hContact) = 0;
+ virtual void AddContact(HCONTACT hContact) = 0;
+ virtual void DeleteContact(HCONTACT hContact) = 0;
virtual void ShowPropertyPage(WPARAM wp,OPTIONSDIALOGPAGE& odp) = 0;
virtual void RefreshAll() = 0;
- virtual void RefreshContact(HANDLE hContact) = 0;
- virtual void SetContactExtraIcon(HANDLE hContact)const = 0;
+ virtual void RefreshContact(HCONTACT hContact) = 0;
+ virtual void SetContactExtraIcon(HCONTACT hContact)const = 0;
virtual void Run() = 0;
diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp index be7b4fc974..282d5aa448 100644 --- a/plugins/Quotes/src/ImportExport.cpp +++ b/plugins/Quotes/src/ImportExport.cpp @@ -21,7 +21,7 @@ namespace {
CModuleInfo::TXMLEnginePtr m_pXmlEngine;
IXMLNode::TXMLNodePtr m_pNode;
- HANDLE m_hContact;
+ HCONTACT m_hContact;
LPCSTR m_pszModule;
};
@@ -153,7 +153,7 @@ namespace return 0;
}
- IXMLNode::TXMLNodePtr export_contact(HANDLE hContact,const CModuleInfo::TXMLEnginePtr& pXmlEngine)
+ IXMLNode::TXMLNodePtr export_contact(HCONTACT hContact,const CModuleInfo::TXMLEnginePtr& pXmlEngine)
{
IXMLNode::TXMLNodePtr pNode = pXmlEngine->CreateNode(g_pszXmlContact,tstring());
if(pNode)
@@ -273,7 +273,7 @@ INT_PTR Quotes_Export(WPARAM wp,LPARAM lp) CModuleInfo::TXMLEnginePtr pXmlEngine = CModuleInfo::GetInstance().GetXMLEnginePtr();
CModuleInfo::TQuotesProvidersPtr pProviders = CModuleInfo::GetInstance().GetQuoteProvidersPtr();
IXMLNode::TXMLNodePtr pRoot = pXmlEngine->CreateNode(g_pszXmlContacts,tstring());
- HANDLE hContact = reinterpret_cast<HANDLE>(wp);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wp);
if(hContact)
{
CQuotesProviders::TQuotesProviderPtr pProvider = pProviders->GetContactProviderPtr(hContact);
@@ -307,13 +307,13 @@ INT_PTR Quotes_Export(WPARAM wp,LPARAM lp) namespace
{
- bool set_contact_settings(HANDLE hContact, DBCONTACTWRITESETTING& dbs)
+ bool set_contact_settings(HCONTACT hContact, DBCONTACTWRITESETTING& dbs)
{
assert(DBVT_DELETED != dbs.value.type);
return (0 == db_set(hContact, dbs.szModule, dbs.szSetting, &dbs.value));
}
- bool handle_module(HANDLE hContact,const IXMLNode::TXMLNodePtr& pXmlModule,UINT nFlags)
+ bool handle_module(HCONTACT hContact,const IXMLNode::TXMLNodePtr& pXmlModule,UINT nFlags)
{
size_t cCreatedRecords = 0;
tstring sModuleName = pXmlModule->GetText();
@@ -488,7 +488,7 @@ namespace struct CContactState
{
CContactState() : m_hContact(NULL),m_bNewContact(false){}
- HANDLE m_hContact;
+ HCONTACT m_hContact;
CQuotesProviders::TQuotesProviderPtr m_pProvider;
bool m_bNewContact;
};
@@ -568,7 +568,7 @@ namespace visitor(const IXMLNode::TXMLNodePtr& pXmlQuotes)
: m_hContact(NULL),m_pXmlQuotes(pXmlQuotes){}
- HANDLE GetContact()const{return m_hContact;}
+ HCONTACT GetContact()const{return m_hContact;}
private:
virtual void Visit(const CQuotesProviderDukasCopy& rProvider)
@@ -646,7 +646,7 @@ namespace }
private:
- HANDLE m_hContact;
+ HCONTACT m_hContact;
IXMLNode::TXMLNodePtr m_pXmlQuotes;
};
@@ -676,7 +676,7 @@ namespace {
if(NULL == cst.m_hContact)
{
- cst.m_hContact = reinterpret_cast<HANDLE>(CallService(MS_DB_CONTACT_ADD,0,0));
+ cst.m_hContact = reinterpret_cast<HCONTACT>(CallService(MS_DB_CONTACT_ADD,0,0));
cst.m_bNewContact = true;
}
else if(impctx.m_nFlags"ES_IMPORT_SKIP_EXISTING_CONTACTS)
diff --git a/plugins/Quotes/src/QuoteChart.cpp b/plugins/Quotes/src/QuoteChart.cpp index 123c8c1a4f..82c4eefe0d 100644 --- a/plugins/Quotes/src/QuoteChart.cpp +++ b/plugins/Quotes/src/QuoteChart.cpp @@ -31,7 +31,7 @@ namespace return pChart;
}
- bool read_log_file(HANDLE hContact,TChart& rChart)
+ bool read_log_file(HCONTACT hContact,TChart& rChart)
{
tstring sLogFileName = GetContactLogFileName(hContact);
if(false == sLogFileName.empty())
@@ -90,7 +90,7 @@ namespace case WM_CREATE:
{
CREATESTRUCT* pCS = reinterpret_cast<CREATESTRUCT*>(lp);
- HANDLE hContact = reinterpret_cast<HANDLE>(pCS->lpCreateParams);
+ HCONTACT hContact = reinterpret_cast<HANDLE>(pCS->lpCreateParams);
TChart* pChart = new TChart;
read_log_file(hContact,*pChart);
@@ -184,7 +184,7 @@ namespace inline HANDLE get_contact(HWND hWnd)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(GetWindowLongPtr(hWnd,GWLP_USERDATA));
+ HCONTACT hContact = reinterpret_cast<HANDLE>(GetWindowLongPtr(hWnd,GWLP_USERDATA));
return hContact;
}
@@ -202,7 +202,7 @@ namespace {
case WM_INITDIALOG:
{
- HANDLE hContact = reinterpret_cast<HANDLE>(lp);
+ HCONTACT hContact = reinterpret_cast<HANDLE>(lp);
TranslateDialogDefault(hDlg);
@@ -260,7 +260,7 @@ namespace return (TRUE);
case WM_CLOSE:
{
- HANDLE hContact = get_contact(hDlg);
+ HCONTACT hContact = get_contact(hDlg);
SetWindowLongPtr(hDlg,GWLP_USERDATA,0);
// save_options(hDlg,hContact);
@@ -370,7 +370,7 @@ namespace INT_PTR QuotesMenu_Chart(WPARAM wp,LPARAM lp)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wp);
+ HCONTACT hContact = reinterpret_cast<HANDLE>(wp);
if(NULL == hContact)
{
return 0;
diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp index d21b3f2fed..fa7ae638c2 100644 --- a/plugins/Quotes/src/QuoteInfoDlg.cpp +++ b/plugins/Quotes/src/QuoteInfoDlg.cpp @@ -14,21 +14,21 @@ extern HGENMENU g_hMenuRefresh; namespace
{
- HANDLE g_hContact;
+ HCONTACT g_hContact;
- inline bool IsMyContact(HANDLE hContact)
+ inline bool IsMyContact(HCONTACT hContact)
{
CQuotesProviders::TQuotesProviderPtr pProvider = CModuleInfo::GetQuoteProvidersPtr()->GetContactProviderPtr(hContact);
return (NULL != pProvider);
}
- inline HANDLE get_contact(HWND hWnd)
+ inline HCONTACT get_contact(HWND hWnd)
{
- return reinterpret_cast<HANDLE>(GetWindowLongPtr(hWnd,GWLP_USERDATA));
+ return reinterpret_cast<HCONTACT>(GetWindowLongPtr(hWnd,GWLP_USERDATA));
}
- bool get_fetch_time(time_t& rTime,HANDLE hContact)
+ bool get_fetch_time(time_t& rTime,HCONTACT hContact)
{
DBVARIANT dbv;
if (db_get(hContact, QUOTES_PROTOCOL_NAME, DB_STR_QUOTE_FETCH_TIME, &dbv) || (DBVT_DWORD != dbv.type))
@@ -38,7 +38,7 @@ namespace return true;
}
- INT_PTR CALLBACK QuoteInfoDlgProcImpl(HANDLE hContact,HWND hdlg,UINT msg,WPARAM wParam,LPARAM lParam)
+ INT_PTR CALLBACK QuoteInfoDlgProcImpl(HCONTACT hContact,HWND hdlg,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg)
{
@@ -118,7 +118,7 @@ namespace int QuotesEventFunc_OnUserInfoInit(WPARAM wp,LPARAM lp)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(lp);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(lp);
if(NULL == hContact)
return 0;
@@ -141,7 +141,7 @@ int QuotesEventFunc_OnUserInfoInit(WPARAM wp,LPARAM lp) INT_PTR QuotesMenu_EditSettings(WPARAM wp,LPARAM lp)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wp);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wp);
if(NULL == hContact)
{
return 0;
@@ -154,7 +154,7 @@ INT_PTR QuotesMenu_EditSettings(WPARAM wp,LPARAM lp) namespace
{
- bool get_log_file(HANDLE hContact,tstring& rsLogfile)
+ bool get_log_file(HCONTACT hContact,tstring& rsLogfile)
{
rsLogfile = GetContactLogFileName(hContact);
return ((rsLogfile.empty()) ? false : true);
@@ -163,7 +163,7 @@ namespace INT_PTR QuotesMenu_OpenLogFile(WPARAM wp,LPARAM lp)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wp);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wp);
if(NULL == hContact)
{
return 0;
@@ -180,7 +180,7 @@ INT_PTR QuotesMenu_OpenLogFile(WPARAM wp,LPARAM lp) INT_PTR QuotesMenu_RefreshContact(WPARAM wp,LPARAM lp)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wp);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wp);
if(NULL == hContact)
{
return 0;
@@ -201,12 +201,12 @@ namespace {
INT_PTR CALLBACK QuoteInfoDlgProc1(HWND hdlg,UINT msg,WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
switch(msg)
{
case WM_INITDIALOG:
{
- hContact = reinterpret_cast<HANDLE>(lParam);
+ hContact = reinterpret_cast<HCONTACT>(lParam);
HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_INFO,false);
assert(hWL);
WindowList_Add(hWL,hdlg,hContact);
@@ -221,7 +221,7 @@ namespace return FALSE;
case WM_DESTROY:
{
- HANDLE hContact = get_contact(hdlg);
+ HCONTACT hContact = get_contact(hdlg);
if(hContact)
{
SetWindowLongPtr(hdlg,GWLP_USERDATA,0);
@@ -251,7 +251,7 @@ namespace int Quotes_OnContactDoubleClick(WPARAM wp,LPARAM/* lp*/)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(wp);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wp);
if(CModuleInfo::GetQuoteProvidersPtr()->GetContactProviderPtr(hContact))
{
HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_INFO,true);
@@ -297,7 +297,7 @@ int Quotes_PrebuildContactMenu(WPARAM wp,LPARAM lp) #endif
enable_menu(g_hMenuRefresh,false);
- HANDLE hContact = reinterpret_cast<HANDLE>(wp);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(wp);
if(NULL == hContact)
{
return 0;
diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp index e0f17a9b1d..b017c7c162 100644 --- a/plugins/Quotes/src/QuotesProviderBase.cpp +++ b/plugins/Quotes/src/QuotesProviderBase.cpp @@ -238,7 +238,7 @@ bool CQuotesProviderBase::IsOnline() return ID_STATUS_ONLINE == g_nStatus;
}
-void CQuotesProviderBase::AddContact(HANDLE hContact)
+void CQuotesProviderBase::AddContact(HCONTACT hContact)
{
// CCritSection cs(m_cs);
assert(m_aContacts.end() == std::find(m_aContacts.begin(),m_aContacts.end(),hContact));
@@ -246,7 +246,7 @@ void CQuotesProviderBase::AddContact(HANDLE hContact) m_aContacts.push_back(hContact);
}
-void CQuotesProviderBase::DeleteContact(HANDLE hContact)
+void CQuotesProviderBase::DeleteContact(HCONTACT hContact)
{
CGuard<CLightMutex> cs(m_cs);
@@ -257,7 +257,7 @@ void CQuotesProviderBase::DeleteContact(HANDLE hContact) }
}
-void CQuotesProviderBase::SetContactStatus(HANDLE hContact,int nNewStatus)
+void CQuotesProviderBase::SetContactStatus(HCONTACT hContact,int nNewStatus)
{
int nStatus = db_get_w(hContact,QUOTES_PROTOCOL_NAME,DB_STR_STATUS,ID_STATUS_OFFLINE);
if(nNewStatus != nStatus)
@@ -304,7 +304,7 @@ namespace public:
CTendency() : m_nComparison(NonValid){}
- bool Parse(const IQuotesProvider* pProvider,const tstring& rsFrmt,HANDLE hContact)
+ bool Parse(const IQuotesProvider* pProvider,const tstring& rsFrmt,HCONTACT hContact)
{
m_abValueFlags[0] = false;
m_abValueFlags[1] = false;
@@ -460,7 +460,7 @@ namespace };
tstring format_rate(const IQuotesProvider* pProvider,
- HANDLE hContact,
+ HCONTACT hContact,
const tstring& rsFrmt,
double dRate)
{
@@ -535,7 +535,7 @@ namespace }
void log_to_file(const IQuotesProvider* pProvider,
- HANDLE hContact,
+ HCONTACT hContact,
double dRate,
const tstring& rsLogFileName,
const tstring& rsFormat)
@@ -563,7 +563,7 @@ namespace }
void log_to_history(const IQuotesProvider* pProvider,
- HANDLE hContact,
+ HCONTACT hContact,
double dRate,
time_t nTime,
const tstring& rsFormat)
@@ -581,7 +581,7 @@ namespace db_event_add(hContact, &dbei);
}
- bool do_set_contact_extra_icon(HANDLE hContact,const CTendency& tendency)
+ bool do_set_contact_extra_icon(HCONTACT hContact,const CTendency& tendency)
{
bool bResult = false;
CTendency::EResult nComparison = tendency.Compare();
@@ -604,7 +604,7 @@ namespace }
bool show_popup(const IQuotesProvider* pProvider,
- HANDLE hContact,
+ HCONTACT hContact,
double dRate,
// double dPrevRate,
// bool bValidPrevRate,
@@ -685,7 +685,7 @@ namespace }
}
-void CQuotesProviderBase::WriteContactRate(HANDLE hContact,double dRate,const tstring& rsSymbol/* = ""*/)
+void CQuotesProviderBase::WriteContactRate(HCONTACT hContact,double dRate,const tstring& rsSymbol/* = ""*/)
{
time_t nTime = ::time(NULL);
@@ -825,9 +825,9 @@ void CQuotesProviderBase::WriteContactRate(HANDLE hContact,double dRate,const ts }
}
-HANDLE CQuotesProviderBase::CreateNewContact(const tstring& rsName)
+HCONTACT CQuotesProviderBase::CreateNewContact(const tstring& rsName)
{
- HANDLE hContact = reinterpret_cast<HANDLE>(CallService(MS_DB_CONTACT_ADD,0,0));
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(CallService(MS_DB_CONTACT_ADD,0,0));
if(hContact)
{
if(0 == CallService(MS_PROTO_ADDTOCONTACT,reinterpret_cast<WPARAM>(hContact),(LPARAM)QUOTES_PROTOCOL_NAME))
@@ -1028,7 +1028,7 @@ void CQuotesProviderBase::RefreshAll() assert(b && "Failed to set event");
}
-void CQuotesProviderBase::RefreshContact(HANDLE hContact)
+void CQuotesProviderBase::RefreshContact(HCONTACT hContact)
{
{// for CCritSection
CGuard<CLightMutex> cs(m_cs);
@@ -1039,7 +1039,7 @@ void CQuotesProviderBase::RefreshContact(HANDLE hContact) assert(b && "Failed to set event");
}
-void CQuotesProviderBase::SetContactExtraIcon(HANDLE hContact)const
+void CQuotesProviderBase::SetContactExtraIcon(HCONTACT hContact)const
{
// tstring s = DBGetStringT(hContact,LIST_MODULE_NAME,CONTACT_LIST_NAME);
// tostringstream o;
diff --git a/plugins/Quotes/src/QuotesProviderBase.h b/plugins/Quotes/src/QuotesProviderBase.h index 7340d41f79..d468b38a68 100644 --- a/plugins/Quotes/src/QuotesProviderBase.h +++ b/plugins/Quotes/src/QuotesProviderBase.h @@ -50,7 +50,7 @@ public: };
protected:
- typedef std::vector<HANDLE> TContracts;
+ typedef std::vector<HCONTACT> TContracts;
public:
struct CXMLFileInfo;
@@ -65,20 +65,20 @@ public: virtual bool Init();
virtual const CProviderInfo& GetInfo()const;
- virtual void AddContact(HANDLE hContact);
- virtual void DeleteContact(HANDLE hContact);
+ virtual void AddContact(HCONTACT hContact);
+ virtual void DeleteContact(HCONTACT hContact);
virtual void Run();
virtual void Accept(CQuotesProviderVisitor& visitor)const;
virtual void RefreshAll();
- virtual void RefreshContact(HANDLE hContact);
- virtual void SetContactExtraIcon(HANDLE hContact)const;
+ virtual void RefreshContact(HCONTACT hContact);
+ virtual void SetContactExtraIcon(HCONTACT hContact)const;
protected:
const tstring& GetURL()const;
- HANDLE CreateNewContact(const tstring& rsName);
+ HCONTACT CreateNewContact(const tstring& rsName);
static bool IsOnline();
- static void SetContactStatus(HANDLE hContact,int nNewStatus);
- void WriteContactRate(HANDLE hContact,double dRate,const tstring& rsSymbol = _T(""));
+ static void SetContactStatus(HCONTACT hContact,int nNewStatus);
+ void WriteContactRate(HCONTACT hContact,double dRate,const tstring& rsSymbol = _T(""));
private:
virtual void RefreshQuotes(TContracts& anContacts) = 0;
diff --git a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp index 7a74575308..1d660b155d 100644 --- a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp +++ b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp @@ -10,12 +10,12 @@ CQuotesProviderDukasCopy::~CQuotesProviderDukasCopy() namespace
{
- inline tstring get_quote_id(HANDLE hContact)
+ inline tstring get_quote_id(HCONTACT hContact)
{
return Quotes_DBGetStringT(hContact,QUOTES_MODULE_NAME,DB_STR_QUOTE_ID);
}
- inline bool is_quote_id_equal(HANDLE hContact,const tstring& sID)
+ inline bool is_quote_id_equal(HCONTACT hContact,const tstring& sID)
{
return sID == get_quote_id(hContact);
}
@@ -36,7 +36,7 @@ bool CQuotesProviderDukasCopy::WatchForQuote(const CQuote& rQuote,bool bWatch) if((false == bWatch) && (i != m_aContacts.end()))
{
- HANDLE hContact = *i;
+ HCONTACT hContact = *i;
{// for CCritSection
CGuard<CLightMutex> cs(m_cs);
m_aContacts.erase(i);
@@ -47,7 +47,7 @@ bool CQuotesProviderDukasCopy::WatchForQuote(const CQuote& rQuote,bool bWatch) }
else if((true == bWatch) && (i == m_aContacts.end()))
{
- HANDLE hContact = CreateNewContact(rQuote.GetSymbol());
+ HCONTACT hContact = CreateNewContact(rQuote.GetSymbol());
if(hContact)
{
db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_ID,sQuoteID.c_str());
@@ -72,7 +72,7 @@ tstring CQuotesProviderDukasCopy::BuildHTTPURL()const CGuard<CLightMutex> cs(m_cs);
for(TContracts::const_iterator i = m_aContacts.begin();i != m_aContacts.end();++i)
{
- HANDLE hContact = *i;
+ HCONTACT hContact = *i;
tstring sID = get_quote_id(hContact);
if(false == sID.empty())
{
@@ -243,7 +243,7 @@ void CQuotesProviderDukasCopy::RefreshQuotes(TContracts& anContacts) boost::bind(is_quote_id_equal,_1,ri.m_sID));
if(i != anContacts.end() && (true == IsOnline()))
{
- HANDLE hContact = *i;
+ HCONTACT hContact = *i;
anContacts.erase(i);
WriteContactRate(hContact,ri.m_dCurRate,ri.m_sName);
@@ -270,38 +270,14 @@ void CQuotesProviderDukasCopy::Accept(CQuotesProviderVisitor& visitor)const visitor.Visit(*this);
}
-HANDLE CQuotesProviderDukasCopy::GetContactByQuoteID(const tstring& rsQuoteID)const
+HCONTACT CQuotesProviderDukasCopy::GetContactByQuoteID(const tstring& rsQuoteID)const
{
CGuard<CLightMutex> cs(m_cs);
TContracts::const_iterator i = std::find_if(m_aContacts.begin(),m_aContacts.end(),
boost::bind(std::equal_to<tstring>(),rsQuoteID,boost::bind(get_quote_id,_1)));
if(i != m_aContacts.end())
- {
return *i;
- }
- else
- {
- return NULL;
- }
-}
-
-// #ifdef CHART_IMPLEMENT
-// bool CQuotesProviderDukasCopy::Chart(HANDLE hContact,const tstring& url)const
-// {
-// LogIt(Info,url);
-//
-// CHTTPSession http;
-// if((true == http.OpenURL(url)))
-// {
-// tstring sHTML;
-// if((true == http.ReadResponce(sHTML)))
-// {
-// LogIt(Info,sHTML);
-// }
-// }
-//
-// return false;
-// }
-// #endif //CHART_IMPLEMENT
+ return NULL;
+}
diff --git a/plugins/Quotes/src/QuotesProviderDukasCopy.h b/plugins/Quotes/src/QuotesProviderDukasCopy.h index 6bd49fc87e..117788c044 100644 --- a/plugins/Quotes/src/QuotesProviderDukasCopy.h +++ b/plugins/Quotes/src/QuotesProviderDukasCopy.h @@ -16,9 +16,9 @@ public: bool WatchForQuote(const CQuote& rQuote,bool bWatch);
bool IsQuoteWatched(const CQuote& rQuote)const;
- HANDLE GetContactByQuoteID(const tstring& rsQuoteID)const;
+ HCONTACT GetContactByQuoteID(const tstring& rsQuoteID)const;
// #ifdef CHART_IMPLEMENT
-// bool Chart(HANDLE hContact,const tstring& url)const;
+// bool Chart(HCONTACT hContact,const tstring& url)const;
// #endif
private:
diff --git a/plugins/Quotes/src/QuotesProviderFinance.cpp b/plugins/Quotes/src/QuotesProviderFinance.cpp index cbd121ea4b..83e6389d54 100644 --- a/plugins/Quotes/src/QuotesProviderFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderFinance.cpp @@ -3,7 +3,7 @@ void CQuotesProviderFinance::GetWatchedQuotes(TQuotes& raQuotes)const
{
raQuotes.clear();
- BOOST_FOREACH(HANDLE hContact,m_aContacts)
+ BOOST_FOREACH(HCONTACT hContact,m_aContacts)
{
tstring sID = Quotes_DBGetStringT(hContact,QUOTES_MODULE_NAME,DB_STR_QUOTE_ID);
tstring sSymbol = Quotes_DBGetStringT(hContact,QUOTES_MODULE_NAME,DB_STR_QUOTE_SYMBOL,sID.c_str());
@@ -16,12 +16,12 @@ void CQuotesProviderFinance::GetWatchedQuotes(TQuotes& raQuotes)const namespace
{
- inline tstring get_quote_id(HANDLE hContact)
+ inline tstring get_quote_id(HCONTACT hContact)
{
return Quotes_DBGetStringT(hContact,QUOTES_MODULE_NAME,DB_STR_QUOTE_ID);
}
- inline bool is_quote_id_equal(HANDLE hContact,const tstring& sID)
+ inline bool is_quote_id_equal(HCONTACT hContact,const tstring& sID)
{
return sID == get_quote_id(hContact);
}
@@ -35,7 +35,7 @@ bool CQuotesProviderFinance::WatchForQuote(const CQuote& rQuote,bool bWatch) if ((false == bWatch) && (i != m_aContacts.end()))
{
- HANDLE hContact = *i;
+ HCONTACT hContact = *i;
{// for CCritSection
CGuard<CLightMutex> cs(m_cs);
m_aContacts.erase(i);
@@ -46,7 +46,7 @@ bool CQuotesProviderFinance::WatchForQuote(const CQuote& rQuote,bool bWatch) }
else if ((true == bWatch) && (i == m_aContacts.end()))
{
- HANDLE hContact = CreateNewContact(rQuote.GetSymbol());
+ HCONTACT hContact = CreateNewContact(rQuote.GetSymbol());
if(hContact)
{
db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_ID,sQuoteID.c_str());
@@ -62,7 +62,7 @@ bool CQuotesProviderFinance::WatchForQuote(const CQuote& rQuote,bool bWatch) return false;
}
-HANDLE CQuotesProviderFinance::GetContactByQuoteID(const tstring& rsQuoteID)const
+HCONTACT CQuotesProviderFinance::GetContactByQuoteID(const tstring& rsQuoteID)const
{
CGuard<CLightMutex> cs(m_cs);
diff --git a/plugins/Quotes/src/QuotesProviderFinance.h b/plugins/Quotes/src/QuotesProviderFinance.h index f5f0e547cc..df71a70a90 100644 --- a/plugins/Quotes/src/QuotesProviderFinance.h +++ b/plugins/Quotes/src/QuotesProviderFinance.h @@ -9,7 +9,7 @@ public: public:
void GetWatchedQuotes(TQuotes& raQuotes)const;
bool WatchForQuote(const CQuote& rQuote,bool bWatch);
- HANDLE GetContactByQuoteID(const tstring& rsQuoteID)const;
+ HCONTACT GetContactByQuoteID(const tstring& rsQuoteID)const;
protected:
virtual void ShowPropertyPage(WPARAM wp,OPTIONSDIALOGPAGE& odp);
diff --git a/plugins/Quotes/src/QuotesProviderGoogle.cpp b/plugins/Quotes/src/QuotesProviderGoogle.cpp index f2fbc5f8ca..14f9ae1daa 100644 --- a/plugins/Quotes/src/QuotesProviderGoogle.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogle.cpp @@ -17,7 +17,7 @@ namespace return o.str();
}
- inline bool is_rate_watched(HANDLE hContact,
+ inline bool is_rate_watched(HCONTACT hContact,
const CQuotesProviderBase::CQuote& from,
const CQuotesProviderBase::CQuote& to)
{
@@ -36,7 +36,7 @@ bool CQuotesProviderGoogle::WatchForRate(const CRateInfo& ri, if ((true == bWatch) && (i == m_aContacts.end()))
{
tstring sName = make_contact_name(ri.m_from.GetSymbol(),ri.m_to.GetSymbol());
- HANDLE hContact = CreateNewContact(sName);
+ HCONTACT hContact = CreateNewContact(sName);
if(hContact)
{
db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_FROM_ID,ri.m_from.GetID().c_str());
@@ -55,7 +55,7 @@ bool CQuotesProviderGoogle::WatchForRate(const CRateInfo& ri, }
else if ((false == bWatch) && (i != m_aContacts.end()))
{
- HANDLE hContact = *i;
+ HCONTACT hContact = *i;
{// for CCritSection
CGuard<CLightMutex> cs(m_cs);
m_aContacts.erase(i);
@@ -77,7 +77,7 @@ bool CQuotesProviderGoogle::GetWatchedRateInfo(size_t nIndex,CRateInfo& rRateInf {
if(nIndex < m_aContacts.size())
{
- HANDLE hContact = m_aContacts[nIndex];
+ HCONTACT hContact = m_aContacts[nIndex];
tstring sSymbolFrom = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_FROM_ID);
tstring sSymbolTo = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_TO_ID);
tstring sDescFrom = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_FROM_DESCRIPTION);
@@ -101,7 +101,7 @@ namespace o << rsURL << _T("?a=") << std::fixed << dAmount << _T("&from=") << from << _T("&to=") << to;
return o.str();
}
- tstring build_url(HANDLE hContact,const tstring& rsURL,double dAmount = 1.0)
+ tstring build_url(HCONTACT hContact,const tstring& rsURL,double dAmount = 1.0)
{
tstring sFrom = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_FROM_ID);
tstring sTo = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_TO_ID);
@@ -168,7 +168,7 @@ void CQuotesProviderGoogle::RefreshQuotes(TContracts& anContacts) for(TContracts::const_iterator i = anContacts.begin();i != anContacts.end() && IsOnline();++i)
{
- HANDLE hContact = *i;
+ HCONTACT hContact = *i;
if(bUseExtendedStatus)
{
@@ -497,7 +497,7 @@ double CQuotesProviderGoogle::Convert(double dAmount,const CQuote& from,const CQ namespace
{
- bool is_equal_ids(HANDLE hContact,const tstring& rsFromID,const tstring& rsToID)
+ bool is_equal_ids(HCONTACT hContact,const tstring& rsFromID,const tstring& rsToID)
{
tstring sFrom = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_FROM_ID);
tstring sTo = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_TO_ID);
@@ -506,7 +506,7 @@ namespace }
}
-HANDLE CQuotesProviderGoogle::GetContactByID(const tstring& rsFromID,const tstring& rsToID)const
+HCONTACT CQuotesProviderGoogle::GetContactByID(const tstring& rsFromID,const tstring& rsToID)const
{
CGuard<CLightMutex> cs(m_cs);
diff --git a/plugins/Quotes/src/QuotesProviderGoogle.h b/plugins/Quotes/src/QuotesProviderGoogle.h index 48e3d27e11..59cb3273b0 100644 --- a/plugins/Quotes/src/QuotesProviderGoogle.h +++ b/plugins/Quotes/src/QuotesProviderGoogle.h @@ -27,7 +27,7 @@ public: size_t GetWatchedRateCount()const;
bool GetWatchedRateInfo(size_t nIndex,CRateInfo& rRateInfo);
- HANDLE GetContactByID(const tstring& rsFromID,const tstring& rsToID)const;
+ HCONTACT GetContactByID(const tstring& rsFromID,const tstring& rsToID)const;
double Convert(double dAmount,const CQuote& from,const CQuote& to)const;
diff --git a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp index 5150610ed5..be34fcb29e 100644 --- a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp @@ -10,7 +10,7 @@ CQuotesProviderGoogleFinance::~CQuotesProviderGoogleFinance() namespace
{
- tstring build_url(HANDLE hContact,const tstring& rsURL)
+ tstring build_url(HCONTACT hContact,const tstring& rsURL)
{
tostringstream o;
o << rsURL << _T("?q=") << Quotes_DBGetStringT(hContact,QUOTES_MODULE_NAME,DB_STR_QUOTE_ID);
@@ -292,7 +292,7 @@ void CQuotesProviderGoogleFinance::RefreshQuotes(TContracts& anContacts) for(TContracts::const_iterator i = anContacts.begin();i != anContacts.end() && IsOnline();++i)
{
- HANDLE hContact = *i;
+ HCONTACT hContact = *i;
if(bUseExtendedStatus)
{
diff --git a/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp b/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp index 0c95f3846f..a78096d052 100644 --- a/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp +++ b/plugins/Quotes/src/QuotesProviderVisitorFormater.cpp @@ -1,6 +1,6 @@ #include "StdAfx.h"
-CQuotesProviderVisitorFormater::CQuotesProviderVisitorFormater(HANDLE hContact,TCHAR chr,int nWidth)
+CQuotesProviderVisitorFormater::CQuotesProviderVisitorFormater(HCONTACT hContact,TCHAR chr,int nWidth)
: m_hContact(hContact),
m_chr(chr),
m_nWidth(nWidth)
@@ -45,7 +45,7 @@ void CQuotesProviderVisitorFormater::Visit(const CQuotesProviderGoogle& rProvide namespace
{
- bool get_fetch_time(HANDLE hContact,time_t& rTime)
+ bool get_fetch_time(HCONTACT hContact,time_t& rTime)
{
DBVARIANT dbv;
if (db_get(hContact, QUOTES_MODULE_NAME, DB_STR_QUOTE_FETCH_TIME, &dbv) || (DBVT_DWORD != dbv.type))
@@ -55,7 +55,7 @@ namespace return true;
}
- tstring format_fetch_time(const CQuotesProviderBase& rProvider,HANDLE hContact,const tstring& rsFormat)
+ tstring format_fetch_time(const CQuotesProviderBase& rProvider,HCONTACT hContact,const tstring& rsFormat)
{
time_t nTime;
if(true == get_fetch_time(hContact,nTime))
diff --git a/plugins/Quotes/src/QuotesProviderVisitorFormater.h b/plugins/Quotes/src/QuotesProviderVisitorFormater.h index 412c4a9fda..605c919725 100644 --- a/plugins/Quotes/src/QuotesProviderVisitorFormater.h +++ b/plugins/Quotes/src/QuotesProviderVisitorFormater.h @@ -4,7 +4,7 @@ class CQuotesProviderVisitorFormater : public CQuotesProviderVisitor
{
public:
- CQuotesProviderVisitorFormater(HANDLE hContact,TCHAR chr,int nWidth);
+ CQuotesProviderVisitorFormater(HCONTACT hContact,TCHAR chr,int nWidth);
~CQuotesProviderVisitorFormater();
const tstring& GetResult()const;
@@ -21,7 +21,7 @@ private: // void FormatChangeValueHelper(bool bPercentage);
private:
- HANDLE m_hContact;
+ HCONTACT m_hContact;
TCHAR m_chr;
tstring m_sResult;
int m_nWidth;
diff --git a/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp b/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp index 752dcc403e..0f53784953 100644 --- a/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp +++ b/plugins/Quotes/src/QuotesProviderVisitorTendency.cpp @@ -1,6 +1,6 @@ #include "stdafx.h"
-CQuotesProviderVisitorTendency::CQuotesProviderVisitorTendency(HANDLE hContact,TCHAR chr)
+CQuotesProviderVisitorTendency::CQuotesProviderVisitorTendency(HCONTACT hContact,TCHAR chr)
: m_hContact(hContact),m_chr(chr),m_bValid(false),m_dResult(0.0)
{
}
diff --git a/plugins/Quotes/src/QuotesProviderVisitorTendency.h b/plugins/Quotes/src/QuotesProviderVisitorTendency.h index c9acf27317..48411d6a4b 100644 --- a/plugins/Quotes/src/QuotesProviderVisitorTendency.h +++ b/plugins/Quotes/src/QuotesProviderVisitorTendency.h @@ -4,7 +4,7 @@ class CQuotesProviderVisitorTendency : public CQuotesProviderVisitor
{
public:
- CQuotesProviderVisitorTendency(HANDLE hContact,TCHAR chr);
+ CQuotesProviderVisitorTendency(HCONTACT hContact,TCHAR chr);
bool IsValid()const{return m_bValid;}
double GetResult()const{return m_dResult;}
@@ -18,7 +18,7 @@ private: void GetValue(LPCSTR pszDbKeyName);
private:
- HANDLE m_hContact;
+ HCONTACT m_hContact;
TCHAR m_chr;
bool m_bValid;
double m_dResult;
diff --git a/plugins/Quotes/src/QuotesProviderYahoo.cpp b/plugins/Quotes/src/QuotesProviderYahoo.cpp index f34a21523b..20581b0d89 100644 --- a/plugins/Quotes/src/QuotesProviderYahoo.cpp +++ b/plugins/Quotes/src/QuotesProviderYahoo.cpp @@ -50,7 +50,7 @@ namespace typedef std::vector<tstring> TStrings;
- bool get_double_from_parsed_line(HANDLE hContact,const TStrings& rasParsedLine,size_t nIndex,const char* pszDbName)
+ bool get_double_from_parsed_line(HCONTACT hContact,const TStrings& rasParsedLine,size_t nIndex,const char* pszDbName)
{
if(rasParsedLine.size() > nIndex)
{
@@ -71,13 +71,13 @@ void CQuotesProviderYahoo::RefreshQuotes(TContracts& anContacts) tstring sURL = GetURL();
bool bUseExtendedStatus = CModuleInfo::GetInstance().GetExtendedStatusFlag();
- typedef std::map<tstring,HANDLE> TQuoteID2ContractHandles;
+ typedef std::map<tstring,HCONTACT> TQuoteID2ContractHandles;
TQuoteID2ContractHandles aQuoteID2Handles;
tostringstream oURL;
oURL << sURL << _T("dioksin.txt?s=");
for(TContracts::const_iterator i = anContacts.begin();i != anContacts.end() && IsOnline();++i)
{
- HANDLE hContact = *i;
+ HCONTACT hContact = *i;
if(bUseExtendedStatus)
{
SetContactStatus(hContact,ID_STATUS_OCCUPIED);
@@ -151,7 +151,7 @@ void CQuotesProviderYahoo::RefreshQuotes(TContracts& anContacts) auto it3 = aQuoteID2Handles.find(asStrings[indexSymbol]);
if(it3 != aQuoteID2Handles.end())
{
- HANDLE hContact = it3->second;
+ HCONTACT hContact = it3->second;
double dRate = 0.0;
if(true == t2d(asStrings[indexLastTrade],dRate))
{
diff --git a/plugins/Quotes/src/QuotesProviders.cpp b/plugins/Quotes/src/QuotesProviders.cpp index cfab6903ab..1acf732f6f 100644 --- a/plugins/Quotes/src/QuotesProviders.cpp +++ b/plugins/Quotes/src/QuotesProviders.cpp @@ -44,7 +44,7 @@ void CQuotesProviders::ClearProviders() namespace
{
- void convert_contact_settings(HANDLE hContact)
+ void convert_contact_settings(HCONTACT hContact)
{
WORD dwLogMode = db_get_w(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG,static_cast<WORD>(lmDisabled));
if ((dwLogMode&lmInternalHistory) || (dwLogMode&lmExternalFile))
@@ -60,7 +60,7 @@ void CQuotesProviders::InitProviders() const WORD nCurrentVersion = 17;
WORD nVersion = db_get_w(NULL,QUOTES_MODULE_NAME,LAST_RUN_VERSION,1);
- for(HANDLE hContact = db_find_first(QUOTES_MODULE_NAME); hContact; hContact = db_find_next(hContact, QUOTES_MODULE_NAME))
+ for(HCONTACT hContact = db_find_first(QUOTES_MODULE_NAME); hContact; hContact = db_find_next(hContact, QUOTES_MODULE_NAME))
{
TQuotesProviderPtr pProvider = GetContactProviderPtr(hContact);
if(pProvider)
@@ -76,7 +76,7 @@ void CQuotesProviders::InitProviders() db_set_w(NULL,QUOTES_MODULE_NAME,LAST_RUN_VERSION,nCurrentVersion);
}
-CQuotesProviders::TQuotesProviderPtr CQuotesProviders::GetContactProviderPtr(HANDLE hContact)const
+CQuotesProviders::TQuotesProviderPtr CQuotesProviders::GetContactProviderPtr(HCONTACT hContact)const
{
char* szProto = GetContactProto(hContact);
if(NULL == szProto || 0 != ::_stricmp(szProto, QUOTES_PROTOCOL_NAME))
diff --git a/plugins/Quotes/src/QuotesProviders.h b/plugins/Quotes/src/QuotesProviders.h index 8ccb3a5474..50394923cb 100644 --- a/plugins/Quotes/src/QuotesProviders.h +++ b/plugins/Quotes/src/QuotesProviders.h @@ -14,7 +14,7 @@ public: ~CQuotesProviders();
TQuotesProviderPtr FindProvider(const tstring& rsName)const;
- TQuotesProviderPtr GetContactProviderPtr(HANDLE hContact)const;
+ TQuotesProviderPtr GetContactProviderPtr(HCONTACT hContact)const;
const TQuotesProviders& GetProviders()const;
private:
diff --git a/plugins/Quotes/src/SettingsDlg.cpp b/plugins/Quotes/src/SettingsDlg.cpp index 9cf906526f..0045c21cad 100644 --- a/plugins/Quotes/src/SettingsDlg.cpp +++ b/plugins/Quotes/src/SettingsDlg.cpp @@ -126,10 +126,10 @@ namespace struct CSettingWindowParam
{
- CSettingWindowParam(HANDLE hContact) : m_hContact(hContact),m_pPopupSettings(NULL){}
+ CSettingWindowParam(HCONTACT hContact) : m_hContact(hContact),m_pPopupSettings(NULL){}
~CSettingWindowParam(){delete m_pPopupSettings;}
- HANDLE m_hContact;
+ HCONTACT m_hContact;
CPopupSettings* m_pPopupSettings;
};
@@ -268,7 +268,7 @@ namespace {
case WM_INITDIALOG:
{
- HANDLE hContact = reinterpret_cast<HANDLE>(lp);
+ HCONTACT hContact = reinterpret_cast<HCONTACT>(lp);
TranslateDialogDefault(hWnd);
HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_SETTINGS,false);
@@ -393,7 +393,7 @@ namespace case IDOK:
{
CSettingWindowParam* pParam = get_param(hWnd);
- HANDLE hContact = pParam->m_hContact;
+ HCONTACT hContact = pParam->m_hContact;
bool bUseContactSpec = 1 == ::IsDlgButtonChecked(hWnd,IDC_CHECK_CONTACT_SPECIFIC);
@@ -507,7 +507,7 @@ namespace }
-void ShowSettingsDlg(HANDLE hContact)
+void ShowSettingsDlg(HCONTACT hContact)
{
HANDLE hWL = CModuleInfo::GetInstance().GetWindowList(WINDOW_PREFIX_SETTINGS,true);
assert(hWL);
@@ -933,7 +933,7 @@ COLORREF CPopupSettings::GetDefColourText() return ::GetSysColor(COLOR_BTNTEXT);
}
-void CPopupSettings::InitForContact(HANDLE hContact)
+void CPopupSettings::InitForContact(HCONTACT hContact)
{
BYTE m = db_get_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_MODE,static_cast<BYTE>(m_modeColour));
if(m >= CPopupSettings::colourDefault && m <= CPopupSettings::colourUserDefined)
@@ -953,7 +953,7 @@ void CPopupSettings::InitForContact(HANDLE hContact) m_bUseHistory = 1 == db_get_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_HISTORY_FLAG,m_bUseHistory);
}
-void CPopupSettings::SaveForContact(HANDLE hContact)const
+void CPopupSettings::SaveForContact(HCONTACT hContact)const
{
db_set_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_MODE,static_cast<BYTE>(m_modeColour));
db_set_dw(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_BK,m_rgbBkg);
@@ -1088,7 +1088,7 @@ tstring GenerateLogFileName(const tstring& rsLogFilePattern, return sPath;
}
-tstring GetContactLogFileName(HANDLE hContact)
+tstring GetContactLogFileName(HCONTACT hContact)
{
tstring result;
@@ -1113,7 +1113,7 @@ tstring GetContactLogFileName(HANDLE hContact) return result;
}
-tstring GetContactName(HANDLE hContact)
+tstring GetContactName(HCONTACT hContact)
{
tstring sDescription = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_DESCRIPTION);
if(sDescription.empty())
diff --git a/plugins/Quotes/src/SettingsDlg.h b/plugins/Quotes/src/SettingsDlg.h index 569d0b7d2c..355f7bd216 100644 --- a/plugins/Quotes/src/SettingsDlg.h +++ b/plugins/Quotes/src/SettingsDlg.h @@ -25,8 +25,8 @@ public: static COLORREF GetDefColourBk();
static COLORREF GetDefColourText();
- void InitForContact(HANDLE hContact);
- void SaveForContact(HANDLE hContact)const;
+ void InitForContact(HCONTACT hContact);
+ void SaveForContact(HCONTACT hContact)const;
EColourMode GetColourMode()const;
void SetColourMode(EColourMode nMode);
@@ -101,7 +101,7 @@ private: mutable CPopupSettings* m_pPopupSettings;
};
-void ShowSettingsDlg(HANDLE hContact);
+void ShowSettingsDlg(HCONTACT hContact);
bool ShowSettingsDlg(HWND hWndParent,CAdvProviderSettings* pAdvSettings);
enum
@@ -111,8 +111,8 @@ enum glfnResolveAll = glfnResolveQuoteName|glfnResolveUserProfile,
};
tstring GenerateLogFileName(const tstring& rsLogFilePattern,const tstring& rsQuoteSymbol,int nFlags = glfnResolveAll);
-tstring GetContactLogFileName(HANDLE hContact);
-tstring GetContactName(HANDLE hContact);
+tstring GetContactLogFileName(HCONTACT hContact);
+tstring GetContactName(HCONTACT hContact);
#endif //__E211E4D9_383C_43BE_A787_7EF1D585B90D_SettingsDlg_h__
diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp index f9043254f4..b875ae23c6 100644 --- a/plugins/Rate/src/main.cpp +++ b/plugins/Rate/src/main.cpp @@ -69,7 +69,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda ///////////////////////////////////////////////////////////////////////////////
-static void setExtraIcon(HANDLE hContact, int bRate = -1, BOOL clear = TRUE)
+static void setExtraIcon(HCONTACT hContact, int bRate = -1, BOOL clear = TRUE)
{
if (hContact == NULL)
return;
@@ -106,7 +106,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) hExtraIcon = ExtraIcon_Register("contact_rate", LPGEN("Contact rate"), "rate_high");
// Set initial value for all contacts
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
setExtraIcon(hContact, -1, FALSE);
return 0;
@@ -117,7 +117,7 @@ int onContactSettingChanged(WPARAM wParam,LPARAM lParam) DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
if (wParam != NULL && !lstrcmpA(cws->szModule,"CList") && !lstrcmpA(cws->szSetting,"Rate"))
- setExtraIcon((HANDLE)wParam, cws->value.type == DBVT_DELETED ? 0 : cws->value.bVal);
+ setExtraIcon((HCONTACT)wParam, cws->value.type == DBVT_DELETED ? 0 : cws->value.bVal);
return 0;
}
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index d1d129039f..335e4baf56 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -130,7 +130,7 @@ BOOL ShowListMainDlgProc_OpenContactMenu(HWND hDlg, HWND hList, int item, LASTUC if (hCMenu != NULL) {
POINT p;
GetCursorPos(&p);
- DlgDat->hContact = (HANDLE) lvi.lParam;
+ DlgDat->hContact = (HCONTACT) lvi.lParam;
BOOL ret = TrackPopupMenu(hCMenu, 0, p.x, p.y, 0, hDlg, NULL);
DestroyMenu(hCMenu);
if (ret)
@@ -242,7 +242,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM if (LastUCOpt.HideOffline == 1) {
szProto = GetContactProto(curContact->second);
- if (szProto != NULL && db_get_w((HANDLE)curContact->second, szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
+ if (szProto != NULL && db_get_w(curContact->second, szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
continue;
}
@@ -379,9 +379,8 @@ INT_PTR OnMenuCommandShowList(WPARAM wParam, LPARAM lParam) BYTE buf[1];
dbe.pBlob = buf;
HANDLE curEvent;
- HANDLE curContact = db_find_first();
- for (; curContact != NULL; curContact = db_find_next(curContact))
- {
+
+ for (HCONTACT curContact = db_find_first(); curContact != NULL; curContact = db_find_next(curContact)) {
curTime = ((__time64_t)db_get_dw(curContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeLo, -1)) |
(((__time64_t)db_get_dw(curContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeHi, -1)) << 32);
@@ -455,7 +454,7 @@ int Create_MenuitemShowList(void) return 0;
}
-BOOL SaveLastUsedTimeStamp(HANDLE hContact)
+BOOL SaveLastUsedTimeStamp(HCONTACT hContact)
{
__time64_t ct = _time64(NULL);
db_set_dw(hContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeLo, (DWORD)ct);
@@ -485,7 +484,7 @@ static int OnPrebuildContactMenu (WPARAM wParam, LPARAM lParam) CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME | CMIF_TCHAR;
- if ( db_get_b((HANDLE)wParam, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0)
+ if ( db_get_b((HCONTACT)wParam, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0)
clmi.ptszName = TranslateT("Ignore Contact");
else
clmi.ptszName = TranslateT("Show Contact");
@@ -516,7 +515,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) INT_PTR ToggleIgnore (WPARAM wParam, LPARAM lParam)
{
if (wParam != NULL) {
- HANDLE hContact = ( HANDLE )wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
int state = db_get_b(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0 ? 1 : 0 ;
db_set_b(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, state);
return state;
diff --git a/plugins/RecentContacts/src/RecentContacts.h b/plugins/RecentContacts/src/RecentContacts.h index 246bc9d8b0..474fce2d97 100644 --- a/plugins/RecentContacts/src/RecentContacts.h +++ b/plugins/RecentContacts/src/RecentContacts.h @@ -71,13 +71,13 @@ struct TABSRMM_SessionInfo { };
-typedef std::multimap <__time64_t, HANDLE, std::greater<__time64_t> > cmultimap;
-typedef std::pair <__time64_t, HANDLE> cpair;
+typedef std::multimap <__time64_t, HCONTACT, std::greater<__time64_t> > cmultimap;
+typedef std::pair <__time64_t, HCONTACT> cpair;
typedef struct LASTUC_DLG_DATA
{
cmultimap *Contacts;
SIZE WindowMinSize;
RECT ListUCRect;
- HANDLE hContact;
+ HCONTACT hContact;
} LASTUC_DLG_DATA;
\ No newline at end of file diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index d1e8a698ea..0583087e57 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -97,7 +97,7 @@ BOOL GetSettings(const char *section, char *buffer, size_t bufferSize); void DeleteFileOrFolder(const char *name);
void DeleteSetting(const char *setting);
void DeleteSettingEx(const char *szModule, const char *szSetting);
-BOOL isMetaContact(HANDLE hContact);
+BOOL isMetaContact(HCONTACT hContact);
@@ -222,9 +222,8 @@ void SetProtocolsOffline() void RemoveUsers()
{
if ( GetSettingBool("GlobalSettings", "RemoveAllUsers", TRUE) ) {
- HANDLE hContact;
+ HCONTACT hContact, hContactOld;
HANDLE hDbEvent;
- HANDLE hContactOld;
// To be faster, remove first all metacontacts (because it syncs histories)
hContact = db_find_first();
@@ -232,14 +231,14 @@ void RemoveUsers() hContactOld = hContact;
hContact = db_find_next(hContact);
- if ( isMetaContact(hContactOld) )
- CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContactOld, 0);
+ if (isMetaContact(hContactOld) )
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContactOld, 0);
}
// Now delete all left-overs
hContact = db_find_first();
while(hContact != NULL) {
- CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
hContact = db_find_first();
}
@@ -614,7 +613,7 @@ void DeleteFileOrFolder(const char *name) }
-BOOL isMetaContact(HANDLE hContact)
+BOOL isMetaContact(HCONTACT hContact)
{
return lstrcmpA(GetContactProto(hContact), METACONTACTS_PROTOCOL_NAME) == 0;
}
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 7e5d31be65..549d959a92 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -54,7 +54,7 @@ int LoadModules(void) int SmsRebuildContactMenu(WPARAM wParam,LPARAM lParam)
{
- Menu_ShowItem(ssSMSSettings.hContactMenuItems[0], GetContactPhonesCount((HANDLE)wParam));
+ Menu_ShowItem(ssSMSSettings.hContactMenuItems[0], GetContactPhonesCount((HCONTACT)wParam));
return 0;
}
@@ -65,11 +65,11 @@ int SendSMSMenuCommand(WPARAM wParam,LPARAM lParam) // user clicked on the "SMS Message" on one of the users
if (wParam) {
- hwndSendSms = SendSMSWindowIsOtherInstanceHContact((HANDLE)wParam);
+ hwndSendSms = SendSMSWindowIsOtherInstanceHContact((HCONTACT)wParam);
if (hwndSendSms)
SetFocus(hwndSendSms);
else
- hwndSendSms = SendSMSWindowAdd((HANDLE)wParam);
+ hwndSendSms = SendSMSWindowAdd((HCONTACT)wParam);
}
// user clicked on the "SMS Send" in the Main Menu
else{
@@ -77,7 +77,7 @@ int SendSMSMenuCommand(WPARAM wParam,LPARAM lParam) EnableWindow(GetDlgItem(hwndSendSms,IDC_NAME),TRUE);
EnableWindow(GetDlgItem(hwndSendSms,IDC_SAVENUMBER),FALSE);
- 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 (GetContactPhonesCount(hContact)) {
SendDlgItemMessage(hwndSendSms,IDC_NAME,CB_ADDSTRING,0,(LPARAM)GetContactNameW(hContact));
SendSMSWindowSMSContactAdd(hwndSendSms,hContact);
@@ -134,7 +134,7 @@ void RestoreUnreadMessageAlerts(void) {
DBEVENTINFO dbei = { sizeof(dbei) };
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
for (HANDLE hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hDbEvent)) {
dbei.cbBlob = 0;
if (db_event_get(hDbEvent, &dbei) == 0)
diff --git a/plugins/SMS/src/common.h b/plugins/SMS/src/common.h index 5388d6dda6..ae468ebcc6 100644 --- a/plugins/SMS/src/common.h +++ b/plugins/SMS/src/common.h @@ -92,26 +92,26 @@ extern SMS_SETTINGS ssSMSSettings; #define DB_SMS_SetWord(Contact,valueName,parValue) db_set_w(Contact,PROTOCOL_NAMEA,valueName,parValue)
#define DB_SMS_GetByte(Contact,valueName,parDefltValue) db_get_b(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
#define DB_SMS_SetByte(Contact,valueName,parValue) db_set_b(Contact,PROTOCOL_NAMEA,valueName,parValue)
-BOOL DB_GetStaticStringW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
+BOOL DB_GetStaticStringW(HCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
#define DB_SMS_GetStaticStringW(Contact,ValueName,Ret,RetBuffSize,pRetBuffSize) DB_GetStaticStringW(Contact,PROTOCOL_NAMEA,ValueName,Ret,RetBuffSize,pRetBuffSize)
#define DB_SetStringW(Contact,Module,valueName,parValue) db_set_ws(Contact,Module,valueName,parValue)
#define DB_SMS_SetStringW(Contact,valueName,parValue) db_set_ws(Contact,PROTOCOL_NAMEA,valueName,parValue)
LRESULT CALLBACK MessageSubclassProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
-LPSTR GetModuleName(HANDLE hContact);
+LPSTR GetModuleName(HCONTACT hContact);
void EnableControlsArray(HWND hWndDlg,WORD *pwControlsList,SIZE_T dwControlsListCount,BOOL bEnabled);
// Declaration of function that returns received string with only numbers
SIZE_T CopyNumberA(LPSTR lpszOutBuff,LPSTR lpszBuff,SIZE_T dwLen);
SIZE_T CopyNumberW(LPWSTR lpcOutBuff,LPWSTR lpcBuff,SIZE_T dwLen);
bool IsPhoneW(LPWSTR lpwszString,SIZE_T dwStringLen);
-DWORD GetContactPhonesCount(HANDLE hContact);
-BOOL IsContactPhone(HANDLE hContact,LPWSTR lpwszPhone,SIZE_T dwPhoneSize);
+DWORD GetContactPhonesCount(HCONTACT hContact);
+BOOL IsContactPhone(HCONTACT hContact,LPWSTR lpwszPhone,SIZE_T dwPhoneSize);
// Declaration of function that returns HANDLE of contact by his cellular number
-HANDLE HContactFromPhone(LPWSTR lpwszPhone,SIZE_T dwPhoneSize);
-BOOL GetDataFromMessage(LPSTR lpszMessage,SIZE_T dwMessageSize,DWORD *pdwEventType,LPWSTR lpwszPhone,SIZE_T dwPhoneSize,SIZE_T *pdwPhoneSizeRet,UINT *piIcon);
+HCONTACT HContactFromPhone(LPWSTR lpwszPhone,SIZE_T dwPhoneSize);
+BOOL GetDataFromMessage(LPSTR lpszMessage,SIZE_T dwMessageSize,DWORD *pdwEventType,LPWSTR lpwszPhone,SIZE_T dwPhoneSize,SIZE_T *pdwPhoneSizeRet,UINT *piIcon);
// Declaration of function that gets a XML string and return the asked tag.
BOOL GetXMLFieldEx(LPSTR lpszXML,SIZE_T dwXMLSize,LPSTR *plpszData,SIZE_T *pdwDataSize,const char *tag1,...);
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index f61e6ee67d..d560ad733c 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -1,6 +1,6 @@ #include "common.h"
-BOOL DB_GetStaticStringW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
+BOOL DB_GetStaticStringW(HCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize)
{// sizes in wchars
BOOL bRet=FALSE;
SIZE_T dwReadedStringLen;
@@ -26,7 +26,7 @@ BOOL DB_GetStaticStringW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LP return(bRet);
}
-LPSTR GetModuleName(HANDLE hContact)
+LPSTR GetModuleName(HCONTACT hContact)
{
LPSTR lpszRet;
@@ -92,7 +92,7 @@ bool IsPhoneW(LPWSTR lpwszString,SIZE_T dwStringLen) }
-DWORD GetContactPhonesCountParam(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName)
+DWORD GetContactPhonesCountParam(HCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName)
{
DWORD dwRet=0;
char szBuff[MAX_PATH];
@@ -113,7 +113,7 @@ DWORD GetContactPhonesCountParam(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValu }
-DWORD GetContactPhonesCount(HANDLE hContact)
+DWORD GetContactPhonesCount(HCONTACT hContact)
{
DWORD dwRet = 0;
LPSTR lpszProto = GetContactProto(hContact);
@@ -130,7 +130,7 @@ DWORD GetContactPhonesCount(HANDLE hContact) }
-BOOL IsContactPhoneParam(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszPhone,SIZE_T dwPhoneSize)
+BOOL IsContactPhoneParam(HCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszPhone,SIZE_T dwPhoneSize)
{
char szBuff[MAX_PATH];
WCHAR wszPhoneLocal[MAX_PHONE_LEN];
@@ -157,7 +157,7 @@ BOOL IsContactPhoneParam(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LP }
-BOOL IsContactPhone(HANDLE hContact,LPWSTR lpwszPhone,SIZE_T dwPhoneSize)
+BOOL IsContactPhone(HCONTACT hContact,LPWSTR lpwszPhone,SIZE_T dwPhoneSize)
{
BOOL bRet=FALSE;
WCHAR wszPhoneLocal[MAX_PHONE_LEN];
@@ -181,11 +181,11 @@ BOOL IsContactPhone(HANDLE hContact,LPWSTR lpwszPhone,SIZE_T dwPhoneSize) //This function get a string cellular number and return the HANDLE of the contact that has this
//number in the miranda phonebook (and marked as an SMS able) at the User Details.
//If no one has this number function returns NULL.
-HANDLE HContactFromPhone(LPWSTR lpwszPhone,SIZE_T dwPhoneSize)
+HCONTACT HContactFromPhone(LPWSTR lpwszPhone,SIZE_T dwPhoneSize)
{
if (lpwszPhone && dwPhoneSize) {
//check not already on list
- for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
if (IsContactPhone(hContact,lpwszPhone,dwPhoneSize))
return hContact;
}
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index 43cab8af13..e6f647adc6 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -45,7 +45,6 @@ int handleAckSMS(WPARAM wParam,LPARAM lParam) {
LPSTR lpszMessageUTF;
SIZE_T dwBuffLen,dwMessageXMLEncodedSize,dwMessageXMLDecodedSize;
- HANDLE hContact;
DBEVENTINFO dbei = { sizeof(dbei) };
dwBuffLen=(dwDataSize+MAX_PATH);
@@ -61,7 +60,7 @@ int handleAckSMS(WPARAM wParam,LPARAM lParam) dwPhoneSize=CopyNumberA(szPhone,lpszPhone,dwPhoneSize);
dwPhoneSize=MultiByteToWideChar(CP_UTF8,0,szPhone,dwPhoneSize,tszPhone,MAX_PHONE_LEN);
- hContact=HContactFromPhone(tszPhone,dwPhoneSize);
+ HCONTACT hContact=HContactFromPhone(tszPhone,dwPhoneSize);
dbei.szModule=GetModuleName(hContact);
dbei.timestamp=time(NULL);
@@ -89,7 +88,7 @@ int handleAckSMS(WPARAM wParam,LPARAM lParam) {
dwPhoneSize=CopyNumberA(szPhone,lpszPhone,dwPhoneSize);
dwPhoneSize=MultiByteToWideChar(CP_UTF8,0,szPhone,dwPhoneSize,tszPhone,MAX_PHONE_LEN);
- HANDLE hContact=HContactFromPhone(tszPhone,dwPhoneSize);
+ HCONTACT hContact=HContactFromPhone(tszPhone,dwPhoneSize);
DBEVENTINFO dbei={0};
dbei.cbSize=sizeof(dbei);
@@ -212,7 +211,8 @@ int handleNewMessage(WPARAM wParam, LPARAM lParam) {
char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
TCHAR szToolTip[MAX_PATH];
- HANDLE hContact = (HANDLE)wParam, hDbEvent = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)wParam;
+ HANDLE hDbEvent = (HANDLE)lParam;
DBEVENTINFO dbei = { sizeof(dbei) };
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) != -1) {
diff --git a/plugins/SMS/src/recvdlg.cpp b/plugins/SMS/src/recvdlg.cpp index e7f640ffca..eea5b7ca60 100644 --- a/plugins/SMS/src/recvdlg.cpp +++ b/plugins/SMS/src/recvdlg.cpp @@ -30,10 +30,10 @@ Enjoy the code and use it smartly! //Defnition needed to the SMS window list
typedef struct
{
- LIST_MT_ITEM lmtListMTItem;
- HWND hWnd;
- HBRUSH hBkgBrush;
- HANDLE hContact;
+ LIST_MT_ITEM lmtListMTItem;
+ HWND hWnd;
+ HBRUSH hBkgBrush;
+ HCONTACT hContact;
} RECV_SMS_WINDOW_DATA;
INT_PTR CALLBACK RecvSmsDlgProc (HWND hWndDlg,UINT message,WPARAM wParam,LPARAM lParam);
@@ -134,7 +134,7 @@ INT_PTR CALLBACK RecvSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l {
WCHAR wszPhone[MAX_PHONE_LEN];
HWND hwndSendSms;
- HANDLE hContact;
+ HCONTACT hContact;
hContact=HContactFromPhone(wszPhone,GetDlgItemText(hWndDlg,IDC_NUMBER,wszPhone,SIZEOF(wszPhone)));
hwndSendSms=SendSMSWindowIsOtherInstanceHContact(hContact);
@@ -164,7 +164,7 @@ INT_PTR CALLBACK RecvSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l //This function create a new SMS receive window, and insert it to the list.
//The function gets void and return the window HWND
-HWND RecvSMSWindowAdd(HANDLE hContact,DWORD dwEventType,LPWSTR lpwszPhone,SIZE_T dwPhoneSize,LPSTR lpszMessage,SIZE_T dwMessageSize)
+HWND RecvSMSWindowAdd(HCONTACT hContact,DWORD dwEventType,LPWSTR lpwszPhone,SIZE_T dwPhoneSize,LPSTR lpszMessage,SIZE_T dwMessageSize)
{
HWND hRet=NULL;
diff --git a/plugins/SMS/src/recvdlg.h b/plugins/SMS/src/recvdlg.h index 5090dff12e..47363466fe 100644 --- a/plugins/SMS/src/recvdlg.h +++ b/plugins/SMS/src/recvdlg.h @@ -3,7 +3,7 @@ DWORD RecvSMSWindowInitialize ();
void RecvSMSWindowDestroy ();
-HWND RecvSMSWindowAdd (HANDLE hContact,DWORD dwEventType,LPWSTR lpwszPhone,SIZE_T dwPhoneSize,LPSTR lpszMessage,SIZE_T dwMessageSize);
+HWND RecvSMSWindowAdd (HCONTACT hContact,DWORD dwEventType,LPWSTR lpwszPhone,SIZE_T dwPhoneSize,LPSTR lpszMessage,SIZE_T dwMessageSize);
void RecvSMSWindowRemove (HWND hWndDlg);
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp index e92fdbe2ce..e8c32565e7 100644 --- a/plugins/SMS/src/senddlg.cpp +++ b/plugins/SMS/src/senddlg.cpp @@ -36,20 +36,20 @@ Enjoy the code and use it smartly! //Defnition needed to the SMS window list
typedef struct
{
- LIST_MT_ITEM lmtListMTItem;
- HWND hWnd;
- HBRUSH hBkgBrush;
- HANDLE hProcess;
- HANDLE hContact;
- HANDLE hMyContact;
- HTREEITEM hItemSend;
- BOOL bMultiple;
- SIZE_T dwContactsListCount;
- HANDLE *phContactsList;
- DBEVENTINFO *pdbei;
+ LIST_MT_ITEM lmtListMTItem;
+ HWND hWnd;
+ HBRUSH hBkgBrush;
+ HANDLE hProcess;
+ HCONTACT hContact;
+ HCONTACT hMyContact;
+ HTREEITEM hItemSend;
+ BOOL bMultiple;
+ SIZE_T dwContactsListCount;
+ HCONTACT *phContactsList;
+ DBEVENTINFO *pdbei;
} SEND_SMS_WINDOW_DATA;
-void AddContactPhonesToCombo (HWND hWnd,HANDLE hContact);
+void AddContactPhonesToCombo (HWND hWnd,HCONTACT hContact);
void SendSMSWindowFillTreeView (HWND hWnd);
SIZE_T GetSMSMessageLenMax (HWND hWndDlg);
@@ -427,7 +427,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l SendDlgItemMessage(hWndDlg,IDC_ADDRESS,CB_RESETCONTENT,0,0);
if (SendDlgItemMessage(hWndDlg,IDC_NAME,CB_GETCURSEL,0,0))
{
- HANDLE hContact=SendSMSWindowSMSContactGet(hWndDlg,(SendDlgItemMessage(hWndDlg,IDC_NAME,CB_GETCURSEL,0,0)-1));
+ HCONTACT hContact = SendSMSWindowSMSContactGet(hWndDlg,(SendDlgItemMessage(hWndDlg,IDC_NAME,CB_GETCURSEL,0,0)-1));
if (hContact) AddContactPhonesToCombo(hWndDlg,hContact);
}
}
@@ -557,7 +557,7 @@ INT_PTR CALLBACK SMSAcceptedDlgProc(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM l //This function create a new SMS send window, and insert it to the list.
//The function gets void and return the window HWND
-HWND SendSMSWindowAdd(HANDLE hContact)
+HWND SendSMSWindowAdd(HCONTACT hContact)
{
HWND hRet=NULL;
SEND_SMS_WINDOW_DATA *psswdWindowData=(SEND_SMS_WINDOW_DATA*)MEMALLOC(sizeof(SEND_SMS_WINDOW_DATA));
@@ -608,18 +608,18 @@ void SendSMSWindowRemove(HWND hWndDlg) //This function return the contact HANDLE for the given to the SMS send window.
//The function gets the HWND of the window and return the HANDLE of the contact.
-HANDLE SendSMSWindowHContactGet(HWND hWndDlg)
+HCONTACT SendSMSWindowHContactGet(HWND hWndDlg)
{
- HANDLE hRet=NULL;
+ HCONTACT hRet=NULL;
SEND_SMS_WINDOW_DATA *psswdWindowData=GET_WINDOW_DATA(hWndDlg);
if (psswdWindowData) hRet=psswdWindowData->hMyContact;
-return(hRet);
+ return(hRet);
}
//This function set the contact info of the person we send him the in the given to the SMS send window.
//The function gets the HWND of the window and the HANDLE of the contact and return void
-void SendSMSWindowHContactSet(HWND hWndDlg,HANDLE hContact)
+void SendSMSWindowHContactSet(HWND hWndDlg,HCONTACT hContact)
{
SEND_SMS_WINDOW_DATA *psswdWindowData=GET_WINDOW_DATA(hWndDlg);
if (psswdWindowData) psswdWindowData->hMyContact=hContact;
@@ -837,7 +837,7 @@ return(NULL); //This function get the HANDLE of an user. if there is already a SMS send window for this contact
//it return its HWND else the function return NULL.
//The function gets the HANDLE of a contact and return HWND
-HWND SendSMSWindowIsOtherInstanceHContact(HANDLE hContact)
+HWND SendSMSWindowIsOtherInstanceHContact(HCONTACT hContact)
{
HWND hRet=NULL;
SEND_SMS_WINDOW_DATA *psswdWindowData;
@@ -893,33 +893,30 @@ void SendSMSWindowNext(HWND hWndDlg) //////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
//This function gets a HANDLE of a contact and add it to a list.
-void SendSMSWindowSMSContactAdd(HWND hWndDlg,HANDLE hContact)
+void SendSMSWindowSMSContactAdd(HWND hWndDlg,HCONTACT hContact)
{
SEND_SMS_WINDOW_DATA *psswdWindowData=GET_WINDOW_DATA(hWndDlg);
- if (psswdWindowData)
- {
+ if (psswdWindowData) {
psswdWindowData->dwContactsListCount++;
if (psswdWindowData->phContactsList)
- {
- psswdWindowData->phContactsList=(HANDLE*)MEMREALLOC(psswdWindowData->phContactsList,(sizeof(HANDLE)*psswdWindowData->dwContactsListCount));
- }else{
- psswdWindowData->phContactsList=(HANDLE*)MEMALLOC((sizeof(HANDLE)*psswdWindowData->dwContactsListCount));
- }
+ psswdWindowData->phContactsList = (HCONTACT*)MEMREALLOC(psswdWindowData->phContactsList,(sizeof(HANDLE)*psswdWindowData->dwContactsListCount));
+ else
+ psswdWindowData->phContactsList = (HCONTACT*)MEMALLOC((sizeof(HANDLE)*psswdWindowData->dwContactsListCount));
+
*(psswdWindowData->phContactsList+psswdWindowData->dwContactsListCount-1)=hContact;
}
}
//This function gets the number of the given contact in the combo list and return its contact.
-HANDLE SendSMSWindowSMSContactGet(HWND hWndDlg,SIZE_T iNum)
+HCONTACT SendSMSWindowSMSContactGet(HWND hWndDlg,SIZE_T iNum)
{
SEND_SMS_WINDOW_DATA *psswdWindowData=GET_WINDOW_DATA(hWndDlg);
if (psswdWindowData)
- {
return(*((psswdWindowData->phContactsList)+iNum));
- }
-return(NULL);
+
+ return(NULL);
}
void SendSMSWindowSMSContactsRemove(HWND hWndDlg)
@@ -977,7 +974,7 @@ void SendSMSWindowsUpdateAllAccountLists() -void AddContactPhonesToComboToListParam(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,HWND hWndList)
+void AddContactPhonesToComboToListParam(HCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,HWND hWndList)
{
char szBuff[MAX_PATH];
TCHAR tszPhone[MAX_PHONE_LEN],tszPhoneRaw[MAX_PHONE_LEN];
@@ -1011,7 +1008,7 @@ void AddContactPhonesToComboToListParam(HANDLE hContact,LPSTR lpszModule,LPSTR l }
-void AddContactPhonesToCombo(HWND hWnd,HANDLE hContact)
+void AddContactPhonesToCombo(HWND hWnd,HCONTACT hContact)
{
HWND hWndList = GetDlgItem(hWnd,IDC_ADDRESS);
SendDlgItemMessage(hWnd,IDC_ADDRESS,CB_RESETCONTENT,0,0);
@@ -1032,7 +1029,7 @@ void AddContactPhonesToCombo(HWND hWnd,HANDLE hContact) -void AddContactPhonesToTreeViewParam(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,HWND hWndList,HTREEITEM *phParent)
+void AddContactPhonesToTreeViewParam(HCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,HWND hWndList,HTREEITEM *phParent)
{
char szBuff[MAX_PATH];
TCHAR tszPhone[MAX_PHONE_LEN],tszPhoneRaw[MAX_PHONE_LEN];
@@ -1090,7 +1087,7 @@ void SendSMSWindowFillTreeView(HWND hWnd) HWND hWndTreeView=GetDlgItem(hWnd,IDC_NUMBERSLIST);
TreeView_DeleteAllItems(hWndTreeView);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HTREEITEM hParent = NULL;
LPSTR lpszProto = GetContactProto(hContact);
if (lpszProto) {
diff --git a/plugins/SMS/src/senddlg.h b/plugins/SMS/src/senddlg.h index e3ad1d40b5..81c7acf2dc 100644 --- a/plugins/SMS/src/senddlg.h +++ b/plugins/SMS/src/senddlg.h @@ -11,26 +11,26 @@ INT_PTR CALLBACK SMSTimedOutDlgProc(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM l HTREEITEM SendSMSWindowHItemSendGet(HWND hWndDlg);
HTREEITEM SendSMSWindowNextHItemGet(HWND hWndDlg,HTREEITEM hItem);
-HWND SendSMSWindowAdd(HANDLE hContact);
-void SendSMSWindowRemove(HWND hWndDlg);
-HANDLE SendSMSWindowHContactGet(HWND hWndDlg);
-void SendSMSWindowHContactSet(HWND hWndDlg,HANDLE hContact);
-HWND SendSMSWindowHwndByHProcessGet(HANDLE hProcess);
-void SendSMSWindowHProcessSet(HWND hWndDlg,HANDLE hProcess);
-BOOL SendSMSWindowMultipleGet(HWND hWndDlg);
-void SendSMSWindowMultipleSet(HWND hWndDlg,BOOL bMultiple);
-void SendSMSWindowNumberSet(HWND hWndDlg,LPWSTR lpwszPhone,SIZE_T dwPhoneSize);
-void SendSMSWindowAsSentSet(HWND hWndDlg);
-void SendSMSWindowDbeiSet(HWND hWndDlg,DBEVENTINFO *pdbei);
-void SendSMSWindowDBAdd(HWND hWndDlg);
-void SendSMSWindowHItemSendSet(HWND hWndDlg,HTREEITEM hItemSend);
-HWND SendSMSWindowIsOtherInstanceHContact(HANDLE hContact);
-void SendSMSWindowNext(HWND hWndDlg);
+HWND SendSMSWindowAdd(HCONTACT hContact);
+void SendSMSWindowRemove(HWND hWndDlg);
+HCONTACT SendSMSWindowHContactGet(HWND hWndDlg);
+void SendSMSWindowHContactSet(HWND hWndDlg,HCONTACT hContact);
+HWND SendSMSWindowHwndByHProcessGet(HANDLE hProcess);
+void SendSMSWindowHProcessSet(HWND hWndDlg,HANDLE hProcess);
+BOOL SendSMSWindowMultipleGet(HWND hWndDlg);
+void SendSMSWindowMultipleSet(HWND hWndDlg,BOOL bMultiple);
+void SendSMSWindowNumberSet(HWND hWndDlg,LPWSTR lpwszPhone,SIZE_T dwPhoneSize);
+void SendSMSWindowAsSentSet(HWND hWndDlg);
+void SendSMSWindowDbeiSet(HWND hWndDlg,DBEVENTINFO *pdbei);
+void SendSMSWindowDBAdd(HWND hWndDlg);
+void SendSMSWindowHItemSendSet(HWND hWndDlg,HTREEITEM hItemSend);
+HWND SendSMSWindowIsOtherInstanceHContact(HCONTACT hContact);
+void SendSMSWindowNext(HWND hWndDlg);
-void SendSMSWindowSMSContactAdd(HWND hWndDlg,HANDLE hContact);
-HANDLE SendSMSWindowSMSContactGet(HWND hWndDlg,SIZE_T iNum);
-void SendSMSWindowSMSContactsRemove(HWND hWndDlg);
-void SendSMSWindowUpdateAccountList(HWND hWndDlg);
-void SendSMSWindowsUpdateAllAccountLists();
+void SendSMSWindowSMSContactAdd(HWND hWndDlg,HCONTACT hContact);
+HCONTACT SendSMSWindowSMSContactGet(HWND hWndDlg,SIZE_T iNum);
+void SendSMSWindowSMSContactsRemove(HWND hWndDlg);
+void SendSMSWindowUpdateAccountList(HWND hWndDlg);
+void SendSMSWindowsUpdateAllAccountLists();
#endif // !defined(AFX_SMS_SENDDLG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
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
diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp index de3173403e..6dccfe53bc 100644 --- a/plugins/SecureIM/src/commonheaders.cpp +++ b/plugins/SecureIM/src/commonheaders.cpp @@ -5,7 +5,7 @@ HINSTANCE g_hInst, g_hIconInst; char TEMP[MAX_PATH];
int TEMP_SIZE = 0;
-HANDLE g_hEvent[2], g_hCLIcon=0, g_hFolders=0;
+HANDLE g_hEvent[2], g_hCLIcon, g_hFolders = 0;
HGENMENU g_hMenu[15];
int iService=0;
@@ -37,7 +37,7 @@ PLUGININFOEX pluginInfoEx = { {0x1B2A39E5, 0xE2F6, 0x494D, {0x95, 0x8D, 0x18, 0x08, 0xFD, 0x11, 0x0D, 0xD5}}
};
-LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSetting)
+LPSTR myDBGetStringDecode(HCONTACT hContact,const char *szModule,const char *szSetting)
{
char *val = db_get_sa(hContact,szModule,szSetting);
if (!val) return NULL;
@@ -47,7 +47,7 @@ LPSTR myDBGetStringDecode(HANDLE hContact,const char *szModule,const char *szSet return buf;
}
-int myDBWriteStringEncode(HANDLE hContact,const char *szModule,const char *szSetting,const char *val)
+int myDBWriteStringEncode(HCONTACT hContact,const char *szModule,const char *szSetting,const char *val)
{
int len = (int)strlen(val)+64;
char *buf = (LPSTR)alloca(len);
diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h index 9396b9426d..69305e6d4d 100644 --- a/plugins/SecureIM/src/commonheaders.h +++ b/plugins/SecureIM/src/commonheaders.h @@ -102,7 +102,7 @@ int onModulesLoaded(WPARAM, LPARAM); int onShutdown(WPARAM, LPARAM);
int ModuleLoad(WPARAM wParam, LPARAM lParam);
-__forceinline int SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
+__forceinline int SendBroadcast(HCONTACT hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
return ProtoBroadcastAck( GetContactProto(hContact), hContact, type, result, hProcess, lParam);
}
diff --git a/plugins/SecureIM/src/crypt.h b/plugins/SecureIM/src/crypt.h index a2ec230e48..9da46e8be9 100644 --- a/plugins/SecureIM/src/crypt.h +++ b/plugins/SecureIM/src/crypt.h @@ -39,7 +39,7 @@ typedef partitionMessage* pPM; // memory struct for keys
struct UinKey
{
- HANDLE hContact; // handle of contact
+ HCONTACT hContact; // handle of contact
u_int header; // HEADER
pSupPro proto; // proto struct
BYTE mode,tmode; // mode: Native,PGP,GPG,RSA/AES,RSA [0..4]
@@ -70,13 +70,13 @@ typedef UinKey* pUinKey; struct TFakeAckParams
{
- __forceinline TFakeAckParams(HANDLE p1, LONG p2, LPCSTR p3) :
+ __forceinline TFakeAckParams(HCONTACT p1, LONG p2, LPCSTR p3) :
hContact(p1),
id(p2),
msg(p3)
{}
- HANDLE hContact;
+ HCONTACT hContact;
LONG id;
LPCSTR msg;
};
@@ -90,73 +90,73 @@ extern LIST<UinKey> arClist; // crypt_lists.cpp
void loadContactList();
void freeContactList();
-pUinKey addContact(HANDLE hContact);
-void delContact(HANDLE hContact);
-pSupPro getSupPro(HANDLE);
-pUinKey findUinKey(HANDLE hContact);
-pUinKey getUinKey(HANDLE hContact);
+pUinKey addContact(HCONTACT hContact);
+void delContact(HCONTACT hContact);
+pSupPro getSupPro(HCONTACT);
+pUinKey findUinKey(HCONTACT hContact);
+pUinKey getUinKey(HCONTACT hContact);
pUinKey getUinCtx(HANDLE);
void addMsg2Queue(pUinKey,WPARAM,LPSTR);
-void getContactName(HANDLE hContact, LPSTR szName);
-void getContactNameA(HANDLE hContact, LPSTR szName);
-void getContactUin(HANDLE hContact, LPSTR szUIN);
-void getContactUinA(HANDLE hContact, LPSTR szUIN);
+void getContactName(HCONTACT hContact, LPSTR szName);
+void getContactNameA(HCONTACT hContact, LPSTR szName);
+void getContactUin(HCONTACT hContact, LPSTR szUIN);
+void getContactUinA(HCONTACT hContact, LPSTR szUIN);
// crypt_check.cpp
-int getContactStatus(HANDLE);
+int getContactStatus(HCONTACT);
-bool isSecureProtocol(HANDLE hContact);
-BYTE isContactSecured(HANDLE hContact);
+bool isSecureProtocol(HCONTACT hContact);
+BYTE isContactSecured(HCONTACT hContact);
bool isClientMiranda(pUinKey ptr, BOOL emptyMirverAsMiranda=FALSE);
-bool isClientMiranda(HANDLE hContact, BOOL emptyMirverAsMiranda=FALSE);
-bool isProtoSmallPackets(HANDLE);
-bool isContactInvisible(HANDLE);
-bool isNotOnList(HANDLE);
-bool isContactNewPG(HANDLE);
-bool isContactPGP(HANDLE);
-bool isContactGPG(HANDLE);
-bool isContactRSAAES(HANDLE);
-bool isContactRSA(HANDLE);
-bool isChatRoom(HANDLE);
+bool isClientMiranda(HCONTACT hContact, BOOL emptyMirverAsMiranda=FALSE);
+bool isProtoSmallPackets(HCONTACT);
+bool isContactInvisible(HCONTACT);
+bool isNotOnList(HCONTACT);
+bool isContactNewPG(HCONTACT);
+bool isContactPGP(HCONTACT);
+bool isContactGPG(HCONTACT);
+bool isContactRSAAES(HCONTACT);
+bool isContactRSA(HCONTACT);
+bool isChatRoom(HCONTACT);
bool isFileExist(LPCSTR);
bool isSecureIM(pUinKey ptr, BOOL emptyMirverAsSecureIM=FALSE);
-bool isSecureIM(HANDLE hContact, BOOL emptyMirverAsSecureIM=FALSE);
+bool isSecureIM(HCONTACT hContact, BOOL emptyMirverAsSecureIM=FALSE);
// crypt_icons.cpp
HICON mode2icon(int,int);
HANDLE mode2clicon(int mode, int type);
void RefreshContactListIcons(void);
-void ShowStatusIcon(HANDLE,UINT);
-void ShowStatusIcon(HANDLE);
-void ShowStatusIconNotify(HANDLE);
+void ShowStatusIcon(HCONTACT, UINT);
+void ShowStatusIcon(HCONTACT);
+void ShowStatusIconNotify(HCONTACT);
// crypt_popups.cpp
//static int CALLBACK PopupDlgProc(HWND,UINT,WPARAM,LPARAM);
-void showPopup(LPCSTR,HANDLE,HICON,UINT);
-void showPopupEC(HANDLE);
-void showPopupDCmsg(HANDLE,LPCSTR);
-void showPopupDC(HANDLE);
-void showPopupKS(HANDLE);
-void showPopupKRmsg(HANDLE,LPCSTR);
-void showPopupKR(HANDLE);
-void showPopupSM(HANDLE);
-void showPopupRM(HANDLE);
+void showPopup(LPCSTR, HCONTACT, HICON, UINT);
+void showPopupEC(HCONTACT);
+void showPopupDCmsg(HCONTACT, LPCSTR);
+void showPopupDC(HCONTACT);
+void showPopupKS(HCONTACT);
+void showPopupKRmsg(HCONTACT, LPCSTR);
+void showPopupKR(HCONTACT);
+void showPopupSM(HCONTACT);
+void showPopupRM(HCONTACT);
// crypt_meta.cpp
-BOOL isProtoMetaContacts(HANDLE);
-BOOL isDefaultSubContact(HANDLE);
-HANDLE getMetaContact(HANDLE);
-HANDLE getMostOnline(HANDLE);
-void DeinitMetaContact(HANDLE);
+BOOL isProtoMetaContacts(HCONTACT);
+BOOL isDefaultSubContact(HCONTACT);
+HCONTACT getMetaContact(HCONTACT);
+HCONTACT getMostOnline(HCONTACT);
+void DeinitMetaContact(HCONTACT);
// crypt_dll.cpp
-LPSTR InitKeyA(pUinKey,int);
-int InitKeyB(pUinKey,LPCSTR);
-void InitKeyX(pUinKey,BYTE*);
-BOOL CalculateKeyX(pUinKey,HANDLE);
-LPSTR encodeMsg(pUinKey,LPARAM);
-LPSTR decodeMsg(pUinKey,LPARAM,LPSTR);
+LPSTR InitKeyA(pUinKey, int);
+int InitKeyB(pUinKey, LPCSTR);
+void InitKeyX(pUinKey, BYTE*);
+BOOL CalculateKeyX(pUinKey, HCONTACT);
+LPSTR encodeMsg(pUinKey, LPARAM);
+LPSTR decodeMsg(pUinKey, LPARAM, LPSTR);
BOOL LoadKeyPGP(pUinKey);
BOOL LoadKeyGPG(pUinKey);
diff --git a/plugins/SecureIM/src/crypt_check.cpp b/plugins/SecureIM/src/crypt_check.cpp index 9369a1ba64..44c6c8183a 100644 --- a/plugins/SecureIM/src/crypt_check.cpp +++ b/plugins/SecureIM/src/crypt_check.cpp @@ -1,6 +1,6 @@ #include "commonheaders.h"
-int getContactStatus(HANDLE hContact)
+int getContactStatus(HCONTACT hContact)
{
pSupPro ptr = getSupPro(hContact);
if (ptr)
@@ -9,7 +9,7 @@ int getContactStatus(HANDLE hContact) return -1;
}
-bool isSecureProtocol(HANDLE hContact)
+bool isSecureProtocol(HCONTACT hContact)
{
pSupPro ptr = getSupPro(hContact);
if (!ptr)
@@ -18,7 +18,7 @@ bool isSecureProtocol(HANDLE hContact) return ptr->inspecting != 0;
}
-BYTE isContactSecured(HANDLE hContact)
+BYTE isContactSecured(HCONTACT hContact)
{
// íóæíà ïðîâåðêà íà Offline è â ýòîì ñëó÷àå äðóãèå ñòàòóñû
if (!arClist.getCount()) return 0;
@@ -76,7 +76,7 @@ bool isClientMiranda(pUinKey ptr, BOOL emptyMirverAsMiranda) return isMiranda;
}
-bool isClientMiranda(HANDLE hContact, BOOL emptyMirverAsMiranda)
+bool isClientMiranda(HCONTACT hContact, BOOL emptyMirverAsMiranda)
{
if (!bMCD) return true;
if (!arClist.getCount()) return false;
@@ -85,7 +85,7 @@ bool isClientMiranda(HANDLE hContact, BOOL emptyMirverAsMiranda) return (p) ? isClientMiranda(p, emptyMirverAsMiranda) : false;
}
-bool isProtoSmallPackets(HANDLE hContact)
+bool isProtoSmallPackets(HCONTACT hContact)
{
pUinKey p = findUinKey(hContact);
if (!p || !p->proto || !p->proto->inspecting)
@@ -94,7 +94,7 @@ bool isProtoSmallPackets(HANDLE hContact) return strstr(p->proto->name,"IRC") != NULL || strstr(p->proto->name,"WinPopup") != NULL || strstr(p->proto->name,"VyChat") != NULL;
}
-bool isContactInvisible(HANDLE hContact)
+bool isContactInvisible(HCONTACT hContact)
{
if (db_get_b(hContact, "CList", "Hidden", 0))
return true;
@@ -114,12 +114,12 @@ bool isContactInvisible(HANDLE hContact) return false;
}
-bool isNotOnList(HANDLE hContact)
+bool isNotOnList(HCONTACT hContact)
{
return db_get_b(hContact, "CList", "NotOnList", 0) != 0;
}
-bool isContactNewPG(HANDLE hContact)
+bool isContactNewPG(HCONTACT hContact)
{
pUinKey p = findUinKey(hContact);
if (!p || !p->proto || !p->proto->inspecting || !p->cntx)
@@ -128,7 +128,7 @@ bool isContactNewPG(HANDLE hContact) return (p->features & CPP_FEATURES_NEWPG) != 0;
}
-bool isContactPGP(HANDLE hContact)
+bool isContactPGP(HCONTACT hContact)
{
if (!bPGPloaded || (!bPGPkeyrings && !bPGPprivkey)) return false;
@@ -142,7 +142,7 @@ bool isContactPGP(HANDLE hContact) return true;
}
-bool isContactGPG(HANDLE hContact)
+bool isContactGPG(HCONTACT hContact)
{
if (!bGPGloaded || !bGPGkeyrings) return false;
@@ -156,7 +156,7 @@ bool isContactGPG(HANDLE hContact) return true;
}
-bool isContactRSAAES(HANDLE hContact)
+bool isContactRSAAES(HCONTACT hContact)
{
pUinKey p = findUinKey(hContact);
if (!p || !p->proto || !p->proto->inspecting)
@@ -165,7 +165,7 @@ bool isContactRSAAES(HANDLE hContact) return p->mode == MODE_RSAAES;
}
-bool isContactRSA(HANDLE hContact)
+bool isContactRSA(HCONTACT hContact)
{
pUinKey p = findUinKey(hContact);
if (!p || !p->proto || !p->proto->inspecting)
@@ -174,7 +174,7 @@ bool isContactRSA(HANDLE hContact) return p->mode == MODE_RSA;
}
-bool isChatRoom(HANDLE hContact)
+bool isChatRoom(HCONTACT hContact)
{
pUinKey p = findUinKey(hContact);
if (!p || !p->proto || !p->proto->inspecting)
@@ -205,7 +205,7 @@ bool isSecureIM(pUinKey ptr, BOOL emptyMirverAsSecureIM) return isSecureIM;
}
-bool isSecureIM(HANDLE hContact, BOOL emptyMirverAsSecureIM)
+bool isSecureIM(HCONTACT hContact, BOOL emptyMirverAsSecureIM)
{
if (!bAIP) return false;
diff --git a/plugins/SecureIM/src/crypt_dll.cpp b/plugins/SecureIM/src/crypt_dll.cpp index f9b5325e2f..59c5698384 100644 --- a/plugins/SecureIM/src/crypt_dll.cpp +++ b/plugins/SecureIM/src/crypt_dll.cpp @@ -73,7 +73,7 @@ void InitKeyX(pUinKey ptr,BYTE *key) // calculate secret key
-BOOL CalculateKeyX(pUinKey ptr,HANDLE hContact)
+BOOL CalculateKeyX(pUinKey ptr,HCONTACT hContact)
{
int agr = cpp_calc_keyx(ptr->cntx);
if (agr) {
diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp index ab421e843b..dfb0d0771d 100644 --- a/plugins/SecureIM/src/crypt_icons.cpp +++ b/plugins/SecureIM/src/crypt_icons.cpp @@ -62,9 +62,9 @@ HANDLE mode2clicon(int mode, int type) }
// îáíîâëÿåò èêîíêè â clist è â messagew
-void ShowStatusIcon(HANDLE hContact, int mode)
+void ShowStatusIcon(HCONTACT hContact, int mode)
{
- HANDLE hMC = getMetaContact(hContact);
+ HCONTACT hMC = getMetaContact(hContact);
// îáíîâèòü èêîíêè â clist
if (mode != -1) {
@@ -92,12 +92,12 @@ void ShowStatusIcon(HANDLE hContact, int mode) }
}
-void ShowStatusIcon(HANDLE hContact)
+void ShowStatusIcon(HCONTACT hContact)
{
ShowStatusIcon(hContact, isContactSecured(hContact));
}
-void ShowStatusIconNotify(HANDLE hContact)
+void ShowStatusIconNotify(HCONTACT hContact)
{
BYTE mode = isContactSecured(hContact);
NotifyEventHooks(g_hEvent[(mode&SECURED) != 0], (WPARAM)hContact, 0);
@@ -109,7 +109,7 @@ void RefreshContactListIcons(void) for (int i=0; i < arIcoList.getCount(); i++)
arIcoList[i].hCLIcon = 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))
if (isSecureProtocol(hContact))
ShowStatusIcon(hContact);
}
diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp index 2e229a1ccf..9ec49d9705 100644 --- a/plugins/SecureIM/src/crypt_lists.cpp +++ b/plugins/SecureIM/src/crypt_lists.cpp @@ -62,7 +62,7 @@ void freeSupportedProtocols() arProto.destroy();
}
-pSupPro getSupPro(HANDLE hContact)
+pSupPro getSupPro(HCONTACT hContact)
{
for (int j=0; j < arProto.getCount(); j++)
if (CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)arProto[j]->name))
@@ -72,7 +72,7 @@ pSupPro getSupPro(HANDLE hContact) }
// add contact in the list of secureIM users
-pUinKey addContact(HANDLE hContact)
+pUinKey addContact(HCONTACT hContact)
{
if (hContact == NULL) return NULL;
@@ -99,7 +99,7 @@ pUinKey addContact(HANDLE hContact) }
// delete contact from the list of secureIM users
-void delContact(HANDLE hContact)
+void delContact(HCONTACT hContact)
{
pUinKey p = arClist.find((pUinKey)&hContact);
if (p) {
@@ -118,7 +118,7 @@ void loadContactList() freeContactList();
loadSupportedProtocols();
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
addContact(hContact);
}
@@ -138,12 +138,12 @@ void freeContactList() }
// find user in the list of secureIM users and add him, if unknow
-pUinKey findUinKey(HANDLE hContact)
+pUinKey findUinKey(HCONTACT hContact)
{
return arClist.find((pUinKey)&hContact);
}
-pUinKey getUinKey(HANDLE hContact)
+pUinKey getUinKey(HCONTACT hContact)
{
pUinKey p = arClist.find((pUinKey)&hContact);
return (p) ? p : addContact(hContact);
@@ -198,16 +198,16 @@ void addMsg2Queue(pUinKey ptr,WPARAM wParam,LPSTR szMsg) LeaveCriticalSection(&localQueueMutex);
}
-void getContactNameA(HANDLE hContact, LPSTR szName) {
+void getContactNameA(HCONTACT hContact, LPSTR szName) {
strcpy(szName,(LPCSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0));
}
-void getContactName(HANDLE hContact, LPSTR szName)
+void getContactName(HCONTACT hContact, LPSTR szName)
{
wcscpy((LPWSTR)szName, (LPWSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GSMDF_UNICODE));
}
-void getContactUinA(HANDLE hContact, LPSTR szUIN)
+void getContactUinA(HCONTACT hContact, LPSTR szUIN)
{
*szUIN = 0;
@@ -233,7 +233,7 @@ void getContactUinA(HANDLE hContact, LPSTR szUIN) db_free(&dbv_uniqueid);
}
-void getContactUin(HANDLE hContact, LPSTR szUIN)
+void getContactUin(HCONTACT hContact, LPSTR szUIN)
{
getContactUinA(hContact, szUIN);
if (*szUIN) {
diff --git a/plugins/SecureIM/src/crypt_metacontacts.cpp b/plugins/SecureIM/src/crypt_metacontacts.cpp index 39bebd23c2..50bd21767e 100644 --- a/plugins/SecureIM/src/crypt_metacontacts.cpp +++ b/plugins/SecureIM/src/crypt_metacontacts.cpp @@ -1,6 +1,6 @@ #include "commonheaders.h"
-BOOL isProtoMetaContacts(HANDLE hContact)
+BOOL isProtoMetaContacts(HCONTACT hContact)
{
if (bMetaContacts) {
LPSTR proto = GetContactProto(hContact);
@@ -10,7 +10,7 @@ BOOL isProtoMetaContacts(HANDLE hContact) return false;
}
-BOOL isDefaultSubContact(HANDLE hContact)
+BOOL isDefaultSubContact(HCONTACT hContact)
{
if (bMetaContacts)
return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0) == hContact;
@@ -18,29 +18,29 @@ BOOL isDefaultSubContact(HANDLE hContact) return false;
}
-HANDLE getMetaContact(HANDLE hContact)
+HCONTACT getMetaContact(HCONTACT hContact)
{
if (bMetaContacts)
- return (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ return (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
return 0;
}
-HANDLE getMostOnline(HANDLE hContact)
+HCONTACT getMostOnline(HCONTACT hContact)
{
if (bMetaContacts)
- return (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ return (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
return 0;
}
// remove all secureim connections on subcontacts
-void DeinitMetaContact(HANDLE hContact)
+void DeinitMetaContact(HCONTACT hContact)
{
- HANDLE hMetaContact = isProtoMetaContacts(hContact) ? hContact : getMetaContact(hContact);
+ HCONTACT hMetaContact = isProtoMetaContacts(hContact) ? hContact : getMetaContact(hContact);
if (hMetaContact) {
for (int i=0; i < CallService(MS_MC_GETNUMCONTACTS,(WPARAM)hMetaContact,0); i++) {
- HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hMetaContact, i);
+ HCONTACT hSubContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hMetaContact, i);
if (hSubContact && (isContactSecured(hSubContact)&SECURED))
CallContactService(hSubContact,PSS_MESSAGE, PREF_METANODB, (LPARAM)SIG_DEIN);
}
diff --git a/plugins/SecureIM/src/crypt_misc.cpp b/plugins/SecureIM/src/crypt_misc.cpp index aa0025038c..6e34f77aee 100644 --- a/plugins/SecureIM/src/crypt_misc.cpp +++ b/plugins/SecureIM/src/crypt_misc.cpp @@ -2,7 +2,7 @@ static void sttWaitForExchange(LPVOID param)
{
- HANDLE hContact = (HANDLE)param;
+ HCONTACT hContact = (HCONTACT)param;
pUinKey ptr = getUinKey(hContact);
if (!ptr)
return;
diff --git a/plugins/SecureIM/src/crypt_popups.cpp b/plugins/SecureIM/src/crypt_popups.cpp index b584f5902d..9b085bdb3e 100644 --- a/plugins/SecureIM/src/crypt_popups.cpp +++ b/plugins/SecureIM/src/crypt_popups.cpp @@ -1,6 +1,6 @@ #include "commonheaders.h"
-void showPopup(LPCSTR lpzText,HANDLE hContact,HICON hIcon, UINT type)
+void showPopup(LPCSTR lpzText,HCONTACT hContact,HICON hIcon, UINT type)
{
//type=0 key colors
//type=1 session colors
@@ -52,50 +52,50 @@ void showPopup(LPCSTR lpzText,HANDLE hContact,HICON hIcon, UINT type) PUAddPopupW(&ppd);
}
-void showPopupDCmsg(HANDLE hContact,LPCSTR msg)
+void showPopupDCmsg(HCONTACT hContact,LPCSTR msg)
{
if (db_get_b(0, MODULENAME, "dc", 1))
showPopup(msg, hContact, g_hPOP[POP_PU_DIS], 1);
}
-void showPopupDC(HANDLE hContact)
+void showPopupDC(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "dc", 1))
showPopup(sim006, hContact, g_hPOP[POP_PU_DIS], 1);
}
-void showPopupEC(HANDLE hContact)
+void showPopupEC(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "ec", 1))
showPopup(sim001, hContact, g_hPOP[POP_PU_EST], 1);
}
-void showPopupKS(HANDLE hContact)
+void showPopupKS(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "ks",1))
showPopup(sim007, hContact, g_hPOP[POP_PU_PRC], 0);
}
-void showPopupKRmsg(HANDLE hContact,LPCSTR msg)
+void showPopupKRmsg(HCONTACT hContact,LPCSTR msg)
{
if (db_get_b(0, MODULENAME, "kr", 1))
showPopup(msg, hContact, g_hPOP[POP_PU_PRC], 0);
}
-void showPopupKR(HANDLE hContact)
+void showPopupKR(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "kr", 1))
showPopup(sim008, hContact, g_hPOP[POP_PU_PRC], 0);
}
-void showPopupSM(HANDLE hContact)
+void showPopupSM(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "ss", 0))
showPopup(sim009, hContact, g_hPOP[POP_PU_MSS], 2);
SkinPlaySound("OutgoingSecureMessage");
}
-void showPopupRM(HANDLE hContact)
+void showPopupRM(HCONTACT hContact)
{
if (db_get_b(0, MODULENAME, "sr", 0))
showPopup(sim010, hContact, g_hPOP[POP_PU_MSR], 2);
diff --git a/plugins/SecureIM/src/dbevent.cpp b/plugins/SecureIM/src/dbevent.cpp index 6e43318dad..7d3d0afaf7 100644 --- a/plugins/SecureIM/src/dbevent.cpp +++ b/plugins/SecureIM/src/dbevent.cpp @@ -1,7 +1,7 @@ #include "commonheaders.h"
-void HistoryLog(HANDLE hContact, LPCSTR szText)
+void HistoryLog(HCONTACT hContact, LPCSTR szText)
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = GetContactProto(hContact);
diff --git a/plugins/SecureIM/src/dbevent.h b/plugins/SecureIM/src/dbevent.h index c46ead73a1..4eb5251eb1 100644 --- a/plugins/SecureIM/src/dbevent.h +++ b/plugins/SecureIM/src/dbevent.h @@ -1,6 +1,6 @@ #ifndef __DBEVENT_H__
#define __DBEVENT_H__
-void HistoryLog(HANDLE,LPCSTR);
+void HistoryLog(HCONTACT, LPCSTR);
#endif
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 432d0ccb4d..31d5159a9b 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -977,7 +977,7 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) char tmp[NAMSIZE];
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
pUinKey ptr = getUinKey(hContact);
if (ptr && isSecureProtocol(hContact) && !isChatRoom(hContact)) {
if (iInit) {
@@ -1063,7 +1063,7 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit) char tmp[NAMSIZE];
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
pUinKey ptr = getUinKey(hContact);
if (ptr && ptr->mode == MODE_PGP && isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) {
LPSTR szKeyID = db_get_sa(hContact,MODULENAME,"pgp_abbr");
@@ -1123,7 +1123,7 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit) char tmp[NAMSIZE];
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
pUinKey ptr = getUinKey(hContact);
if (ptr && ptr->mode == MODE_GPG && isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) {
if (iInit )
@@ -1176,7 +1176,7 @@ void ResetGeneralDlg(HWND hDlg) lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
char tmp[NAMSIZE];
- 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 (!isSecureProtocol(hContact) || isChatRoom(hContact))
continue;
diff --git a/plugins/SecureIM/src/svcs_clist.cpp b/plugins/SecureIM/src/svcs_clist.cpp index b2af53bb19..24efb7785b 100644 --- a/plugins/SecureIM/src/svcs_clist.cpp +++ b/plugins/SecureIM/src/svcs_clist.cpp @@ -3,7 +3,7 @@ int __cdecl onContactSettingChanged(WPARAM wParam,LPARAM lParam) {
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
if (!hContact || strcmp(cws->szSetting,"Status")) return 0;
@@ -35,8 +35,9 @@ int __cdecl onContactSettingChanged(WPARAM wParam,LPARAM lParam) { // wParam=(WPARAM)(HANDLE)hContact
// lParam=0
-int __cdecl onContactAdded(WPARAM wParam,LPARAM lParam) {
- addContact((HANDLE)wParam);
+int __cdecl onContactAdded(WPARAM wParam,LPARAM lParam)
+{
+ addContact((HCONTACT)wParam);
return 0;
}
@@ -45,7 +46,7 @@ int __cdecl onContactAdded(WPARAM wParam,LPARAM lParam) { // lParam=0
int __cdecl onContactDeleted(WPARAM wParam,LPARAM lParam)
{
- delContact((HANDLE)wParam);
+ delContact((HCONTACT)wParam);
return 0;
}
@@ -58,15 +59,15 @@ int __cdecl onExtraImageListRebuilding(WPARAM, LPARAM) int __cdecl onExtraImageApplying(WPARAM wParam, LPARAM)
{
- if (isSecureProtocol((HANDLE)wParam))
- ExtraIcon_SetIcon(g_hCLIcon, (HANDLE)wParam, mode2clicon( isContactSecured((HANDLE)wParam), 1));
+ if (isSecureProtocol((HCONTACT)wParam))
+ ExtraIcon_SetIcon(g_hCLIcon, (HCONTACT)wParam, mode2clicon(isContactSecured((HCONTACT)wParam), 1));
return 0;
}
int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
BOOL bMC = isProtoMetaContacts(hContact);
if (bMC ) hContact = getMostOnline(hContact); // âîçüìåì òîò, ÷åðåç êîòîðûé ïîéäåò ñîîáùåíèå
pUinKey ptr = getUinKey(hContact);
diff --git a/plugins/SecureIM/src/svcs_menu.cpp b/plugins/SecureIM/src/svcs_menu.cpp index b8fba61f48..f099757b0d 100644 --- a/plugins/SecureIM/src/svcs_menu.cpp +++ b/plugins/SecureIM/src/svcs_menu.cpp @@ -3,19 +3,19 @@ INT_PTR __cdecl Service_IsContactSecured(WPARAM wParam, LPARAM lParam)
{
- return (isContactSecured((HANDLE)wParam)&SECURED) || isContactPGP((HANDLE)wParam) || isContactGPG((HANDLE)wParam);
+ return (isContactSecured((HCONTACT)wParam)&SECURED) || isContactPGP((HCONTACT)wParam) || isContactGPG((HCONTACT)wParam);
}
INT_PTR __cdecl Service_CreateIM(WPARAM wParam,LPARAM lParam)
{
- CallContactService((HANDLE)wParam,PSS_MESSAGE, PREF_METANODB,(LPARAM)SIG_INIT);
+ CallContactService((HCONTACT)wParam, PSS_MESSAGE, PREF_METANODB, (LPARAM)SIG_INIT);
return 1;
}
INT_PTR __cdecl Service_DisableIM(WPARAM wParam,LPARAM lParam)
{
- CallContactService((HANDLE)wParam,PSS_MESSAGE, PREF_METANODB,(LPARAM)SIG_DEIN);
+ CallContactService((HCONTACT)wParam, PSS_MESSAGE, PREF_METANODB, (LPARAM)SIG_DEIN);
return 1;
}
@@ -25,7 +25,7 @@ INT_PTR __cdecl Service_Status(WPARAM wParam, LPARAM lParam) case STATUS_DISABLED:
case STATUS_ENABLED:
case STATUS_ALWAYSTRY:
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
if (ptr) {
ptr->status=ptr->tstatus=(BYTE)lParam;
if (ptr->status == STATUS_ENABLED) db_unset(ptr->hContact, MODULENAME, "StatusID");
@@ -55,15 +55,15 @@ INT_PTR __cdecl Service_StatusTry(WPARAM wParam, LPARAM lParam) INT_PTR __cdecl Service_PGPdelKey(WPARAM wParam, LPARAM lParam)
{
if (bPGPloaded) {
- db_unset((HANDLE)wParam, MODULENAME, "pgp");
- db_unset((HANDLE)wParam, MODULENAME, "pgp_mode");
- db_unset((HANDLE)wParam, MODULENAME, "pgp_abbr");
+ db_unset((HCONTACT)wParam, MODULENAME, "pgp");
+ db_unset((HCONTACT)wParam, MODULENAME, "pgp_mode");
+ db_unset((HCONTACT)wParam, MODULENAME, "pgp_abbr");
}
{
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
cpp_delete_context(ptr->cntx); ptr->cntx=0;
}
- ShowStatusIconNotify((HANDLE)wParam);
+ ShowStatusIconNotify((HCONTACT)wParam);
return 1;
}
@@ -75,10 +75,10 @@ INT_PTR __cdecl Service_PGPsetKey(WPARAM wParam, LPARAM lParam) char szKeyID[128]; szKeyID[0]='\0';
PVOID KeyID = pgp_select_keyid(GetForegroundWindow(),szKeyID);
if (szKeyID[0]) {
- db_unset((HANDLE)wParam,MODULENAME,"pgp");
- db_set_blob((HANDLE)wParam, MODULENAME, "pgp", KeyID, pgp_size_keyid());
- db_set_b((HANDLE)wParam,MODULENAME,"pgp_mode",0);
- db_set_s((HANDLE)wParam,MODULENAME,"pgp_abbr",szKeyID);
+ db_unset((HCONTACT)wParam, MODULENAME, "pgp");
+ db_set_blob((HCONTACT)wParam, MODULENAME, "pgp", KeyID, pgp_size_keyid());
+ db_set_b((HCONTACT)wParam, MODULENAME, "pgp_mode", 0);
+ db_set_s((HCONTACT)wParam, MODULENAME, "pgp_abbr", szKeyID);
del = false;
}
}
@@ -87,10 +87,10 @@ INT_PTR __cdecl Service_PGPsetKey(WPARAM wParam, LPARAM lParam) if (ShowSelectKeyDlg(0,KeyPath)) {
char *publ = LoadKeys(KeyPath,false);
if (publ) {
- db_unset((HANDLE)wParam,MODULENAME,"pgp");
- db_set_s((HANDLE)wParam,MODULENAME,"pgp",publ);
- db_set_b((HANDLE)wParam,MODULENAME,"pgp_mode",1);
- db_set_s((HANDLE)wParam,MODULENAME,"pgp_abbr","(binary)");
+ db_unset((HCONTACT)wParam, MODULENAME, "pgp");
+ db_set_s((HCONTACT)wParam, MODULENAME, "pgp", publ);
+ db_set_b((HCONTACT)wParam, MODULENAME, "pgp_mode", 1);
+ db_set_s((HCONTACT)wParam, MODULENAME, "pgp_abbr", "(binary)");
mir_free(publ);
del = false;
}
@@ -101,22 +101,22 @@ INT_PTR __cdecl Service_PGPsetKey(WPARAM wParam, LPARAM lParam) if (del)
Service_PGPdelKey(wParam,lParam);
else {
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
cpp_delete_context(ptr->cntx); ptr->cntx=0;
}
- ShowStatusIconNotify((HANDLE)wParam);
+ ShowStatusIconNotify((HCONTACT)wParam);
return 1;
}
INT_PTR __cdecl Service_GPGdelKey(WPARAM wParam, LPARAM lParam)
{
if (bGPGloaded)
- db_unset((HANDLE)wParam, MODULENAME, "gpg");
+ db_unset((HCONTACT)wParam, MODULENAME, "gpg");
{
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
cpp_delete_context(ptr->cntx); ptr->cntx=0;
}
- ShowStatusIconNotify((HANDLE)wParam);
+ ShowStatusIconNotify((HCONTACT)wParam);
return 1;
}
@@ -127,28 +127,28 @@ INT_PTR __cdecl Service_GPGsetKey(WPARAM wParam, LPARAM lParam) char szKeyID[128]; szKeyID[0]='\0';
gpg_select_keyid(GetForegroundWindow(),szKeyID);
if (szKeyID[0]) {
- db_set_s((HANDLE)wParam,MODULENAME,"gpg",szKeyID);
+ db_set_s((HCONTACT)wParam, MODULENAME, "gpg", szKeyID);
del = false;
}
}
if (del) Service_GPGdelKey(wParam,lParam);
else {
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
cpp_delete_context(ptr->cntx); ptr->cntx=0;
}
- ShowStatusIconNotify((HANDLE)wParam);
+ ShowStatusIconNotify((HCONTACT)wParam);
return 1;
}
INT_PTR __cdecl Service_Mode(WPARAM wParam, LPARAM lParam)
{
- pUinKey ptr = getUinKey((HANDLE)wParam);
+ pUinKey ptr = getUinKey((HCONTACT)wParam);
switch(--lParam) {
case MODE_NATIVE:
case MODE_RSAAES:
- if (isContactSecured((HANDLE)wParam)&SECURED) {
+ if (isContactSecured((HCONTACT)wParam)&SECURED) {
msgbox(NULL, sim111, MODULENAME, MB_OK);
return 0;
}
@@ -165,9 +165,9 @@ INT_PTR __cdecl Service_Mode(WPARAM wParam, LPARAM lParam) ptr->keyLoaded = 0;
}
ptr->mode=(BYTE)lParam;
- db_set_b((HANDLE)wParam, MODULENAME, "mode", (BYTE)lParam);
+ db_set_b((HCONTACT)wParam, MODULENAME, "mode", (BYTE)lParam);
}
- ShowStatusIcon((HANDLE)wParam);
+ ShowStatusIcon((HCONTACT)wParam);
break;
}
diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp index 7350aa9e95..7a0c20fe3c 100644 --- a/plugins/SecureIM/src/svcs_proto.cpp +++ b/plugins/SecureIM/src/svcs_proto.cpp @@ -31,13 +31,13 @@ static void sttFakeAck(LPVOID param) delete tParam;
}
-int returnNoError(HANDLE hContact)
+int returnNoError(HCONTACT hContact)
{
mir_forkthread(sttFakeAck, new TFakeAckParams(hContact, 777, 0));
return 777;
}
-int returnError(HANDLE hContact, LPCSTR err)
+int returnError(HCONTACT hContact, LPCSTR err)
{
mir_forkthread(sttFakeAck, new TFakeAckParams(hContact, 666, err));
return 666;
diff --git a/plugins/SecureIM/src/svcs_srmm.cpp b/plugins/SecureIM/src/svcs_srmm.cpp index 6c05f77bca..59791ee43c 100644 --- a/plugins/SecureIM/src/svcs_srmm.cpp +++ b/plugins/SecureIM/src/svcs_srmm.cpp @@ -11,7 +11,7 @@ int __cdecl onWindowEvent(WPARAM, LPARAM lParam) int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (isProtoMetaContacts(hContact))
hContact = getMostOnline(hContact); // âîçüìåì òîò, ÷åðåç êîòîðûé ïîéäåò ñîîáùåíèå
diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp index 8aea65614b..d049fda7d3 100644 --- a/plugins/SeenPlugin/src/file.cpp +++ b/plugins/SeenPlugin/src/file.cpp @@ -59,7 +59,7 @@ int InitFileOutput(void) /*
Writes a line into the log.
*/
-void FileWrite(HANDLE hcontact)
+void FileWrite(HCONTACT hcontact)
{
TCHAR szout[1024];
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index bb269830a7..1d935e4d7b 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -31,7 +31,7 @@ char* BuildSetting(int historyLast) { return setting;
}
-void HistoryWrite(HANDLE hContact)
+void HistoryWrite(HCONTACT hContact)
{
int historyMax = db_get_w(NULL, S_MOD, "HistoryMax", 10);
if (historyMax < 0)
@@ -64,7 +64,7 @@ void HistoryWrite(HANDLE hContact) db_set_w(hContact, S_MOD, "HistoryFirst", (historyFirst+1) % historyMax);
}
-void LoadHistoryList(HANDLE hContact, HWND hwnd, int nList)
+void LoadHistoryList(HCONTACT hContact, HWND hwnd, int nList)
{
SendDlgItemMessage(hwnd, nList, LB_RESETCONTENT, 0, 0);
int historyMax = db_get_w(NULL,S_MOD,"HistoryMax",10);
@@ -161,13 +161,13 @@ void MyResizeGetOffset (HWND hwndDlg, HWND hwndControl, int nWidth, int nHeight, INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARAM lparam)
{
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR sztemp[1024];
switch(Message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- hContact = (HANDLE)lparam;
+ hContact = (HCONTACT)lparam;
SetWindowLongPtr(hwndDlg,GWLP_USERDATA,lparam);
mir_sntprintf(sztemp, SIZEOF(sztemp), _T("%s: %s"),
CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR),
@@ -199,7 +199,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA return CallService(MS_CLIST_MENUDRAWITEM,wparam,lparam);
case WM_COMMAND:
- hContact=(HANDLE)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
+ hContact=(HCONTACT)GetWindowLongPtr(hwndDlg,GWLP_USERDATA);
if (CallService(MS_CLIST_MENUPROCESSCOMMAND,MAKEWPARAM(LOWORD(wparam),MPCF_CONTACTMENU),(LPARAM)hContact))
break;
@@ -278,7 +278,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA return FALSE;
}
-void ShowHistory(HANDLE hContact, BYTE isAlert)
+void ShowHistory(HCONTACT hContact, BYTE isAlert)
{
HWND hHistoryDlg = WindowList_Find(hWindowList,hContact);
if (hHistoryDlg == NULL) {
diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index 6056971494..849c271dc6 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -30,14 +30,14 @@ Handles the messages sent by clicking the contact's menu item */
INT_PTR MenuitemClicked(WPARAM wparam,LPARAM)
{
- ShowHistory((HANDLE)wparam, 0);
+ ShowHistory((HCONTACT)wparam, 0);
return 0;
}
int BuildContactMenu(WPARAM wparam,LPARAM)
{
int id = -1, isetting;
- HANDLE hContact = (HANDLE)wparam;
+ HCONTACT hContact = (HCONTACT)wparam;
char *szProto = GetContactProto(hContact);
CLISTMENUITEM cmi = { sizeof(cmi) };
@@ -49,10 +49,10 @@ int BuildContactMenu(WPARAM wparam,LPARAM) DBVARIANT dbv;
if ( !db_get_ts(NULL, S_MOD, "MenuStamp", &dbv)) {
- cmi.ptszName = ParseString(dbv.ptszVal, (HANDLE)wparam, 0);
+ cmi.ptszName = ParseString(dbv.ptszVal, (HCONTACT)wparam, 0);
db_free(&dbv);
}
- else cmi.ptszName = ParseString(DEFAULT_MENUSTAMP, (HANDLE)wparam, 0);
+ else cmi.ptszName = ParseString(DEFAULT_MENUSTAMP, (HCONTACT)wparam, 0);
if ( !_tcscmp(cmi.ptszName, TranslateT("<unknown>"))) {
if ( IsWatchedProtocol(szProto))
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index ae29690d72..5746d0b647 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -42,7 +42,7 @@ int RemoveUser(int pos) int ResetMissed(void)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
db_set_b(hContact, S_MOD, "Missed", 0);
ZeroMemory(&mcs,sizeof(mcs));
@@ -51,7 +51,7 @@ int ResetMissed(void) int CheckIfOnline(void)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
if ( CallService(MS_CLIST_GETCONTACTICON, (WPARAM)hContact, 0) != ICON_OFFLINE)
db_set_b(hContact, S_MOD, "Missed", 2);
@@ -128,12 +128,12 @@ int Test(WPARAM wparam,LPARAM lparam) if (CallService(MS_IGNORE_ISIGNORED,wparam,IGNOREEVENT_USERONLINE))
return 0;
- if ( db_get_b((HANDLE)wparam,S_MOD,"Missed",0)==2)
+ if ( db_get_b((HCONTACT)wparam,S_MOD,"Missed",0)==2)
return 0;
switch(lparam) {
case ICON_OFFLINE:
- if ( db_get_b((HANDLE)wparam,S_MOD,"Missed",0) == 1) {
+ if ( db_get_b((HCONTACT)wparam,S_MOD,"Missed",0) == 1) {
WORD missed = IsUserMissed(wparam);
if (!LOWORD(missed)) {
mcs.times[mcs.count]=1;
@@ -141,7 +141,7 @@ int Test(WPARAM wparam,LPARAM lparam) }
else mcs.times[HIWORD(missed)]++;
- db_set_b((HANDLE)wparam,S_MOD,"Missed",0);
+ db_set_b((HCONTACT)wparam,S_MOD,"Missed",0);
}
break;
@@ -152,7 +152,7 @@ int Test(WPARAM wparam,LPARAM lparam) case ICON_DND:
case ICON_FREE:
case ICON_INVIS:
- db_set_b((HANDLE)wparam,S_MOD,"Missed",1);
+ db_set_b((HCONTACT)wparam,S_MOD,"Missed",1);
break;
}
diff --git a/plugins/SeenPlugin/src/seen.h b/plugins/SeenPlugin/src/seen.h index b716ead0a5..15b357ac1f 100644 --- a/plugins/SeenPlugin/src/seen.h +++ b/plugins/SeenPlugin/src/seen.h @@ -52,8 +52,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "resource.h"
#include "version.h"
-WCHAR *any_to_IdleNotidleUnknown(HANDLE hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen);
-WCHAR *any_to_Idle(HANDLE hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen);
+WCHAR *any_to_IdleNotidleUnknown(HCONTACT hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen);
+WCHAR *any_to_Idle(HCONTACT hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen);
#define NUM100NANOSEC 116444736000000000
@@ -94,7 +94,7 @@ typedef struct{ } MISSEDCONTACTS;
int IsWatchedProtocol(const char* szProto);
-TCHAR *ParseString(TCHAR*, HANDLE, BYTE);
+TCHAR *ParseString(TCHAR*, HCONTACT, BYTE);
void GetColorsFromDWord(LPCOLORREF First, LPCOLORREF Second, DWORD colDword);
DWORD GetDWordFromColors(COLORREF First, COLORREF Second);
int OptionsInit(WPARAM,LPARAM);
@@ -106,11 +106,11 @@ int ModeChange(WPARAM,LPARAM); void SetOffline(void);
int ModeChange_mo(WPARAM,LPARAM);
int CheckIfOnline(void);
-void ShowHistory(HANDLE hContact, BYTE isAlert);
+void ShowHistory(HCONTACT hContact, BYTE isAlert);
struct logthread_info
{
- HANDLE hContact;
+ HCONTACT hContact;
char sProtoName[MAXMODULELABELLENGTH];
WORD currStatus;
};
diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index 6205dcaa1e..ddab491d6a 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -40,10 +40,10 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) {
TCHAR *szout;
if ( !db_get_ts(NULL, S_MOD, "UserStamp", &dbv)) {
- szout = ParseString(dbv.ptszVal, (HANDLE)lparam, 0);
+ szout = ParseString(dbv.ptszVal, (HCONTACT)lparam, 0);
db_free(&dbv);
}
- else szout = ParseString(DEFAULT_USERSTAMP, (HANDLE)lparam, 0);
+ else szout = ParseString(DEFAULT_USERSTAMP, (HCONTACT)lparam, 0);
SetDlgItemText(hdlg, IDC_INFOTEXT, szout);
if ( !lstrcmp(szout, TranslateT("<unknown>")))
@@ -62,7 +62,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) int UserinfoInit(WPARAM wparam,LPARAM lparam)
{
- char *proto = GetContactProto((HANDLE)lparam);
+ char *proto = GetContactProto((HCONTACT)lparam);
if ( IsWatchedProtocol(proto)) {
OPTIONSDIALOGPAGE uip = { sizeof(uip) };
uip.hInstance = hInstance;
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index c7e0705a7d..9bcb42000b 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -20,8 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "seen.h"
-void FileWrite(HANDLE);
-void HistoryWrite(HANDLE hcontact);
+void FileWrite(HCONTACT);
+void HistoryWrite(HCONTACT hcontact);
extern HANDLE g_hShutdownEvent;
char * courProtoName = 0;
@@ -96,7 +96,7 @@ BOOL isMSN(char *protoname) return FALSE;
}
-DWORD isSeen(HANDLE hcontact, SYSTEMTIME *st)
+DWORD isSeen(HCONTACT hcontact, SYSTEMTIME *st)
{
FILETIME ft;
ULONGLONG ll;
@@ -142,7 +142,7 @@ TCHAR *wdays_short[] = { LPGENT("Sun."), LPGENT("Mon."), LPGENT("Tue."), LPGENT( TCHAR *monthnames[] = { LPGENT("January"), LPGENT("February"), LPGENT("March"), LPGENT("April"), LPGENT("May"), LPGENT("June"), LPGENT("July"), LPGENT("August"), LPGENT("September"), LPGENT("October"), LPGENT("November"), LPGENT("December") };
TCHAR *mnames_short[] = { LPGENT("Jan."), LPGENT("Feb."), LPGENT("Mar."), LPGENT("Apr."), LPGENT("May"), LPGENT("Jun."), LPGENT("Jul."), LPGENT("Aug."), LPGENT("Sep."), LPGENT("Oct."), LPGENT("Nov."), LPGENT("Dec.") };
-TCHAR *ParseString(TCHAR *szstring, HANDLE hcontact, BYTE isfile)
+TCHAR *ParseString(TCHAR *szstring, HCONTACT hcontact, BYTE isfile)
{
#define MAXSIZE 1024
static TCHAR sztemp[MAXSIZE+1];
@@ -386,7 +386,7 @@ LBL_charPtr: return sztemp;
}
-void _DBWriteTime(SYSTEMTIME *st,HANDLE hcontact)
+void _DBWriteTime(SYSTEMTIME *st, HCONTACT hcontact)
{
db_set_w(hcontact,S_MOD,"Day",st->wDay);
db_set_w(hcontact,S_MOD,"Month",st->wMonth);
@@ -398,7 +398,7 @@ void _DBWriteTime(SYSTEMTIME *st,HANDLE hcontact) }
-void DBWriteTimeTS(DWORD t, HANDLE hcontact){
+void DBWriteTimeTS(DWORD t, HCONTACT hcontact){
SYSTEMTIME st;
FILETIME ft;
ULONGLONG ll = UInt32x32To64(CallService(MS_DB_TIME_TIMESTAMPTOLOCAL,t,0), 10000000) + NUM100NANOSEC;
@@ -454,7 +454,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa switch(message) {
case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED){
- HANDLE hContact = PUGetContact(hwnd);
+ HCONTACT hContact = PUGetContact(hwnd);
if (hContact > 0) CallService(MS_MSG_SENDMESSAGE,(WPARAM)hContact,0);
}
case WM_CONTEXTMENU:
@@ -465,7 +465,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa return DefWindowProc(hwnd, message, wParam, lParam);
};
-void ShowPopup(HANDLE hcontact, const char * lpzProto, int newStatus)
+void ShowPopup(HCONTACT hcontact, const char * lpzProto, int newStatus)
{
if ( CallService(MS_IGNORE_ISIGNORED, (WPARAM)hcontact, IGNOREEVENT_USERONLINE))
return;
@@ -548,7 +548,7 @@ int UpdateValues(WPARAM wparam,LPARAM lparam) // to make this code faster
if (!wparam) return 0;
- HANDLE hContact = (HANDLE)wparam;
+ HCONTACT hContact = (HCONTACT)wparam;
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING *)lparam;
//if (CallService(MS_IGNORE_ISIGNORED,(WPARAM)hContact,IGNOREEVENT_USERONLINE)) return 0;
BOOL isIdleEvent = includeIdle?(strcmp(cws->szSetting,"IdleTS")==0):0;
@@ -642,7 +642,7 @@ static void cleanThread(void *param) // I hope in 10 secons all logged-in contacts will be listed
if ( WaitForSingleObject(g_hShutdownEvent, 10000) == WAIT_TIMEOUT) {
- for (HANDLE hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) {
+ for (HCONTACT hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) {
WORD oldStatus = db_get_w(hContact,S_MOD,"StatusTriger",ID_STATUS_OFFLINE) | 0x8000;
if (oldStatus > ID_STATUS_OFFLINE) {
if (db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)==ID_STATUS_OFFLINE){
@@ -711,7 +711,7 @@ int ModeChange(WPARAM wparam,LPARAM lparam) return 0;
}
-short int isDbZero(HANDLE hContact, const char *module_name, const char *setting_name)
+short int isDbZero(HCONTACT hContact, const char *module_name, const char *setting_name)
{
DBVARIANT dbv;
if ( !db_get(hContact, module_name, setting_name, &dbv)) {
@@ -729,7 +729,7 @@ short int isDbZero(HANDLE hContact, const char *module_name, const char *setting return -1;
}
-TCHAR *any_to_IdleNotidleUnknown(HANDLE hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen) {
+TCHAR *any_to_IdleNotidleUnknown(HCONTACT hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen) {
short int r = isDbZero(hContact, module_name, setting_name);
if (r==-1){
_tcsncpy(buff, TranslateT("Unknown"), bufflen);
@@ -740,7 +740,7 @@ TCHAR *any_to_IdleNotidleUnknown(HANDLE hContact, const char *module_name, const return buff;
}
-TCHAR *any_to_Idle(HANDLE hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen) {
+TCHAR *any_to_Idle(HCONTACT hContact, const char *module_name, const char *setting_name, TCHAR *buff, int bufflen) {
if (isDbZero(hContact, module_name, setting_name)==0) { //DB setting is NOT zero and exists
buff[0] = L'/';
_tcsncpy(&buff[1], TranslateT("Idle"), bufflen-1);
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index a8f6dd53e8..4158368e9f 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "global.h" //--------------------------------------------------------------------------- -CSend::CSend(HWND Owner, HANDLE hContact, bool bFreeOnExit) { +CSend::CSend(HWND Owner, HCONTACT hContact, bool bFreeOnExit) { m_hWndO = Owner; m_bFreeOnExit = bFreeOnExit; m_pszFile = NULL; @@ -59,7 +59,7 @@ CSend::~CSend(){ } //--------------------------------------------------------------------------- -void CSend::SetContact(HANDLE hContact) { +void CSend::SetContact(HCONTACT hContact) { m_hContact = hContact; m_pszProto = GetContactProto(hContact); m_ChatRoom = db_get_b(hContact, m_pszProto, "ChatRoom", 0); @@ -145,7 +145,7 @@ void CSend::svcSendChat() { gci.pszModule = m_pszProto; for (int i = 0; i < cnt ; i++ ) { gci.iItem = i; - gci.Flags = BYINDEX | HCONTACT | ID; + gci.Flags = GCF_BYINDEX | GCF_HCONTACT | GCF_ID; CallService(MS_GC_GETINFO, 0, (LPARAM)&gci); if (gci.hContact == m_hContact) { GCDEST gcd = { m_pszProto, gci.pszID, GC_EVENT_SENDMESSAGE }; diff --git a/plugins/SendScreenshotPlus/src/CSend.h b/plugins/SendScreenshotPlus/src/CSend.h index 6e65252919..cdd12a5393 100644 --- a/plugins/SendScreenshotPlus/src/CSend.h +++ b/plugins/SendScreenshotPlus/src/CSend.h @@ -48,13 +48,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //--------------------------------------------------------------------------- class CSend { public: - CSend(HWND Owner, HANDLE hContact, bool bFreeOnExit); // oder (TfrmMain & Owner) + CSend(HWND Owner, HCONTACT hContact, bool bFreeOnExit); // oder (TfrmMain & Owner) virtual ~CSend(); virtual void Send() = 0; // void SendSync(bool Sync) {m_SendSync = Sync;}; bool m_bFreeOnExit; // need to "delete object;" on exit ? - void SetContact(HANDLE hContact); + void SetContact(HCONTACT hContact); BYTE GetEnableItem() {return m_EnableItem;}; LPTSTR GetErrorMsg() {return m_ErrorMsg;}; @@ -66,14 +66,13 @@ class CSend { private: protected: - LPTSTR m_pszSendTyp; //hold string for error mess - HWND m_hWndO; //window handle of caller - HANDLE m_hContact; //Contact handle - char* m_pszProto; //Contact Proto Modul - BYTE m_EnableItem; //hold flag for send type - void AfterSendDelete(); - BYTE m_ChatRoom; //is Contact chatroom -// bool m_SendSync; //send sync / async + LPTSTR m_pszSendTyp; //hold string for error mess + HWND m_hWndO; //window handle of caller + HCONTACT m_hContact; //Contact handle + char *m_pszProto; //Contact Proto Modul + BYTE m_EnableItem; //hold flag for send type + BYTE m_ChatRoom; //is Contact chatroom + void AfterSendDelete(); bool hasCap(unsigned int Flag); unsigned int m_PFflag; diff --git a/plugins/SendScreenshotPlus/src/CSendEmail.cpp b/plugins/SendScreenshotPlus/src/CSendEmail.cpp index c7f216b454..778c28390c 100644 --- a/plugins/SendScreenshotPlus/src/CSendEmail.cpp +++ b/plugins/SendScreenshotPlus/src/CSendEmail.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "global.h" //--------------------------------------------------------------------------- -CSendEmail::CSendEmail(HWND Owner, HANDLE hContact, bool bFreeOnExit) +CSendEmail::CSendEmail(HWND Owner, HCONTACT hContact, bool bFreeOnExit) : CSend(Owner, hContact, bFreeOnExit){ m_EnableItem = SS_DLG_DELETEAFTERSSEND | SS_DLG_DESCRIPTION; // SS_DLG_AUTOSEND | ; m_pszSendTyp = _T("Email transfer"); diff --git a/plugins/SendScreenshotPlus/src/CSendEmail.h b/plugins/SendScreenshotPlus/src/CSendEmail.h index 35e2372fc9..bfd51da9ce 100644 --- a/plugins/SendScreenshotPlus/src/CSendEmail.h +++ b/plugins/SendScreenshotPlus/src/CSendEmail.h @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CSendEmail : public CSend {
public:
// Deklaration Standardkonstruktor/Standarddestructor
- CSendEmail(HWND Owner, HANDLE hContact, bool bFreeOnExit);
+ CSendEmail(HWND Owner, HCONTACT hContact, bool bFreeOnExit);
~CSendEmail();
void Send();
diff --git a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp index 355ea225ad..f7a4661261 100644 --- a/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp +++ b/plugins/SendScreenshotPlus/src/CSendFTPFile.cpp @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //---------------------------------------------------------------------------
-CSendFTPFile::CSendFTPFile(HWND Owner, HANDLE hContact, bool bFreeOnExit)
+CSendFTPFile::CSendFTPFile(HWND Owner, HCONTACT hContact, bool bFreeOnExit)
: CSend(Owner, hContact, bFreeOnExit){
m_EnableItem = NULL ; //SS_DLG_DESCRIPTION| SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND;
m_pszSendTyp = LPGENT("FTPFile transfer");
diff --git a/plugins/SendScreenshotPlus/src/CSendFTPFile.h b/plugins/SendScreenshotPlus/src/CSendFTPFile.h index 9fa83e0481..11eaabb3e0 100644 --- a/plugins/SendScreenshotPlus/src/CSendFTPFile.h +++ b/plugins/SendScreenshotPlus/src/CSendFTPFile.h @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CSendFTPFile : public CSend {
public:
// Deklaration Standardkonstruktor/Standarddestructor
- CSendFTPFile(HWND Owner, HANDLE hContact, bool bFreeOnExit);
+ CSendFTPFile(HWND Owner, HCONTACT hContact, bool bFreeOnExit);
~CSendFTPFile();
void Send();
diff --git a/plugins/SendScreenshotPlus/src/CSendFile.cpp b/plugins/SendScreenshotPlus/src/CSendFile.cpp index 34489fbe1d..0453d581c0 100644 --- a/plugins/SendScreenshotPlus/src/CSendFile.cpp +++ b/plugins/SendScreenshotPlus/src/CSendFile.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "global.h"
//---------------------------------------------------------------------------
-CSendFile::CSendFile(HWND Owner, HANDLE hContact, bool bFreeOnExit)
+CSendFile::CSendFile(HWND Owner, HCONTACT hContact, bool bFreeOnExit)
: CSend(Owner, hContact, bFreeOnExit){
m_EnableItem = SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND | SS_DLG_DESCRIPTION;
m_pszSendTyp = _T("File transfer");
diff --git a/plugins/SendScreenshotPlus/src/CSendFile.h b/plugins/SendScreenshotPlus/src/CSendFile.h index 1476c58c14..07877cdac8 100644 --- a/plugins/SendScreenshotPlus/src/CSendFile.h +++ b/plugins/SendScreenshotPlus/src/CSendFile.h @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CSendFile : public CSend {
public:
// Deklaration Standardkonstruktor/Standarddestructor
- CSendFile(HWND Owner, HANDLE hContact, bool bFreeOnExit);
+ CSendFile(HWND Owner, HCONTACT hContact, bool bFreeOnExit);
~CSendFile();
void Send();
diff --git a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp index af3f4f277f..cdc146b0e9 100644 --- a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp @@ -34,7 +34,7 @@ INT_PTR (*g_MirCallService)(const char *, WPARAM, LPARAM)=NULL; //--------------------------------------------------------------------------- -CSendHTTPServer::CSendHTTPServer(HWND Owner, HANDLE hContact, bool bFreeOnExit) +CSendHTTPServer::CSendHTTPServer(HWND Owner, HCONTACT hContact, bool bFreeOnExit) : CSend(Owner, hContact, bFreeOnExit){ m_EnableItem = SS_DLG_DESCRIPTION ; //| SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND; m_pszSendTyp = _T("HTTPServer transfer"); diff --git a/plugins/SendScreenshotPlus/src/CSendHTTPServer.h b/plugins/SendScreenshotPlus/src/CSendHTTPServer.h index d8b2209aa0..740be3edf6 100644 --- a/plugins/SendScreenshotPlus/src/CSendHTTPServer.h +++ b/plugins/SendScreenshotPlus/src/CSendHTTPServer.h @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CSendHTTPServer : public CSend { public: // Deklaration Standardkonstruktor/Standarddestructor - CSendHTTPServer(HWND Owner, HANDLE hContact, bool bFreeOnExit); + CSendHTTPServer(HWND Owner, HCONTACT hContact, bool bFreeOnExit); ~CSendHTTPServer(); void Send(); diff --git a/plugins/SendScreenshotPlus/src/CSendImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendImageShack.cpp index 54608e6d35..68f91bbdc1 100644 --- a/plugins/SendScreenshotPlus/src/CSendImageShack.cpp +++ b/plugins/SendScreenshotPlus/src/CSendImageShack.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "global.h" //--------------------------------------------------------------------------- -CSendImageShack::CSendImageShack(HWND Owner, HANDLE hContact, bool bFreeOnExit) +CSendImageShack::CSendImageShack(HWND Owner, HCONTACT hContact, bool bFreeOnExit) : CSend(Owner, hContact, bFreeOnExit) { m_EnableItem = SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND | SS_DLG_DESCRIPTION; m_pszSendTyp = _T("Image upload"); diff --git a/plugins/SendScreenshotPlus/src/CSendImageShack.h b/plugins/SendScreenshotPlus/src/CSendImageShack.h index c7ee7e1e15..6ab5670c7c 100644 --- a/plugins/SendScreenshotPlus/src/CSendImageShack.h +++ b/plugins/SendScreenshotPlus/src/CSendImageShack.h @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CSendImageShack : public CSend { public: // Deklaration Standardkonstruktor/Standarddestructor - CSendImageShack(HWND Owner, HANDLE hContact, bool bFreeOnExit); + CSendImageShack(HWND Owner, HCONTACT hContact, bool bFreeOnExit); ~CSendImageShack(); void Send(); diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index 3df0ba8f66..9ad59587ef 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -210,7 +210,7 @@ INT_PTR service_CaptureAndSendDesktop(WPARAM wParam, LPARAM lParam) { delete frmMain; return -1; } - HANDLE hContact = (HANDLE) wParam; + HCONTACT hContact = (HCONTACT) wParam; LPSTR pszProto = GetContactProto(hContact); bool bChatRoom = db_get_b(hContact, pszProto, "ChatRoom", 0) != 0; frmMain->m_opt_chkTimed = false; @@ -239,7 +239,7 @@ INT_PTR service_OpenCaptureDialog(WPARAM wParam, LPARAM lParam){ delete frmMain; return -1; } - frmMain->Init(pszPath,(HANDLE)wParam); + frmMain->Init(pszPath, (HCONTACT)wParam); mir_free(pszPath); if(lParam==0xFFFF){ frmMain->SetTargetWindow(NULL); @@ -276,7 +276,7 @@ INT_PTR service_EditBitmap(WPARAM wParam, LPARAM lParam) { // lParam = (HANDLE)contact (can be null) INT_PTR service_Send2ImageShack(WPARAM wParam, LPARAM lParam) { LPSTR result = NULL; - CSendImageShack* cSend = new CSendImageShack(NULL, (HANDLE)lParam, false); + CSendImageShack* cSend = new CSendImageShack(NULL, (HCONTACT)lParam, false); cSend->m_pszFile = mir_a2t((char*)wParam); cSend->m_bDeleteAfterSend = FALSE; if (lParam != NULL) { diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index d7d058df1c..4be9eabbaa 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -764,7 +764,7 @@ void TfrmMain::SaveOptions(void) { } //--------------------------------------------------------------------------- -void TfrmMain::Init(LPTSTR DestFolder, HANDLE Contact) { +void TfrmMain::Init(LPTSTR DestFolder, HCONTACT Contact) { m_FDestFolder = mir_tstrdup(DestFolder); m_hContact = Contact; if(!m_hContact) m_opt_cboxSendBy = SS_JUSTSAVE; @@ -775,7 +775,8 @@ void TfrmMain::Init(LPTSTR DestFolder, HANDLE Contact) { _HandleMapping.insert(CHandleMapping::value_type(m_hWnd, this)); //check Contact - if(m_cSend) m_cSend->SetContact(Contact); + if(m_cSend) + m_cSend->SetContact(Contact); } //--------------------------------------------------------------------------- diff --git a/plugins/SendScreenshotPlus/src/UMainForm.h b/plugins/SendScreenshotPlus/src/UMainForm.h index cf6c827c4e..7e5029aa15 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.h +++ b/plugins/SendScreenshotPlus/src/UMainForm.h @@ -69,7 +69,7 @@ class TfrmMain{ bool m_bOnExitSave; static void Unload(); - void Init(LPTSTR DestFolder, HANDLE Contact); + void Init(LPTSTR DestFolder, HCONTACT Contact); void Close(){SendMessage(m_hWnd,WM_CLOSE,0,0);} void Show(){ShowWindow(m_hWnd,SW_SHOW);} void Hide(){ShowWindow(m_hWnd,SW_HIDE);} @@ -79,7 +79,7 @@ class TfrmMain{ private: HWND m_hWnd; - HANDLE m_hContact; + HCONTACT m_hContact; bool m_bDeleteAfterSend; bool m_bFormAbout, m_bFormEdit; HWND m_hTargetWindow, m_hLastWin; diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp index b73d3d5fa7..e32f22d332 100644 --- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp @@ -691,7 +691,7 @@ LRESULT CALLBACK PopupProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) /**
* This is the service function for external plugins to use the nice messagebox
*
- * @param wParam - HANDLE hContact which can display an avatar for popups
+ * @param wParam - HCONTACT hContact which can display an avatar for popups
* @param lParam - MSGBOX structure holding parameters
*
* @return The function returns the ID of the clicked button (IDOK, IDCANCEL, ...)
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 2180386f89..475e00ad62 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -44,9 +44,9 @@ HWND g_hSDlg; BOOL DONT = FALSE;
BOOL StartUp, isLastTRUE = FALSE, g_mode,bSC = FALSE;
-HANDLE session_list[255] = {0};
-HANDLE user_session_list[255] = {0};
-HANDLE session_list_recovered[255];
+HCONTACT session_list[255] = { 0 };
+HCONTACT user_session_list[255] = { 0 };
+HCONTACT session_list_recovered[255];
int count = 0;
unsigned int ses_count = 0;
@@ -227,7 +227,7 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar GetWindowText(GetDlgItem(hdlg, IDC_LIST), szUserSessionName, SIZEOF(szUserSessionName));
szUserSessionName[lenght+1]='\0';
if (IsDlgButtonChecked(hdlg,IDC_SELCONTACTS)&&bSC) {
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
BYTE res =(BYTE)SendMessage(hClistControl, CLM_GETCHECKMARK, SendMessage(hClistControl, CLM_FINDCONTACT, (WPARAM)hContact, 0), 0);
if (res) {
user_session_list[i] = hContact;
@@ -443,13 +443,13 @@ INT_PTR CloseCurrentSession(WPARAM wparam,LPARAM lparam) while(session_list[0]!=0)
{
mwid.cbSize = sizeof(MessageWindowInputData);
- mwid.hContact=session_list[i];
- mwid.uFlags=MSG_WINDOW_UFLAG_MSG_BOTH;
+ mwid.hContact = session_list[i];
+ mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
mwd.cbSize = sizeof(MessageWindowData);
mwd.hContact = mwid.hContact;
- mwd.uFlags=MSG_WINDOW_UFLAG_MSG_BOTH;
- CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid,(LPARAM)&mwd);
+ mwd.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
+ CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd);
if (g_mode)
{
@@ -468,7 +468,7 @@ int SaveSessionHandles(WPARAM wparam,LPARAM lparam) return 1;
int k=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)) {
if ((k=CheckForDuplicate(session_list,hContact)) != -1 && !(g_bExclHidden && !CheckContactVisibility(hContact))) {
AddSessionMark(hContact,lparam,'1');
AddInSessionOrder(hContact,lparam,k,1);
@@ -597,8 +597,8 @@ int LoadSession(WPARAM wparam,LPARAM lparam) {
int dup=0;
int hidden[255]={'0'};
- HANDLE hContact;
- HANDLE session_list_t[255]={0};
+ HCONTACT hContact;
+ HCONTACT session_list_t[255] = { 0 };
int mode=0;
int i=0,j=0;
if ((UINT)lparam>=ses_limit&&lparam!=256)
@@ -672,7 +672,7 @@ int LoadSession(WPARAM wparam,LPARAM lparam) int DelUserDefSession(int ses_count)
{
int i=0;
- HANDLE hContact;
+ HCONTACT hContact;
char szSessionName[256]={0};
TCHAR *szSessionNameBuf=NULL;
@@ -713,7 +713,7 @@ int DelUserDefSession(int ses_count) int DeleteAutoSession(int ses_count)
{
int i=0;
- HANDLE hContact;
+ HCONTACT hContact;
char szSessionName[256]={0};
TCHAR *szSessionNameBuf=NULL;
@@ -963,7 +963,7 @@ extern "C" __declspec(dllexport) int Load(void) int i=0;
ZeroMemory(session_list_recovered, sizeof(session_list_recovered));
- 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_b(hContact, MODNAME, "wasInLastSession", 0))
session_list_recovered[i++] = hContact;
}
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index caaae48365..64932b37e7 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -46,7 +46,7 @@ int OpLoadSessionContacts(WPARAM wparam,LPARAM lparam) {
ZeroMemory(session_list_t, sizeof(session_list_t));
- 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 (LoadContactsFromMask(hContact,1,lparam)) {
int i = GetInSessionOrder(hContact,1, lparam);
session_list_t[i] = hContact;
@@ -277,7 +277,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) if (((LPNMHDR)lparam)->idFrom == IDC_EMCLIST)
{
int iSelection = (int)((NMCLISTCONTROL *)lparam)->hItem;
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
for ( ; hContact; hContact = db_find_next(hContact))
if (SendDlgItemMessage(hdlg, IDC_EMCLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0) == iSelection)
break;
@@ -319,11 +319,11 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) if (!hOpClistControl)
EnableWindow(GetDlgItem(hdlg,IDC_DEL),TRUE);
else {
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
SendMessage(hOpClistControl, CLM_SETCHECKMARK, (WPARAM)hContact,0);
for (int i=0 ; session_list_t[i] > 0; i++) {
- HANDLE hContact = (HANDLE)SendMessage(hOpClistControl,CLM_FINDCONTACT, (WPARAM)session_list_t[i], 0);
+ HCONTACT hContact = (HCONTACT)SendMessage(hOpClistControl, CLM_FINDCONTACT, (WPARAM)session_list_t[i], 0);
SendMessage(hOpClistControl, CLM_SETCHECKMARK, (WPARAM)hContact, 1);
}
EnableWindow(GetDlgItem(hdlg,IDC_SAVE),FALSE);
@@ -366,7 +366,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) case IDC_SAVE:
{
int i=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)) {
BYTE res =(BYTE)SendMessage(GetDlgItem(hdlg,IDC_EMCLIST), CLM_GETCHECKMARK,
SendMessage(GetDlgItem(hdlg,IDC_EMCLIST), CLM_FINDCONTACT, (WPARAM)hContact, 0), 0);
if (res) {
diff --git a/plugins/Sessions/Src/Sessions.h b/plugins/Sessions/Src/Sessions.h index fd9c805235..727918e007 100644 --- a/plugins/Sessions/Src/Sessions.h +++ b/plugins/Sessions/Src/Sessions.h @@ -58,8 +58,8 @@ INT_PTR CloseCurrentSession(WPARAM ,LPARAM ); int SaveSessionDate();
extern HINSTANCE hinstance;
-extern HANDLE session_list_recovered[255];
-extern HANDLE session_list[255];
+extern HCONTACT session_list_recovered[255];
+extern HCONTACT session_list[255];
extern unsigned int ses_limit;
extern unsigned int g_ses_count;
extern BOOL g_bExclHidden;
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index 480c8d3c0f..dd5315185a 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "sessions.h"
-void AddSessionMark(HANDLE hContact, int mode, char bit)
+void AddSessionMark(HCONTACT hContact, int mode, char bit)
{
DBVARIANT dbv;
unsigned int i;
@@ -70,7 +70,7 @@ void AddSessionMark(HANDLE hContact, int mode, char bit) }
}
-void RemoveSessionMark(HANDLE hContact,int mode,int marknum)
+void RemoveSessionMark(HCONTACT hContact,int mode,int marknum)
{
unsigned int i=1;
char temp_1[1]={'\0'},temp_2[1]={'\0'};
@@ -100,7 +100,7 @@ void RemoveSessionMark(HANDLE hContact,int mode,int marknum) }
}
-void SetSessionMark(HANDLE hContact,int mode,char bit,unsigned int marknum)
+void SetSessionMark(HCONTACT hContact,int mode,char bit,unsigned int marknum)
{
DBVARIANT dbv;
char* pszBuffer=NULL;
@@ -124,7 +124,7 @@ void SetSessionMark(HANDLE hContact,int mode,char bit,unsigned int marknum) }
}
-BOOL LoadContactsFromMask(HANDLE hContact,int mode,int count)
+BOOL LoadContactsFromMask(HCONTACT hContact,int mode,int count)
{
DBVARIANT dbv;
if (mode == 0) {
@@ -142,7 +142,7 @@ BOOL LoadContactsFromMask(HANDLE hContact,int mode,int count) return res;
}
-void AddInSessionOrder(HANDLE hContact,int mode,int ordernum,int writemode)
+void AddInSessionOrder(HCONTACT hContact,int mode,int ordernum,int writemode)
{
int i;
char temp_1[2]={'\0'},temp_2[2]={'\0'};
@@ -233,7 +233,7 @@ void AddInSessionOrder(HANDLE hContact,int mode,int ordernum,int writemode) }
}
-int GetInSessionOrder(HANDLE hContact,int mode,int count)
+int GetInSessionOrder(HCONTACT hContact,int mode,int count)
{
int iOrder = 0;
char szTemp[3]={'\0'};
@@ -258,7 +258,7 @@ int GetInSessionOrder(HANDLE hContact,int mode,int count) return iOrder;
}
-void SetInSessionOrder(HANDLE hContact,int mode,int count,unsigned int ordernum)
+void SetInSessionOrder(HCONTACT hContact,int mode,int count,unsigned int ordernum)
{
int iOrder=0;
char szTemp[3]={'\0'};
@@ -319,10 +319,10 @@ BOOL ResaveSettings(char* szName,int iFirst,int iLimit,TCHAR* szBuffer) return 1;
}
-int AddToCurSession (HANDLE wparam,LPARAM lparam)
+int AddToCurSession(HCONTACT wparam, LPARAM lparam)
{
- if (CheckForDuplicate(session_list,wparam) == -1) {
- for (int i=0;;i++) {
+ if (CheckForDuplicate(session_list, wparam) == -1) {
+ for (int i = 0;; i++) {
if (session_list[i] == 0) {
session_list[i] = wparam;
break;
@@ -346,7 +346,7 @@ int DelFromCurSession(HANDLE wparam,LPARAM lparam) return 0;
}
-int CheckForDuplicate(HANDLE contact_list[], HANDLE lparam)
+int CheckForDuplicate(HCONTACT contact_list[], HANDLE lparam)
{
int i=0;
HANDLE s_list[255] = {0};
@@ -425,7 +425,7 @@ void OffsetWindow(HWND parent, HWND hwnd, int dx, int dy) SetWindowPos(hwnd, NULL, rc.left, rc.top,0, 0, SWP_NOZORDER |SWP_NOSIZE);
}
-int CheckContactVisibility(HANDLE hContact)
+int CheckContactVisibility(HCONTACT hContact)
{
if (db_get_b(hContact, "CList", "Hidden", 0))
return 0;
diff --git a/plugins/Sessions/Src/Utils.h b/plugins/Sessions/Src/Utils.h index 3e5aaaa002..174ef38afc 100644 --- a/plugins/Sessions/Src/Utils.h +++ b/plugins/Sessions/Src/Utils.h @@ -20,16 +20,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef __UTILS_H__
# define __UTILS_H__
-void SetInSessionOrder(HANDLE hContact,int mode,int count,unsigned int ordernum);
-void AddInSessionOrder(HANDLE hContact,int mode,int ordernum,int writemode);
-int GetInSessionOrder(HANDLE hContact,int mode,int count);
-void AddSessionMark(HANDLE hContact,int mode,char bit);
-void RemoveSessionMark(HANDLE hContact,int mode,int marknum);
-void SetSessionMark(HANDLE hContact,int mode,char bit,unsigned int marknum);
-BOOL LoadContactsFromMask(HANDLE hContact,int mode,int count);
-int AddToCurSession (HANDLE wparam,LPARAM lparam);
+void SetInSessionOrder(HCONTACT hContact,int mode,int count,unsigned int ordernum);
+void AddInSessionOrder(HCONTACT hContact,int mode,int ordernum,int writemode);
+int GetInSessionOrder(HCONTACT hContact,int mode,int count);
+void AddSessionMark(HCONTACT hContact,int mode,char bit);
+void RemoveSessionMark(HCONTACT hContact,int mode,int marknum);
+void SetSessionMark(HCONTACT hContact,int mode,char bit,unsigned int marknum);
+BOOL LoadContactsFromMask(HCONTACT hContact,int mode,int count);
+int AddToCurSession(HCONTACT wparam, LPARAM lparam);
int DelFromCurSession(HANDLE wparam,LPARAM lparam);
-int CheckForDuplicate(HANDLE contact_list[],HANDLE lparam);
+int CheckForDuplicate(HCONTACT contact_list[], HANDLE lparam);
BOOL ResaveSettings(char* szName,int iFirst,int iLimit,TCHAR* pszPrevSetting);
void OffsetWindow(HWND parent, HWND hwnd, int dx, int dy);
int LoadSessionToCombobox (HWND hdlg,BOOL mode,int iLimit,char* pszSetting,int iFirstNum);
@@ -37,7 +37,7 @@ int MarkUserDefSession(int ses_count,BYTE bCheck); BYTE IsMarkedUserDefSession(int ses_count);
void SavePosition(HWND hWnd, char *wndName);
void LoadPosition(HWND hWnd, char *wndName);
-int CheckContactVisibility(HANDLE hContact);
+int CheckContactVisibility(HCONTACT hContact);
void RenameUserDefSession(int ses_count,TCHAR* ptszNewName);
int FillFavoritesMenu (HMENU hMenu,int iLimit);
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index 5457f5e307..6de7acdb6c 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -62,7 +62,8 @@ struct TAddArgList int cch; // it's length (with space for NULL char)
int count; // number we have so far
LPSTR *files;
- HANDLE hContact, hEvent;
+ HCONTACT hContact;
+ HANDLE hEvent;
};
BOOL AddToList(TAddArgList& args)
@@ -178,7 +179,7 @@ void __cdecl IssueTransferThread(void *param) struct TSlotInfo
{
- HANDLE hContact;
+ HCONTACT hContact;
int hProto;
int dwStatus; // will be aligned anyway
};
@@ -257,7 +258,7 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode) TSlotInfo *pContacts = (TSlotInfo*)mir_alloc((dwContacts + 2) * sizeof(TSlotInfo));
int i = 0;
int dwOnline = 0;
- for (HANDLE hContact = db_find_first(); hContact != 0; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact != 0; hContact = db_find_next(hContact)) {
if (i >= dwContacts)
break;
@@ -353,7 +354,7 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode) // worker thread to clear MRU, called by the IPC bridge
void __cdecl ClearMRUThread(void*)
{
- for (HANDLE hContact = db_find_first(); hContact != 0; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact != 0; hContact = db_find_next(hContact))
if ( db_get_b(hContact, SHLExt_Name, SHLExt_MRU, 0) > 0)
db_set_b(hContact, SHLExt_Name, SHLExt_MRU, 0);
}
diff --git a/plugins/ShellExt/src/shlcom.h b/plugins/ShellExt/src/shlcom.h index c7d88349d0..4e78587f61 100644 --- a/plugins/ShellExt/src/shlcom.h +++ b/plugins/ShellExt/src/shlcom.h @@ -86,7 +86,7 @@ struct TSlotIPC BYTE cbSize;
int fType; // a REQUEST_* type
TSlotIPC *Next;
- HANDLE hContact;
+ HCONTACT hContact;
UINT hProto; // hash of the protocol the user is on
UINT hGroup; // hash of the entire path (not defined for REQUEST_GROUPS slots)
WORD Status;
@@ -207,7 +207,7 @@ struct TMenuDrawInfo int cch;
int wID; // should be the same as the menu item's ID
TSlotDrawTypes fTypes;
- HANDLE hContact;
+ HCONTACT hContact;
HICON hStatusIcon; // HICON from Self->ProtoIcons[index].hIcons[status]; Do not DestroyIcon()
HBITMAP hStatusBitmap; // HBITMAP, don't free.
int pid;
diff --git a/plugins/ShellExt/src/shlext.cpp b/plugins/ShellExt/src/shlext.cpp index 64f46e1855..7672226989 100644 --- a/plugins/ShellExt/src/shlext.cpp +++ b/plugins/ShellExt/src/shlext.cpp @@ -702,7 +702,7 @@ HRESULT TShellExt::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT _idCmdFirs /////////////////////////////////////////////////////////////////////////////////////////
-HRESULT ipcGetFiles(THeaderIPC *pipch, IDataObject* pDataObject, HANDLE hContact)
+HRESULT ipcGetFiles(THeaderIPC *pipch, IDataObject* pDataObject, HCONTACT hContact)
{
FORMATETC fet;
fet.cfFormat = CF_HDROP;
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 1c995f5262..aad11984f5 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -72,7 +72,7 @@ INT_PTR ToggleEnable(WPARAM wParam, LPARAM lParam) INT_PTR Toggle(WPARAM w, LPARAM l)
{
- HANDLE hContact = (HANDLE)w;
+ HCONTACT hContact = (HCONTACT)w;
BOOL on = !db_get_b(hContact, protocolname, "TurnedOn", 0);
db_set_b(hContact, protocolname, "TurnedOn", on);
on = !on;
@@ -87,7 +87,7 @@ INT_PTR Toggle(WPARAM w, LPARAM l) INT OnPreBuildContactMenu(WPARAM w, LPARAM l)
{
- HANDLE hContact = (HANDLE)w;
+ HCONTACT hContact = (HCONTACT)w;
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR;
@@ -183,7 +183,7 @@ TCHAR* StrReplace (TCHAR* Search, TCHAR* Replace, TCHAR* Resource) INT addEvent(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HANDLE hDBEvent = (HANDLE)lParam;
BOOL fEnabled = db_get_b(NULL, protocolname, KEY_ENABLED, 1);
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 991384b69a..f2888d2443 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -79,7 +79,7 @@ static TCHAR *StrNormNewline(TCHAR *tszStr) struct AwayMsgDlgData
{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hSeq;
HANDLE hAwayMsgEvent;
};
@@ -97,7 +97,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP dat = (AwayMsgDlgData*)mir_alloc(sizeof(AwayMsgDlgData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- dat->hContact = (HANDLE)lParam;
+ dat->hContact = (HCONTACT)lParam;
dat->hSeq = (HANDLE)CallContactService(dat->hContact, PSS_GETAWAYMSG, 0, 0);
dat->hAwayMsgEvent = dat->hSeq ? HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_AWAYMSG) : NULL;
WindowList_Add(hWindowList, hwndDlg, dat->hContact);
@@ -126,7 +126,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadSkinnedProtoIcon(szProto, dwStatus));
EnableWindow(GetDlgItem(hwndDlg, IDC_COPY), FALSE);
}
- Utils_RestoreWindowPosition(hwndDlg, (HANDLE)lParam, "SRAway", "AwayMsgDlg");
+ Utils_RestoreWindowPosition(hwndDlg, (HCONTACT)lParam, "SRAway", "AwayMsgDlg");
return TRUE;
case HM_AWAYMSG:
@@ -203,7 +203,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP static INT_PTR GetMessageCommand(WPARAM wParam, LPARAM)
{
- if (HWND hwnd = WindowList_Find(hWindowList, (HANDLE)wParam))
+ if (HWND hwnd = WindowList_Find(hWindowList, (HCONTACT)wParam))
{
SetForegroundWindow(hwnd);
SetFocus(hwnd);
@@ -227,7 +227,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP dat = (AwayMsgDlgData*)mir_alloc(sizeof(AwayMsgDlgData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- dat->hContact = (HANDLE)lParam;
+ dat->hContact = (HCONTACT)lParam;
dat->hSeq = (HANDLE)CallContactService(dat->hContact, PSS_GETAWAYMSG, 0, 0);
dat->hAwayMsgEvent = dat->hSeq ? HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_AWAYMSG) : NULL;
WindowList_Add(hWindowList2, hwndDlg, dat->hContact);
@@ -301,7 +301,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP static INT_PTR CopyAwayMsgCommand(WPARAM wParam, LPARAM)
{
- if (HWND hwnd = WindowList_Find(hWindowList2, (HANDLE)wParam))
+ if (HWND hwnd = WindowList_Find(hWindowList2, (HCONTACT)wParam))
{
SetForegroundWindow(hwnd);
SetFocus(hwnd);
@@ -330,7 +330,7 @@ static char *StrFindURL(char *pszStr) static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM lParam)
{
- ptrA szMsg(db_get_sa((HANDLE)wParam, "CList", "StatusMsg"));
+ ptrA szMsg(db_get_sa((HCONTACT)wParam, "CList", "StatusMsg"));
char *szURL = StrFindURL(szMsg);
if (szURL != NULL)
@@ -354,8 +354,8 @@ static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM lParam) static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam)
{
TCHAR str[128];
- char *szProto = GetContactProto((HANDLE)wParam);
- int iHidden = szProto ? db_get_b((HANDLE)wParam, szProto, "ChatRoom", 0) : 0;
+ char *szProto = GetContactProto((HCONTACT)wParam);
+ int iHidden = szProto ? db_get_b((HCONTACT)wParam, szProto, "ChatRoom", 0) : 0;
int iStatus;
CLISTMENUITEM clmi = { sizeof(clmi) };
@@ -363,7 +363,7 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam) clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
if (!iHidden) {
iHidden = 1;
- iStatus = db_get_w((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE);
+ iStatus = db_get_w((HCONTACT)wParam, szProto, "Status", ID_STATUS_OFFLINE);
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1,0) & PF1_MODEMSGRECV) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3,0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
iHidden = 0;
@@ -377,7 +377,7 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam) Menu_ModifyItem(hAwayMsgMenuItem, &clmi);
Skin_ReleaseIcon(clmi.hIcon);
- ptrA szMsg(db_get_sa((HANDLE)wParam, "CList", "StatusMsg"));
+ ptrA szMsg(db_get_sa((HCONTACT)wParam, "CList", "StatusMsg"));
clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
if (!iHidden && szMsg != NULL) {
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index fc120c6acb..8494ad66d6 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -384,7 +384,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) return msg;
}
-TCHAR *InsertVarsIntoMsg(TCHAR *tszMsg, const char *szProto, int iStatus, HANDLE hContact)
+TCHAR *InsertVarsIntoMsg(TCHAR *tszMsg, const char *szProto, int iStatus, HCONTACT hContact)
{
if (ServiceExists(MS_VARS_FORMATSTRING) && db_get_b(NULL, "SimpleStatusMsg", "EnableVariables", 1))
{
@@ -523,7 +523,7 @@ void SaveStatusAsCurrent(const char *szProto, int iStatus) db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)iStatus);
}
-static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, HANDLE hContact)
+static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, HCONTACT hContact)
{
TCHAR *format = NULL;
char szSetting[80];
@@ -1775,7 +1775,7 @@ static int OnICQStatusMsgRequest(WPARAM wParam, LPARAM lParam, LPARAM lMirParam) char *szProto = (char *)lMirParam;
BOOL bContactFound = FALSE;
- HANDLE hContact;
+ HCONTACT hContact;
for (hContact = db_find_first(szProto); hContact; hContact = db_find_next(hContact, szProto)) {
if (db_get_dw(hContact, szProto, "UIN", 0) == (DWORD)lParam) {
diff --git a/plugins/SmileyAdd/src/customsmiley.cpp b/plugins/SmileyAdd/src/customsmiley.cpp index 053028aaaa..e9efd4ddee 100644 --- a/plugins/SmileyAdd/src/customsmiley.cpp +++ b/plugins/SmileyAdd/src/customsmiley.cpp @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. SmileyPackCListType g_SmileyPackCStore;
-bool SmileyPackCListType::AddSmileyPack(HANDLE hContact, TCHAR* dir)
+bool SmileyPackCListType::AddSmileyPack(HCONTACT hContact, TCHAR* dir)
{
bool res = true;
if (GetSmileyPack(hContact) == NULL) {
@@ -38,7 +38,7 @@ bool SmileyPackCListType::AddSmileyPack(HANDLE hContact, TCHAR* dir) }
-bool SmileyPackCListType::AddSmiley(HANDLE hContact, TCHAR* path)
+bool SmileyPackCListType::AddSmiley(HCONTACT hContact, TCHAR* path)
{
SmileyPackCType *smpack = GetSmileyPack(hContact);
if (smpack == NULL) {
diff --git a/plugins/SmileyAdd/src/customsmiley.h b/plugins/SmileyAdd/src/customsmiley.h index c613b5dc75..fc8e0dff02 100644 --- a/plugins/SmileyAdd/src/customsmiley.h +++ b/plugins/SmileyAdd/src/customsmiley.h @@ -69,8 +69,8 @@ private: public:
int NumberOfSmileyPacks(void) { return m_SmileyPacks.getCount(); }
- bool AddSmileyPack(HANDLE hContact, TCHAR* dir);
- bool AddSmiley(HANDLE hContact, TCHAR* path);
+ bool AddSmileyPack(HCONTACT hContact, TCHAR* dir);
+ bool AddSmiley(HCONTACT hContact, TCHAR* path);
void ClearAndFreeAll(void) { m_SmileyPacks.destroy(); }
diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index aed46dc9c6..d46eb2da72 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // we are not supposed to use this object, so be aware
typedef struct NewMessageWindowLParam
{
- HANDLE hContact;
+ HCONTACT hContact;
int isSend;
const char *szInitialText;
}
@@ -56,7 +56,7 @@ public: mutable HBITMAP hSmlBmp;
mutable HICON hSmlIco;
int idxLastChar;
- HANDLE hContact;
+ HCONTACT hContact;
bool doSmileyReplace;
bool doSmileyButton;
bool OldButtonPlace;
@@ -290,7 +290,7 @@ static MsgWndData* IsMsgWnd(HWND hwnd) }
-static void MsgWndDetect(HWND hwndDlg, HANDLE hContact, msgData* datm)
+static void MsgWndDetect(HWND hwndDlg, HCONTACT hContact, msgData* datm)
{
MsgWndData dat;
@@ -303,7 +303,7 @@ static void MsgWndDetect(HWND hwndDlg, HANDLE hContact, msgData* datm) else dat.hContact = hContact;
// Get the protocol for this contact to display correct smileys.
- char *protonam = GetContactProto( DecodeMetaContact(dat.hContact));
+ char *protonam = GetContactProto(DecodeMetaContact(dat.hContact));
if (protonam) {
strncpy(dat.ProtocolName, protonam, sizeof(dat.ProtocolName));
dat.ProtocolName[sizeof(dat.ProtocolName)-1] = 0;
diff --git a/plugins/SmileyAdd/src/general.cpp b/plugins/SmileyAdd/src/general.cpp index b10c77cdae..91050e25cd 100644 --- a/plugins/SmileyAdd/src/general.cpp +++ b/plugins/SmileyAdd/src/general.cpp @@ -211,11 +211,11 @@ void DestroyGdiPlus(void) }
}
-HANDLE DecodeMetaContact(HANDLE hContact)
+HCONTACT DecodeMetaContact(HCONTACT hContact)
{
if (hContact == NULL) return NULL;
- HANDLE hReal = (HANDLE) CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM) hContact, 0);
- if (hReal == NULL || hReal == (HANDLE)CALLSERVICE_NOTFOUND)
+ HCONTACT hReal = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ if (hReal == NULL || hReal == (HCONTACT)CALLSERVICE_NOTFOUND)
hReal = hContact;
return hReal;
diff --git a/plugins/SmileyAdd/src/general.h b/plugins/SmileyAdd/src/general.h index 489bd06b3a..f9c255e3fc 100644 --- a/plugins/SmileyAdd/src/general.h +++ b/plugins/SmileyAdd/src/general.h @@ -164,7 +164,7 @@ bool IsOldSrmm(void); int CalculateTextHeight(HDC hdc, CHARFORMAT2* chf);
const TCHAR* GetImageExt(CMString &fname);
-HANDLE DecodeMetaContact(HANDLE hContact);
+HCONTACT DecodeMetaContact(HCONTACT hContact);
bool IsSmileyProto(char* proto);
HICON ImageList_GetIconFixed (HIMAGELIST himl, INT i, UINT fStyle);
@@ -180,7 +180,7 @@ HICON GetDefaultIcon(bool copy = true); void CloseRichCallback(HWND hwnd);
void CloseRichOwnerCallback(HWND hwnd);
-bool SetRichCallback(HWND hwnd, HANDLE hContact, bool subany, bool subnew);
+bool SetRichCallback(HWND hwnd, HCONTACT hContact, bool subany, bool subnew);
void SetRichOwnerCallback(HWND hwnd, HWND hwndInput, HWND hwndLog);
void ProcessAllInputAreas(bool restoreText);
void RichEditData_Destroy(void);
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index 2da19f7c31..7fb45de5f0 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -633,7 +633,7 @@ void OptionsType::WriteCustomCategories(const CMString& cats) }
-void OptionsType::ReadContactCategory(HANDLE hContact, CMString& cats)
+void OptionsType::ReadContactCategory(HCONTACT hContact, CMString& cats)
{
DBVARIANT dbv;
INT_PTR res = db_get_ts(hContact, "SmileyAdd", "CustomCategory", &dbv);
@@ -644,7 +644,7 @@ void OptionsType::ReadContactCategory(HANDLE hContact, CMString& cats) }
-void OptionsType::WriteContactCategory(HANDLE hContact, const CMString& cats)
+void OptionsType::WriteContactCategory(HCONTACT hContact, const CMString& cats)
{
if (cats.IsEmpty())
db_unset(hContact, "SmileyAdd", "CustomCategory");
diff --git a/plugins/SmileyAdd/src/options.h b/plugins/SmileyAdd/src/options.h index 349fe2f9dd..ed953c5760 100644 --- a/plugins/SmileyAdd/src/options.h +++ b/plugins/SmileyAdd/src/options.h @@ -48,10 +48,10 @@ public: static void ReadPackFileName(CMString& filename, const CMString& name,
const CMString& defaultFilename);
static void ReadCustomCategories(CMString& cats);
- static void ReadContactCategory(HANDLE hContact, CMString& cats);
+ static void ReadContactCategory(HCONTACT hContact, CMString& cats);
static void WritePackFileName(const CMString& filename, const CMString& name);
static void WriteCustomCategories(const CMString& cats);
- static void WriteContactCategory(HANDLE hContact, const CMString& cats);
+ static void WriteContactCategory(HCONTACT hContact, const CMString& cats);
};
extern OptionsType opt;
diff --git a/plugins/SmileyAdd/src/richcall.cpp b/plugins/SmileyAdd/src/richcall.cpp index 8ddc79d4a3..73579c0be9 100644 --- a/plugins/SmileyAdd/src/richcall.cpp +++ b/plugins/SmileyAdd/src/richcall.cpp @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. struct RichEditData
{
HWND hwnd;
- HANDLE hContact;
+ HCONTACT hContact;
HWND hToolTip;
int tipActive;
bool inputarea;
@@ -312,7 +312,7 @@ static LRESULT CALLBACK RichEditSubclass(HWND hwnd, UINT uMsg, WPARAM wParam, LP return result;
}
-bool SetRichCallback(HWND hwnd, HANDLE hContact, bool subany, bool subnew)
+bool SetRichCallback(HWND hwnd, HCONTACT hContact, bool subany, bool subnew)
{
RichEditData* rdt = g_RichEditList.find((RichEditData*)&hwnd);
if (rdt == NULL) {
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 00f27437c6..f7db0a0b94 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -23,7 +23,7 @@ LIST<void> menuHandleArray(5); //implementation of service functions
-SmileyPackType* GetSmileyPack(const char* proto, HANDLE hContact, SmileyPackCType** smlc)
+SmileyPackType* GetSmileyPack(const char* proto, HCONTACT hContact, SmileyPackCType** smlc)
{
hContact = DecodeMetaContact(hContact);
if (smlc)
@@ -100,7 +100,7 @@ INT_PTR ShowSmileySelectionCommand(WPARAM, LPARAM lParam) if (smaddInfo == NULL || smaddInfo->cbSize < SMADD_SHOWSEL_SIZE_V1) return FALSE;
HWND parent = smaddInfo->cbSize > SMADD_SHOWSEL_SIZE_V1 ? smaddInfo->hwndParent : NULL;
- HANDLE hContact = smaddInfo->cbSize > SMADD_SHOWSEL_SIZE_V2 ? smaddInfo->hContact : NULL;
+ HCONTACT hContact = smaddInfo->cbSize > SMADD_SHOWSEL_SIZE_V2 ? smaddInfo->hContact : NULL;
SmileyToolWindowParam *stwp = new SmileyToolWindowParam;
stwp->pSmileyPack = GetSmileyPack(smaddInfo->Protocolname, hContact);
@@ -155,7 +155,7 @@ INT_PTR GetSmileyIconCommand(WPARAM, LPARAM lParam) static int GetInfoCommandE(SMADD_INFO2* smre, bool retDup)
{
if (smre == NULL || smre->cbSize < SMADD_INFO_SIZE_V1) return FALSE;
- HANDLE hContact = smre->cbSize > SMADD_INFO_SIZE_V1 ? smre->hContact : NULL;
+ HCONTACT hContact = smre->cbSize > SMADD_INFO_SIZE_V1 ? smre->hContact : NULL;
SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname, hContact);
@@ -282,7 +282,7 @@ INT_PTR ParseTextBatch(WPARAM, LPARAM lParam) SMADD_BATCHPARSE2* smre = (SMADD_BATCHPARSE2*) lParam;
if (smre == NULL || smre->cbSize < SMADD_BATCHPARSE_SIZE_V1) return FALSE;
- HANDLE hContact = smre->cbSize > SMADD_BATCHPARSE_SIZE_V1 ? smre->hContact : NULL;
+ HCONTACT hContact = smre->cbSize > SMADD_BATCHPARSE_SIZE_V1 ? smre->hContact : NULL;
SmileyPackCType* smcp = NULL;
SmileyPackType* SmileyPack = GetSmileyPack(smre->Protocolname, hContact,
@@ -356,7 +356,7 @@ INT_PTR RegisterPack(WPARAM, LPARAM lParam) INT_PTR CustomCatMenu(WPARAM wParam, LPARAM lParam)
{
- const HANDLE hContact = (HANDLE)wParam;
+ const HCONTACT hContact = (HCONTACT)wParam;
if (lParam != 0)
{
SmileyCategoryType* smct = g_SmileyCategories.GetSmileyCategory((unsigned)lParam - 3);
@@ -382,7 +382,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) {
SmileyCategoryListType::SmileyCategoryVectorType& smc = *g_SmileyCategories.GetSmileyCategoryList();
- char* protnam = GetContactProto((HANDLE)wParam);
+ char* protnam = GetContactProto((HCONTACT)wParam);
bool haveMenu = IsSmileyProto(protnam);
if (haveMenu && opt.UseOneForAll) {
unsigned cnt = 0;
@@ -399,7 +399,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) if (haveMenu) {
CMString cat;
- opt.ReadContactCategory((HANDLE)wParam, cat);
+ opt.ReadContactCategory((HCONTACT)wParam, cat);
CLISTMENUITEM mi = { sizeof(mi) };
mi.hParentMenu = hContactMenuItem;
@@ -473,8 +473,7 @@ INT_PTR LoadContactSmileys(WPARAM, LPARAM lParam) SMADD_CONT* cont = (SMADD_CONT*)lParam;
- switch (cont->type)
- {
+ switch (cont->type) {
case 0:
g_SmileyPackCStore.AddSmileyPack(cont->hContact, cont->path);
NotifyEventHooks(hEvent1, (WPARAM)cont->hContact, 0);
@@ -541,7 +540,7 @@ int AccountListChanged(WPARAM wParam, LPARAM lParam) int DbSettingChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam;
if (hContact == NULL) return 0;
diff --git a/plugins/SmileyAdd/src/services.h b/plugins/SmileyAdd/src/services.h index 992f921479..21ee912e79 100644 --- a/plugins/SmileyAdd/src/services.h +++ b/plugins/SmileyAdd/src/services.h @@ -38,7 +38,7 @@ INT_PTR LoadContactSmileys(WPARAM, LPARAM lParam); int AccountListChanged(WPARAM wParam, LPARAM lParam);
int DbSettingChanged(WPARAM wParam, LPARAM lParam);
-SmileyPackType* GetSmileyPack(const char* proto, HANDLE hContact = NULL, SmileyPackCType** smlc = NULL);
+SmileyPackType* GetSmileyPack(const char* proto, HCONTACT hContact = NULL, SmileyPackCType** smlc = NULL);
#endif // SMILEYADD_SERVICES_H_
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index abcfe7b7aa..51e1fafb8d 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -152,7 +152,7 @@ SmileyType* SmileyPackType::GetSmiley(unsigned index) }
-static DWORD_PTR ConvertServiceParam(HANDLE hContact, const TCHAR *param)
+static DWORD_PTR ConvertServiceParam(HCONTACT hContact, const TCHAR *param)
{
DWORD_PTR ret;
if (param == NULL)
@@ -168,7 +168,7 @@ static DWORD_PTR ConvertServiceParam(HANDLE hContact, const TCHAR *param) }
-void SmileyType::CallSmileyService(HANDLE hContact)
+void SmileyType::CallSmileyService(HCONTACT hContact)
{
_TPattern * srvsplit = _TPattern::compile(_T("(.*)\\|(.*)\\|(.*)"));
_TMatcher * m0 = srvsplit->createTMatcher(GetTriggerText());
@@ -856,7 +856,7 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc) {
CMString tname(A2T_SM(acc->szModuleName));
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char* proto = GetContactProto(hContact);
if (proto == NULL)
continue;
@@ -878,7 +878,7 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc) }
}
-void SmileyCategoryListType::AddContactTransportAsCategory(HANDLE hContact, const CMString& defaultFile)
+void SmileyCategoryListType::AddContactTransportAsCategory(HCONTACT hContact, const CMString& defaultFile)
{
char* proto = GetContactProto(hContact);
if (proto == NULL) return;
@@ -944,7 +944,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) for (int i = 0; i < protoCount; i++)
AddAccountAsCategory(accList[i], defaultFile);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
AddContactTransportAsCategory(hContact, defaultFile);
CMString cats;
diff --git a/plugins/SmileyAdd/src/smileys.h b/plugins/SmileyAdd/src/smileys.h index b654b32ff3..4e7d95f6fa 100644 --- a/plugins/SmileyAdd/src/smileys.h +++ b/plugins/SmileyAdd/src/smileys.h @@ -76,7 +76,7 @@ public: HICON GetIconDup(void);
HBITMAP GetBitmap(COLORREF bkgClr, int sizeX, int sizeY);
- void CallSmileyService(HANDLE hContact);
+ void CallSmileyService(HCONTACT hContact);
void SetHidden(bool hid) { SetFlagsBit(HiddenSmiley, hid); }
void SetRegEx(bool regex) { SetFlagsBit(RegExSmiley, regex); }
@@ -291,7 +291,7 @@ public: void AddAndLoad(const CMString& name, const CMString& displayName);
void AddAllProtocolsAsCategory(void);
void AddAccountAsCategory(PROTOACCOUNT *acc, const CMString& defaultFile);
- void AddContactTransportAsCategory(HANDLE hContact, const CMString& defaultFile);
+ void AddContactTransportAsCategory(HCONTACT hContact, const CMString& defaultFile);
void ClearAndLoadAll(void);
void ClearAll(void)
diff --git a/plugins/SmileyAdd/src/smltool.cpp b/plugins/SmileyAdd/src/smltool.cpp index 821a0bc3d9..821173887b 100644 --- a/plugins/SmileyAdd/src/smltool.cpp +++ b/plugins/SmileyAdd/src/smltool.cpp @@ -45,7 +45,7 @@ private: int m_Direction;
UINT m_TargetMessage;
WPARAM m_TargetWParam;
- HANDLE m_hContact;
+ HCONTACT m_hContact;
int rowSel;
bool m_Choosing;
@@ -171,10 +171,10 @@ LRESULT SmileyToolWindowType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lP struct smlsrvstruct
{
- smlsrvstruct(SmileyType *tsml, HANDLE thContact)
+ smlsrvstruct(SmileyType *tsml, HCONTACT thContact)
: sml(tsml), hContact(thContact) {}
SmileyType *sml;
- HANDLE hContact;
+ HCONTACT hContact;
};
void CALLBACK smileyServiceCallback(void* arg)
diff --git a/plugins/SmileyAdd/src/smltool.h b/plugins/SmileyAdd/src/smltool.h index 89fb786862..ccdab2511e 100644 --- a/plugins/SmileyAdd/src/smltool.h +++ b/plugins/SmileyAdd/src/smltool.h @@ -32,7 +32,7 @@ struct SmileyToolWindowParam HWND hWndParent;
UINT targetMessage;
WPARAM targetWParam;
- HANDLE hContact;
+ HCONTACT hContact;
};
diff --git a/plugins/Spamotron/src/bayes.cpp b/plugins/Spamotron/src/bayes.cpp index 8a00005150..9df33ba9a1 100644 --- a/plugins/Spamotron/src/bayes.cpp +++ b/plugins/Spamotron/src/bayes.cpp @@ -221,7 +221,7 @@ double get_msg_score(TCHAR *msg) return tmp1 / (tmp1 + tmp2);
}
-void queue_message(HANDLE hContact, DWORD msgtime, TCHAR *message)
+void queue_message(HCONTACT hContact, DWORD msgtime, TCHAR *message)
{
char *tmp;
sqlite3_stmt *stmt;
@@ -245,7 +245,7 @@ void queue_message(HANDLE hContact, DWORD msgtime, TCHAR *message) sqlite3_finalize(stmt);
}
-void bayes_approve_contact(HANDLE hContact)
+void bayes_approve_contact(HCONTACT hContact)
{
const char *message;
TCHAR *messageW;
diff --git a/plugins/Spamotron/src/common.h b/plugins/Spamotron/src/common.h index e8d0903b13..2e9501c0ff 100644 --- a/plugins/Spamotron/src/common.h +++ b/plugins/Spamotron/src/common.h @@ -42,7 +42,7 @@ #define _getOptD(a,b) _getCOptD(NULL, a, b)
#define _setOptD(a,b) _setCOptD(NULL, a, b)
-TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, HANDLE hContact, const char* option, const TCHAR *def);
+TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, HCONTACT hContact, const char* option, const TCHAR *def);
#define _getOptS(a,b,c,d) _getCOptS(a, b, NULL, c, d)
#define _setCOptTS(a,b,c) db_set_ts(a, PLUGIN_NAME, b, c)
#define _setCOptS(a,b,c) db_set_s(a, PLUGIN_NAME, b, c)
@@ -105,11 +105,11 @@ BOOL _isvalidregex(TCHAR* strSearch); BOOL _regmatch(TCHAR* str, TCHAR* strSearch);
BOOL Contains(TCHAR* dst, TCHAR* src);
BOOL isOneDay(DWORD timestamp1, DWORD timestamp2);
-void MarkUnread(HANDLE hContact);
+void MarkUnread(HCONTACT hContact);
-int ShowPopup(HANDLE hContact, BYTE popupType, TCHAR *line1, TCHAR *line2);
+int ShowPopup(HCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2);
int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2);
-int _notify(HANDLE hContact, BYTE type, TCHAR *message, TCHAR *origmessage);
+int _notify(HCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage);
int LogToSystemHistory(char *message, char *origmessage);
#define POPUP_DEFAULT 0
#define POPUP_BLOCKED 1
@@ -151,8 +151,8 @@ void learn_spam(TCHAR *msg); int get_token_count(int type);
int get_msg_count(int type);
double get_msg_score(TCHAR *msg);
-void queue_message(HANDLE hContact, DWORD msgtime, TCHAR *message);
-void bayes_approve_contact(HANDLE hContact);
+void queue_message(HCONTACT hContact, DWORD msgtime, TCHAR *message);
+void bayes_approve_contact(HCONTACT hContact);
void dequeue_messages();
#ifdef _DEBUG
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index a2e4e3e0b3..7a3cdf0672 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -2,7 +2,7 @@ TCHAR currentResponse[256] = {0};
-TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, HANDLE hContact, const char* option, const TCHAR *def)
+TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, HCONTACT hContact, const char* option, const TCHAR *def)
{
DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
diff --git a/plugins/Spamotron/src/popups.cpp b/plugins/Spamotron/src/popups.cpp index 585f36170c..ee11962bed 100644 --- a/plugins/Spamotron/src/popups.cpp +++ b/plugins/Spamotron/src/popups.cpp @@ -192,7 +192,7 @@ int ShowPopupPreview(HWND optDlg, BYTE popupType, TCHAR *line1, TCHAR *line2) }
-int ShowPopup(HANDLE hContact, BYTE popupType, TCHAR *line1, TCHAR *line2)
+int ShowPopup(HCONTACT hContact, BYTE popupType, TCHAR *line1, TCHAR *line2)
{
POPUPDATAT ppdp = {0};
switch (popupType)
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index 78b95f6e8e..0c79c8b958 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -50,7 +50,7 @@ int OnDBEventAdded(WPARAM wParam, LPARAM lParam) int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBEVENTINFO *dbei = (DBEVENTINFO *)lParam;
char *msgblob;
POPUPDATA ppdp = {0};
@@ -68,7 +68,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) // get hContact from DBEVENTINFO as icq_proto.c doesn't pass hContact the usual way for some reason.
if (dbei->eventType == EVENTTYPE_AUTHREQUEST)
- hContact = *((PHANDLE)(dbei->pBlob+sizeof(DWORD)));
+ hContact = (HCONTACT)*(PDWORD(dbei->pBlob+sizeof(DWORD)));
// get maximum length of the message a protocol supports
maxmsglen = CallProtoService(dbei->szModule, PS_GETCAPS, PFLAG_MAXLENOFMESSAGE, (LPARAM)hContact);
@@ -524,7 +524,7 @@ void RemoveNotOnListSettings() {
DBVARIANT dbv;
char protoName[256] = {0};
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
strcpy(protoName, "proto_");
while (hContact != NULL) {
if (db_get_s(hContact, "Protocol", "p", &dbv) == 0) {
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index 5f930e47bd..4858ee2297 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -433,7 +433,7 @@ TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num) return dst;
}
-int _notify(HANDLE hContact, BYTE type, TCHAR *message, TCHAR *origmessage)
+int _notify(HCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage)
{
char *tmp, *tmporig;
TCHAR msg[MAX_BUFFER_LENGTH];
@@ -484,7 +484,7 @@ int LogToSystemHistory(char *message, char *origmessage) return 0;
}
-void MarkUnread(HANDLE hContact)
+void MarkUnread(HCONTACT hContact)
{
// We're not actually marking anything. We just pushing saved events to the database from a temporary location
DBVARIANT _dbv = {0};
diff --git a/plugins/SpellChecker/src/commons.h b/plugins/SpellChecker/src/commons.h index fa435a0a42..ac8ba21e2d 100644 --- a/plugins/SpellChecker/src/commons.h +++ b/plugins/SpellChecker/src/commons.h @@ -120,7 +120,7 @@ struct Dialog {
HWND hwnd;
HWND hwnd_owner;
- HANDLE hContact;
+ HCONTACT hContact;
char name[64];
Dictionary *lang;
TCHAR lang_name[32];
@@ -150,7 +150,7 @@ int MsgWindowEvent(WPARAM wParam, LPARAM lParam); int MsgWindowPopup(WPARAM wParam, LPARAM lParam);
int IconPressed(WPARAM wParam, LPARAM lParam);
-int AddContactTextBox(HANDLE hContact, HWND hwnd, char *name, BOOL srmm, HWND hwndOwner);
+int AddContactTextBox(HCONTACT hContact, HWND hwnd, char *name, BOOL srmm, HWND hwndOwner);
int RemoveContactTextBox(HWND hwnd);
int ShowPopupMenu(HWND hwnd, HMENU hMenu, POINT pt, HWND hwndOwner);
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 78027c7ca6..afa493cb39 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -715,7 +715,7 @@ int GetClosestLanguage(TCHAR *lang_name) return -1; } -void GetUserProtoLanguageSetting(Dialog *dlg, HANDLE hContact, char *group, char *setting, BOOL isProtocol = TRUE) +void GetUserProtoLanguageSetting(Dialog *dlg, HCONTACT hContact, char *group, char *setting, BOOL isProtocol = TRUE) { DBVARIANT dbv = {0}; dbv.type = DBVT_TCHAR; @@ -776,7 +776,7 @@ void GetUserLanguageSetting(Dialog *dlg, char *setting) if (metacontacts_proto != NULL) { mc = CallService(MS_MC_GETMETACONTACT, (WPARAM) dlg->hContact, 0); if (mc != CALLSERVICE_NOTFOUND) { - HANDLE hMetaContact = (HANDLE) mc; + HCONTACT hMetaContact = (HCONTACT)mc; if (hMetaContact != NULL) { GetUserProtoLanguageSetting(dlg, hMetaContact, metacontacts_proto, setting); if (dlg->lang_name[0] != _T('\0')) @@ -816,7 +816,7 @@ void GetContactLanguage(Dialog *dlg) if (dlg->lang_name[0] == _T('\0')) { INT_PTR mc = CallService(MS_MC_GETMETACONTACT, (WPARAM) dlg->hContact, 0); if (mc != CALLSERVICE_NOTFOUND) { - HANDLE hMetaContact = (HANDLE) mc; + HCONTACT hMetaContact = (HCONTACT)mc; if (hMetaContact != NULL) { if (!db_get_ts(hMetaContact, MODULE_NAME, "TalkLanguage", &dbv)) { lstrcpyn(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name)); @@ -899,7 +899,7 @@ void NotifyWrongSRMM() notified = TRUE; } -int AddContactTextBox(HANDLE hContact, HWND hwnd, char *name, BOOL srmm, HWND hwndOwner) +int AddContactTextBox(HCONTACT hContact, HWND hwnd, char *name, BOOL srmm, HWND hwndOwner) { if (languages.getCount() <= 0) return 0; @@ -1406,7 +1406,7 @@ int IconPressed(WPARAM wParam, LPARAM lParam) if (sicd == NULL || strcmp(sicd->szModule, MODULE_NAME) != 0) return 0; - HANDLE hContact = (HANDLE) wParam; + HCONTACT hContact = (HCONTACT)wParam; if (hContact == NULL) return 0; diff --git a/plugins/SplashScreen/src/debug.h b/plugins/SplashScreen/src/debug.h index cf3de0cbb3..7ccd1b0b42 100644 --- a/plugins/SplashScreen/src/debug.h +++ b/plugins/SplashScreen/src/debug.h @@ -11,7 +11,7 @@ extern TCHAR szLogFile[MAX_PATH]; *
*/
-int inline _DebugPopup(HANDLE hContact, TCHAR *fmt, ...)
+int inline _DebugPopup(HCONTACT hContact, TCHAR *fmt, ...)
{
va_list va;
TCHAR debug[1024];
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 5ce8eb08e6..cce7cdb970 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -136,7 +136,7 @@ int DisablePopup(WPARAM wParam, LPARAM lParam) || ((DefPopup == 1 && DefEnabled == 1) && timer !=2) ) //also filtered only: We do not run next lines every time
//if "Filtered only..." is unchecked --->
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact != NULL)
{
char* cp = GetContactProto(hContact);
diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp index 14c842d1df..5afac93be1 100755 --- a/plugins/StopSpamMod/src/init.cpp +++ b/plugins/StopSpamMod/src/init.cpp @@ -76,7 +76,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) return &pluginInfoEx;
}
-extern tstring DBGetContactSettingStringPAN(HANDLE hContact, char const * szModule, char const * szSetting, tstring errorValue);
+extern tstring DBGetContactSettingStringPAN(HCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue);
void InitVars()
{
diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index cd8fd9b75e..b2b788c30d 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -26,7 +26,7 @@ MIRANDA_HOOK_EVENT(ME_DB_CONTACT_ADDED, w, l) MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) { - HANDLE hContact = (HANDLE)wParam; + HCONTACT hContact = (HCONTACT)wParam; HANDLE hDbEvent = (HANDLE)lParam; DBEVENTINFO dbei = { sizeof(dbei) }; @@ -44,7 +44,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) // event is an auth request if(gbHandleAuthReq) { if(!(dbei.flags & DBEF_SENT) && !(dbei.flags & DBEF_READ) && dbei.eventType == EVENTTYPE_AUTHREQUEST) { - HANDLE hcntct = DbGetAuthEventContact(&dbei); + HCONTACT hcntct = DbGetAuthEventContact(&dbei); // if request is from unknown or not marked Answered contact int a = db_get_b(hcntct, "CList", "NotOnList", 0); @@ -83,7 +83,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) { - HANDLE hContact = (HANDLE)w; + HCONTACT hContact = (HCONTACT)w; if(!l) //fix potential DEP crash return 0; DBEVENTINFO * dbei = (DBEVENTINFO*)l; @@ -345,7 +345,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) MIRANDA_HOOK_EVENT(ME_DB_CONTACT_SETTINGCHANGED, w, l) { - HANDLE hContact = (HANDLE)w; + HCONTACT hContact = (HCONTACT)w; DBCONTACTWRITESETTING * cws = (DBCONTACTWRITESETTING*)l; // if CList/NotOnList is being deleted then remove answeredSetting diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 73ab682878..ac092f927d 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -18,7 +18,7 @@ #include "headers.h"
-tstring DBGetContactSettingStringPAN(HANDLE hContact, char const * szModule, char const * szSetting, tstring errorValue)
+tstring DBGetContactSettingStringPAN(HCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue)
{
DBVARIANT dbv;
//if(db_get(hContact, szModule, szSetting, &dbv))
@@ -30,7 +30,7 @@ tstring DBGetContactSettingStringPAN(HANDLE hContact, char const * szModule, cha return errorValue;
}
-std::string DBGetContactSettingStringPAN_A(HANDLE hContact, char const * szModule, char const * szSetting, std::string errorValue)
+std::string DBGetContactSettingStringPAN_A(HCONTACT hContact, char const * szModule, char const * szSetting, std::string errorValue)
{
DBVARIANT dbv;
//if(db_get(hContact, szModule, szSetting, &dbv))
@@ -97,7 +97,7 @@ int RemoveTmp(WPARAM,LPARAM) return 0;
}
-tstring variables_parse(tstring const &tstrFormat, HANDLE hContact){
+tstring variables_parse(tstring const &tstrFormat, HCONTACT hContact){
if (gbVarsServiceExist) {
FORMATINFO fi;
TCHAR *tszParsed;
@@ -201,7 +201,7 @@ BOOL IsUrlContains(TCHAR * Str) return 0;
}
-tstring GetContactUid(HANDLE hContact, tstring Protocol)
+tstring GetContactUid(HCONTACT hContact, tstring Protocol)
{
tstring Uid;
TCHAR dUid[32]={0};
@@ -235,7 +235,7 @@ tstring GetContactUid(HANDLE hContact, tstring Protocol) return Uid;
}
-void LogSpamToFile(HANDLE hContact, tstring message)
+void LogSpamToFile(HCONTACT hContact, tstring message)
{
if (!gbLogToFile) return;
@@ -293,15 +293,15 @@ void CleanProtocolTmpThread(std::string proto) boost::this_thread::sleep(boost::posix_time::seconds(2));
}
- std::list<HANDLE> contacts;
- for(HANDLE hContact = db_find_first(proto.c_str()); hContact; hContact = db_find_next(hContact, proto.c_str()))
+ std::list<HCONTACT> contacts;
+ for(HCONTACT hContact = db_find_first(proto.c_str()); hContact; hContact = db_find_next(hContact, proto.c_str()))
if(db_get_b(hContact, "CList", "NotOnList", 0)|| (_T("Not In List")== DBGetContactSettingStringPAN(hContact,"CList","Group",_T(""))))
contacts.push_back(hContact);
boost::this_thread::sleep(boost::posix_time::seconds(5));
clean_mutex.lock();
- std::list<HANDLE>::iterator end = contacts.end();
- for(std::list<HANDLE>::iterator i = contacts.begin(); i != end; ++i)
+ std::list<HCONTACT>::iterator end = contacts.end();
+ for(std::list<HCONTACT>::iterator i = contacts.begin(); i != end; ++i)
{
LogSpamToFile(*i, _T("Deleted"));
HistoryLogFunc(*i, "Deleted");
@@ -320,15 +320,15 @@ void CleanProtocolExclThread(std::string proto) boost::this_thread::sleep(boost::posix_time::seconds(2));
}
- std::list<HANDLE> contacts;
- for(HANDLE hContact = db_find_first(proto.c_str()); hContact; hContact = db_find_next(hContact, proto.c_str()))
+ std::list<HCONTACT> contacts;
+ for(HCONTACT hContact = db_find_first(proto.c_str()); hContact; hContact = db_find_next(hContact, proto.c_str()))
if(db_get_b(hContact, "CList", "NotOnList", 0) && db_get_b(hContact, pluginName, "Excluded", 0))
contacts.push_back(hContact);
boost::this_thread::sleep(boost::posix_time::seconds(5));
clean_mutex.lock();
- std::list<HANDLE>::iterator end = contacts.end();
- for(std::list<HANDLE>::iterator i = contacts.begin(); i != end; ++i)
+ std::list<HCONTACT>::iterator end = contacts.end();
+ for(std::list<HCONTACT>::iterator i = contacts.begin(); i != end; ++i)
{
LogSpamToFile(*i, _T("Deleted"));
HistoryLogFunc(*i, "Deleted");
@@ -358,7 +358,7 @@ void CleanThread() }
}
-void HistoryLog(HANDLE hContact, char *data, int event_type, int flags)
+void HistoryLog(HCONTACT hContact, char *data, int event_type, int flags)
{
DBEVENTINFO Event = { sizeof(Event) };
Event.szModule = pluginName;
@@ -370,7 +370,7 @@ void HistoryLog(HANDLE hContact, char *data, int event_type, int flags) db_event_add(hContact, &Event);
}
-void HistoryLogFunc(HANDLE hContact, std::string message)
+void HistoryLogFunc(HCONTACT hContact, std::string message)
{
if(gbHistoryLog)
{
diff --git a/plugins/StopSpamMod/src/utilities.h b/plugins/StopSpamMod/src/utilities.h index 62a3ef5750..287a7bc54e 100755 --- a/plugins/StopSpamMod/src/utilities.h +++ b/plugins/StopSpamMod/src/utilities.h @@ -1,19 +1,19 @@ -tstring DBGetContactSettingStringPAN(HANDLE hContact, char const * szModule, char const * szSetting, tstring errorValue); -std::string DBGetContactSettingStringPAN_A(HANDLE hContact, char const * szModule, char const * szSetting, std::string errorValue); +tstring DBGetContactSettingStringPAN(HCONTACT hContact, char const * szModule, char const * szSetting, tstring errorValue); +std::string DBGetContactSettingStringPAN_A(HCONTACT hContact, char const * szModule, char const * szSetting, std::string errorValue); tstring &GetDlgItemString(HWND hwnd, int id); std::string &GetProtoList(); bool ProtoInList(std::string proto); void RemoveExcludedUsers(); -tstring variables_parse(tstring const &tstrFormat, HANDLE hContact); +tstring variables_parse(tstring const &tstrFormat, HCONTACT hContact); const int Stricmp(const TCHAR *str, const TCHAR *substr); //const int Stristr(const TCHAR *str, const TCHAR *substr); TCHAR* ReqGetText(DBEVENTINFO* dbei); BOOL IsUrlContains(TCHAR * Str); void DeleteCListGroupsByName(TCHAR* szGroupName); -tstring GetContactUid(HANDLE hContact, std::string Protocol); -void LogSpamToFile(HANDLE hContact, tstring message); +tstring GetContactUid(HCONTACT hContact, std::string Protocol); +void LogSpamToFile(HCONTACT hContact, tstring message); std::string toUTF8(std::wstring str); std::string toUTF8(std::string str); std::wstring toUTF16(std::string str); -void HistoryLogFunc(HANDLE hContact, std::string message); +void HistoryLogFunc(HCONTACT hContact, std::string message); std::string get_random_num(int length);
\ No newline at end of file diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index 3f9c7bb1d7..309fbdc612 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -20,7 +20,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) // event is an auth request
if (!(dbei.flags & DBEF_SENT) && !(dbei.flags & DBEF_READ) && dbei.eventType == EVENTTYPE_AUTHREQUEST) {
- HANDLE hcntct = DbGetAuthEventContact(&dbei);
+ HCONTACT hcntct = DbGetAuthEventContact(&dbei);
// if request is from unknown or not marked Answered contact
//and if I don't sent message to this contact
@@ -48,7 +48,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l)
{
- HANDLE hContact = (HANDLE)w;
+ HCONTACT hContact = (HCONTACT)w;
DBEVENTINFO *dbei = (DBEVENTINFO*)l;
if (dbei == NULL) //fix potential DEP crash
return 0;
@@ -188,7 +188,7 @@ MIRANDA_HOOK_EVENT(ME_OPT_INITIALISE, w, l) MIRANDA_HOOK_EVENT(ME_DB_CONTACT_SETTINGCHANGED, w, l)
{
- HANDLE hContact = (HANDLE)w;
+ HCONTACT hContact = (HCONTACT)w;
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)l;
// if CList/NotOnList is being deleted then remove answeredSetting
diff --git a/plugins/StopSpamPlus/src/headers.h b/plugins/StopSpamPlus/src/headers.h index 3084a6d007..08f8965dab 100644 --- a/plugins/StopSpamPlus/src/headers.h +++ b/plugins/StopSpamPlus/src/headers.h @@ -48,8 +48,8 @@ INT_PTR CALLBACK ProtoDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) void SetDlgItemString(HWND hwndDlg, UINT idItem, std::string const &str);
void SetDlgItemString(HWND hwndDlg, UINT idItem, std::wstring const &str);
tstring &GetDlgItemString(HWND hwnd, int id);
-bool IsExistMyMessage(HANDLE hContact);
-tstring variables_parse(tstring const &tstrFormat, HANDLE hContact);
+bool IsExistMyMessage(HCONTACT hContact);
+tstring variables_parse(tstring const &tstrFormat, HCONTACT hContact);
tstring trim(tstring const &tstr, tstring const &trimChars = _T(" \f\n\r\t\v"));
INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/);
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index 8b2914beac..032b70c94c 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -2,7 +2,7 @@ INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/)
{
- HANDLE hContact = ( HANDLE )wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
std::string proto = GetContactProto(hContact);
if ( !plSets->ProtoDisabled( proto.c_str()))
@@ -22,8 +22,8 @@ INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/) INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam)
{
- for (HANDLE hContact = db_find_first(); hContact; ) {
- HANDLE hNext = db_find_next(hContact);
+ for (HCONTACT hContact = db_find_first(); hContact; ) {
+ HCONTACT hNext = db_find_next(hContact);
ptrT szGroup( db_get_tsa( hContact, "CList", "Group"));
if ( db_get_b(hContact, "CList", "NotOnList", 0) || db_get_b(hContact, "CList", "Hidden", 0 ) || (szGroup != NULL && (_tcsstr(szGroup, _T("Not In List")) || _tcsstr(szGroup, TranslateT("Not In List"))))) {
diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp index d6faed1bfc..17ef65e2bb 100644 --- a/plugins/StopSpamPlus/src/utils.cpp +++ b/plugins/StopSpamPlus/src/utils.cpp @@ -12,7 +12,7 @@ tstring &GetDlgItemString(HWND hwnd, int id) return s;
}
-bool IsExistMyMessage(HANDLE hContact)
+bool IsExistMyMessage(HCONTACT hContact)
{
HANDLE hDbEvent = db_event_first(hContact);
while(hDbEvent){
@@ -41,7 +41,7 @@ void SetDlgItemString(HWND hwndDlg, UINT idItem, std::wstring const &str) SetDlgItemTextW(hwndDlg, idItem, str.c_str());
}
-tstring variables_parse(tstring const &tstrFormat, HANDLE hContact){
+tstring variables_parse(tstring const &tstrFormat, HCONTACT hContact){
if (ServiceExists(MS_VARS_FORMATSTRING)) {
FORMATINFO fi;
tstring tstrResult;
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);
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index 3377994eb6..dd0ffc75d4 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -48,14 +48,14 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) if (opt.bWaitForContent && IsContactTooltip(clcitex))
{
- char *szProto = GetContactProto(clcitex->hItem);
+ char *szProto = GetContactProto((HCONTACT)clcitex->hItem);
if (!szProto) return false;
if (opt.bWaitForStatusMsg && !bStatusMsgReady)
{
- db_unset(clcitex->hItem, MODULE, "TempStatusMsg");
- if (CanRetrieveStatusMsg(clcitex->hItem, szProto) &&
- CallContactService(clcitex->hItem, PSS_GETAWAYMSG, 0, 0))
+ db_unset((HCONTACT)clcitex->hItem, MODULE, "TempStatusMsg");
+ if (CanRetrieveStatusMsg((HCONTACT)clcitex->hItem, szProto) &&
+ CallContactService((HCONTACT)clcitex->hItem, PSS_GETAWAYMSG, 0, 0))
{
if (WaitForContentTimerID)
KillTimer(0, WaitForContentTimerID);
@@ -69,7 +69,7 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) CallProtoService(szProto, PS_GETAVATARCAPS, AF_ENABLED, 0))
{
DBVARIANT dbv;
- if (!db_get_s(clcitex->hItem, "ContactPhoto", "File", &dbv))
+ if (!db_get_s((HCONTACT)clcitex->hItem, "ContactPhoto", "File", &dbv))
{
if (!strstr(dbv.pszVal, ".xml"))
{
@@ -137,14 +137,12 @@ unsigned int CALLBACK MessagePumpThread(void *param) }
case MUM_DELETEPOPUP:
{
- if (hwndTip)
- {
+ if (hwndTip) {
MyDestroyWindow(hwndTip);
hwndTip = 0;
}
- if (clcitex)
- {
+ if (clcitex) {
mir_free(clcitex);
clcitex = 0;
}
@@ -155,7 +153,7 @@ unsigned int CALLBACK MessagePumpThread(void *param) }
case MUM_GOTSTATUS:
{
- HANDLE hContact = (HANDLE)hwndMsg.wParam;
+ HCONTACT hContact = (HCONTACT)hwndMsg.wParam;
TCHAR *swzMsg = (TCHAR *)hwndMsg.lParam;
if (opt.bWaitForContent &&
@@ -171,7 +169,7 @@ unsigned int CALLBACK MessagePumpThread(void *param) if (swzMsg)
{
- db_set_ts(clcitex->hItem, MODULE, "TempStatusMsg", swzMsg);
+ db_set_ts((HCONTACT)clcitex->hItem, MODULE, "TempStatusMsg", swzMsg);
mir_free(swzMsg);
}
@@ -193,7 +191,7 @@ unsigned int CALLBACK MessagePumpThread(void *param) }
case MUM_GOTAVATAR:
{
- HANDLE hContact = (HANDLE)hwndMsg.wParam;
+ HCONTACT hContact = (HCONTACT)hwndMsg.wParam;
if (opt.bWaitForContent &&
bAvatarReady == false &&
@@ -352,7 +350,7 @@ int ProtoAck(WPARAM wParam, LPARAM lParam) int AvatarChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
PostMPMessage(MUM_GOTAVATAR, (WPARAM)hContact, 0);
return 0;
}
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 2d9c01ed4d..ed49ccb962 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -2101,7 +2101,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETGREYOUTFLAGS, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETLEFTMARGIN, 2, 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_get_b(hContact, MODULE, "FavouriteContact", 0))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
@@ -2118,7 +2118,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, BYTE isChecked;
int count = 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) {
isChecked = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index c2b01d3bf8..b9c3d80277 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -305,7 +305,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa pwd->bIsTextTip = false;
pwd->iIndent = opt.iTextIndent;
pwd->iSidebarWidth= opt.iSidebarWidth;
- pwd->hContact = pwd->clcit.hItem;
+ pwd->hContact = (HCONTACT)pwd->clcit.hItem;
pwd->iIconIndex = (int)CallService(MS_CLIST_GETCONTACTICON, (WPARAM)pwd->hContact, 0);
// don't use stored status message
@@ -1528,7 +1528,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (dwItems & TRAYTIP_NUMCONTACTS) {
int iCount = 0, iCountOnline = 0;
- for (HANDLE hContact = db_find_first(pa->szModuleName); hContact; hContact = db_find_next(hContact, pa->szModuleName)) {
+ for (HCONTACT hContact = db_find_first(pa->szModuleName); hContact; hContact = db_find_next(hContact, pa->szModuleName)) {
if (db_get_w(hContact, pa->szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
iCountOnline++;
iCount++;
@@ -1646,7 +1646,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa bool bTitlePainted = false;
int iCount = 0, iCountOnline = 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)) {
if (db_get_b(hContact, MODULE, "FavouriteContact", 0)) {
char *proto = GetContactProto(hContact);
if (proto == NULL)
diff --git a/plugins/TipperYM/src/popwin.h b/plugins/TipperYM/src/popwin.h index 81d36b0210..64e8df08ce 100644 --- a/plugins/TipperYM/src/popwin.h +++ b/plugins/TipperYM/src/popwin.h @@ -107,7 +107,7 @@ typedef struct { HPEN hpenBorder, hpenDivider;
int iTitleHeight, iAvatarHeight, iIconsHeight, iTextHeight, iLabelWidth;
int iRealAvatarWidth, iRealAvatarHeight;
- HANDLE hContact;
+ HCONTACT hContact;
int iIconIndex;
CLCINFOTIPEX clcit;
TCHAR swzTitle[TITLE_TEXT_LEN];
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 74d6990c98..77938b3d62 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. #include "common.h"
-bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+bool DBGetContactSettingAsString(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
buff[0] = 0;
@@ -63,7 +63,7 @@ bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, cons return buff[0] ? true : false;
}
-bool CheckContactType(HANDLE hContact, const DISPLAYITEM &di)
+bool CheckContactType(HCONTACT hContact, const DISPLAYITEM &di)
{
if (di.type == DIT_ALL)
return true;
@@ -127,7 +127,7 @@ void StripBBCodesInPlace(TCHAR *swzText) }
}
-DWORD LastMessageTimestamp(HANDLE hContact)
+DWORD LastMessageTimestamp(HCONTACT hContact)
{
HANDLE hDbEvent = db_event_last(hContact);
while (hDbEvent) {
@@ -153,7 +153,7 @@ void FormatTimestamp(DWORD ts, char *szFormat, TCHAR *buff, int bufflen) CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt);
}
-bool Uid(HANDLE hContact, char *szProto, TCHAR *buff, int bufflen)
+bool Uid(HCONTACT hContact, char *szProto, TCHAR *buff, int bufflen)
{
char *tmpProto = NULL;
@@ -184,7 +184,7 @@ bool UidName(char *szProto, TCHAR *buff, int bufflen) return false;
}
-TCHAR *GetLastMessageText(HANDLE hContact)
+TCHAR *GetLastMessageText(HCONTACT hContact)
{
HANDLE hDbEvent = db_event_last(hContact);
while (hDbEvent) {
@@ -210,7 +210,7 @@ TCHAR *GetLastMessageText(HANDLE hContact) return 0;
}
-bool CanRetrieveStatusMsg(HANDLE hContact, char *szProto)
+bool CanRetrieveStatusMsg(HCONTACT hContact, char *szProto)
{
if (opt.bGetNewStatusMsg)
{
@@ -242,26 +242,21 @@ bool CanRetrieveStatusMsg(HANDLE hContact, char *szProto) return false;
}
-TCHAR *GetStatusMessageText(HANDLE hContact)
+TCHAR *GetStatusMessageText(HCONTACT hContact)
{
TCHAR *swzMsg = 0;
DBVARIANT dbv;
char *szProto = GetContactProto(hContact);
- if (szProto)
- {
+ if (szProto) {
if (!strcmp(szProto, szMetaModuleName))
- {
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
- }
- else
- {
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ else {
WORD wStatus = (int)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
if (wStatus == ID_STATUS_OFFLINE)
return NULL;
- if (!db_get_ts(hContact, MODULE, "TempStatusMsg", &dbv))
- {
+ if (!db_get_ts(hContact, MODULE, "TempStatusMsg", &dbv)) {
if (_tcslen(dbv.ptszVal) != 0)
swzMsg = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
@@ -291,7 +286,7 @@ TCHAR *GetStatusMessageText(HANDLE hContact) return swzMsg;
}
-bool GetSysSubstText(HANDLE hContact, TCHAR *swzRawSpec, TCHAR *buff, int bufflen)
+bool GetSysSubstText(HCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int bufflen)
{
if (!_tcscmp(swzRawSpec, _T("uid")))
{
@@ -366,14 +361,15 @@ bool GetSysSubstText(HANDLE hContact, TCHAR *swzRawSpec, TCHAR *buff, int buffle }
else if (!_tcscmp(swzRawSpec, _T("meta_subuid")))
{
- HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
- if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND) return false;
+ HCONTACT hSubContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND)
+ return false;
return Uid(hSubContact, 0, buff, bufflen);
}
else if (!_tcscmp(swzRawSpec, _T("meta_subproto")))
{
// get protocol of active subcontact
- HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ HCONTACT hSubContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND)
return false;
return GetSysSubstText(hSubContact, _T("account"), buff, bufflen);
@@ -413,18 +409,18 @@ bool GetSysSubstText(HANDLE hContact, TCHAR *swzRawSpec, TCHAR *buff, int buffle DWORD dwLastTs, dwNewTs, dwRecountTs;
DWORD dwTime, dwDiff;
int iNumber = 1;
- HANDLE hTmpContact = hContact;
+ HCONTACT hTmpContact = hContact;
char *szProto = GetContactProto(hContact);
if (szProto && !strcmp(szProto, szMetaModuleName))
{
iNumber = CallService(MS_MC_GETNUMCONTACTS, (WPARAM)hContact, 0);
- hTmpContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, 0);
+ hTmpContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, 0);
}
for (int i = 0; i < iNumber; i++) {
if (i > 0)
- hTmpContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i);
+ hTmpContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i);
dwRecountTs = db_get_dw(hTmpContact, MODULE, "LastCountTS", 0);
dwTime = (DWORD)time(0);
dwDiff = (dwTime - dwRecountTs);
@@ -478,7 +474,7 @@ bool GetSysSubstText(HANDLE hContact, TCHAR *swzRawSpec, TCHAR *buff, int buffle return false;
}
-bool GetSubstText(HANDLE hContact, const DISPLAYSUBST &ds, TCHAR *buff, int bufflen)
+bool GetSubstText(HCONTACT hContact, const DISPLAYSUBST &ds, TCHAR *buff, int bufflen)
{
TranslateFunc *transFunc = 0;
for (int i = 0; i < iTransFuncsCount; i++)
@@ -513,7 +509,7 @@ bool GetSubstText(HANDLE hContact, const DISPLAYSUBST &ds, TCHAR *buff, int buff return false;
}
-bool GetRawSubstText(HANDLE hContact, char *szRawSpec, TCHAR *buff, int bufflen)
+bool GetRawSubstText(HCONTACT hContact, char *szRawSpec, TCHAR *buff, int bufflen)
{
size_t lenght = strlen(szRawSpec);
for (size_t i = 0; i < lenght; i++)
@@ -545,7 +541,7 @@ bool GetRawSubstText(HANDLE hContact, char *szRawSpec, TCHAR *buff, int bufflen) return false;
}
-bool ApplySubst(HANDLE hContact, const TCHAR *swzSource, bool parseTipperVarsFirst, TCHAR *swzDest, int iDestLen)
+bool ApplySubst(HCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsFirst, TCHAR *swzDest, int iDestLen)
{
// hack - allow empty strings before passing to variables (note - zero length strings return false after this)
if (swzDest && swzSource && _tcslen(swzSource) == 0) {
@@ -789,12 +785,12 @@ error: return true;
}
-bool GetLabelText(HANDLE hContact, const DISPLAYITEM &di, TCHAR *buff, int bufflen)
+bool GetLabelText(HCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, int bufflen)
{
return ApplySubst(hContact, di.swzLabel, false, buff, bufflen);
}
-bool GetValueText(HANDLE hContact, const DISPLAYITEM &di, TCHAR *buff, int bufflen)
+bool GetValueText(HCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, int bufflen)
{
return ApplySubst(hContact, di.swzValue, di.bParseTipperVarsFirst, buff, bufflen);
}
@@ -893,7 +889,7 @@ TCHAR *GetProtoExtraStatusMessage(char *szProto) db_free(&dbv);
if (ServiceExists(MS_VARS_FORMATSTRING)) {
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
char *proto = GetContactProto(hContact);
while(!proto) {
hContact = db_find_next(hContact);
@@ -961,7 +957,7 @@ TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szV return swzText;
}
-HICON GetJabberActivityIcon(HANDLE hContact, char *szProto)
+HICON GetJabberActivityIcon(HCONTACT hContact, char *szProto)
{
DBVARIANT dbv;
HICON hIcon = NULL;
diff --git a/plugins/TipperYM/src/subst.h b/plugins/TipperYM/src/subst.h index 7df4a13cca..05e62014da 100644 --- a/plugins/TipperYM/src/subst.h +++ b/plugins/TipperYM/src/subst.h @@ -21,25 +21,25 @@ Boston, MA 02111-1307, USA. #ifndef _SUBST_INC
#define _SUBST_INC
-bool GetLabelText(HANDLE hContact, const DISPLAYITEM &di, TCHAR *buff, int iBufflen);
-bool GetValueText(HANDLE hContact, const DISPLAYITEM &di, TCHAR *buff, int iBufflen);
+bool GetLabelText(HCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, int iBufflen);
+bool GetValueText(HCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, int iBufflen);
-bool CheckContactType(HANDLE hContact, const DISPLAYITEM &di);
+bool CheckContactType(HCONTACT hContact, const DISPLAYITEM &di);
void StripBBCodesInPlace(TCHAR *text);
// can be used with hContact == 0 to get uid for a given proto
bool UidName(char *szProto, TCHAR *buff, int bufflen);
-bool Uid(HANDLE hContact, char *szProto, TCHAR *buff, int bufflen);
+bool Uid(HCONTACT hContact, char *szProto, TCHAR *buff, int bufflen);
// get info for status and tray tooltip
-bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
-bool CanRetrieveStatusMsg(HANDLE hContact, char *szProto);
+bool DBGetContactSettingAsString(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+bool CanRetrieveStatusMsg(HCONTACT hContact, char *szProto);
TCHAR *GetProtoStatusMessage(char *szProto, WORD status);
TCHAR *GetProtoExtraStatusTitle(char *szProto);
TCHAR *GetProtoExtraStatusMessage(char *szProto);
TCHAR *GetListeningTo(char *szProto);
TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szValue);
-HICON GetJabberActivityIcon(HANDLE hContact, char *szProto);
+HICON GetJabberActivityIcon(HCONTACT hContact, char *szProto);
#endif
diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index c3161b17dc..91ef259fa6 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -111,9 +111,9 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) int EventDeleted(WPARAM wParam, LPARAM lParam)
{
DBEVENTINFO dbei = { sizeof(dbei) };
- if ( !db_event_get((HANDLE)lParam, &dbei))
+ if (!db_event_get((HANDLE)lParam, &dbei))
if (dbei.eventType == EVENTTYPE_MESSAGE)
- db_unset((HANDLE)wParam, MODULE, "LastCountTS");
+ db_unset((HCONTACT)wParam, MODULE, "LastCountTS");
return 0;
}
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 24276afbbe..5fcb384aa4 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -61,14 +61,14 @@ void AddTranslation(DBVTranslation *newTrans) mir_free(szName);
}
-TCHAR *NullTranslation(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *NullTranslation(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
if (DBGetContactSettingAsString(hContact, szModuleName, szSettingName, buff, bufflen))
return buff;
return NULL;
}
-TCHAR *TimestampToShortDate(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *TimestampToShortDate(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
@@ -81,7 +81,7 @@ TCHAR *TimestampToShortDate(HANDLE hContact, const char *szModuleName, const cha return buff;
}
-TCHAR *TimestampToLongDate(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *TimestampToLongDate(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
@@ -94,7 +94,7 @@ TCHAR *TimestampToLongDate(HANDLE hContact, const char *szModuleName, const char return buff;
}
-TCHAR *TimestampToTime(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *TimestampToTime(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
@@ -107,7 +107,7 @@ TCHAR *TimestampToTime(HANDLE hContact, const char *szModuleName, const char *sz return buff;
}
-TCHAR *TimestampToTimeNoSecs(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *TimestampToTimeNoSecs(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
@@ -120,7 +120,7 @@ TCHAR *TimestampToTimeNoSecs(HANDLE hContact, const char *szModuleName, const ch return buff;
}
-TCHAR *TimestampToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *TimestampToTimeDifference(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
DWORD t = (DWORD)time(0);
@@ -140,7 +140,7 @@ TCHAR *TimestampToTimeDifference(HANDLE hContact, const char *szModuleName, cons return buff;
}
-TCHAR *SecondsToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *SecondsToTimeDifference(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD diff = db_get_dw(hContact, szModuleName, szSettingName, 0);
int d = (diff / 60 / 60 / 24);
@@ -156,7 +156,7 @@ TCHAR *SecondsToTimeDifference(HANDLE hContact, const char *szModuleName, const return buff;
}
-TCHAR *WordToStatusDesc(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *WordToStatusDesc(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
WORD wStatus = db_get_w(hContact, szModuleName, szSettingName, ID_STATUS_OFFLINE);
TCHAR *szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
@@ -164,7 +164,7 @@ TCHAR *WordToStatusDesc(HANDLE hContact, const char *szModuleName, const char *s return buff;
}
-TCHAR *ByteToYesNo(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *ByteToYesNo(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
@@ -184,7 +184,7 @@ TCHAR *ByteToYesNo(HANDLE hContact, const char *szModuleName, const char *szSett return 0;
}
-TCHAR *ByteToGender(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *ByteToGender(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
BYTE val = (BYTE)db_get_b(hContact, szModuleName, szSettingName, 0);
if (val == 'F')
@@ -198,7 +198,7 @@ TCHAR *ByteToGender(HANDLE hContact, const char *szModuleName, const char *szSet return buff;
}
-TCHAR *WordToCountry(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *WordToCountry(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
char *szCountryName = 0;
WORD cid = (WORD)db_get_w(hContact, szModuleName, szSettingName, (WORD)-1);
@@ -213,7 +213,7 @@ TCHAR *WordToCountry(HANDLE hContact, const char *szModuleName, const char *szSe return 0;
}
-TCHAR *DwordToIp(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *DwordToIp(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD ip = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ip) {
@@ -243,7 +243,7 @@ bool GetInt(const DBVARIANT &dbv, int *iVal) return false;
}
-TCHAR *DayMonthYearToDate(HANDLE hContact, const char *szModuleName, const char *prefix, TCHAR *buff, int bufflen)
+TCHAR *DayMonthYearToDate(HCONTACT hContact, const char *szModuleName, const char *prefix, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -291,7 +291,7 @@ TCHAR *DayMonthYearToDate(HANDLE hContact, const char *szModuleName, const char return 0;
}
-TCHAR *DayMonthYearToAge(HANDLE hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+TCHAR *DayMonthYearToAge(HCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -340,7 +340,7 @@ TCHAR *DayMonthYearToAge(HANDLE hContact, const char *szModuleName, const char * return 0;
}
-TCHAR *HoursMinutesSecondsToTime(HANDLE hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+TCHAR *HoursMinutesSecondsToTime(HCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -384,7 +384,7 @@ TCHAR *HoursMinutesSecondsToTime(HANDLE hContact, const char *szModuleName, cons return 0;
}
-TCHAR *HoursMinutesToTime(HANDLE hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+TCHAR *HoursMinutesToTime(HCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -420,7 +420,7 @@ TCHAR *HoursMinutesToTime(HANDLE hContact, const char *szModuleName, const char return 0;
}
-TCHAR *DmyToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+TCHAR *DmyToTimeDifference(HCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -522,7 +522,7 @@ TCHAR *DmyToTimeDifference(HANDLE hContact, const char *szModuleName, const char return 0;
}
-TCHAR *DayMonthToDaysToNextBirthday(HANDLE hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
+TCHAR *DayMonthToDaysToNextBirthday(HCONTACT hContact, const char *szModuleName, const char *szPrefix, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
char szSettingName[256];
@@ -575,7 +575,7 @@ TCHAR *DayMonthToDaysToNextBirthday(HANDLE hContact, const char *szModuleName, c }
-TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *EmptyXStatusToDefaultName(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
TCHAR szDefaultName[1024];
CUSTOM_STATUS xstatus = {0};
@@ -615,7 +615,7 @@ TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, cons return 0;
}
-TCHAR *TimezoneToTime(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *TimezoneToTime(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
int timezone = db_get_b(hContact,szModuleName,szSettingName,256);
if (timezone==256 || (char)timezone==-100)
@@ -640,7 +640,7 @@ TCHAR *TimezoneToTime(HANDLE hContact, const char *szModuleName, const char *szS return buff;
}
-TCHAR *ByteToDay(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *ByteToDay(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
int iDay = db_get_w(hContact, szModuleName, szSettingName, -1);
if (iDay > -1 && iDay < 7)
@@ -653,7 +653,7 @@ TCHAR *ByteToDay(HANDLE hContact, const char *szModuleName, const char *szSettin return 0;
}
-TCHAR *ByteToMonth(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *ByteToMonth(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
int iMonth = db_get_w(hContact, szModuleName, szSettingName, 0);
if (iMonth > 0 && iMonth < 13)
@@ -666,7 +666,7 @@ TCHAR *ByteToMonth(HANDLE hContact, const char *szModuleName, const char *szSett return 0;
}
-TCHAR *ByteToLanguage(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR *ByteToLanguage(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
int iLang = db_get_b(hContact, szModuleName, szSettingName, 0);
if (iLang)
diff --git a/plugins/TipperYM/src/translations.h b/plugins/TipperYM/src/translations.h index 985920054e..7f09002bad 100644 --- a/plugins/TipperYM/src/translations.h +++ b/plugins/TipperYM/src/translations.h @@ -117,9 +117,9 @@ static char *months[12] = { void InitTranslations();
void DeinitTranslations();
-TCHAR *TimestampToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
-TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
-TCHAR *WordToStatusDesc(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+TCHAR *TimestampToTimeDifference(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+TCHAR *EmptyXStatusToDefaultName(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
+TCHAR *WordToStatusDesc(HCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen);
#endif
diff --git a/plugins/TooltipNotify/src/DbHelpers.cpp b/plugins/TooltipNotify/src/DbHelpers.cpp index 19de8c826f..15261988de 100644 --- a/plugins/TooltipNotify/src/DbHelpers.cpp +++ b/plugins/TooltipNotify/src/DbHelpers.cpp @@ -11,7 +11,7 @@ static int EnumSettingsProc1(const char *pszSetting, LPARAM lParam) return 0;
}
-bool ModuleSettingsExists(HANDLE hContact, const char* pszModuleName)
+bool ModuleSettingsExists(HCONTACT hContact, const char* pszModuleName)
{
DBCONTACTENUMSETTINGS dbces = {0};
dbces.szModule = pszModuleName;
@@ -28,7 +28,7 @@ static int EnumSettingsProc2(const char *pszSetting, LPARAM lParam) return 0;
}
-void DeleteModuleSettings(HANDLE hContact, const char* pszModuleName)
+void DeleteModuleSettings(HCONTACT hContact, const char* pszModuleName)
{
SettingsList settingsList;
DBCONTACTENUMSETTINGS dbces = {0};
@@ -48,7 +48,7 @@ void DeleteModuleSettings(HANDLE hContact, const char* pszModuleName) }
-static int GetSetting(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
+static int GetSetting(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
int rr = db_get(hContact, szModule, szSetting, dbv);
if (dbv->type != DBVT_UTF8)
@@ -57,7 +57,7 @@ static int GetSetting(HANDLE hContact, const char *szModule, const char *szSetti return 1;
}
-void RenameModule(HANDLE hContact, const char* pszOldName, const char* pszNewName)
+void RenameModule(HCONTACT hContact, const char* pszOldName, const char* pszNewName)
{
SettingsList settingsList;
DBCONTACTENUMSETTINGS dbces = {0};
diff --git a/plugins/TooltipNotify/src/DbHelpers.h b/plugins/TooltipNotify/src/DbHelpers.h index 374df04c05..d07b6cf26b 100644 --- a/plugins/TooltipNotify/src/DbHelpers.h +++ b/plugins/TooltipNotify/src/DbHelpers.h @@ -2,6 +2,6 @@ //
//////////////////////////////////////////////////////////////////////
-bool ModuleSettingsExists(HANDLE hContact, const char* pszModuleName);
-void DeleteModuleSettings(HANDLE hContact, const char* pszModuleName);
-void RenameModule(HANDLE hContact, const char* pszOldName, const char* pszNewName);
+bool ModuleSettingsExists(HCONTACT hContact, const char* pszModuleName);
+void DeleteModuleSettings(HCONTACT hContact, const char* pszModuleName);
+void RenameModule(HCONTACT hContact, const char* pszOldName, const char* pszNewName);
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 3931c5aa29..2352c0749c 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -162,7 +162,7 @@ int CTooltipNotify::ProtoContactIsTyping(WPARAM wParam, LPARAM lParam) {
STooltipData *pTooltipData = new STooltipData;
pTooltipData->uiTimeout = lParam*1000;
- pTooltipData->hContact = (HANDLE)wParam;
+ pTooltipData->hContact = (HCONTACT)wParam;
pTooltipData->iStatus = ID_TTNTF_STATUS_TYPING;
EndNotifyAll();
@@ -211,7 +211,7 @@ int CTooltipNotify::ProtoAck(WPARAM wParam, LPARAM lParam) int CTooltipNotify::ContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if(hContact==NULL) return 0;
bool idle = false;
@@ -798,7 +798,7 @@ void CTooltipNotify::LoadList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown if (hItemUnknown && !m_sOptions.bIgnoreUnknown)
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, MODULENAME, CONTACT_IGNORE_TTNOTIFY, m_sOptions.bIgnoreNew))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM) hItem, 1);
@@ -813,7 +813,7 @@ void CTooltipNotify::SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown if (hItemUnknown)
m_sOptions.bIgnoreUnknown = (BYTE) (SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItemUnknown, 0) ? 0 : 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) {
BYTE bChecked = (BYTE) (SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM) hItem, 0));
@@ -912,7 +912,7 @@ TCHAR *CTooltipNotify::StatusToString(int iStatus, TCHAR *szStatus, int iBufSize }
-TCHAR *CTooltipNotify::MakeTooltipString(HANDLE hContact, int iStatus, TCHAR *szString, int iBufSize)
+TCHAR *CTooltipNotify::MakeTooltipString(HCONTACT hContact, int iStatus, TCHAR *szString, int iBufSize)
{
TCHAR szStatus[32];
StatusToString(iStatus, szStatus, SIZEOF(szStatus));
diff --git a/plugins/TooltipNotify/src/TooltipNotify.h b/plugins/TooltipNotify/src/TooltipNotify.h index 886cacb553..58ddbf9cb9 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.h +++ b/plugins/TooltipNotify/src/TooltipNotify.h @@ -67,7 +67,7 @@ private: CTooltip *pTooltip;
UINT_PTR idTimer;
UINT uiTimeout;
- HANDLE hContact;
+ HCONTACT hContact;
int iStatus;
};
@@ -88,7 +88,7 @@ private: MapTimerIdProtoIter FindProtoByTimer(UINT idTimer);
template<typename T> TooltipsListIter FindBy(T STooltipData::* m, const T& value);
TCHAR *StatusToString(int iStatus, TCHAR *szStatus, int iBufSize);
- TCHAR *MakeTooltipString(HANDLE hContact, int iStatus, TCHAR *szString, int iBufSize);
+ TCHAR *MakeTooltipString(HCONTACT hContact, int iStatus, TCHAR *szString, int iBufSize);
void MigrateSettings();
void RegisterFonts();
void GetFont(int iStatus, LOGFONT* lf, COLORREF* text, COLORREF* bg);
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index a0b350f1a9..8b35da97e9 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -44,18 +44,18 @@ static LIST<MsgWndData> gMsgWndList(10, HandleKeySortT); static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam)
{
WORD countryNumber;
- char *pszProto = GetContactProto((HANDLE)wParam);
+ char *pszProto = GetContactProto((HCONTACT)wParam);
/* UserinfoEx */
- if (countryNumber = db_get_w((HANDLE)wParam, USERINFO, SET_CONTACT_ORIGIN_COUNTRY, 0))
+ if (countryNumber = db_get_w((HCONTACT)wParam, USERINFO, SET_CONTACT_ORIGIN_COUNTRY, 0))
return countryNumber;
- if (countryNumber = db_get_w((HANDLE)wParam, USERINFO, SET_CONTACT_COUNTRY, 0))
+ if (countryNumber = db_get_w((HCONTACT)wParam, USERINFO, SET_CONTACT_COUNTRY, 0))
return countryNumber;
- if (countryNumber = db_get_w((HANDLE)wParam, USERINFO, SET_CONTACT_COMPANY_COUNTRY, 0))
+ if (countryNumber = db_get_w((HCONTACT)wParam, USERINFO, SET_CONTACT_COMPANY_COUNTRY, 0))
return countryNumber;
/* fallback proto settings */
- if (countryNumber = db_get_w((HANDLE)wParam, pszProto, "Country", 0))
+ if (countryNumber = db_get_w((HCONTACT)wParam, pszProto, "Country", 0))
return countryNumber;
- if (countryNumber = db_get_w((HANDLE)wParam, pszProto, "CompanyCountry", 0))
+ if (countryNumber = db_get_w((HCONTACT)wParam, pszProto, "CompanyCountry", 0))
return countryNumber;
return (INT_PTR)0xFFFF;
@@ -69,7 +69,7 @@ static void CALLBACK SetExtraImage(LPARAM lParam) {
/* get contact's country */
int countryNumber = ServiceDetectContactOriginCountry(lParam, 0);
- ExtraIcon_SetIcon(hExtraIconSvc, (HANDLE)lParam, (countryNumber != 0xFFFF || g_bUseUnknownFlag) ? LoadFlagHandle(countryNumber) : NULL);
+ ExtraIcon_SetIcon(hExtraIconSvc, (HCONTACT)lParam, (countryNumber != 0xFFFF || g_bUseUnknownFlag) ? LoadFlagHandle(countryNumber) : NULL);
}
static int OnCListApplyIcons(WPARAM wParam, LPARAM)
@@ -82,7 +82,7 @@ static int OnCListApplyIcons(WPARAM wParam, LPARAM) * message winsow status icon functions
***********************************************************************************************************/
-MsgWndData::MsgWndData(HWND hwnd, HANDLE hContact)
+MsgWndData::MsgWndData(HWND hwnd, HCONTACT hContact)
{
m_hwnd = hwnd;
m_hContact = hContact;
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.h b/plugins/UserInfoEx/src/Flags/svc_flags.h index 71c0cb5bee..55d57a93ae 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.h +++ b/plugins/UserInfoEx/src/Flags/svc_flags.h @@ -33,11 +33,11 @@ extern bool g_eiGender, g_eiHome, g_eiEmail, g_eiPhone; struct MsgWndData
{
- HANDLE m_hContact;
- HWND m_hwnd;
- int m_countryID;
+ HCONTACT m_hContact;
+ HWND m_hwnd;
+ int m_countryID;
- MsgWndData(HWND hwnd, HANDLE hContact);
+ MsgWndData(HWND hwnd, HCONTACT hContact);
~MsgWndData();
void FlagsIconSet();
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 794af36cc8..2731b85bca 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -255,7 +255,7 @@ MZodiac MAnnivDate::Zodiac() * param: hContact - handle to a contact to read the date from
* return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBGetReminderOpts(HANDLE hContact)
+int MAnnivDate::DBGetReminderOpts(HCONTACT hContact)
{
if (!hContact || hContact == INVALID_HANDLE_VALUE)
return 1;
@@ -287,7 +287,7 @@ int MAnnivDate::DBGetReminderOpts(HANDLE hContact) * param: hContact - handle to a contact to read the date from
* return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBWriteReminderOpts(HANDLE hContact)
+int MAnnivDate::DBWriteReminderOpts(HCONTACT hContact)
{
if (!hContact || hContact == INVALID_HANDLE_VALUE)
return 1;
@@ -336,7 +336,7 @@ int MAnnivDate::DBWriteReminderOpts(HANDLE hContact) * szYear - setting of the year to read
* return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBGetDate(HANDLE hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear)
+int MAnnivDate::DBGetDate(HCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear)
{
ZeroDate();
@@ -371,7 +371,7 @@ int MAnnivDate::DBGetDate(HANDLE hContact, LPCSTR pszModule, LPCSTR szDay, LPCST * szYear - setting of the year to read
* return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBWriteDate(HANDLE hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear)
+int MAnnivDate::DBWriteDate(HCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear)
{
return
db_set_b(hContact, pszModule, szDay, (BYTE)Day()) ||
@@ -390,7 +390,7 @@ int MAnnivDate::DBWriteDate(HANDLE hContact, LPCSTR pszModule, LPCSTR szDay, LPC * szYear - setting of the year to read
* return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBDeleteDate(HANDLE hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear) const
+int MAnnivDate::DBDeleteDate(HCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear) const
{
int ret;
@@ -413,7 +413,7 @@ int MAnnivDate::DBDeleteDate(HANDLE hContact, LPCSTR pszModule, LPCSTR szDay, LP * pszSetting - key used to identify the datestamp
* return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBGetDateStamp(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting)
+int MAnnivDate::DBGetDateStamp(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting)
{
DBVARIANT dbv;
if (DB::Setting::GetAsIs(hContact, pszModule, pszSetting, &dbv))
@@ -436,7 +436,7 @@ int MAnnivDate::DBGetDateStamp(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSett * pszSetting - key used to save the datestamp
* return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBWriteDateStamp(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting)
+int MAnnivDate::DBWriteDateStamp(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting)
{
if (hContact == INVALID_HANDLE_VALUE || pszModule == 0 || *pszModule == 0 || pszSetting == 0 || *pszSetting == 0)
return 1;
@@ -457,7 +457,7 @@ int MAnnivDate::DBWriteDateStamp(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSe * pszProto - basic protocol module
* return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBGetBirthDate(HANDLE hContact, LPSTR pszProto)
+int MAnnivDate::DBGetBirthDate(HCONTACT hContact, LPSTR pszProto)
{
Clear();
@@ -482,7 +482,7 @@ int MAnnivDate::DBGetBirthDate(HANDLE hContact, LPSTR pszProto) // try to get setting from the default subcontact first
const int def = DB::MetaContact::SubDefNum(hContact);
if (def > -1 && def < INT_MAX) {
- HANDLE hSubContact = DB::MetaContact::Sub(hContact, def);
+ HCONTACT hSubContact = DB::MetaContact::Sub(hContact, def);
if (hSubContact != NULL && !DBGetBirthDate(hSubContact, NULL)) {
RemoveFlags(MADF_HASCUSTOM);
SetFlags(MADF_HASMETA);
@@ -496,7 +496,7 @@ int MAnnivDate::DBGetBirthDate(HANDLE hContact, LPSTR pszProto) if (cnt < INT_MAX) {
for (int i = 0; i < cnt; i++) {
if (i != def) {
- HANDLE hSubContact = DB::MetaContact::Sub(hContact, i);
+ HCONTACT hSubContact = DB::MetaContact::Sub(hContact, i);
if (hSubContact != NULL && !DBGetBirthDate(hSubContact, NULL)) {
RemoveFlags(MADF_HASCUSTOM);
SetFlags(MADF_HASMETA);
@@ -521,7 +521,7 @@ int MAnnivDate::DBGetBirthDate(HANDLE hContact, LPSTR pszProto) * return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBMoveBirthDate(HANDLE hContact, BYTE bOld, BYTE bNew)
+int MAnnivDate::DBMoveBirthDate(HCONTACT hContact, BYTE bOld, BYTE bNew)
{
Clear();
switch(bOld) {
@@ -556,7 +556,7 @@ int MAnnivDate::DBMoveBirthDate(HANDLE hContact, BYTE bOld, BYTE bNew) * return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBWriteBirthDate(HANDLE hContact)
+int MAnnivDate::DBWriteBirthDate(HCONTACT hContact)
{
LPCSTR pszModule = SvcReminderGetMyBirthdayModule();
@@ -599,7 +599,7 @@ int MAnnivDate::DBWriteBirthDate(HANDLE hContact) * return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBDeleteBirthDate(HANDLE hContact)
+int MAnnivDate::DBDeleteBirthDate(HCONTACT hContact)
{
return DBDeleteDate(hContact, Module(), SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
}
@@ -617,7 +617,7 @@ int MAnnivDate::DBDeleteBirthDate(HANDLE hContact) * return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBGetAnniversaryDate(HANDLE hContact, WORD iIndex)
+int MAnnivDate::DBGetAnniversaryDate(HCONTACT hContact, WORD iIndex)
{
Clear();
@@ -649,7 +649,7 @@ int MAnnivDate::DBGetAnniversaryDate(HANDLE hContact, WORD iIndex) * pszProto - basic protocol module
* return: 0 on success, 1 otherwise
**/
-int MAnnivDate::DBWriteAnniversaryDate(HANDLE hContact, WORD wIndex)
+int MAnnivDate::DBWriteAnniversaryDate(HCONTACT hContact, WORD wIndex)
{
// date can only be written to db as anniversary if it is not marked as birthday
if (wIndex <= ANID_LAST && _wID != ANID_BIRTHDAY) {
@@ -673,7 +673,7 @@ int MAnnivDate::DBWriteAnniversaryDate(HANDLE hContact, WORD wIndex) * automatic backup service
***********************************************************************************************************/
-static WORD AskUser(HANDLE hContact, MAnnivDate *pOldCustomDate, MAnnivDate *pNewProtoDate)
+static WORD AskUser(HCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *pNewProtoDate)
{
MSGBOX MB;
TCHAR szMsg[MAXDATASIZE];
@@ -707,7 +707,7 @@ static WORD AskUser(HANDLE hContact, MAnnivDate *pOldCustomDate, MAnnivDate *pNe * return: 0 if backup was done, 1 otherwise
**/
-int MAnnivDate::BackupBirthday(HANDLE hContact, LPSTR pszProto, const BYTE bDontIgnoreAnything, PWORD lastAnswer)
+int MAnnivDate::BackupBirthday(HCONTACT hContact, LPSTR pszProto, const BYTE bDontIgnoreAnything, PWORD lastAnswer)
{
if (!hContact)
return 1;
@@ -742,7 +742,7 @@ int MAnnivDate::BackupBirthday(HANDLE hContact, LPSTR pszProto, const BYTE bDont // allow backup only, if the custom setting differs from all meta subcontacts' protocol based settings, too.
for (int i = 0; (i < nSubContactCount) && bWantBackup && bIsMeta; i++) {
- HANDLE hSubContact = DB::MetaContact::Sub(hContact, i);
+ HCONTACT hSubContact = DB::MetaContact::Sub(hContact, i);
if (hSubContact && !mdbIgnore.DBGetDate(hSubContact, pszProto, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
bWantBackup = bWantBackup
&& !IsEqual(mdbIgnore.SystemTime())
@@ -767,7 +767,7 @@ int MAnnivDate::BackupBirthday(HANDLE hContact, LPSTR pszProto, const BYTE bDont // update metasubcontacts
for (int i = 0; i < nSubContactCount; i++) {
- HANDLE hSubContact = DB::MetaContact::Sub(hContact, i);
+ HCONTACT hSubContact = DB::MetaContact::Sub(hContact, i);
if (hSubContact != NULL) {
if (!mdbIgnore.DBGetDate(hSubContact, DB::Contact::Proto(hSubContact), SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
mdbIgnore.DBWriteDateStamp(hSubContact, USERINFO, SET_REMIND_BIRTHDAY_IGNORED);
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.h b/plugins/UserInfoEx/src/classMAnnivDate.h index acc3790b96..c2ebffbe89 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.h +++ b/plugins/UserInfoEx/src/classMAnnivDate.h @@ -50,8 +50,8 @@ private: BYTE _bRemind; // per user setting for reminder (0 - disabled, 1 - use local offset, 2 - use global offset)
WORD _wDaysEarlier; // number of days to the anniversary the user wants to be reminded of this anniversary
- int DBWriteDate(HANDLE hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear);
- int DBDeleteDate(HANDLE hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear) const;
+ int DBWriteDate(HCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear);
+ int DBDeleteDate(HCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear) const;
public:
MAnnivDate();
@@ -93,23 +93,23 @@ public: void Clear();
// read date from database
- int DBGetDate(HANDLE hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear);
- int DBGetDateStamp(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
- int DBGetAnniversaryDate(HANDLE hContact, WORD iIndex);
- int DBGetBirthDate(HANDLE hContact, LPSTR pszProto = NULL);
- int DBGetReminderOpts(HANDLE hContact);
+ int DBGetDate(HCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear);
+ int DBGetDateStamp(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ int DBGetAnniversaryDate(HCONTACT hContact, WORD iIndex);
+ int DBGetBirthDate(HCONTACT hContact, LPSTR pszProto = NULL);
+ int DBGetReminderOpts(HCONTACT hContact);
// write date to database
- int DBWriteDateStamp(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
- int DBWriteAnniversaryDate(HANDLE hContact, WORD wIndex);
- int DBWriteBirthDate(HANDLE hContact);
- int DBWriteReminderOpts(HANDLE hContact);
+ int DBWriteDateStamp(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ int DBWriteAnniversaryDate(HCONTACT hContact, WORD wIndex);
+ int DBWriteBirthDate(HCONTACT hContact);
+ int DBWriteReminderOpts(HCONTACT hContact);
// delete date from database
- int DBDeleteBirthDate(HANDLE hContact);
+ int DBDeleteBirthDate(HCONTACT hContact);
- int DBMoveBirthDate(HANDLE hContact, BYTE bOld, BYTE bNew);
- int BackupBirthday (HANDLE hContact, LPSTR pszProto = NULL, const BYTE bDontIgnoreAnything = FALSE, PWORD lastAnswer = NULL);
+ int DBMoveBirthDate(HCONTACT hContact, BYTE bOld, BYTE bNew);
+ int BackupBirthday (HCONTACT hContact, LPSTR pszProto = NULL, const BYTE bDontIgnoreAnything = FALSE, PWORD lastAnswer = NULL);
// setting values
void SetDate(SYSTEMTIME &st);
diff --git a/plugins/UserInfoEx/src/classMTime.cpp b/plugins/UserInfoEx/src/classMTime.cpp index 0d5a42f9d8..5035d8eac9 100644 --- a/plugins/UserInfoEx/src/classMTime.cpp +++ b/plugins/UserInfoEx/src/classMTime.cpp @@ -408,7 +408,7 @@ void MTime::GetLocalTime() ::GetLocalTime(&_SysTime);
}
-void MTime::GetLocalTime(HANDLE hContact)
+void MTime::GetLocalTime(HCONTACT hContact)
{
TIME_ZONE_INFORMATION tzi;
@@ -423,7 +423,7 @@ void MTime::GetLocalTime(HANDLE hContact) * read and write time to miranda's database
*********************************************/
-int MTime::DBGetStamp (HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting)
+int MTime::DBGetStamp (HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting)
{
DWORD dwTimeStamp;
@@ -446,7 +446,7 @@ int MTime::DBGetStamp (HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting) return 0;
}
-int MTime::DBWriteStamp(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting)
+int MTime::DBWriteStamp(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting)
{
if (hContact == INVALID_HANDLE_VALUE ||
pszModule == NULL || pszModule[0] == 0 ||
diff --git a/plugins/UserInfoEx/src/classMTime.h b/plugins/UserInfoEx/src/classMTime.h index 99706578aa..1363a0247b 100644 --- a/plugins/UserInfoEx/src/classMTime.h +++ b/plugins/UserInfoEx/src/classMTime.h @@ -90,7 +90,7 @@ public: // get current time
void GetTimeUTC();
void GetLocalTime();
- void GetLocalTime(HANDLE hContact);
+ void GetLocalTime(HCONTACT hContact);
// conversions
void UTCToLocal();
@@ -100,8 +100,8 @@ public: void TzSpecificLocalToUTC(TIME_ZONE_INFORMATION *tzi);
// read and write from and to db
- int DBGetStamp(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
- int DBWriteStamp(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ int DBGetStamp(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ int DBWriteStamp(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
// operatoren
void operator = (DWORD& dwTimeStamp) { FromStampAsUTC(dwTimeStamp); };
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index f0da0189d1..c0041d26e5 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -140,7 +140,7 @@ void CAnnivEditCtrl::EnableCurrentItem() MAnnivDate *pCurrent = Current();
if (pCurrent) {
- HANDLE hContact;
+ HCONTACT hContact;
PSGetContact(_hwndDlg, hContact);
@@ -233,8 +233,8 @@ INT_PTR CAnnivEditCtrl::DeleteDate(WORD wIndex) // only delete values, but not the item
if (_pDates[wIndex]->Id() == ANID_BIRTHDAY) {
- HANDLE hContact;
- LPCSTR pszProto;
+ HCONTACT hContact;
+ LPCSTR pszProto;
PSGetContact(_hwndDlg, hContact);
PSGetBaseProto(_hwndDlg, pszProto);
@@ -273,7 +273,7 @@ INT_PTR CAnnivEditCtrl::DeleteDate(WORD wIndex) * param:
* return: 0 on success 1 otherwise
**/
-INT_PTR CAnnivEditCtrl::DBGetBirthDay(HANDLE hContact, LPCSTR pszProto)
+INT_PTR CAnnivEditCtrl::DBGetBirthDay(HCONTACT hContact, LPCSTR pszProto)
{
MAnnivDate mdb;
@@ -290,7 +290,7 @@ INT_PTR CAnnivEditCtrl::DBGetBirthDay(HANDLE hContact, LPCSTR pszProto) * param:
* return: 0 on success 1 otherwise
**/
-INT_PTR CAnnivEditCtrl::DBGetAnniversaries(HANDLE hContact)
+INT_PTR CAnnivEditCtrl::DBGetAnniversaries(HCONTACT hContact)
{
MAnnivDate mda;
@@ -317,7 +317,7 @@ INT_PTR CAnnivEditCtrl::DBGetAnniversaries(HANDLE hContact) * param: hContact - the contact to write the anniversaries to
* return: 0 on success 1 otherwise
**/
-INT_PTR CAnnivEditCtrl::DBWriteBirthDay(HANDLE hContact)
+INT_PTR CAnnivEditCtrl::DBWriteBirthDay(HCONTACT hContact)
{
MAnnivDate *pmdb;
@@ -346,7 +346,7 @@ INT_PTR CAnnivEditCtrl::DBWriteBirthDay(HANDLE hContact) * param: hContact - the contact to write the anniversaries to
* return: 0 on success 1 otherwise
**/
-INT_PTR CAnnivEditCtrl::DBWriteAnniversaries(HANDLE hContact)
+INT_PTR CAnnivEditCtrl::DBWriteAnniversaries(HCONTACT hContact)
{
const LPCSTR szPrefix[] = { "Reminder", "Offset", "Desc", "Day", "Month", "Year", "Stamp", "Date" };
CHAR szSet0[MAXSETTING];
@@ -526,7 +526,7 @@ void CAnnivEditCtrl::OnRemindEditChanged() **/
void CAnnivEditCtrl::OnReminderChecked()
{
- HANDLE hContact;
+ HCONTACT hContact;
LPCSTR pszProto;
int state;
TCHAR buf[6];
@@ -606,7 +606,7 @@ void CAnnivEditCtrl::SetZodiacAndAge(MAnnivDate *mt) }
}
-BOOL CAnnivEditCtrl::OnInfoChanged(HANDLE hContact, LPCSTR pszProto)
+BOOL CAnnivEditCtrl::OnInfoChanged(HCONTACT hContact, LPCSTR pszProto)
{
BOOL bChanged;
bChanged = DBGetBirthDay(hContact, pszProto);
@@ -616,7 +616,7 @@ BOOL CAnnivEditCtrl::OnInfoChanged(HANDLE hContact, LPCSTR pszProto) return bChanged;
}
-void CAnnivEditCtrl::OnApply(HANDLE hContact, LPCSTR pszProto)
+void CAnnivEditCtrl::OnApply(HCONTACT hContact, LPCSTR pszProto)
{
DBWriteBirthDay(hContact);
DBWriteAnniversaries(hContact);
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.h b/plugins/UserInfoEx/src/ctrl_annivedit.h index ee6307f8ed..932fe8f49f 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.h +++ b/plugins/UserInfoEx/src/ctrl_annivedit.h @@ -42,11 +42,11 @@ class CAnnivEditCtrl : public CBaseCtrl BYTE ItemValid(WORD wIndex) const;
BYTE CurrentItemValid() const;
- INT_PTR DBGetBirthDay(HANDLE hContact, LPCSTR pszProto);
- INT_PTR DBWriteBirthDay(HANDLE hContact);
+ INT_PTR DBGetBirthDay(HCONTACT hContact, LPCSTR pszProto);
+ INT_PTR DBWriteBirthDay(HCONTACT hContact);
- INT_PTR DBGetAnniversaries(HANDLE hContact);
- INT_PTR DBWriteAnniversaries(HANDLE hContact);
+ INT_PTR DBGetAnniversaries(HCONTACT hContact);
+ INT_PTR DBWriteAnniversaries(HCONTACT hContact);
CAnnivEditCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszSetting);
~CAnnivEditCtrl();
@@ -87,8 +87,8 @@ public: static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting);
virtual void Release();
- virtual BOOL OnInfoChanged(HANDLE hContact, LPCSTR pszProto);
- virtual void OnApply(HANDLE hContact, LPCSTR pszProto);
+ virtual BOOL OnInfoChanged(HCONTACT hContact, LPCSTR pszProto);
+ virtual void OnApply(HCONTACT hContact, LPCSTR pszProto);
};
#endif /* _UINFOEX_CTRLANNIVEDIT_H_ */
\ No newline at end of file diff --git a/plugins/UserInfoEx/src/ctrl_base.cpp b/plugins/UserInfoEx/src/ctrl_base.cpp index 070ae8eb7f..5e90f7f989 100644 --- a/plugins/UserInfoEx/src/ctrl_base.cpp +++ b/plugins/UserInfoEx/src/ctrl_base.cpp @@ -219,7 +219,7 @@ void CCtrlList::OnReset() *
*
**/
-BOOL CCtrlList::OnInfoChanged(HANDLE hContact, LPCSTR pszProto)
+BOOL CCtrlList::OnInfoChanged(HCONTACT hContact, LPCSTR pszProto)
{
BOOL bChanged = 0;
INT_PTR i;
@@ -238,7 +238,7 @@ BOOL CCtrlList::OnInfoChanged(HANDLE hContact, LPCSTR pszProto) *
*
**/
-void CCtrlList::OnApply(HANDLE hContact, LPCSTR pszProto)
+void CCtrlList::OnApply(HCONTACT hContact, LPCSTR pszProto)
{
INT_PTR i;
diff --git a/plugins/UserInfoEx/src/ctrl_base.h b/plugins/UserInfoEx/src/ctrl_base.h index d0bf2b50fb..20ef261090 100644 --- a/plugins/UserInfoEx/src/ctrl_base.h +++ b/plugins/UserInfoEx/src/ctrl_base.h @@ -163,7 +163,7 @@ public: * @retval TRUE - the content was updated
* @retval FALSE - content not updated
**/
- virtual BOOL OnInfoChanged(HANDLE hContact, LPCSTR pszProto) { return 0; }
+ virtual BOOL OnInfoChanged(HCONTACT hContact, LPCSTR pszProto) { return 0; }
/**
* This is a pure virtual method, which is the common interface
@@ -174,7 +174,7 @@ public: *
* @return nothing
**/
- virtual void OnApply(HANDLE hContact, LPCSTR pszProto) { }
+ virtual void OnApply(HCONTACT hContact, LPCSTR pszProto) { }
/**
* This is a pure virtual method, which is called to set the
@@ -220,8 +220,8 @@ public: void Release();
void OnReset();
- BOOL OnInfoChanged(HANDLE hContact, LPCSTR pszProto);
- void OnApply(HANDLE hContact, LPCSTR pszProto);
+ BOOL OnInfoChanged(HCONTACT hContact, LPCSTR pszProto);
+ void OnApply(HCONTACT hContact, LPCSTR pszProto);
void OnChangedByUser(WORD idCtrl, WORD wChangedMsg);
INT_PTR OnSetTextColour(HWND hCtrl, HDC hdc);
};
diff --git a/plugins/UserInfoEx/src/ctrl_combo.cpp b/plugins/UserInfoEx/src/ctrl_combo.cpp index 1eb3817f3e..42a6d6df00 100644 --- a/plugins/UserInfoEx/src/ctrl_combo.cpp +++ b/plugins/UserInfoEx/src/ctrl_combo.cpp @@ -148,7 +148,7 @@ void CCombo::Release() *
* @return nothing
**/
-BOOL CCombo::OnInfoChanged(HANDLE hContact, LPCSTR pszProto)
+BOOL CCombo::OnInfoChanged(HCONTACT hContact, LPCSTR pszProto)
{
if (!_Flags.B.hasChanged && _pList != NULL)
{
@@ -196,7 +196,7 @@ BOOL CCombo::OnInfoChanged(HANDLE hContact, LPCSTR pszProto) *
* @return nothing
**/
-void CCombo::OnApply(HANDLE hContact, LPCSTR pszProto)
+void CCombo::OnApply(HCONTACT hContact, LPCSTR pszProto)
{
if (_Flags.B.hasChanged)
{
diff --git a/plugins/UserInfoEx/src/ctrl_combo.h b/plugins/UserInfoEx/src/ctrl_combo.h index 5e0db3b196..ad5ea0aa54 100644 --- a/plugins/UserInfoEx/src/ctrl_combo.h +++ b/plugins/UserInfoEx/src/ctrl_combo.h @@ -61,8 +61,8 @@ public: static CBaseCtrl* CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting, BYTE bDBDataType, LPIDSTRLIST pList, int nListCount);
virtual void Release();
- virtual BOOL OnInfoChanged(HANDLE hContact, LPCSTR pszProto);
- virtual void OnApply(HANDLE hContact, LPCSTR pszProto);
+ virtual BOOL OnInfoChanged(HCONTACT hContact, LPCSTR pszProto);
+ virtual void OnApply(HCONTACT hContact, LPCSTR pszProto);
virtual void OnChangedByUser(WORD wChangedMsg);
};
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index 1efda63861..12286d6f71 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -690,7 +690,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L cbi.dwID = 0;
if (DialogBoxParam(ghInst, MAKEINTRESOURCE(dlgID), GetParent(hwnd), dlgProc, (LPARAM)&cbi) == IDOK) {
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
SendMessage(hDlgDetails, PSM_GETCONTACT, NULL, (LPARAM)&hContact);
if (hContact) cbi.wFlags |= CTRLF_HASCUSTOM;
@@ -748,7 +748,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
if (DialogBoxParam(ghInst, MAKEINTRESOURCE(dlgID), GetParent(hwnd), dlgProc, (LPARAM)&cbi) == IDOK) {
- HANDLE hContact;
+ HCONTACT hContact;
SendMessage(hDlgDetails, PSM_GETCONTACT, NULL, (LPARAM)&hContact);
if (hContact) cbi.wFlags |= CTRLF_HASCUSTOM;
@@ -826,7 +826,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L {
TCHAR szVal[MAXDATASIZE] = { 0 };
int ccVal;
- HANDLE hContact;
+ HCONTACT hContact;
HWND hDlgDetails = GetParent(GetParent(hwnd));
EnableWindow(cbex->hBtnDel, GetWindowTextLength(cbex->hEdit) > 0);
@@ -1124,7 +1124,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L **/
case CBEXM_ENABLEITEM:
if (cbex->iSelectedItem >= 0 && cbex->iSelectedItem < cbex->numItems) {
- HANDLE hContact;
+ HCONTACT hContact;
BYTE bEnabled;
PSGetContact(GetParent(hwnd), hContact);
@@ -1277,7 +1277,7 @@ int CtrlContactAddItemFromDB( HWND hCtrl,
LPCSTR szIcon,
LPTSTR szItem,
- HANDLE hContact,
+ HCONTACT hContact,
LPCSTR pszModule,
LPCSTR pszProto,
LPCSTR szSettingVal)
@@ -1330,7 +1330,7 @@ int CtrlContactAddMyItemsFromDB( HWND hCtrl,
LPCSTR szIcon,
WORD wForcedFlags,
- HANDLE hContact,
+ HCONTACT hContact,
LPCSTR pszModule,
LPCSTR pszProto,
LPCSTR szFormatCat,
@@ -1406,7 +1406,7 @@ int CtrlContactAddMyItemsFromDB( **/
int CtrlContactWriteItemToDB(
HWND hCtrl,
- HANDLE hContact,
+ HCONTACT hContact,
LPCSTR pszModule,
LPCSTR pszProto,
LPCSTR pszSetting)
@@ -1448,7 +1448,7 @@ int CtrlContactWriteItemToDB( int CtrlContactWriteMyItemsToDB(
HWND hCtrl,
int iFirstItem,
- HANDLE hContact,
+ HCONTACT hContact,
LPCSTR pszModule,
LPCSTR pszProto,
LPCSTR szFormatCat,
diff --git a/plugins/UserInfoEx/src/ctrl_contact.h b/plugins/UserInfoEx/src/ctrl_contact.h index 69b57bac0a..92cc6894ff 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.h +++ b/plugins/UserInfoEx/src/ctrl_contact.h @@ -69,9 +69,9 @@ typedef struct TComboExItem int CtrlContactLoadModule();
int CtrlContactUnLoadModule();
-int CtrlContactAddItemFromDB(HWND hCtrl, LPCSTR szIcon, LPTSTR szItem, HANDLE hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szSettingVal);
-int CtrlContactAddMyItemsFromDB(HWND hCtrl, LPCSTR szIcon, WORD wForcedFlags, HANDLE hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szFormatCat, LPCSTR szFormatVal);
-int CtrlContactWriteItemToDB(HWND hCtrl, HANDLE hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting);
-int CtrlContactWriteMyItemsToDB(HWND hCtrl, int iFirstItem, HANDLE hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szFormatCat, LPCSTR szFormatVal);
+int CtrlContactAddItemFromDB(HWND hCtrl, LPCSTR szIcon, LPTSTR szItem, HCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szSettingVal);
+int CtrlContactAddMyItemsFromDB(HWND hCtrl, LPCSTR szIcon, WORD wForcedFlags, HCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szFormatCat, LPCSTR szFormatVal);
+int CtrlContactWriteItemToDB(HWND hCtrl, HCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting);
+int CtrlContactWriteMyItemsToDB(HWND hCtrl, int iFirstItem, HCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR szFormatCat, LPCSTR szFormatVal);
#endif /* _UI_CTRL_INCLUDE_ */
\ No newline at end of file diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp index 2d25aa7213..c87490dba0 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.cpp +++ b/plugins/UserInfoEx/src/ctrl_edit.cpp @@ -105,7 +105,7 @@ void CEditCtrl::OnReset() *
* @return nothing
**/
-BOOL CEditCtrl::OnInfoChanged(HANDLE hContact, LPCSTR pszProto)
+BOOL CEditCtrl::OnInfoChanged(HCONTACT hContact, LPCSTR pszProto)
{
if (!_Flags.B.hasChanged)
{
@@ -165,7 +165,7 @@ BOOL CEditCtrl::OnInfoChanged(HANDLE hContact, LPCSTR pszProto) *
* @return nothing
**/
-void CEditCtrl::OnApply(HANDLE hContact, LPCSTR pszProto)
+void CEditCtrl::OnApply(HCONTACT hContact, LPCSTR pszProto)
{
if (_Flags.B.hasChanged)
{
diff --git a/plugins/UserInfoEx/src/ctrl_edit.h b/plugins/UserInfoEx/src/ctrl_edit.h index de95a46226..4e569645ba 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.h +++ b/plugins/UserInfoEx/src/ctrl_edit.h @@ -57,8 +57,8 @@ public: virtual void Release();
virtual void OnReset();
- virtual BOOL OnInfoChanged(HANDLE hContact, LPCSTR pszProto);
- virtual void OnApply(HANDLE hContact, LPCSTR pszProto);
+ virtual BOOL OnInfoChanged(HCONTACT hContact, LPCSTR pszProto);
+ virtual void OnApply(HCONTACT hContact, LPCSTR pszProto);
virtual void OnChangedByUser(WORD wChangedMsg);
void OpenUrl();
diff --git a/plugins/UserInfoEx/src/ctrl_tzcombo.cpp b/plugins/UserInfoEx/src/ctrl_tzcombo.cpp index 76152e13c4..d98c591f34 100644 --- a/plugins/UserInfoEx/src/ctrl_tzcombo.cpp +++ b/plugins/UserInfoEx/src/ctrl_tzcombo.cpp @@ -157,7 +157,7 @@ void CTzCombo::Release() *
* @return _Flags.B.hasChanged member
**/
-BOOL CTzCombo::OnInfoChanged(HANDLE hContact, LPCSTR pszProto)
+BOOL CTzCombo::OnInfoChanged(HCONTACT hContact, LPCSTR pszProto)
{
if (!_Flags.B.hasChanged) {
//use new core tz interface to change the cbbox
@@ -198,7 +198,7 @@ BOOL CTzCombo::OnInfoChanged(HANDLE hContact, LPCSTR pszProto) *
* @return nothing
**/
-void CTzCombo::OnApply(HANDLE hContact, LPCSTR pszProto)
+void CTzCombo::OnApply(HCONTACT hContact, LPCSTR pszProto)
{
if (_Flags.B.hasChanged)
{
diff --git a/plugins/UserInfoEx/src/ctrl_tzcombo.h b/plugins/UserInfoEx/src/ctrl_tzcombo.h index 7c87c0ce2b..487792ebd5 100644 --- a/plugins/UserInfoEx/src/ctrl_tzcombo.h +++ b/plugins/UserInfoEx/src/ctrl_tzcombo.h @@ -46,8 +46,8 @@ public: virtual void Release();
// virtual void OnReset() {};
- virtual BOOL OnInfoChanged(HANDLE hContact, LPCSTR pszProto);
- virtual void OnApply(HANDLE hContact, LPCSTR pszProto);
+ virtual BOOL OnInfoChanged(HCONTACT hContact, LPCSTR pszProto);
+ virtual void OnApply(HCONTACT hContact, LPCSTR pszProto);
virtual void OnChangedByUser(WORD wChangedMsg);
void GetTime(LPTSTR szTime, WORD cchTime);
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 00ad372ef0..d451d11ad5 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -91,12 +91,12 @@ class CAnnivList struct CItemData
{
- HANDLE _hContact;
+ HCONTACT _hContact;
MAnnivDate* _pDate;
WORD _wDaysBefore;
BYTE _wReminderState;
- CItemData(HANDLE hContact, MAnnivDate &date)
+ CItemData(HCONTACT hContact, MAnnivDate &date)
{
_hContact = hContact;
_wReminderState = date.RemindOption();
@@ -740,7 +740,7 @@ class CAnnivList * @retval TRUE if successful
* @retval FALSE if failed
**/
- BYTE AddRow(HANDLE hContact, LPCSTR pszProto, MAnnivDate &ad, MTime &mtNow, WORD wDaysBefore)
+ BYTE AddRow(HCONTACT hContact, LPCSTR pszProto, MAnnivDate &ad, MTime &mtNow, WORD wDaysBefore)
{
TCHAR szText[MAX_PATH];
int diff, iItem = -1;
@@ -810,7 +810,6 @@ class CAnnivList **/
void RebuildList()
{
- HANDLE hContact;
LPSTR pszProto;
MTime mtNow;
MAnnivDate ad;
@@ -827,7 +826,7 @@ class CAnnivList mtNow.GetLocalTime();
// insert the items into the list
- for (hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
{
// ignore meta subcontacts here, as they are not interesting.
if (!DB::MetaContact::IsSub(hContact)) {
@@ -835,15 +834,13 @@ class CAnnivList pszProto = DB::Contact::Proto(hContact);
if (pszProto) {
numContacts++;
- switch (GenderOf(hContact, pszProto))
- {
- case 'M': {
- numMale++;
- } break;
+ switch (GenderOf(hContact, pszProto)) {
+ case 'M':
+ numMale++;
+ break;
- case 'F': {
- numFemale++;
- }
+ case 'F':
+ numFemale++;
}
if (!ad.DBGetBirthDate(hContact, pszProto)) {
diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp index 06a470f67d..470d988a1f 100644 --- a/plugins/UserInfoEx/src/dlg_msgbox.cpp +++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp @@ -613,7 +613,7 @@ static LRESULT CALLBACK PopupProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lP /**
* This is the service function for external plugins to use the nice messagebox
*
-* @param wParam - HANDLE hContact which can display an avatar for popups
+* @param wParam - HCONTACT hContact which can display an avatar for popups
* @param lParam - MSGBOX structure holding parameters
*
* @return The function returns the ID of the clicked button (IDOK, IDCANCEL, ...)
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 978da21f4f..653f9c77b2 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -253,7 +253,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) myGlobals.WantAeroAdaption = db_get_b(NULL, MODNAME, SET_PROPSHEET_AEROADAPTION, TRUE);
// allow only one dialog per user
- if (HWND hWnd = WindowList_Find(ghWindowList, (HANDLE)wParam)) {
+ if (HWND hWnd = WindowList_Find(ghWindowList, (HCONTACT)wParam)) {
SetForegroundWindow(hWnd);
SetFocus(hWnd);
return 0;
@@ -285,7 +285,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) ImageList_AddIcon(psh._hImages, hDefIcon);
// init contact
- psh._hContact = (HANDLE)wParam;
+ psh._hContact = (HCONTACT)wParam;
if (psh._hContact == NULL) {
// mark owner icons as initiated
bInitIcons |= INIT_ICONS_OWNER;
@@ -294,7 +294,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) }
else {
// get contact's protocol
- psh._pszPrefix = psh._pszProto = DB::Contact::Proto((HANDLE)wParam);
+ psh._pszPrefix = psh._pszProto = DB::Contact::Proto((HCONTACT)wParam);
if (psh._pszProto == NULL) {
MsgErr(NULL, LPGENT("Could not find contact's protocol. Maybe it is not active!"));
return 1;
@@ -313,12 +313,12 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) // metacontacts sub pages
if (bScanMetaSubContacts) {
- int numSubs = DB::MetaContact::SubCount((HANDLE)wParam);
+ int numSubs = DB::MetaContact::SubCount((HCONTACT)wParam);
psh._dwFlags &= ~PSF_PROTOPAGESONLY_INIT;
psh._dwFlags |= PSF_PROTOPAGESONLY;
for (int i = 0; i < numSubs; i++) {
- psh._hContact = DB::MetaContact::Sub((HANDLE)wParam, i);
+ psh._hContact = DB::MetaContact::Sub((HCONTACT)wParam, i);
psh._nSubContact = i;
if (psh._hContact) {
psh._pszProto = DB::Contact::Proto(psh._hContact);
@@ -326,7 +326,7 @@ static INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam) NotifyEventHooks(ghDetailsInitEvent, (WPARAM)&psh, (LPARAM)psh._hContact);
}
}
- psh._hContact = (HANDLE)wParam;
+ psh._hContact = (HCONTACT)wParam;
}
// sort the pages by the position read from database
@@ -409,10 +409,10 @@ static INT_PTR AddPage(WPARAM wParam, LPARAM lParam) **/
static int OnDeleteContact(WPARAM wParam, LPARAM lParam)
{
- HWND hWnd = WindowList_Find(ghWindowList, (HANDLE)wParam);
- if (hWnd != NULL)
- DestroyWindow(hWnd);
- return 0;
+ HWND hWnd = WindowList_Find(ghWindowList, (HCONTACT)wParam);
+ if (hWnd != NULL)
+ DestroyWindow(hWnd);
+ return 0;
}
/**
@@ -1356,7 +1356,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar **/
case HM_SETTING_CHANGED:
if (!(pPs->dwFlags & PSF_LOCKED)) {
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
DBCONTACTWRITESETTING *pdbcws = (DBCONTACTWRITESETTING*)lParam;
if (hContact != pPs->hContact) {
@@ -1593,7 +1593,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar // count valid subcontacts whose protocol supports the PSS_GETINFO service to update the information
int numSubs = DB::MetaContact::SubCount(pPs->hContact);
for (int i = 0; i < numSubs; i++) {
- HANDLE hSubContact = DB::MetaContact::Sub(pPs->hContact, i);
+ HCONTACT hSubContact = DB::MetaContact::Sub(pPs->hContact, i);
if (hSubContact != NULL) {
if (ProtoServiceExists(DB::Contact::Proto(hSubContact), PSS_GETINFO)) {
pPs->infosUpdated = (TAckInfo*)mir_realloc(pPs->infosUpdated, sizeof(TAckInfo)* (pPs->nSubContacts + 1));
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.h b/plugins/UserInfoEx/src/dlg_propsheet.h index c7965e5693..dce0416454 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.h +++ b/plugins/UserInfoEx/src/dlg_propsheet.h @@ -40,7 +40,7 @@ class CPsTreeItem DWORD _dwFlags; // some flags
int _iPosition; // initiating position if custom (used for sorting)
LPARAM _initParam;
- HANDLE _hContact; // contact the page is accociated with (may be a meta subcontact if details dialog is shown for a meta contact)
+ HCONTACT _hContact; // contact the page is accociated with (may be a meta subcontact if details dialog is shown for a meta contact)
LPCSTR _pszProto; // protocol the page is accociated with (is the contact's protocol if _hContact is not NULL)
LPCSTR _pszPrefix; // pointer to the dialog owning contact's protocol
@@ -68,7 +68,7 @@ public: __inline LPCSTR Proto() const { return _pszProto; };
__inline LPTSTR Label() const { return _ptszLabel; };
void Rename( const LPTSTR pszLabel );
- __inline HANDLE hContact() const { return _hContact; };
+ __inline HCONTACT hContact() const { return _hContact; };
__inline HWND Wnd() const { return _hWnd; };
__inline int DlgId() const { return _idDlg; };
@@ -219,7 +219,7 @@ class CPsHdr {
public:
DWORD _dwSize; // size of this class in bytes
- HANDLE _hContact; // handle to the owning contact
+ HCONTACT _hContact; // handle to the owning contact
LPCSTR _pszProto; // owning contact's protocol
LPCSTR _pszPrefix; // name prefix for treeitem settings
CPsTreeItem** _pPages; // the pages
@@ -238,15 +238,15 @@ public: struct TAckInfo
{
- HANDLE hContact;
- LPINT/*PINT_PTR*/ acks;
- int count;
+ HCONTACT hContact;
+ LPINT acks;
+ int count;
};
struct TPropSheet
{
// dialogs owner
- HANDLE hContact;
+ HCONTACT hContact;
CHAR pszProto[MAXMODULELABELLENGTH];
HANDLE hProtoAckEvent; // eventhook for protocol acks
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index 0906dacaae..efb32e0efc 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -30,17 +30,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. **/
CExImContactBase::CExImContactBase()
{
- _pszNick = NULL;
- _pszDisp = NULL;
- _pszGroup = NULL;
- _pszProto = NULL;
- _pszProtoOld = NULL;
- _pszAMPro = NULL;
- _pszUIDKey = NULL;
- _dbvUIDHash = NULL;
+ _pszNick = NULL;
+ _pszDisp = NULL;
+ _pszGroup = NULL;
+ _pszProto = NULL;
+ _pszProtoOld = NULL;
+ _pszAMPro = NULL;
+ _pszUIDKey = NULL;
+ _dbvUIDHash = NULL;
ZeroMemory(&_dbvUID, sizeof(DBVARIANT));
- _hContact = INVALID_HANDLE_VALUE;
- _isNewContact = FALSE;
+ _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
+ _isNewContact = FALSE;
}
/**
@@ -69,7 +69,7 @@ CExImContactBase::~CExImContactBase() * param: hContact - handle to contact whose information to read
* return: TRUE if successful or FALSE otherwise
**/
-BYTE CExImContactBase::fromDB(HANDLE hContact)
+BYTE CExImContactBase::fromDB(HCONTACT hContact)
{
BYTE ret = FALSE;
BYTE isChatRoom = FALSE;
@@ -224,15 +224,14 @@ BYTE CExImContactBase::fromIni(LPSTR& row) * param: hMetaContact - a meta contact to add this contact to
* return: handle of the contact if successful
**/
-HANDLE CExImContactBase::toDB()
+HCONTACT CExImContactBase::toDB()
{
// create new contact if none exists
if (_hContact == INVALID_HANDLE_VALUE && _pszProto && _pszUIDKey && _dbvUID.type != DBVT_DELETED) {
PROTOACCOUNT* pszAccount = 0;
if (NULL == (pszAccount = ProtoGetAccount( _pszProto ))) {
//account does not exist
- _hContact = INVALID_HANDLE_VALUE;
- return INVALID_HANDLE_VALUE;
+ return _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
}
if (!IsAccountEnabled(pszAccount)) {
;
@@ -240,20 +239,17 @@ HANDLE CExImContactBase::toDB() // create new contact
_hContact = DB::Contact::Add();
if (!_hContact) {
- _hContact = INVALID_HANDLE_VALUE;
- return INVALID_HANDLE_VALUE;
+ return _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
}
// Add the protocol to the new contact
if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)_hContact, (LPARAM)_pszProto)) {
DB::Contact::Delete(_hContact);
- _hContact = INVALID_HANDLE_VALUE;
- return INVALID_HANDLE_VALUE;
+ return _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
}
// write uid to protocol module
if (db_set(_hContact, _pszProto, _pszUIDKey, &_dbvUID)) {
DB::Contact::Delete(_hContact);
- _hContact = INVALID_HANDLE_VALUE;
- return INVALID_HANDLE_VALUE;
+ return _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
}
// write nick and display name
if (_pszNick) db_set_utf(_hContact, _pszProto, SET_CONTACT_NICK, _pszNick);
@@ -477,7 +473,7 @@ BYTE CExImContactBase::isMeta() const return DB::Module::IsMeta(_pszProto);
}
-BYTE CExImContactBase::isHandle(HANDLE hContact)
+BYTE CExImContactBase::isHandle(HCONTACT hContact)
{
LPCSTR pszProto;
DBVARIANT dbv;
@@ -527,10 +523,7 @@ BYTE CExImContactBase::isHandle(HANDLE hContact) **/
HANDLE CExImContactBase::findHandle()
{
- HANDLE hContact;
-
- for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
- {
+ for (HCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
if (isHandle(hContact)) {
_hContact = hContact;
_isNewContact = FALSE;
@@ -538,6 +531,5 @@ HANDLE CExImContactBase::findHandle() }
}
_isNewContact = TRUE;
- _hContact = INVALID_HANDLE_VALUE;
- return INVALID_HANDLE_VALUE;
+ return _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
}
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h index 377b341c3e..c9bb3fee24 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h @@ -36,7 +36,7 @@ protected: LPSTR _pszUIDKey;
DWORD _dbvUIDHash;
DBVARIANT _dbvUID;
- HANDLE _hContact;
+ HCONTACT _hContact;
BYTE _isNewContact; // is this contact a new one?
HANDLE findHandle();
@@ -52,7 +52,7 @@ public: // __inline LPCSTR ampro() const { return mir_strcmp(_pszAMPro,"")? _pszAMPro : NULL; }
// __inline LPCSTR uidk() const { return mir_strcmp(_pszUIDKey,"")? _pszUIDKey : NULL; }
__inline DBVARIANT& uid() { return _dbvUID; }
- __inline HANDLE handle() const { return _hContact; }
+ __inline HCONTACT handle() const { return _hContact; }
__inline void disp(LPCSTR val) { _pszDisp = val ? mir_strdup(val): NULL; }
__inline void group(LPCSTR val) { _pszGroup = val ? mir_strdup(val): NULL; }
@@ -77,16 +77,16 @@ public: mir_free(temp);
}
- BYTE isHandle(HANDLE hContact);
- BYTE isMeta() const;
+ BYTE isHandle(HCONTACT hContact);
+ BYTE isMeta() const;
- LPSTR uid2String(BYTE bPrependType);
+ LPSTR uid2String(BYTE bPrependType);
- BYTE fromDB(HANDLE hContact);
- BYTE fromIni(LPSTR& row);
+ BYTE fromDB(HCONTACT hContact);
+ BYTE fromIni(LPSTR& row);
- HANDLE toDB();
- void toIni(FILE* file, int modCount);
+ HCONTACT toDB();
+ void toIni(FILE* file, int modCount);
- BYTE operator = (HANDLE hContact) { return fromDB(hContact); }
+ BYTE operator = (HCONTACT hContact) { return fromDB(hContact); }
};
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index a292f6d803..8aa92d5285 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -219,7 +219,7 @@ int CExImContactXML::Export(FILE *xmlfile, DB::CEnumList* pModules) const int cnt = DB::MetaContact::SubCount(_hContact);
const int def = DB::MetaContact::SubDefNum(_hContact);
- HANDLE hSubContact = DB::MetaContact::Sub(_hContact, def);
+ HCONTACT hSubContact = DB::MetaContact::Sub(_hContact, def);
// export default subcontact
if (hSubContact && vContact.fromDB(hSubContact))
@@ -488,7 +488,7 @@ int CExImContactXML::LoadXmlElemnt(TiXmlElement *xContact) // delete last contact
db_free(&_dbvUID);
- _hContact = INVALID_HANDLE_VALUE;
+ _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
_xmlNode = xContact;
MIR_FREE(_pszAMPro); ampro(xContact->Attribute("ampro"));
@@ -511,7 +511,7 @@ int CExImContactXML::LoadXmlElemnt(TiXmlElement *xContact) if (vSub = xSub) {
// identify metacontact by the first valid subcontact in xmlfile
if (_hContact == INVALID_HANDLE_VALUE && vSub.handle() != INVALID_HANDLE_VALUE) {
- HANDLE hMeta = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)vSub.handle(), NULL);
+ HCONTACT hMeta = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)vSub.handle(), NULL);
if (hMeta != NULL) {
_hContact = hMeta;
break;
@@ -610,7 +610,7 @@ int CExImContactXML::ImportContact() LPGENT("You aborted import of a new contact.\nSome information may be missing for this contact.\n\nDo you want to delete the incomplete contact?"));
if (result == IDYES) {
DB::Contact::Delete(_hContact);
- _hContact = INVALID_HANDLE_VALUE;
+ _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
}
}
return ERROR_ABORTED;
@@ -674,9 +674,9 @@ int CExImContactXML::Import(BYTE keepMetaSubContact) return result;
// convert default subcontact to metacontact
- _hContact = (HANDLE)CallService(MS_MC_CONVERTTOMETA, (WPARAM)vContact.handle(), NULL);
+ _hContact = (HCONTACT)CallService(MS_MC_CONVERTTOMETA, (WPARAM)vContact.handle(), NULL);
if (_hContact == NULL) {
- _hContact = INVALID_HANDLE_VALUE;
+ _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
return ERROR_CONVERT_METACONTACT;
}
@@ -753,7 +753,7 @@ int CExImContactXML::ImportMetaSubContact(CExImContactXML * pMetaContact) MIR_FREE(ptszMetaNick);
if (result == IDYES) {
DB::Contact::Delete(_hContact);
- _hContact = INVALID_HANDLE_VALUE;
+ _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
}
}
return ERROR_ADDTO_METACONTACT;
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index d170c6d993..1c552187e2 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -292,7 +292,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar // module must exist in at least one contact
if (pDat->ExImContact->Typ != EXIM_CONTACT) // TRUE = All Contacts
{
- HANDLE hContact;
+ HCONTACT hContact;
for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
{
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index 1949ae96f0..3ddfbe0f93 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * file - file to write the settings to
* return nothing
**/
-static void ExportModule(HANDLE hContact, LPCSTR pszModule, FILE* file)
+static void ExportModule(HCONTACT hContact, LPCSTR pszModule, FILE* file)
{
DB::CEnumList Settings;
@@ -126,7 +126,7 @@ static void ExportModule(HANDLE hContact, LPCSTR pszModule, FILE* file) * pModules - module to export, NULL to export all modules of a contact
* file - ini file to write the contact to
**/
-static BYTE ExportContact(HANDLE hContact, DB::CEnumList* pModules, FILE* file)
+static BYTE ExportContact(HCONTACT hContact, DB::CEnumList* pModules, FILE* file)
{
CExImContactBase vcc;
@@ -167,7 +167,7 @@ int SvcExImINI_Export(lpExImParam ExImContact, LPCSTR pszFileName) errno_t err;
DB::CEnumList Modules;
SYSTEMTIME now;
- HANDLE hContact;
+ HCONTACT hContact;
if (!DlgExImModules_SelectModulesToExport(ExImContact, &Modules, NULL))
{
@@ -298,7 +298,7 @@ static DWORD ImportreadLine(FILE* file, LPSTR &str) * cchBuf - character count of the buffer
* return: handle to the contact that matches the information or NULL if no match
**/
-static HANDLE ImportFindContact(HANDLE hContact, LPSTR &strBuf, BYTE bCanCreate)
+static HCONTACT ImportFindContact(HCONTACT hContact, LPSTR &strBuf, BYTE bCanCreate)
{
CExImContactBase vcc;
@@ -322,7 +322,7 @@ static HANDLE ImportFindContact(HANDLE hContact, LPSTR &strBuf, BYTE bCanCreate) * strLine - string with the setting and its value to write to db
* return: 0 if writing was ok, 1 otherwise
**/
-int ImportSetting(HANDLE hContact, LPCSTR pszModule, LPSTR &strLine)
+int ImportSetting(HCONTACT hContact, LPCSTR pszModule, LPSTR &strLine)
{
DBVARIANT dbv;
LPSTR end, value;
@@ -433,10 +433,10 @@ int ImportSetting(HANDLE hContact, LPCSTR pszModule, LPSTR &strLine) * strLine - string with the setting and its value to write to db
* return: 0 if writing was ok, 1 otherwise
**/
-int SvcExImINI_Import(HANDLE hContact, LPCSTR pszFileName)
+int SvcExImINI_Import(HCONTACT hContact, LPCSTR pszFileName)
{
FILE *file;
- HANDLE hNewContact = INVALID_HANDLE_VALUE;
+ HCONTACT hNewContact = (HCONTACT)INVALID_HANDLE_VALUE;
DWORD end,
numLines = 0;
CHAR szModule[MAXSETTING] = {0};
@@ -471,7 +471,7 @@ int SvcExImINI_Import(HANDLE hContact, LPCSTR pszFileName) strBuf = mir_strnerase(strBuf, 0, 1);
numContactsInFile++;
- if ((hNewContact = ImportFindContact(hContact, strBuf, FALSE)) != INVALID_HANDLE_VALUE)
+ if ((hNewContact = ImportFindContact(hContact, strBuf, FALSE)) != (HCONTACT)INVALID_HANDLE_VALUE)
numContactsAdded++;
continue;
}
@@ -484,13 +484,13 @@ int SvcExImINI_Import(HANDLE hContact, LPCSTR pszFileName) *szModule = 0;
numContactsInFile++;
- if ((hNewContact = ImportFindContact(hContact, strBuf, TRUE)) != INVALID_HANDLE_VALUE)
+ if ((hNewContact = ImportFindContact(hContact, strBuf, TRUE)) != (HCONTACT)INVALID_HANDLE_VALUE)
numContactsAdded++;
continue;
}
// read modules and settings only for valid contacts
- if (hNewContact != INVALID_HANDLE_VALUE) {
+ if (hNewContact != (HCONTACT)INVALID_HANDLE_VALUE) {
// found a module line
if (strBuf[0] == '[' && (end = (strchr(strBuf, ']') - strBuf)) > 0) {
mir_strncpy(szModule, &strBuf[1], end);
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.h b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.h index 6961b1b6f7..9d737fcdb8 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.h @@ -25,6 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma once
int SvcExImINI_Export(lpExImParam ExImContact, LPCSTR pszFileName);
- int SvcExImINI_Import(HANDLE hContact, LPCSTR pszFileName);
+ int SvcExImINI_Import(HCONTACT hContact, LPCSTR pszFileName);
#endif /* _SVC_EXIMINI_H_ */
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index e3b6f45f2c..824c4c0fd1 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -557,7 +557,7 @@ size_t CLineBuffer::GetTokenNext(const CHAR delim, CLineBuffer * pBuf) *
* return: 0 if successful, 1 otherwise
**/
-int CLineBuffer::DBWriteTokenFirst(HANDLE hContact, const CHAR* pszModule, const CHAR* pszSetting, const CHAR delim)
+int CLineBuffer::DBWriteTokenFirst(HCONTACT hContact, const CHAR* pszModule, const CHAR* pszSetting, const CHAR delim)
{
PBYTE here;
int iRet = 1;
@@ -594,7 +594,7 @@ int CLineBuffer::DBWriteTokenFirst(HANDLE hContact, const CHAR* pszModule, const *
* return: 0 if successful, 1 otherwise
**/
-int CLineBuffer::DBWriteTokenNext(HANDLE hContact, const CHAR* pszModule, const CHAR* pszSetting, const CHAR delim)
+int CLineBuffer::DBWriteTokenNext(HCONTACT hContact, const CHAR* pszModule, const CHAR* pszSetting, const CHAR delim)
{
PBYTE here;
int iRet = 1;
@@ -628,7 +628,7 @@ int CLineBuffer::DBWriteTokenNext(HANDLE hContact, const CHAR* pszModule, const *
* return: 0 if successful, 1 otherwise
**/
-int CLineBuffer::DBWriteSettingString(HANDLE hContact, const CHAR* pszModule, const CHAR* pszSetting)
+int CLineBuffer::DBWriteSettingString(HCONTACT hContact, const CHAR* pszModule, const CHAR* pszSetting)
{
if (_pVal && _cbUsed > 0)
return db_set_s(hContact, pszModule, pszSetting, (LPSTR)_pVal);
@@ -649,11 +649,11 @@ int CLineBuffer::DBWriteSettingString(HANDLE hContact, const CHAR* pszModule, co **/
CVCardFileVCF::CVCardFileVCF()
{
- _pFile = NULL;
- _hContact = INVALID_HANDLE_VALUE;
- _pszBaseProto = NULL;
- _hasUtf8 = 0;
- _useUtf8 = FALSE;
+ _pFile = NULL;
+ _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
+ _pszBaseProto = NULL;
+ _hasUtf8 = 0;
+ _useUtf8 = FALSE;
}
/**
@@ -850,7 +850,7 @@ void CVCardFileVCF::writeLineEncoded(const CHAR *szSet, size_t *cbRew) * pszMode - the mode the file should be opened with
* return TRUE or FALSE
**/
-BYTE CVCardFileVCF::Open(HANDLE hContact, LPCSTR pszFileName, LPCSTR pszMode)
+BYTE CVCardFileVCF::Open(HCONTACT hContact, LPCSTR pszFileName, LPCSTR pszMode)
{
if (!(_pFile = fopen(pszFileName, pszMode)))
return FALSE;
@@ -873,9 +873,9 @@ void CVCardFileVCF::Close(void) {
if (_pFile)
fclose(_pFile);
- _pFile = NULL;
- _hContact = INVALID_HANDLE_VALUE;
- _pszBaseProto = NULL;
+ _pFile = NULL;
+ _hContact = (HCONTACT)INVALID_HANDLE_VALUE;
+ _pszBaseProto = NULL;
}
/**
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h index 3fbab056e7..2507d83b61 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h @@ -59,9 +59,9 @@ public: size_t GetTokenFirst(const CHAR delim, CLineBuffer * pBuf);
size_t GetTokenNext(const CHAR delim, CLineBuffer * pBuf);
- int DBWriteTokenFirst(HANDLE hContact, const CHAR* pszModule, const CHAR* pszSetting, const CHAR delim);
- int DBWriteTokenNext(HANDLE hContact, const CHAR* pszModule, const CHAR* pszSetting, const CHAR delim);
- int DBWriteSettingString(HANDLE hContact, const CHAR* pszModule, const CHAR* pszSetting);
+ int DBWriteTokenFirst(HCONTACT hContact, const CHAR* pszModule, const CHAR* pszSetting, const CHAR delim);
+ int DBWriteTokenNext(HCONTACT hContact, const CHAR* pszModule, const CHAR* pszSetting, const CHAR delim);
+ int DBWriteSettingString(HCONTACT hContact, const CHAR* pszModule, const CHAR* pszSetting);
};
class CVCardFileVCF
@@ -69,7 +69,7 @@ class CVCardFileVCF private:
CLineBuffer _clVal;
FILE *_pFile;
- HANDLE _hContact;
+ HCONTACT _hContact;
const CHAR *_pszBaseProto;
WORD _cbRew;
BYTE _useUtf8;
@@ -87,7 +87,7 @@ private: public:
CVCardFileVCF();
- BYTE Open(HANDLE hContact, LPCSTR pszFileName, LPCSTR pszMode);
+ BYTE Open(HCONTACT hContact, LPCSTR pszFileName, LPCSTR pszMode);
void Close(void);
BYTE Export(BYTE bExportUtf);
BYTE Import();
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp index 61d46dcef8..c4664b0975 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.cpp @@ -93,7 +93,7 @@ int CFileXml::Export(lpExImParam ExImContact, LPCSTR pszFileName) LONG cbHeader;
SYSTEMTIME now;
DWORD result;
- HANDLE hContact;
+ HCONTACT hContact;
result = (DWORD)DialogBox(ghInst,
MAKEINTRESOURCE(IDD_EXPORT_DATAHISTORY),
@@ -346,7 +346,7 @@ DWORD CFileXml::CountContacts(TiXmlElement* xmlParent) * pszFileName - full qualified path to the xml file which is to import
* return: ERROR_OK on success or one other element of ImportError to tell the type of failure
**/
-int CFileXml::Import(HANDLE hContact, LPCSTR pszFileName)
+int CFileXml::Import(HCONTACT hContact, LPCSTR pszFileName)
{
TiXmlDocument doc;
TiXmlElement *xmlCard = NULL;
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h index 3ec0ca998a..382fdb6dde 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImXML.h @@ -50,13 +50,13 @@ class CFileXml { /*
int ExportOwner(FILE *xmlfile, BYTE bExportEvents);
- int ExportContact(FILE *xmlfile, HANDLE hContact, BYTE bExportEvents, LPENUMLIST pModules);
- int ExportSubContact(TiXmlElement *xContact, HANDLE hContact, BYTE bExportEvents);
+ int ExportContact(FILE *xmlfile, HCONTACT hContact, BYTE bExportEvents, LPENUMLIST pModules);
+ int ExportSubContact(TiXmlElement *xContact, HCONTACT hContact, BYTE bExportEvents);
*/
public:
CFileXml();
- int Import(HANDLE hContact, LPCSTR pszFileName);
+ int Import(HCONTACT hContact, LPCSTR pszFileName);
int Export(lpExImParam ExImContact, LPCSTR pszFileName);
};
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index f331f1f3e3..0632d96f32 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -211,7 +211,7 @@ INT_PTR svcExIm_MainExport_Service(WPARAM wParam, LPARAM lParam) {
ExImParam ExIm;
ZeroMemory(&ExIm, sizeof(ExIm));
- ExIm.hContact = INVALID_HANDLE_VALUE;
+ ExIm.hContact = (HCONTACT)INVALID_HANDLE_VALUE;
ExIm.Typ = EXIM_ALL;
return SvcExImport_Export(&ExIm, (HWND)lParam);
}
@@ -220,7 +220,7 @@ INT_PTR svcExIm_MainImport_Service(WPARAM wParam, LPARAM lParam) {
ExImParam ExIm;
ZeroMemory(&ExIm, sizeof(ExIm));
- ExIm.hContact = INVALID_HANDLE_VALUE;
+ ExIm.hContact = (HCONTACT)INVALID_HANDLE_VALUE;
ExIm.Typ = EXIM_ALL;
return SvcExImport_Import(&ExIm, (HWND)lParam);
}
@@ -233,7 +233,7 @@ INT_PTR svcExIm_ContactExport_Service(WPARAM wParam, LPARAM lParam) {
ExImParam ExIm;
ZeroMemory(&ExIm, sizeof(ExIm));
- ExIm.hContact = (HANDLE)wParam;
+ ExIm.hContact = (HCONTACT)wParam;
ExIm.Typ = EXIM_CONTACT;
return SvcExImport_Export(&ExIm, (HWND)lParam);
}
@@ -242,7 +242,7 @@ INT_PTR svcExIm_ContactImport_Service(WPARAM wParam, LPARAM lParam) {
ExImParam ExIm;
ZeroMemory(&ExIm, sizeof(ExIm));
- ExIm.hContact = (HANDLE)wParam;
+ ExIm.hContact = (HCONTACT)wParam;
ExIm.Typ = EXIM_CONTACT;
return SvcExImport_Import(&ExIm, (HWND)lParam);
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.h b/plugins/UserInfoEx/src/ex_import/svc_ExImport.h index 16c64c25e3..484c266535 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.h @@ -26,7 +26,7 @@ typedef struct {
BYTE Typ;
union {
- HANDLE hContact;
+ HCONTACT hContact;
LPSTR pszName;
LPTSTR ptszName;
};
diff --git a/plugins/UserInfoEx/src/mir_contactqueue.cpp b/plugins/UserInfoEx/src/mir_contactqueue.cpp index 00c612295d..0c9ff0883b 100644 --- a/plugins/UserInfoEx/src/mir_contactqueue.cpp +++ b/plugins/UserInfoEx/src/mir_contactqueue.cpp @@ -123,7 +123,7 @@ void CContactQueue::RemoveAll() *
* @return nothing
**/
-void CContactQueue::RemoveAll(HANDLE hContact)
+void CContactQueue::RemoveAll(HCONTACT hContact)
{
Lock();
@@ -149,7 +149,7 @@ void CContactQueue::RemoveAll(HANDLE hContact) *
* @return nothing
**/
-void CContactQueue::RemoveAllConsiderParam(HANDLE hContact, PVOID param)
+void CContactQueue::RemoveAllConsiderParam(HCONTACT hContact, PVOID param)
{
Lock();
@@ -177,7 +177,7 @@ void CContactQueue::RemoveAllConsiderParam(HANDLE hContact, PVOID param) * @retval TRUE - The item is added to the queue successfully.
* @retval FALSE - The item is not added to the queue.
**/
-BOOL CContactQueue::Add(int waitTime, HANDLE hContact, PVOID param)
+BOOL CContactQueue::Add(int waitTime, HCONTACT hContact, PVOID param)
{
BOOL rc;
@@ -201,7 +201,7 @@ BOOL CContactQueue::Add(int waitTime, HANDLE hContact, PVOID param) * @retval TRUE - The item is added to the queue successfully.
* @retval FALSE - The item is not added to the queue.
**/
-BOOL CContactQueue::AddIfDontHave(int waitTime, HANDLE hContact, PVOID param)
+BOOL CContactQueue::AddIfDontHave(int waitTime, HCONTACT hContact, PVOID param)
{
int i;
BOOL rc;
@@ -235,7 +235,7 @@ BOOL CContactQueue::AddIfDontHave(int waitTime, HANDLE hContact, PVOID param) * @retval TRUE - The item is added to the queue successfully.
* @retval FALSE - The item is not added to the queue.
**/
-BOOL CContactQueue::AddUnique(int waitTime, HANDLE hContact, PVOID param)
+BOOL CContactQueue::AddUnique(int waitTime, HCONTACT hContact, PVOID param)
{
BOOL rc;
@@ -261,7 +261,7 @@ BOOL CContactQueue::AddUnique(int waitTime, HANDLE hContact, PVOID param) * @retval TRUE - The item is added to the queue successfully.
* @retval FALSE - The item is not added to the queue.
**/
-BOOL CContactQueue::AddUniqueConsiderParam(int waitTime, HANDLE hContact, PVOID param)
+BOOL CContactQueue::AddUniqueConsiderParam(int waitTime, HCONTACT hContact, PVOID param)
{
BOOL rc;
@@ -285,7 +285,7 @@ BOOL CContactQueue::AddUniqueConsiderParam(int waitTime, HANDLE hContact, PVOID * @retval TRUE - The item is added to the queue successfully.
* @retval FALSE - The item is not added to the queue.
**/
-BOOL CContactQueue::InternalAdd(int waitTime, HANDLE hContact, PVOID param)
+BOOL CContactQueue::InternalAdd(int waitTime, HCONTACT hContact, PVOID param)
{
BOOL rc;
CQueueItem *qi = (CQueueItem *) mir_alloc(sizeof(CQueueItem));
diff --git a/plugins/UserInfoEx/src/mir_contactqueue.h b/plugins/UserInfoEx/src/mir_contactqueue.h index b42d89c1a6..4da54dcacc 100644 --- a/plugins/UserInfoEx/src/mir_contactqueue.h +++ b/plugins/UserInfoEx/src/mir_contactqueue.h @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct CQueueItem
{
DWORD check_time;
- HANDLE hContact;
+ HCONTACT hContact;
PVOID param;
};
@@ -65,7 +65,7 @@ public: *
* @return nothing
**/
- void RemoveAll(HANDLE hContact);
+ void RemoveAll(HCONTACT hContact);
/**
* This function removes all queue items for the hContact considering the correct parameter.
@@ -75,7 +75,7 @@ public: *
* @return nothing
**/
- void RemoveAllConsiderParam(HANDLE hContact, PVOID param);
+ void RemoveAllConsiderParam(HCONTACT hContact, PVOID param);
/**
* This method adds the desired new item.
@@ -87,7 +87,7 @@ public: * @retval TRUE - The item is added to the queue successfully.
* @retval FALSE - The item is not added to the queue.
**/
- BOOL Add(int waitTime, HANDLE hContact, PVOID param = NULL);
+ BOOL Add(int waitTime, HCONTACT hContact, PVOID param = NULL);
/**
* This method adds the desired new item only, if the queue does not yet contain
@@ -100,7 +100,7 @@ public: * @retval TRUE - The item is added to the queue successfully.
* @retval FALSE - The item is not added to the queue.
**/
- BOOL AddIfDontHave(int waitTime, HANDLE hContact, PVOID param = NULL);
+ BOOL AddIfDontHave(int waitTime, HCONTACT hContact, PVOID param = NULL);
/**
* This method removes all existing queue items for the contact and adds a new queue item
@@ -113,7 +113,7 @@ public: *
* @return nothing
**/
- BOOL AddUnique(int waitTime, HANDLE hContact, PVOID param = NULL);
+ BOOL AddUnique(int waitTime, HCONTACT hContact, PVOID param = NULL);
/**
* This method removes all existing queue items for the contact with the same parameter as @e param
@@ -126,7 +126,7 @@ public: *
* @return nothing
**/
- BOOL AddUniqueConsiderParam (int waitTime, HANDLE hContact, PVOID param = NULL);
+ BOOL AddUniqueConsiderParam (int waitTime, HCONTACT hContact, PVOID param = NULL);
/**
* This method resumes the worker thread and immitiatly goes on with the next entry.
@@ -140,7 +140,7 @@ public: protected:
virtual void OnEmpty () {};
- virtual void Callback (HANDLE hContact, PVOID param) = 0;
+ virtual void Callback (HCONTACT hContact, PVOID param) = 0;
/**
* This is the real thread callback function. As long as _status
@@ -198,7 +198,7 @@ private: * @retval TRUE - The item is added to the queue successfully.
* @retval FALSE - The item is not added to the queue.
**/
- BOOL InternalAdd(int waitTime, HANDLE hContact, PVOID param);
+ BOOL InternalAdd(int waitTime, HCONTACT hContact, PVOID param);
};
#endif // __CONTACTASYNCQUEUE_H__
\ No newline at end of file diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index ed48c02193..1a41e8da34 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -25,41 +25,41 @@ namespace DB { namespace MetaContact {
-INT_PTR SubCount(HANDLE hMetaContact)
+INT_PTR SubCount(HCONTACT hMetaContact)
{
INT_PTR result = CallService(MS_MC_GETNUMCONTACTS, (WPARAM) hMetaContact, 0);
return (result == CALLSERVICE_NOTFOUND) ? -1 : result;
}
-INT_PTR SubDefNum(HANDLE hMetaContact)
+INT_PTR SubDefNum(HCONTACT hMetaContact)
{
INT_PTR result = CallService(MS_MC_GETDEFAULTCONTACTNUM, (WPARAM) hMetaContact, 0);
return (result == CALLSERVICE_NOTFOUND) ? -1 : result;
}
-HANDLE Sub(HANDLE hMetaContact, int idx)
+HCONTACT Sub(HCONTACT hMetaContact, int idx)
{
if (idx != -1) {
INT_PTR result = CallService(MS_MC_GETSUBCONTACT, (WPARAM) hMetaContact, (LPARAM) idx);
- return (result == CALLSERVICE_NOTFOUND) ? NULL : (HANDLE) result;
+ return (result == CALLSERVICE_NOTFOUND) ? NULL : (HCONTACT)result;
}
return NULL;
}
-bool IsSub(HANDLE hContact)
+bool IsSub(HCONTACT hContact)
{
return myGlobals.szMetaProto &&
db_get_b(NULL, myGlobals.szMetaProto, "Enabled", TRUE) &&
db_get_b(hContact, myGlobals.szMetaProto, "IsSubcontact", FALSE);
}
-HANDLE GetMeta(HANDLE hContact)
+HCONTACT GetMeta(HCONTACT hContact)
{
if (!myGlobals.szMetaProto)
return NULL;
- HANDLE result = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM) hContact, 0);
- return (result == (HANDLE)CALLSERVICE_NOTFOUND) ? NULL : result;
+ HCONTACT result = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ return (result == (HCONTACT)CALLSERVICE_NOTFOUND) ? NULL : result;
}
} /* namespace MetaContact */
@@ -76,7 +76,7 @@ namespace Contact { * @return Returns the display name of a contact.
**/
-LPTSTR DisplayName(HANDLE hContact)
+LPTSTR DisplayName(HCONTACT hContact)
{
return pcli->pfnGetContactDisplayName(hContact, 0);
}
@@ -87,7 +87,7 @@ LPTSTR DisplayName(HANDLE hContact) * @return This function returns the basic protocol of a contact.
**/
-LPSTR Proto(HANDLE hContact)
+LPSTR Proto(HCONTACT hContact)
{
if (hContact) {
INT_PTR result;
@@ -112,16 +112,16 @@ INT_PTR GetCount() * Simply adds a new contact without setting up any protocol or something else
* @return HANDLE The function returns the HANDLE of the new contact
**/
-HANDLE Add()
+HCONTACT Add()
{
- return (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ return (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
}
/**
* This function deletes a contact from the database.
* @param hContact - handle to the contact
**/
-BYTE Delete(HANDLE hContact)
+BYTE Delete(HCONTACT hContact)
{
return CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0) != 0;
}
@@ -159,7 +159,7 @@ namespace Module { * return: nothing
**/
-void Delete(HANDLE hContact, LPCSTR pszModule)
+void Delete(HCONTACT hContact, LPCSTR pszModule)
{
CEnumList Settings;
if (!Settings.EnumSettings(hContact, pszModule))
@@ -187,7 +187,7 @@ static int IsEmptyEnumProc(LPCSTR pszSetting, LPARAM lParam) * @retval FALSE - the module contains settings
**/
-bool IsEmpty(HANDLE hContact, LPCSTR pszModule)
+bool IsEmpty(HCONTACT hContact, LPCSTR pszModule)
{
DBCONTACTENUMSETTINGS dbces = { 0 };
dbces.pfnEnumProc = IsEmptyEnumProc;
@@ -236,7 +236,7 @@ namespace Setting { * @retval 1 - error
**/
-BYTE Get(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
+BYTE Get(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
{
// read value without translation to specific type
BYTE result = db_get_s(hContact, pszModule, pszSetting, dbv, 0) != 0;
@@ -256,7 +256,7 @@ BYTE Get(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, c * @return string value
**/
-LPSTR GetAString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting)
+LPSTR GetAString(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting)
{
DBVARIANT dbv;
if (GetAString(hContact, pszModule, pszSetting, &dbv) == 0){
@@ -277,7 +277,7 @@ LPSTR GetAString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting) * @return string value
**/
-LPWSTR GetWString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting)
+LPWSTR GetWString(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting)
{
DBVARIANT dbv;
if (GetWString(hContact, pszModule, pszSetting, &dbv) == 0) {
@@ -302,7 +302,7 @@ LPWSTR GetWString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting) * @retval 1 - error
**/
-BYTE GetEx(HANDLE hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
+BYTE GetEx(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
{
BYTE result = !pszModule || Get(hContact, pszModule, pszSetting, dbv, destType);
// try to read setting from the contact's protocol module
@@ -311,13 +311,12 @@ BYTE GetEx(HANDLE hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting // try to get setting from a metasubcontact
if (result && DB::Module::IsMetaAndScan(pszProto)) {
const INT_PTR def = DB::MetaContact::SubDefNum(hContact);
- HANDLE hSubContact;
+ HCONTACT hSubContact;
// try to get setting from the default subcontact first
if (def > -1 && def < INT_MAX) {
hSubContact = DB::MetaContact::Sub(hContact, def);
- if (hSubContact != NULL) {
+ if (hSubContact != NULL)
result = DB::Setting::GetEx(hSubContact, pszModule, DB::Contact::Proto(hSubContact), pszSetting, dbv, destType) != 0;
- }
}
// scan all subcontacts for the setting
if (result) {
@@ -348,7 +347,7 @@ BYTE GetEx(HANDLE hContact, LPCSTR pszModule, LPCSTR pszProto, LPCSTR pszSetting * @return This function returns the WORD which contains the source of information.
**/
-WORD GetCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
+WORD GetCtrl(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR pszProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE destType)
{
WORD wFlags = 0;
@@ -367,7 +366,7 @@ WORD GetCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR pszP // try to read the setting from the sub contacts' modules
else if (DB::Module::IsMetaAndScan(pszProto)) {
const INT_PTR def = DB::MetaContact::SubDefNum(hContact);
- HANDLE hSubContact;
+ HCONTACT hSubContact;
// try to get setting from the default subcontact first
if (def > -1 && def < INT_MAX) {
hSubContact = DB::MetaContact::Sub(hContact, def);
@@ -410,7 +409,7 @@ WORD GetCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSubModule, LPCSTR pszP * @retval FALSE - setting does not exist
**/
-BYTE Exists(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting)
+BYTE Exists(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting)
{
if (pszModule && pszSetting) {
CHAR szDummy[1];
@@ -429,7 +428,7 @@ BYTE Exists(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting) * @return nothing
**/
-void DeleteArray(HANDLE hContact, LPCSTR pszModule, LPCSTR pszFormat, int iStart)
+void DeleteArray(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszFormat, int iStart)
{
CHAR pszSetting[MAXSETTING];
do {
@@ -703,7 +702,7 @@ static FORCEINLINE bool IsEqual(const DBEVENTINFO *d1, const DBEVENTINFO *d2, bo *
**/
-bool Exists(HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
+bool Exists(HCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
{
bool result = false;
DBEVENTINFO edbei;
@@ -827,7 +826,7 @@ INT_PTR CEnumList::EnumModules() * @retval 0 - success
**/
-INT_PTR CEnumList::EnumSettings(HANDLE hContact, LPCSTR pszModule)
+INT_PTR CEnumList::EnumSettings(HCONTACT hContact, LPCSTR pszModule)
{
DBCONTACTENUMSETTINGS dbces = { 0 };
dbces.pfnEnumProc = (DBSETTINGENUMPROC)CEnumList::EnumSettingsProc;
diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h index 27424857fb..2732d6e6f8 100644 --- a/plugins/UserInfoEx/src/mir_db.h +++ b/plugins/UserInfoEx/src/mir_db.h @@ -24,12 +24,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. namespace DB {
namespace MetaContact{
- INT_PTR SubCount(HANDLE hMetaContact);
- INT_PTR SubDefNum(HANDLE hMetaContact);
- HANDLE Sub(HANDLE hMetaContact, int idx);
+ INT_PTR SubCount(HCONTACT hMetaContact);
+ INT_PTR SubDefNum(HCONTACT hMetaContact);
+ HCONTACT Sub(HCONTACT hMetaContact, int idx);
- bool IsSub(HANDLE hContact);
- HANDLE GetMeta(HANDLE hContact);
+ bool IsSub(HCONTACT hContact);
+ HCONTACT GetMeta(HCONTACT hContact);
} /* namespace MetaContact */
/**
@@ -37,21 +37,21 @@ namespace MetaContact{ * or modify contacts in the database.
**/
namespace Contact {
- LPTSTR DisplayName(HANDLE hContact);
- LPSTR Proto(HANDLE hContact);
+ LPTSTR DisplayName(HCONTACT hContact);
+ LPSTR Proto(HCONTACT hContact);
INT_PTR GetCount();
- HANDLE Add();
- BYTE Delete(HANDLE hContact);
+ HCONTACT Add();
+ BYTE Delete(HCONTACT hContact);
DWORD WhenAdded(DWORD dwUIN, LPCSTR szBaseProto);
} /* namespace Contact */
namespace Module {
- void Delete(HANDLE hContact, LPCSTR pszModule);
- bool IsEmpty(HANDLE hContact, LPCSTR pszModule);
+ void Delete(HCONTACT hContact, LPCSTR pszModule);
+ bool IsEmpty(HCONTACT hContact, LPCSTR pszModule);
bool IsMeta(LPCSTR pszModule);
bool IsMetaAndScan(LPCSTR pszModule);
@@ -62,38 +62,38 @@ namespace Module { **/
namespace Setting {
- BYTE Get(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
- static FORCEINLINE BYTE GetAsIs(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ BYTE Get(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
+ static FORCEINLINE BYTE GetAsIs(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, 0); }
- static FORCEINLINE BYTE GetAString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ static FORCEINLINE BYTE GetAString(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_ASCIIZ); }
- LPSTR GetAString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
- static FORCEINLINE BYTE GetWString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ LPSTR GetAString(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ static FORCEINLINE BYTE GetWString(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_WCHAR); }
- LPWSTR GetWString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
- static FORCEINLINE BYTE GetUString(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
+ LPWSTR GetWString(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ static FORCEINLINE BYTE GetUString(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting, DBVARIANT *dbv)
{ return Get(hContact, pszModule, pszSetting, dbv, DBVT_UTF8); }
- BYTE GetEx(HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
- static FORCEINLINE BYTE GetAsIsEx(HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ BYTE GetEx(HCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
+ static FORCEINLINE BYTE GetAsIsEx(HCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetEx(hContact, pszModule, szProto, pszSetting, dbv, 0); }
- static FORCEINLINE LPSTR GetAStringEx(HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
+ static FORCEINLINE LPSTR GetAStringEx(HCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
{ DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_ASCIIZ) && dbv.type == DBVT_ASCIIZ) ? dbv.pszVal : NULL; }
- static FORCEINLINE LPWSTR GetWStringEx(HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
+ static FORCEINLINE LPWSTR GetWStringEx(HCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
{ DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_WCHAR) && dbv.type == DBVT_WCHAR) ? dbv.pwszVal : NULL; }
- static FORCEINLINE LPSTR GetUStringEx(HANDLE hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
+ static FORCEINLINE LPSTR GetUStringEx(HCONTACT hContact, LPCSTR pszModule, LPCSTR szProto, LPCSTR pszSetting)
{ DBVARIANT dbv; return (!GetEx(hContact, pszModule, szProto, pszSetting, &dbv, DBVT_UTF8) && dbv.type == DBVT_UTF8) ? dbv.pszVal : NULL; }
- WORD GetCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
- static FORCEINLINE WORD GetAsIsCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ WORD GetCtrl(HCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv, const BYTE nType);
+ static FORCEINLINE WORD GetAsIsCtrl(HCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, 0); }
- static FORCEINLINE WORD GetAStringCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ static FORCEINLINE WORD GetAStringCtrl(HCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_ASCIIZ); }
- static FORCEINLINE WORD GetWStringCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ static FORCEINLINE WORD GetWStringCtrl(HCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_WCHAR); }
- static FORCEINLINE WORD GetUStringCtrl(HANDLE hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
+ static FORCEINLINE WORD GetUStringCtrl(HCONTACT hContact, LPCSTR pszModule, LPCSTR szSubModule, LPCSTR szProto, LPCSTR pszSetting, DBVARIANT *dbv)
{ return GetCtrl(hContact, pszModule, szSubModule, szProto, pszSetting, dbv, DBVT_UTF8); }
#define GetTString GetWString
@@ -104,8 +104,8 @@ namespace Setting { /**
* misc operations
**/
- BYTE Exists(HANDLE hContact, LPCSTR pszModule, LPCSTR pszSetting);
- void DeleteArray(HANDLE hContact, LPCSTR pszModule, LPCSTR pszFormat, int iStart);
+ BYTE Exists(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
+ void DeleteArray(HCONTACT hContact, LPCSTR pszModule, LPCSTR pszFormat, int iStart);
} /* namespace Setting */
@@ -115,11 +115,11 @@ namespace Variant { } /* namespace Variant */
namespace Event {
- HANDLE FindLast(HANDLE hContact);
+ HANDLE FindLast(HCONTACT hContact);
bool GetInfo(HANDLE hEvent, DBEVENTINFO *dbei);
bool GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei);
DWORD GetTime(HANDLE hEvent);
- bool Exists(HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei);
+ bool Exists(HCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei);
} /* namespace Events */
/**
@@ -140,7 +140,7 @@ public: LPSTR Insert(LPCSTR str);
INT_PTR EnumModules();
- INT_PTR EnumSettings(HANDLE hContact, LPCSTR pszModule);
+ INT_PTR EnumSettings(HCONTACT hContact, LPCSTR pszModule);
};
} /* namespace DB */
\ No newline at end of file diff --git a/plugins/UserInfoEx/src/psp_base.cpp b/plugins/UserInfoEx/src/psp_base.cpp index ebdf9e1e96..77ec44c285 100644 --- a/plugins/UserInfoEx/src/psp_base.cpp +++ b/plugins/UserInfoEx/src/psp_base.cpp @@ -56,46 +56,40 @@ INT_PTR CALLBACK PSPBaseProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) return pCtrlList->OnSetTextColour((HWND)lParam, (HDC)wParam);
case WM_NOTIFY:
- {
- switch (((LPNMHDR)lParam)->idFrom) {
- case 0: {
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
- LPSTR pszProto;
-
- switch (((LPNMHDR)lParam)->code) {
- case PSN_RESET: {
- pCtrlList->OnReset();
- } break;
-
- case PSN_INFOCHANGED: {
- if (PSGetBaseProto(hDlg, pszProto) && *pszProto) {
- BOOL bChanged = (GetWindowLongPtr(hDlg, DWLP_MSGRESULT)&PSP_CHANGED)|pCtrlList->OnInfoChanged(hContact, pszProto);
- SetWindowLongPtr(hDlg, DWLP_MSGRESULT, bChanged ? PSP_CHANGED : 0);
- }
- } break;
-
- case PSN_APPLY: {
- if (PSGetBaseProto(hDlg, pszProto) && *pszProto) {
- pCtrlList->OnApply(hContact, pszProto);
- }
- } break;
- }
- } break;
+ switch (((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
+ LPSTR pszProto;
+
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_RESET:
+ pCtrlList->OnReset();
+ break;
+
+ case PSN_INFOCHANGED:
+ if (PSGetBaseProto(hDlg, pszProto) && *pszProto) {
+ BOOL bChanged = (GetWindowLongPtr(hDlg, DWLP_MSGRESULT)&PSP_CHANGED) | pCtrlList->OnInfoChanged(hContact, pszProto);
+ SetWindowLongPtr(hDlg, DWLP_MSGRESULT, bChanged ? PSP_CHANGED : 0);
+ }
+ break;
+
+ case PSN_APPLY:
+ if (PSGetBaseProto(hDlg, pszProto) && *pszProto)
+ pCtrlList->OnApply(hContact, pszProto);
+ break;
}
- } break;
+ break;
+ }
+ break;
case WM_COMMAND:
- {
- if (!PspIsLocked(hDlg)) {
- pCtrlList->OnChangedByUser(LOWORD(wParam), HIWORD(wParam));
- }
- } break;
+ if (!PspIsLocked(hDlg))
+ pCtrlList->OnChangedByUser(LOWORD(wParam), HIWORD(wParam));
+ break;
case WM_DESTROY:
- {
- // destroy all control objects and the list
- pCtrlList->Release();
- }
+ // destroy all control objects and the list
+ pCtrlList->Release();
}
}
return 0;
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp index 09f0604ba3..b71f809b49 100644 --- a/plugins/UserInfoEx/src/psp_contact.cpp +++ b/plugins/UserInfoEx/src/psp_contact.cpp @@ -41,7 +41,7 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM if (pCtrlList)
{
TCHAR szAddr[MAX_PATH];
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
LPIDSTRLIST pList;
UINT nList;
@@ -74,7 +74,7 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM {
case 0:
{
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
LPCSTR pszProto;
HWND hCtrl;
@@ -196,7 +196,7 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM if (pCtrlList)
{
TCHAR szAddr[MAX_PATH];
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
LPIDSTRLIST pList;
UINT nList;
@@ -227,7 +227,7 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM {
case 0:
{
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
LPCSTR pszProto;
HWND hCtrl;
diff --git a/plugins/UserInfoEx/src/psp_general.cpp b/plugins/UserInfoEx/src/psp_general.cpp index 896b016c1c..d881f8b812 100644 --- a/plugins/UserInfoEx/src/psp_general.cpp +++ b/plugins/UserInfoEx/src/psp_general.cpp @@ -77,7 +77,7 @@ INT_PTR CALLBACK PSPProcGeneral(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar {
case 0:
{
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
char* pszProto;
switch (((LPNMHDR)lParam)->code)
@@ -149,7 +149,7 @@ INT_PTR CALLBACK PSPProcGeneral(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case WM_COMMAND:
{
- HANDLE hContact;
+ HCONTACT hContact;
LPCSTR pszProto;
switch (LOWORD(wParam))
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 300eaf9d27..49626f63e7 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -488,7 +488,7 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam LPGENT("This will delete all settings, you've made!\nAll TreeView settings, window positions and any other settings!\n\nAre you sure to procceed?"));
if (WantReset) {
- HANDLE hContact;
+ HCONTACT hContact;
DB::CEnumList Settings;
// delete all skin icons
@@ -706,7 +706,7 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam if (bOld != bNew) {
//keep the database clean
MAnnivDate mdb;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
DBWriteComboByte(hDlg, EDIT_BIRTHMODULE, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE);
//walk through all the contacts stored in the DB
for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
diff --git a/plugins/UserInfoEx/src/psp_origin.cpp b/plugins/UserInfoEx/src/psp_origin.cpp index 979a574747..6b337a4d5c 100644 --- a/plugins/UserInfoEx/src/psp_origin.cpp +++ b/plugins/UserInfoEx/src/psp_origin.cpp @@ -72,7 +72,7 @@ INT_PTR CALLBACK PSPProcOrigin(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara {
case 0:
{
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY) lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
LPCSTR pszProto;
switch (((LPNMHDR) lParam)->code)
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index f0e2084f16..098fc8ad72 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -278,7 +278,7 @@ static HWND ProfileList_BeginLabelEdit(LPLISTCTRL pList, int iItem, int iSubItem {
LVITEM lvi;
LPLCITEM pItem;
- HANDLE hContact;
+ HCONTACT hContact;
RECT rcList;
if (!PtrIsValid(pList))
@@ -431,7 +431,7 @@ static BYTE ProfileList_AddNewItem(HWND hDlg, LPLISTCTRL pList, const PROFILEENT {
LPLCITEM pItem;
LVITEM lvi;
- HANDLE hContact;
+ HCONTACT hContact;
if (PtrIsValid(pList) && (pItem = (LPLCITEM)mir_alloc(sizeof(LCITEM)))) {
PSGetContact(hDlg, hContact);
@@ -478,7 +478,7 @@ static int ProfileList_AddItemlistFromDB( int &iItem,
LPIDSTRLIST idList,
UINT nList,
- HANDLE hContact,
+ HCONTACT hContact,
LPCSTR pszModule,
LPCSTR szCatFormat,
LPCSTR szValFormat,
@@ -1113,7 +1113,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR switch (((LPNMHDR)lParam)->idFrom) {
case 0:
{
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
LPCSTR pszProto;
if (!PtrIsValid(pList = (LPLISTCTRL)GetUserData(hList)))
@@ -1144,11 +1144,11 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR // scan all basic protocols for the subcontacts
if (DB::Module::IsMetaAndScan(pszProto)) {
int iDefault = CallService(MS_MC_GETDEFAULTCONTACTNUM, (WPARAM)hContact, NULL);
- HANDLE hSubContact, hDefContact;
+ HCONTACT hSubContact, hDefContact;
LPCSTR pszSubBaseProto;
int j, numSubs;
- if ((hDefContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, iDefault)) &&
+ if ((hDefContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, iDefault)) &&
(pszSubBaseProto = DB::Contact::Proto(hDefContact)))
{
if ((numProtoItems += ProfileList_AddItemlistFromDB(pList, iItem, idList, nList, hDefContact, pszSubBaseProto, pFmt[i].szCatFmt, pFmt[i].szValFmt, CTRLF_HASMETA|CTRLF_HASPROTO)) < 0)
@@ -1158,7 +1158,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR numSubs = CallService(MS_MC_GETNUMCONTACTS, (WPARAM)hContact, NULL);
for (j = 0; j < numSubs; j++) {
if (j == iDefault) continue;
- if (!(hSubContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, j))) continue;
+ if (!(hSubContact = (HCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, j))) continue;
if (!(pszSubBaseProto = DB::Contact::Proto(hSubContact))) continue;
if ((numProtoItems += ProfileList_AddItemlistFromDB(pList, iItem, idList, nList, hSubContact, pszSubBaseProto, pFmt[i].szCatFmt, pFmt[i].szValFmt, CTRLF_HASMETA|CTRLF_HASPROTO)) < 0)
return FALSE;
@@ -1270,7 +1270,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR {
HMENU hMenu = CreatePopupMenu();
MENUITEMINFO mii;
- HANDLE hContact;
+ HCONTACT hContact;
LVHITTESTINFO hi;
LPLCITEM pItem;
POINT pt;
diff --git a/plugins/UserInfoEx/src/svc_avatar.cpp b/plugins/UserInfoEx/src/svc_avatar.cpp index abccecb80e..38b3897a43 100644 --- a/plugins/UserInfoEx/src/svc_avatar.cpp +++ b/plugins/UserInfoEx/src/svc_avatar.cpp @@ -50,7 +50,7 @@ namespace NServices *
*
**/
- static void SetZodiacAvatar(HANDLE hContact)
+ static void SetZodiacAvatar(HCONTACT hContact)
{
MAnnivDate mtb;
@@ -76,7 +76,7 @@ namespace NServices }
}
- void DeleteAvatar(HANDLE hContact)
+ void DeleteAvatar(HCONTACT hContact)
{
if (hContact && db_get_b(hContact, "ContactPhoto", "IsZodiac", FALSE))
{
@@ -94,7 +94,7 @@ namespace NServices *
*
**/
- static int OnAvatarChanged(HANDLE hContact, AVATARCACHEENTRY *ace)
+ static int OnAvatarChanged(HCONTACT hContact, AVATARCACHEENTRY *ace)
{
if (hContact)
{
@@ -127,7 +127,7 @@ namespace NServices **/
void Enable(BYTE bEnable)
{
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
if (bEnable && !ghChangedHook)
diff --git a/plugins/UserInfoEx/src/svc_contactinfo.cpp b/plugins/UserInfoEx/src/svc_contactinfo.cpp index 0c39d10aec..1743477c89 100644 --- a/plugins/UserInfoEx/src/svc_contactinfo.cpp +++ b/plugins/UserInfoEx/src/svc_contactinfo.cpp @@ -705,7 +705,7 @@ INT_PTR GetContactInfo(WPARAM wParam, LPARAM lParam) static INT_PTR GetContactSettingStrExService(WPARAM wParam, LPARAM lParam)
{
DBCONTACTGETSETTING *cgs = (DBCONTACTGETSETTING*)lParam;
- return DB::Setting::GetEx((HANDLE)wParam, USERINFO,
+ return DB::Setting::GetEx((HCONTACT)wParam, USERINFO,
cgs->szModule, cgs->szSetting, cgs->pValue, cgs->pValue->type);
}
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index 9fae47b727..40bbf256cc 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -39,7 +39,7 @@ bool g_eiEmail = false; * @retval NULL, if contact does not provide any email address
**/
-static LPSTR Get(HANDLE hContact)
+static LPSTR Get(HCONTACT hContact)
{
// ignore owner
if (hContact != NULL) {
@@ -84,7 +84,7 @@ static INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam) __try
{
- val = Get((HANDLE) wParam);
+ val = Get((HCONTACT)wParam);
if (val) {
LPSTR szUrl;
INT_PTR len;
@@ -126,8 +126,8 @@ static INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam) static int OnCListApplyIcons(WPARAM wParam, LPARAM lParam)
{
- LPSTR val = Get((HANDLE)wParam);
- ExtraIcon_SetIcon(ghExtraIconSvc, (HANDLE)wParam, (val) ? ICO_BTN_EMAIL: 0);
+ LPSTR val = Get((HCONTACT)wParam);
+ ExtraIcon_SetIcon(ghExtraIconSvc, (HCONTACT)wParam, (val) ? ICO_BTN_EMAIL : 0);
mir_free(val);
return 0;
}
@@ -139,7 +139,7 @@ static int OnCListApplyIcons(WPARAM wParam, LPARAM lParam) * @param lParam - (DBCONTACTWRITESETTING*)pdbcws
**/
-static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcws)
+static int OnContactSettingChanged(HCONTACT hContact, DBCONTACTWRITESETTING* pdbcws)
{
if (hContact && pdbcws && pdbcws->szSetting &&
((pdbcws->value.type & DBVTF_VARIABLELENGTH) || (pdbcws->value.type == DBVT_DELETED)) &&
@@ -163,7 +163,7 @@ static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw static int OnPreBuildMenu(WPARAM wParam, LPARAM lParam)
{
- LPSTR val = Get((HANDLE)wParam);
+ LPSTR val = Get((HCONTACT)wParam);
Menu_ShowItem(ghMenuItem, val != NULL);
mir_free(val);
return 0;
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp index 75ddfdf09f..26a26d7aa7 100644 --- a/plugins/UserInfoEx/src/svc_gender.cpp +++ b/plugins/UserInfoEx/src/svc_gender.cpp @@ -30,7 +30,7 @@ static HANDLE hApplyIconHook = NULL; bool g_eiGender = false;
-BYTE GenderOf(HANDLE hContact, LPCSTR pszProto)
+BYTE GenderOf(HCONTACT hContact, LPCSTR pszProto)
{
DBVARIANT dbv;
if (DB::Setting::GetAsIsEx(hContact, USERINFO, pszProto, SET_CONTACT_GENDER, &dbv) == 0) {
@@ -53,7 +53,7 @@ BYTE GenderOf(HANDLE hContact, LPCSTR pszProto) * @retval 0 - contact does not provide its gender
**/
-BYTE GenderOf(HANDLE hContact)
+BYTE GenderOf(HCONTACT hContact)
{
return GenderOf(hContact, DB::Contact::Proto(hContact));
}
@@ -69,7 +69,7 @@ BYTE GenderOf(HANDLE hContact) * @param lParam - not used
**/
-static int OnCListApplyIcons(HANDLE hContact, LPARAM)
+static int OnCListApplyIcons(HCONTACT hContact, LPARAM)
{
if (ghExtraIconSvc != INVALID_HANDLE_VALUE) {
char *icoName;
@@ -90,7 +90,7 @@ static int OnCListApplyIcons(HANDLE hContact, LPARAM) * @param lParam - (DBCONTACTWRITESETTING*)pdbcws
**/
-static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcws)
+static int OnContactSettingChanged(HCONTACT hContact, DBCONTACTWRITESETTING* pdbcws)
{
if (hContact && pdbcws && (pdbcws->value.type <= DBVT_BYTE) && !lstrcmpA(pdbcws->szSetting, SET_CONTACT_GENDER))
OnCListApplyIcons(hContact, 0);
diff --git a/plugins/UserInfoEx/src/svc_gender.h b/plugins/UserInfoEx/src/svc_gender.h index 8c7c892ccf..1e90820b95 100644 --- a/plugins/UserInfoEx/src/svc_gender.h +++ b/plugins/UserInfoEx/src/svc_gender.h @@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _UINFOEX_SVCGENDER_H_INCLUDED_
#define _UINFOEX_SVCGENDER_H_INCLUDED_
-BYTE GenderOf(HANDLE hContact, LPCSTR pszProto);
-BYTE GenderOf(HANDLE hContact);
+BYTE GenderOf(HCONTACT hContact, LPCSTR pszProto);
+BYTE GenderOf(HCONTACT hContact);
bool SvcGenderEnableExtraIcons(bool bEnable = false, bool bUpdateDB = false);
void SvcGenderUnloadModule();
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp index abc25bfdce..2845570486 100644 --- a/plugins/UserInfoEx/src/svc_homepage.cpp +++ b/plugins/UserInfoEx/src/svc_homepage.cpp @@ -39,7 +39,7 @@ bool g_eiHome = false; * @retval NULL if contact provides no homepage
**/
-static LPSTR Get(HANDLE hContact)
+static LPSTR Get(HCONTACT hContact)
{
// ignore owner
if (hContact != NULL) {
@@ -68,7 +68,7 @@ static LPSTR Get(HANDLE hContact) static INT_PTR MenuCommand(WPARAM wParam, LPARAM lParam)
{
- LPSTR szUrl = Get((HANDLE)wParam);
+ LPSTR szUrl = Get((HCONTACT)wParam);
if (szUrl) {
CallService(MS_UTILS_OPENURL, 1, (LPARAM)szUrl);
mir_free(szUrl);
@@ -89,7 +89,7 @@ static INT_PTR MenuCommand(WPARAM wParam, LPARAM lParam) * @param lParam - not used
**/
-static int OnCListApplyIcons(HANDLE hContact, LPARAM)
+static int OnCListApplyIcons(HCONTACT hContact, LPARAM)
{
LPSTR val = Get(hContact);
if (ghExtraIconSvc != INVALID_HANDLE_VALUE)
@@ -105,7 +105,7 @@ static int OnCListApplyIcons(HANDLE hContact, LPARAM) * @param lParam - (DBCONTACTWRITESETTING*)pdbcws
**/
-static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcws)
+static int OnContactSettingChanged(HCONTACT hContact, DBCONTACTWRITESETTING* pdbcws)
{
if (hContact && pdbcws && pdbcws->szSetting &&
((pdbcws->value.type & DBVTF_VARIABLELENGTH) || (pdbcws->value.type == DBVT_DELETED)) &&
@@ -127,7 +127,7 @@ static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw static int OnPreBuildMenu(WPARAM wParam, LPARAM lParam)
{
- LPSTR val = Get((HANDLE)wParam);
+ LPSTR val = Get((HCONTACT)wParam);
Menu_ShowItem(ghMenuItem, val != 0);
mir_free(val);
return 0;
diff --git a/plugins/UserInfoEx/src/svc_phone.cpp b/plugins/UserInfoEx/src/svc_phone.cpp index 258cde98c1..6a510f28c3 100644 --- a/plugins/UserInfoEx/src/svc_phone.cpp +++ b/plugins/UserInfoEx/src/svc_phone.cpp @@ -47,7 +47,7 @@ bool g_eiPhone = false; * @retval PHONE_NONE: The contact does not provide any phone number
**/
-static INT_PTR Get(HANDLE hContact)
+static INT_PTR Get(HCONTACT hContact)
{
INT_PTR nType = PHONE_NONE;
@@ -86,7 +86,7 @@ static INT_PTR Get(HANDLE hContact) * @param lParam - not used
**/
-static int OnCListApplyIcons(HANDLE hContact, LPARAM)
+static int OnCListApplyIcons(HCONTACT hContact, LPARAM)
{
char *icoName;
switch (Get(hContact)) {
@@ -105,7 +105,7 @@ static int OnCListApplyIcons(HANDLE hContact, LPARAM) * @param lParam - (DBCONTACTWRITESETTING*)pdbcws
**/
-static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcws)
+static int OnContactSettingChanged(HCONTACT hContact, DBCONTACTWRITESETTING* pdbcws)
{
if (hContact && pdbcws && pdbcws->szSetting &&
((pdbcws->value.type & DBVTF_VARIABLELENGTH) || (pdbcws->value.type == DBVT_DELETED)) &&
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index 0b83a036cb..4d2715dc39 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -485,7 +485,7 @@ class CContactUpdater : public CContactQueue {
CUpdProgress* _pProgress; // pointer to the progress dialog/popup
HANDLE _hProtoAckEvent; // handle to protocol ack notification
- HANDLE _hContact; // current contact being refreshed
+ HCONTACT _hContact; // current contact being refreshed
PBYTE _hContactAcks; // array of acknoledgements for the current contact to wait for
INT_PTR _nContactAcks; // number of acknoledgements for the current contact to wait for
@@ -627,7 +627,7 @@ class CContactUpdater : public CContactQueue *
* @return nothing
**/
- virtual void Callback(HANDLE hContact, PVOID param)
+ virtual void Callback(HCONTACT hContact, PVOID param)
{
LPSTR pszProto = DB::Contact::Proto(hContact);
@@ -687,7 +687,7 @@ public: *
*
**/
- BOOL QueueAddRefreshContact(HANDLE hContact, int iWait)
+ BOOL QueueAddRefreshContact(HCONTACT hContact, int iWait)
{
LPSTR pszProto = DB::Contact::Proto(hContact);
@@ -708,7 +708,7 @@ public: {
int iWait = 100;
- for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
if (QueueAddRefreshContact(hContact, iWait))
iWait += 5000;
@@ -840,13 +840,13 @@ static int OnContactAdded(WPARAM wParam, LPARAM lParam) {
try
{
- DWORD dwStmp = db_get_dw((HANDLE)wParam, USERINFO, SET_CONTACT_ADDEDTIME, 0);
+ DWORD dwStmp = db_get_dw((HCONTACT)wParam, USERINFO, SET_CONTACT_ADDEDTIME, 0);
if (!dwStmp)
{
MTime mt;
mt.GetLocalTime();
- mt.DBWriteStamp((HANDLE)wParam, USERINFO, SET_CONTACT_ADDEDTIME);
+ mt.DBWriteStamp((HCONTACT)wParam, USERINFO, SET_CONTACT_ADDEDTIME);
// create updater, if not yet exists
if (!ContactUpdater)
@@ -858,8 +858,7 @@ static int OnContactAdded(WPARAM wParam, LPARAM lParam) ContactUpdater->AddIfDontHave(
(ContactUpdater->Size() > 0)
? max(ContactUpdater->Get(ContactUpdater->Size() - 1)->check_time + 15000, 4000)
- : 4000,
- (HANDLE)wParam);
+ : 4000, (HCONTACT)wParam);
}
}
catch(...)
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index e0dd88f83e..235694e451 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -173,7 +173,7 @@ static HICON GetAnnivIcon(const CEvent &evt) * @return nothing
**/
-static void NotifyWithExtraIcon(HANDLE hContact, const CEvent &evt)
+static void NotifyWithExtraIcon(HCONTACT hContact, const CEvent &evt)
{
if (gRemindOpts.bCListExtraIcon) {
char szIcon[MAXSETTING], *icoName;
@@ -244,7 +244,7 @@ static LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA * @return return value of the popup service
**/
-static int NotifyWithPopup(HANDLE hContact, CEvent::EType eventType, int DaysToAnniv, LPCTSTR pszDesc, LPCTSTR pszMsg)
+static int NotifyWithPopup(HCONTACT hContact, CEvent::EType eventType, int DaysToAnniv, LPCTSTR pszDesc, LPCTSTR pszMsg)
{
if (!gRemindOpts.bPopups)
return 1;
@@ -304,7 +304,7 @@ static int NotifyWithPopup(HANDLE hContact, CEvent::EType eventType, int DaysToA * @return nothing
**/
-static void NotifyFlashCListIcon(HANDLE hContact, const CEvent &evt)
+static void NotifyFlashCListIcon(HCONTACT hContact, const CEvent &evt)
{
if (!gRemindOpts.bFlashCList || evt._wDaysLeft != 0)
return;
@@ -369,7 +369,7 @@ static BYTE NotifyWithSound(const CEvent &evt) * "check for anniversary" functions
***********************************************************************************************************/
-static LPCTSTR ContactGender(HANDLE hContact)
+static LPCTSTR ContactGender(HCONTACT hContact)
{
switch (GenderOf(hContact)) {
case 'M': return TranslateT("He");
@@ -378,7 +378,7 @@ static LPCTSTR ContactGender(HANDLE hContact) return TranslateT("He/She");
}
-static BYTE CheckAnniversaries(HANDLE hContact, MTime &Now, CEvent &evt, BYTE bNotify)
+static BYTE CheckAnniversaries(HCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotify)
{
int numAnniversaries = 0;
int Diff;
@@ -466,7 +466,7 @@ static BYTE CheckAnniversaries(HANDLE hContact, MTime &Now, CEvent &evt, BYTE bN * @retval FALSE - contact has no birthday or it is not within the desired period of time.
**/
-static BYTE CheckBirthday(HANDLE hContact, MTime &Now, CEvent &evt, BYTE bNotify, PWORD LastAnwer)
+static BYTE CheckBirthday(HCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotify, PWORD LastAnwer)
{
BYTE result = FALSE;
@@ -534,7 +534,7 @@ static BYTE CheckBirthday(HANDLE hContact, MTime &Now, CEvent &evt, BYTE bNotify * @return nothing
**/
-static void CheckContact(HANDLE hContact, MTime &Now, CEvent &evt, BYTE bNotify, PWORD LastAnwer = 0)
+static void CheckContact(HCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotify, PWORD LastAnwer = 0)
{
// ignore meta subcontacts here as their birthday information are collected explicitly
if (hContact &&
@@ -570,7 +570,7 @@ void SvcReminderCheckAll(const ENotify notify) now.GetLocalTime();
//walk through all the contacts stored in the DB
- for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
CheckContact(hContact, now, evt, notify != NOTIFY_CLIST, &a1);
if (notify != NOTIFY_CLIST) {
@@ -623,7 +623,7 @@ static int OnCListRebuildIcons(WPARAM, LPARAM) * @return This function must return 0 in order to continue in the notification chain.
**/
-int OnCListApplyIcon(HANDLE hContact, LPARAM)
+int OnCListApplyIcon(HCONTACT hContact, LPARAM)
{
if (gRemindOpts.RemindState != REMIND_OFF) {
CEvent evt;
@@ -645,7 +645,7 @@ int OnCListApplyIcon(HANDLE hContact, LPARAM) * @return This function must return 0 in order to continue in the notification chain.
**/
-static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcws)
+static int OnContactSettingChanged(HCONTACT hContact, DBCONTACTWRITESETTING* pdbcws)
{
if (hContact && // valid contact not owner!
ghCListIA && // extraicons active
@@ -656,7 +656,7 @@ static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw !strncmp(pdbcws->szSetting, "Anniv", 5) ||
!strncmp(pdbcws->szSetting, "DOB", 3)))
{
- HANDLE hMeta = DB::MetaContact::GetMeta(hContact);
+ HCONTACT hMeta = DB::MetaContact::GetMeta(hContact);
WORD LastAnswer = IDNONE;
CEvent evt;
MTime now;
@@ -727,7 +727,7 @@ static INT_PTR CheckService(WPARAM, LPARAM) static INT_PTR BackupBirthdayService(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
MAnnivDate mdb;
if (hContact) {
@@ -872,7 +872,7 @@ void SvcReminderEnable(BYTE bEnable) UpdateTimer(TRUE);
}
else { // Reminder is off
- for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
NotifyWithExtraIcon(hContact, CEvent());
gRemindOpts.RemindState = REMIND_OFF;
diff --git a/plugins/UserInfoEx/src/svc_timezone.cpp b/plugins/UserInfoEx/src/svc_timezone.cpp index 37f0a89d11..777a12e2a8 100644 --- a/plugins/UserInfoEx/src/svc_timezone.cpp +++ b/plugins/UserInfoEx/src/svc_timezone.cpp @@ -41,7 +41,7 @@ INT_PTR GetContactTimeZoneInformation(WPARAM wParam,LPARAM lParam) {
//use new core tz interface
LPTIME_ZONE_INFORMATION pTimeZoneInformation = (LPTIME_ZONE_INFORMATION)lParam;
- (*pTimeZoneInformation) = *tmi.getTzi(tmi.createByContact((HANDLE)wParam, 0));
+ (*pTimeZoneInformation) = *tmi.getTzi(tmi.createByContact((HCONTACT)wParam, 0));
return (pTimeZoneInformation == NULL);
}
@@ -58,7 +58,7 @@ INT_PTR GetContactLocalTime(WPARAM wParam, LPARAM lParam) {
//use new core tz interface
LPSYSTEMTIME pSystemTime = (LPSYSTEMTIME)lParam;
- return (INT_PTR)tmi.getTimeZoneTimeByContact((HANDLE)wParam, pSystemTime);
+ return (INT_PTR)tmi.getTimeZoneTimeByContact((HCONTACT)wParam, pSystemTime);
}
/***********************************************************************************************************
diff --git a/plugins/UserInfoEx/src/svc_timezone_old.cpp b/plugins/UserInfoEx/src/svc_timezone_old.cpp index 683af3c65b..641d4c6d3e 100644 --- a/plugins/UserInfoEx/src/svc_timezone_old.cpp +++ b/plugins/UserInfoEx/src/svc_timezone_old.cpp @@ -375,7 +375,7 @@ static TZ_MAP MirTZ2WinTZ(const CHAR MirTz) * @retval CTimeZone* - Pointer to the timezone.
**/
-CTimeZone* GetContactTimeZone(HANDLE hContact, LPCSTR pszProto)
+CTimeZone* GetContactTimeZone(HCONTACT hContact, LPCSTR pszProto)
{
LPTSTR ptszName;
CTimeZone* pTimeZone = NULL;
@@ -410,7 +410,7 @@ CTimeZone* GetContactTimeZone(HANDLE hContact, LPCSTR pszProto) *
**/
-CTimeZone* GetContactTimeZone(HANDLE hContact)
+CTimeZone* GetContactTimeZone(HCONTACT hContact)
{
return GetContactTimeZone(hContact, DB::Contact::Proto(hContact));
}
@@ -431,7 +431,7 @@ CTimeZone* GetContactTimeZone(HANDLE hContact) * @e dwIndex retrieved its value. If not, dwIndex is -100 (unspecified).
**/
-WORD GetContactTimeZoneCtrl(HANDLE hContact, LPCSTR pszProto, CTimeZone** pTimeZone)
+WORD GetContactTimeZoneCtrl(HCONTACT hContact, LPCSTR pszProto, CTimeZone** pTimeZone)
{
WORD flags;
DBVARIANT dbv;
@@ -476,7 +476,7 @@ WORD GetContactTimeZoneCtrl(HANDLE hContact, LPCSTR pszProto, CTimeZone** pTimeZ * @return String containing display name.
**/
-LPCTSTR GetContactTimeZoneDisplayName(HANDLE hContact)
+LPCTSTR GetContactTimeZoneDisplayName(HCONTACT hContact)
{
CTimeZone *pTimeZone;
@@ -561,7 +561,7 @@ INT_PTR GetContactTimeZoneInformation_old(WPARAM wParam,LPARAM lParam) CTimeZone *pTimeZone;
TIME_ZONE_INFORMATION* pTimeZoneInformation = (TIME_ZONE_INFORMATION*)lParam;
- pTimeZone = GetContactTimeZone((HANDLE)wParam);
+ pTimeZone = GetContactTimeZone((HCONTACT)wParam);
if (pTimeZone && pTimeZoneInformation)
(*pTimeZoneInformation) = *pTimeZone;
@@ -580,7 +580,7 @@ INT_PTR GetContactTimeZoneInformation_old(WPARAM wParam,LPARAM lParam) INT_PTR GetContactLocalTime_old(WPARAM wParam, LPARAM lParam)
{
MTime now;
- now.GetLocalTime((HANDLE)wParam);
+ now.GetLocalTime((HCONTACT)wParam);
LPSYSTEMTIME pSystemTime = (LPSYSTEMTIME)lParam;
*pSystemTime = now.SystemTime();
diff --git a/plugins/UserInfoEx/src/svc_timezone_old.h b/plugins/UserInfoEx/src/svc_timezone_old.h index 8d8627039f..073794fd21 100644 --- a/plugins/UserInfoEx/src/svc_timezone_old.h +++ b/plugins/UserInfoEx/src/svc_timezone_old.h @@ -78,10 +78,10 @@ struct CTimeZone : public REG_TZI_FORMAT typedef INT_PTR (*PEnumNamesProc)(CTimeZone* pTimeZone, int index, LPARAM lParam);
-CTimeZone* GetContactTimeZone(HANDLE hContact);
-CTimeZone* GetContactTimeZone(HANDLE hContact, LPCSTR pszProto);
-WORD GetContactTimeZoneCtrl(HANDLE hContact, LPCSTR pszProto, CTimeZone** pTimeZone);
-LPCTSTR GetContactTimeZoneDisplayName(HANDLE hContact);
+CTimeZone* GetContactTimeZone(HCONTACT hContact);
+CTimeZone* GetContactTimeZone(HCONTACT hContact, LPCSTR pszProto);
+WORD GetContactTimeZoneCtrl(HCONTACT hContact, LPCSTR pszProto, CTimeZone** pTimeZone);
+LPCTSTR GetContactTimeZoneDisplayName(HCONTACT hContact);
INT_PTR EnumTimeZones(PEnumNamesProc enumProc, LPARAM lParam);
INT_PTR GetContactTimeZoneInformation_old(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Utils/mir_buffer.h b/plugins/Utils/mir_buffer.h index 1461be9f61..40d450fa47 100644 --- a/plugins/Utils/mir_buffer.h +++ b/plugins/Utils/mir_buffer.h @@ -439,7 +439,7 @@ class Buffer };
-static void ReplaceVars(Buffer<TCHAR> *buffer, HANDLE hContact, TCHAR **variables, int numVariables)
+static void ReplaceVars(Buffer<TCHAR> *buffer, HCONTACT hContact, TCHAR **variables, int numVariables)
{
if (buffer->len < 3)
return;
@@ -502,7 +502,7 @@ static void ReplaceVars(Buffer<TCHAR> *buffer, HANDLE hContact, TCHAR **variable }
-static void ReplaceTemplate(Buffer<TCHAR> *out, HANDLE hContact, TCHAR *templ, TCHAR **vars, int numVars)
+static void ReplaceTemplate(Buffer<TCHAR> *out, HCONTACT hContact, TCHAR *templ, TCHAR **vars, int numVars)
{
if (ServiceExists(MS_VARS_FORMATSTRING))
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index 1e0b5189df..5ceadf4486 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -33,7 +33,7 @@ Boston, MA 02111-1307, USA. #include "mir_options.h"
#include "mir_memory.h"
-static TCHAR* MyDBGetContactSettingTString(HANDLE hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def)
+static TCHAR* MyDBGetContactSettingTString(HCONTACT hContact, char* module, char* setting, TCHAR* out, size_t len, TCHAR *def)
{
DBVARIANT dbv = {0};
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 2299324552..a655d799ae 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -75,7 +75,7 @@ static builtinCnfs[] = typedef struct {
TCHAR* tszContact;
- HANDLE hContact;
+ HCONTACT hContact;
DWORD flags;
} CONTACTCE; /* contact cache entry */
@@ -104,7 +104,7 @@ BYTE getContactInfoType(TCHAR* type) /*
returns info about a contact as a string
*/
-TCHAR* getContactInfoT(BYTE type, HANDLE hContact)
+TCHAR* getContactInfoT(BYTE type, HCONTACT hContact)
{
/* returns dynamic allocated buffer with info, or NULL if failed */
TCHAR *res = NULL;
@@ -216,7 +216,7 @@ int getContactFromString(CONTACTSINFO *ci) for (int i=0; i < cacheSize; i++) {
if ((!_tcscmp(cce[i].tszContact, tszContact)) && (ci->flags == cce[i].flags)) {
/* found in cache */
- ci->hContacts = (HANDLE*)mir_alloc(sizeof(HANDLE));
+ ci->hContacts = (HCONTACT*)mir_alloc(sizeof(HCONTACT));
if (ci->hContacts == NULL)
return -1;
@@ -227,7 +227,7 @@ int getContactFromString(CONTACTSINFO *ci) }
/* contact was not in cache, do a search */
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
continue;
@@ -325,7 +325,7 @@ int getContactFromString(CONTACTSINFO *ci) }
}
if (bMatch) {
- ci->hContacts = (HANDLE*)mir_realloc(ci->hContacts, (count+1)*sizeof(HANDLE));
+ ci->hContacts = (HCONTACT*)mir_realloc(ci->hContacts, (count + 1)*sizeof(HCONTACT));
if (ci->hContacts == NULL)
return -1;
@@ -353,7 +353,7 @@ int getContactFromString(CONTACTSINFO *ci) static int contactSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *dbw = (DBCONTACTWRITESETTING*)lParam;
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
mir_cslock lck(csContactCache);
for (int i=0; i < cacheSize; i++) {
@@ -407,7 +407,7 @@ int deinitContactModule() // returns a string in the form <PROTOID:UNIQUEID>, cannot be _HANDLE_!
// result must be freed
-TCHAR *encodeContactToString(HANDLE hContact)
+TCHAR* encodeContactToString(HCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
TCHAR *tszUniqueId = getContactInfoT(CNF_UNIQUEID, hContact);
@@ -423,16 +423,16 @@ TCHAR *encodeContactToString(HANDLE hContact) // returns a contact from a string in the form <PROTOID:UNIQUEID>
// returns INVALID_HANDLE_VALUE in case of an error.
-HANDLE *decodeContactFromString(TCHAR *tszContact)
+HCONTACT decodeContactFromString(TCHAR *tszContact)
{
- HANDLE hContact = INVALID_HANDLE_VALUE;
+ HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE;
CONTACTSINFO ci = { sizeof(ci) };
ci.tszContact = tszContact;
ci.flags = CI_PROTOID|CI_TCHAR;
int count = getContactFromString( &ci );
if (count != 1) {
mir_free(ci.hContacts);
- return (HANDLE*)hContact;
+ return hContact;
}
if (ci.hContacts != NULL) {
@@ -440,5 +440,5 @@ HANDLE *decodeContactFromString(TCHAR *tszContact) mir_free(ci.hContacts);
}
- return (HANDLE*)hContact;
+ return hContact;
}
diff --git a/plugins/Variables/src/contact.h b/plugins/Variables/src/contact.h index 5e5eae2e69..0a81df4d1f 100644 --- a/plugins/Variables/src/contact.h +++ b/plugins/Variables/src/contact.h @@ -83,7 +83,7 @@ typedef struct { WCHAR *wszContact;
TCHAR *tszContact;
};
- HANDLE *hContacts; // (output) Array of contacts found.
+ HCONTACT *hContacts; // (output) Array of contacts found.
DWORD flags; // Contact details that will be matched with the search
// string (flags can be combined).
} CONTACTSINFO;
@@ -115,5 +115,5 @@ typedef struct { #define CI_TCHAR 0
#endif
-TCHAR *encodeContactToString(HANDLE hContact);
-HANDLE *decodeContactFromString(TCHAR *tszContact);
+TCHAR *encodeContactToString(HCONTACT hContact);
+HCONTACT decodeContactFromString(TCHAR *tszContact);
diff --git a/plugins/Variables/src/dbhelpers.h b/plugins/Variables/src/dbhelpers.h index cb5852de34..8cc7332a69 100644 --- a/plugins/Variables/src/dbhelpers.h +++ b/plugins/Variables/src/dbhelpers.h @@ -22,7 +22,7 @@ #endif
// database helpers
-static int __inline DBWriteIthSettingByte(DWORD i, HANDLE hContact,const char *szModule,const char *szSetting,BYTE val) {
+static int __inline DBWriteIthSettingByte(DWORD i, HCONTACT hContact,const char *szModule,const char *szSetting,BYTE val) {
char dbSetting[128];
@@ -30,7 +30,7 @@ static int __inline DBWriteIthSettingByte(DWORD i, HANDLE hContact,const char *s return db_set_b(hContact, szModule, dbSetting, val);
}
-static int __inline DBWriteIthSettingWord(DWORD i, HANDLE hContact,const char *szModule,const char *szSetting,WORD val) {
+static int __inline DBWriteIthSettingWord(DWORD i, HCONTACT hContact,const char *szModule,const char *szSetting,WORD val) {
char dbSetting[128];
@@ -38,7 +38,7 @@ static int __inline DBWriteIthSettingWord(DWORD i, HANDLE hContact,const char *s return db_set_w(hContact, szModule, dbSetting, val);
}
-static int __inline DBWriteIthSettingDword(DWORD i, HANDLE hContact,const char *szModule,const char *szSetting,DWORD val) {
+static int __inline DBWriteIthSettingDword(DWORD i, HCONTACT hContact,const char *szModule,const char *szSetting,DWORD val) {
char dbSetting[128];
@@ -46,7 +46,7 @@ static int __inline DBWriteIthSettingDword(DWORD i, HANDLE hContact,const char * return db_set_dw(hContact, szModule, dbSetting, val);
}
-static int __inline DBWriteIthSettingString(DWORD i, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
+static int __inline DBWriteIthSettingString(DWORD i, HCONTACT hContact,const char *szModule,const char *szSetting,const char *val) {
char dbSetting[128];
@@ -54,7 +54,7 @@ static int __inline DBWriteIthSettingString(DWORD i, HANDLE hContact,const char return db_set_s(hContact, szModule, dbSetting, val);
}
-static int __inline DBGetIthSettingByte(DWORD i, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+static int __inline DBGetIthSettingByte(DWORD i, HCONTACT hContact, const char *szModule, const char *szSetting, int errorValue) {
char dbSetting[128];
@@ -63,7 +63,7 @@ static int __inline DBGetIthSettingByte(DWORD i, HANDLE hContact, const char *sz return db_get_b(hContact, szModule, dbSetting, errorValue);
}
-static WORD __inline DBGetIthSettingWord(DWORD i, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+static WORD __inline DBGetIthSettingWord(DWORD i, HCONTACT hContact, const char *szModule, const char *szSetting, int errorValue) {
char dbSetting[128];
@@ -72,7 +72,7 @@ static WORD __inline DBGetIthSettingWord(DWORD i, HANDLE hContact, const char *s return db_get_w(hContact, szModule, dbSetting, errorValue);
}
-static DWORD __inline DBGetIthSettingDword(DWORD i, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
+static DWORD __inline DBGetIthSettingDword(DWORD i, HCONTACT hContact, const char *szModule, const char *szSetting, int errorValue) {
char dbSetting[128];
@@ -81,7 +81,7 @@ static DWORD __inline DBGetIthSettingDword(DWORD i, HANDLE hContact, const char return db_get_dw(hContact, szModule, dbSetting, errorValue);
}
-static int __inline DBGetIthSetting(DWORD i, HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) {
+static int __inline DBGetIthSetting(DWORD i, HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) {
char dbSetting[128];
@@ -90,7 +90,7 @@ static int __inline DBGetIthSetting(DWORD i, HANDLE hContact, const char *szModu return db_get(hContact, szModule, dbSetting, dbv);
}
-static int __inline DBDeleteIthSetting(DWORD i, HANDLE hContact,const char *szModule,const char *szSetting) {
+static int __inline DBDeleteIthSetting(DWORD i, HCONTACT hContact,const char *szModule,const char *szSetting) {
char dbSetting[128];
diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp index d19484235b..669d737aa3 100644 --- a/plugins/Variables/src/help.cpp +++ b/plugins/Variables/src/help.cpp @@ -140,9 +140,9 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM case VARM_SETSUBJECT: {
LPARAM res = 0;
- HANDLE hContact, hItem;
+ HCONTACT hContact, hItem;
- hContact = (HANDLE)wParam;
+ hContact = (HCONTACT)wParam;
log_debugA("VARM_SETSUBJECT: %u", hContact);
if (hContact == INVALID_HANDLE_VALUE) {
TCHAR *tszContact = db_get_tsa(NULL, MODULENAME, SETTING_SUBJECT);
@@ -154,7 +154,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM } }
if ((hContact != INVALID_HANDLE_VALUE) && (hContact != NULL))
- hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ hItem = (HCONTACT)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
else
hItem = NULL;
@@ -225,7 +225,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM case WM_DESTROY:
db_unset(NULL, MODULENAME, SETTING_SUBJECT);
{
- HANDLE hContact = (HANDLE)SendMessage(hwndDlg, VARM_GETSUBJECT, 0, 0);
+ HCONTACT hContact = (HCONTACT)SendMessage(hwndDlg, VARM_GETSUBJECT, 0, 0);
if (hContact != NULL) {
TCHAR *tszContact = encodeContactToString(hContact);
if (tszContact != NULL) {
@@ -726,7 +726,7 @@ static INT_PTR CALLBACK inputDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM else extraText = NULL;
if (string != NULL) {
- TCHAR *newString = variables_parsedup(string, extraText, (HANDLE)SendMessage(GetParent(hwndDlg), VARM_GETSUBJECT, 0, 0));
+ TCHAR *newString = variables_parsedup(string, extraText, (HCONTACT)SendMessage(GetParent(hwndDlg), VARM_GETSUBJECT, 0, 0));
if (newString != NULL) {
TCHAR *oldString = Hlp_GetDlgItemText(hwndDlg, IDC_RESULT);
if (oldString == NULL || _tcscmp(oldString, newString))
@@ -1003,7 +1003,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l SendMessageA(hwndDlg, VARM_GETEXTRATEXT, (WPARAM)len + 1, (LPARAM)dat->vhs->fi->szExtraText);
}
}
- dat->vhs->fi->hContact = (HANDLE)SendMessage(hwndDlg, VARM_GETSUBJECT, 0, 0);
+ dat->vhs->fi->hContact = (HCONTACT)SendMessage(hwndDlg, VARM_GETSUBJECT, 0, 0);
}
// fall through
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp index 65ccfe638c..3cb038c029 100644 --- a/plugins/Variables/src/parse_metacontacts.cpp +++ b/plugins/Variables/src/parse_metacontacts.cpp @@ -24,7 +24,7 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
CONTACTSINFO ci = { 0 };
ci.cbSize = sizeof(ci);
@@ -40,7 +40,7 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai) return NULL;
}
- hContact = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
if (hContact == NULL)
return NULL;
@@ -79,7 +79,7 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
CONTACTSINFO ci = { 0 };
ci.cbSize = sizeof(ci);
@@ -95,7 +95,7 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai) return NULL;
}
- hContact = (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT, (WPARAM)hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETDEFAULTCONTACT, (WPARAM)hContact, 0);
if (hContact == NULL)
return NULL;
@@ -134,7 +134,7 @@ static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
CONTACTSINFO ci = { 0 };
ci.cbSize = sizeof(ci);
@@ -150,7 +150,7 @@ static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai) return NULL;
}
- hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ hContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
if (hContact == NULL)
return NULL;
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index f2a9a1b4e9..3c7279782c 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -99,7 +99,7 @@ static TCHAR* parseContact(ARGUMENTSINFO *ai) mir_free(ci.hContacts);
return NULL;
}
- HANDLE hContact = ci.hContacts[n];
+ HCONTACT hContact = ci.hContacts[n];
log_debugA("contact: %x", hContact);
mir_free(ci.hContacts);
@@ -127,7 +127,7 @@ static TCHAR* parseContactInfo(ARGUMENTSINFO *ai) if (ai->argc != 3)
return NULL;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
CONTACTSINFO ci = { 0 };
ci.cbSize = sizeof(ci);
ci.tszContact = ai->targv[1];
@@ -172,7 +172,7 @@ static TCHAR* parseDBProfilePath(ARGUMENTSINFO *ai) return mir_tstrdup(path);
}
-static TCHAR* getDBSetting(HANDLE hContact, char* module, char* setting, TCHAR* defaultValue)
+static TCHAR* getDBSetting(HCONTACT hContact, char* module, char* setting, TCHAR* defaultValue)
{
DBVARIANT dbv;
if (db_get_s(hContact, module, setting, &dbv, 0))
@@ -210,7 +210,7 @@ static TCHAR* parseDBSetting(ARGUMENTSINFO *ai) return NULL;
TCHAR *res = NULL, *szDefaultValue = NULL;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
if (_tcslen(ai->targv[1]) > 0) {
CONTACTSINFO ci = { 0 };
@@ -247,7 +247,7 @@ static TCHAR* parseLastSeenDate(ARGUMENTSINFO *ai) if (ai->argc <= 1)
return NULL;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
CONTACTSINFO ci = { 0 };
ci.cbSize = sizeof(ci);
ci.tszContact = ai->targv[1];
@@ -300,7 +300,7 @@ static TCHAR* parseLastSeenTime(ARGUMENTSINFO *ai) if (ai->argc <= 1)
return NULL;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
CONTACTSINFO ci = { 0 };
ci.cbSize = sizeof(ci);
@@ -355,7 +355,7 @@ static TCHAR* parseLastSeenStatus(ARGUMENTSINFO *ai) if (ai->argc != 2)
return NULL;
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
CONTACTSINFO ci = { 0 };
ci.cbSize = sizeof(ci);
ci.tszContact = ai->targv[1];
@@ -498,7 +498,7 @@ static BOOL isValidDbEvent(DBEVENTINFO *dbe, int flags) return (bEventType && bEventFlags);
}
-static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags)
+static HANDLE findDbEvent(HCONTACT hContact, HANDLE hDbEvent, int flags)
{
DBEVENTINFO dbe;
BOOL bEventOk;
@@ -530,7 +530,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags) hMatchEvent = hSearchEvent = NULL;
matchTimestamp = priorTimestamp = 0;
if (flags & DBE_FIRST) {
- for (HANDLE hSearchContact = db_find_first(); hSearchContact; hSearchContact = db_find_next(hSearchContact)) {
+ for (HCONTACT hSearchContact = db_find_first(); hSearchContact; hSearchContact = db_find_next(hSearchContact)) {
hSearchEvent = findDbEvent(hSearchContact, NULL, flags);
dbe.cbBlob = 0;
if (!db_event_get(hSearchEvent, &dbe)) {
@@ -543,7 +543,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags) hDbEvent = hMatchEvent;
}
else if (flags & DBE_LAST) {
- for (HANDLE hSearchContact = db_find_first(); hSearchContact; hSearchContact = db_find_next(hSearchContact)) {
+ for (HCONTACT hSearchContact = db_find_first(); hSearchContact; hSearchContact = db_find_next(hSearchContact)) {
hSearchEvent = findDbEvent(hSearchContact, NULL, flags);
dbe.cbBlob = 0;
if (!db_event_get(hSearchEvent, &dbe)) {
@@ -559,7 +559,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags) dbe.cbBlob = 0;
if (!db_event_get(hDbEvent, &dbe)) {
priorTimestamp = dbe.timestamp;
- for (HANDLE hSearchContact = db_find_first(); hSearchContact; hSearchContact = db_find_next(hSearchContact)) {
+ for (HCONTACT hSearchContact = db_find_first(); hSearchContact; hSearchContact = db_find_next(hSearchContact)) {
hSearchEvent = findDbEvent(hSearchContact, hDbEvent, flags);
dbe.cbBlob = 0;
if (!db_event_get(hSearchEvent, &dbe)) {
@@ -575,7 +575,7 @@ static HANDLE findDbEvent(HANDLE hContact, HANDLE hDbEvent, int flags) else if (flags & DBE_PREV) {
if (!db_event_get(hDbEvent, &dbe)) {
priorTimestamp = dbe.timestamp;
- for (HANDLE hSearchContact = db_find_first(); hSearchContact; hSearchContact = db_find_next(hSearchContact)) {
+ for (HCONTACT hSearchContact = db_find_first(); hSearchContact; hSearchContact = db_find_next(hSearchContact)) {
hSearchEvent = findDbEvent(hSearchContact, hDbEvent, flags);
dbe.cbBlob = 0;
if (!db_event_get(hSearchEvent, &dbe)) {
@@ -648,7 +648,7 @@ static TCHAR* parseDbEvent(ARGUMENTSINFO *ai) break;
}
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
CONTACTSINFO ci = { 0 };
ci.cbSize = sizeof(ci);
diff --git a/plugins/Variables/src/variables.h b/plugins/Variables/src/variables.h index 2eb66836ff..a537364c84 100644 --- a/plugins/Variables/src/variables.h +++ b/plugins/Variables/src/variables.h @@ -122,7 +122,7 @@ For example: ?contact(miranda@hotmail.com,email) or ?contact(Miranda,nick). The #define VARM_GETINPUTTEXT (WM_APP+13)
#define VARM_GETINPUTTEXTLENGTH (WM_APP+14)
#define VARM_SETSUBJECT (WM_APP+15)
-#define VARM_GETSUBJECT (WM_APP+16) // wParam=HANDLE hContact
+#define VARM_GETSUBJECT (WM_APP+16) // wParam=HCONTACT hContact
#define VARM_SETEXTRATEXT (WM_APP+17)
#define VARM_GETEXTRATEXT (WM_APP+18)
#define VARM_GETEXTRATEXTLENGTH (WM_APP+19)
@@ -136,7 +136,7 @@ typedef struct { int cbSize;
char *szFormat;
char *szSource;
- HANDLE hContact;
+ HCONTACT hContact;
int pCount; // number of succesful parses
int eCount; // number of failures
} FORMATINFOV1;
@@ -172,7 +172,7 @@ int initTokenRegister(); int deinitTokenRegister();
// contact.c
BYTE getContactInfoType(TCHAR* type);
-TCHAR* getContactInfoT(BYTE type, HANDLE hContact);
+TCHAR* getContactInfoT(BYTE type, HCONTACT hContact);
int getContactFromString( CONTACTSINFO* );
int initContactModule();
int deinitContactModule();
diff --git a/plugins/Watrack_MPD/src/utilities.cpp b/plugins/Watrack_MPD/src/utilities.cpp index 55e100cea1..901bfbe6b9 100755 --- a/plugins/Watrack_MPD/src/utilities.cpp +++ b/plugins/Watrack_MPD/src/utilities.cpp @@ -17,7 +17,7 @@ #include "commonheaders.h" -TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,const char* szSetting, TCHAR* szDef) +TCHAR* __stdcall UniGetContactSettingUtf(HCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef) { DBVARIANT dbv = {DBVT_DELETED}; TCHAR* szRes = NULL; diff --git a/plugins/Watrack_MPD/src/utilities.h b/plugins/Watrack_MPD/src/utilities.h index 018f32a03c..6460a8d479 100755 --- a/plugins/Watrack_MPD/src/utilities.h +++ b/plugins/Watrack_MPD/src/utilities.h @@ -2,6 +2,6 @@ #define UTILITIES_H HANDLE CreateThreadEx(pThreadFuncEx AFunc, void* arg, DWORD* pThreadID); -TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,const char* szSetting, TCHAR* szDef); +TCHAR* __stdcall UniGetContactSettingUtf(HCONTACT hContact, const char *szModule,const char* szSetting, TCHAR* szDef); #endif diff --git a/plugins/Weather/src/weather.h b/plugins/Weather/src/weather.h index 0130a8e383..27fd3f82c7 100644 --- a/plugins/Weather/src/weather.h +++ b/plugins/Weather/src/weather.h @@ -226,7 +226,7 @@ struct MYOPTIONS // other misc stuff
TCHAR Default[64];
- HANDLE DefStn;
+ HCONTACT DefStn;
};
void DestroyOptions(void);
@@ -234,7 +234,7 @@ void DestroyOptions(void); //============ STRUCT USED TO MAKE AN UPDATE LIST ============
struct WCONTACTLIST {
- HANDLE hContact;
+ HCONTACT hContact;
struct WCONTACTLIST *next;
};
@@ -395,7 +395,7 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa int ContactDeleted(WPARAM wParam,LPARAM lParam);
-BOOL IsMyContact(HANDLE hContact);
+BOOL IsMyContact(HCONTACT hContact);
// functions in weather_conv.c
BOOL is_number(char *s);
@@ -422,10 +422,10 @@ void GetID(TCHAR *pszID); TCHAR *GetError(int code);
// functions in weather_data.c
-void GetStationID(HANDLE hContact, TCHAR* id, size_t idlen);
-WEATHERINFO LoadWeatherInfo(HANDLE Change);
-int DBGetData(HANDLE hContact, char *setting, DBVARIANT *dbv);
-int DBGetStaticString(HANDLE hContact, const char *szModule, const char *valueName, TCHAR *dest, size_t dest_len);
+void GetStationID(HCONTACT hContact, TCHAR* id, size_t idlen);
+WEATHERINFO LoadWeatherInfo(HCONTACT Change);
+int DBGetData(HCONTACT hContact, char *setting, DBVARIANT *dbv);
+int DBGetStaticString(HCONTACT hContact, const char *szModule, const char *valueName, TCHAR *dest, size_t dest_len);
void EraseAllInfo(void);
@@ -438,7 +438,7 @@ void wSetData(WCHAR **Data, const WCHAR *Value); void wfree(char **Data);
void wfree(WCHAR **Data);
-void DBDataManage(HANDLE hContact, WORD Mode, WPARAM wParam, LPARAM lParam);
+void DBDataManage(HCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM lParam);
// functions in weather_http.c
int InternetDownloadFile (char *szUrl, char *cookie, TCHAR** szData);
@@ -498,12 +498,12 @@ INT_PTR WeatherLoadIcon(WPARAM wParam, LPARAM lParam); void UpdateMenu(BOOL State);
void UpdatePopupMenu(BOOL State);
void AddMenuItems();
-void AvatarDownloaded(HANDLE hContact);
+void AvatarDownloaded(HCONTACT hContact);
// functions in weather_update.c
-int UpdateWeather(HANDLE hContact);
+int UpdateWeather(HCONTACT hContact);
-int RetrieveWeather(HANDLE hContact, WEATHERINFO *winfo);
+int RetrieveWeather(HCONTACT hContact, WEATHERINFO *winfo);
void UpdateAll(BOOL AutoUpdate, BOOL RemoveOld);
void UpdateThreadProc(LPVOID hWnd);
@@ -512,7 +512,7 @@ INT_PTR UpdateAllInfo(WPARAM wParam,LPARAM lParam); INT_PTR UpdateSingleRemove(WPARAM wParam,LPARAM lParam);
INT_PTR UpdateAllRemove(WPARAM wParam,LPARAM lParam);
-int GetWeatherData(HANDLE hContact);
+int GetWeatherData(HCONTACT hContact);
void CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
void CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
@@ -522,8 +522,8 @@ void InitMwin(void); void DestroyMwin(void);
INT_PTR Mwin_MenuClicked(WPARAM wParam, LPARAM lParam);
int BuildContactMenu(WPARAM wparam, LPARAM lparam);
-void UpdateMwinData(HANDLE hContact);
-void removeWindow(HANDLE hContact);
+void UpdateMwinData(HCONTACT hContact);
+void removeWindow(HCONTACT hContact);
// functions in weather_userinfo.c
int UserInfoInit(WPARAM wParam, LPARAM lParam);
@@ -535,7 +535,7 @@ INT_PTR CALLBACK DlgProcINIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int BriefInfo(WPARAM wParam, LPARAM lParam);
INT_PTR BriefInfoSvc(WPARAM wParam, LPARAM lParam);
-void LoadBriefInfoText(HWND hwndDlg, HANDLE hContact);
+void LoadBriefInfoText(HWND hwndDlg, HCONTACT hContact);
INT_PTR CALLBACK DlgProcBrief(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
void InitIcons(void);
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index 25e95846e6..a587b471a6 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -40,7 +40,7 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam) return 0;
// search for existing contact
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
// check if it is a weather contact
if ( IsMyContact(hContact)) {
DBVARIANT dbv;
@@ -64,7 +64,7 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam) // if contact with the same ID was not found, add it
if (psr->cbSize < sizeof(PROTOSEARCHRESULT)) return 0;
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)WEATHERPROTONAME);
// suppress online notification for the new contact
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, IGNOREEVENT_USERONLINE);
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 9f93bd6a1a..13758addac 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -43,7 +43,7 @@ INT_PTR ViewLog(WPARAM wParam, LPARAM lParam) {
// see if the log path is set
DBVARIANT dbv;
- if ( !db_get_ts((HANDLE)wParam, WEATHERPROTONAME, "Log", &dbv)) {
+ if (!db_get_ts((HCONTACT)wParam, WEATHERPROTONAME, "Log", &dbv)) {
if (dbv.pszVal[0] != 0)
ShellExecute((HWND)lParam, _T("open"), dbv.ptszVal, _T(""), _T(""), SW_SHOW);
db_free(&dbv);
@@ -59,10 +59,10 @@ INT_PTR ViewLog(WPARAM wParam, LPARAM lParam) INT_PTR LoadForecast(WPARAM wParam, LPARAM lParam)
{
TCHAR id[256], loc2[256];
- GetStationID((HANDLE)wParam, id, SIZEOF(id));
+ GetStationID((HCONTACT)wParam, id, SIZEOF(id));
if (id[0] != 0) {
// check if the complte forecast URL is set. If it is not, display warning and quit
- if ( DBGetStaticString((HANDLE)wParam, WEATHERPROTONAME, "InfoURL", loc2, SIZEOF(loc2)) || loc2[0] == 0) {
+ if (DBGetStaticString((HCONTACT)wParam, WEATHERPROTONAME, "InfoURL", loc2, SIZEOF(loc2)) || loc2[0] == 0) {
MessageBox(NULL, TranslateT("The URL for complete forcast have not been set. You can set it from the Edit Settings dialog."),
TranslateT("Weather Protocol"), MB_ICONINFORMATION);
return 1;
@@ -78,10 +78,10 @@ INT_PTR LoadForecast(WPARAM wParam, LPARAM lParam) INT_PTR WeatherMap(WPARAM wParam, LPARAM lParam)
{
TCHAR id[256], loc2[256];
- GetStationID((HANDLE)wParam, id, SIZEOF(id));
+ GetStationID((HCONTACT)wParam, id, SIZEOF(id));
if (id[0] != 0) {
// check if the weather map URL is set. If it is not, display warning and quit
- if ( DBGetStaticString((HANDLE)wParam, WEATHERPROTONAME, "MapURL", loc2, SIZEOF(loc2)) || loc2[0] == 0) {
+ if (DBGetStaticString((HCONTACT)wParam, WEATHERPROTONAME, "MapURL", loc2, SIZEOF(loc2)) || loc2[0] == 0) {
MessageBox(NULL, TranslateT("The URL for weather map have not been set. You can set it from the Edit Settings dialog."), TranslateT("Weather Protocol"), MB_ICONINFORMATION);
return 1;
}
@@ -99,7 +99,7 @@ INT_PTR WeatherMap(WPARAM wParam, LPARAM lParam) // wParam = current contact
INT_PTR EditSettings(WPARAM wParam, LPARAM lParam)
{
- HWND hEditDlg = WindowList_Find(hWindowList, (HANDLE)wParam);
+ HWND hEditDlg = WindowList_Find(hWindowList, (HCONTACT)wParam);
// search the dialog list to prevent multiple instance of dialog for the same contact
if (hEditDlg != NULL) {
@@ -109,7 +109,7 @@ INT_PTR EditSettings(WPARAM wParam, LPARAM lParam) }
else {
// if the dialog box is not opened, open a new one
- if (IsMyContact((HANDLE)wParam))
+ if (IsMyContact((HCONTACT)wParam))
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_EDIT), NULL, DlgProcChange, (LPARAM)wParam);
}
@@ -118,7 +118,7 @@ INT_PTR EditSettings(WPARAM wParam, LPARAM lParam) typedef struct
{
- HANDLE hContact;
+ HCONTACT hContact;
HICON hRename;
HICON hUserDetail;
HICON hFile;
@@ -133,7 +133,7 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa TCHAR str[256], str2[256], city[256], filter[256], *pfilter, *chop;
char loc[512];
OPENFILENAME ofn; // common dialog box structure
- HANDLE hContact;
+ HCONTACT hContact;
WIDATA *sData;
CntSetWndDataType *wndData = NULL;
@@ -142,7 +142,7 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa TranslateDialogDefault(hwndDlg);
wndData = ( CntSetWndDataType* )mir_alloc(sizeof(CntSetWndDataType));
- wndData->hContact = hContact = (HANDLE)lParam;
+ wndData->hContact = hContact = (HCONTACT)lParam;
wndData->hRename = LoadSkinnedIcon(SKINICON_OTHER_RENAME);
wndData->hUserDetail = LoadSkinnedIcon(SKINICON_OTHER_USERDETAILS);
wndData->hFile = LoadSkinnedIcon(SKINICON_EVENT_FILE);
@@ -430,14 +430,14 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa // wParam = deleted contact
int ContactDeleted(WPARAM wParam, LPARAM lParam)
{
- if ( !IsMyContact((HANDLE)wParam))
+ if (!IsMyContact((HCONTACT)wParam))
return 0;
- removeWindow((HANDLE)wParam);
+ removeWindow((HCONTACT)wParam);
// exit this function if it is not default station
DBVARIANT dbv;
- if ( !db_get_ts((HANDLE)wParam, WEATHERPROTONAME, "ID", &dbv)) {
+ if (!db_get_ts((HCONTACT)wParam, WEATHERPROTONAME, "ID", &dbv)) {
if ( _tcscmp(dbv.ptszVal, opt.Default)) {
db_free(&dbv);
return 0;
@@ -448,7 +448,7 @@ int ContactDeleted(WPARAM wParam, LPARAM lParam) // now the default station is deleted, try to get a new one
// start looking for other weather stations
- for (HANDLE hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) {
+ for (HCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) {
if ( !db_get_ts(hContact, WEATHERPROTONAME, "ID", &dbv)) {
// if the station is not a default station, set it as the new default station
// this is the first weather station encountered from the search
@@ -475,7 +475,7 @@ int ContactDeleted(WPARAM wParam, LPARAM lParam) return 0;
}
-BOOL IsMyContact(HANDLE hContact)
+BOOL IsMyContact(HCONTACT hContact)
{
const char* szProto = GetContactProto(hContact);
return szProto != NULL && strcmp(WEATHERPROTONAME, szProto) == 0;
diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index c986ab7530..7e18e3f749 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -572,7 +572,7 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str) TCHAR svcReturnText[MAX_TEXT_SIZE];
INT_PTR GetDisplaySvcFunc(WPARAM wParam, LPARAM lParam)
{
- WEATHERINFO winfo = LoadWeatherInfo((HANDLE)wParam);
+ WEATHERINFO winfo = LoadWeatherInfo((HCONTACT)wParam);
return (INT_PTR)GetDisplay(&winfo, (TCHAR*)lParam, svcReturnText);
}
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index 4f5aaaa0ad..288b415509 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -30,7 +30,7 @@ saving individual weather data for a weather contact. // hContact = the current contact handle
// return value = the string for station ID
-void GetStationID(HANDLE hContact, TCHAR* id, size_t idlen)
+void GetStationID(HCONTACT hContact, TCHAR* id, size_t idlen)
{
// accessing the database
if (DBGetStaticString(hContact, WEATHERPROTONAME, "ID", id, idlen))
@@ -40,7 +40,7 @@ void GetStationID(HANDLE hContact, TCHAR* id, size_t idlen) // initialize weather info by loading values from database
// hContact = current contact handle
// return value = the current weather information in WEATHERINFO struct
-WEATHERINFO LoadWeatherInfo(HANDLE hContact)
+WEATHERINFO LoadWeatherInfo(HCONTACT hContact)
{
// obtaining values from the DB
// assuming station ID must exist at all time, but others does not have to
@@ -86,7 +86,7 @@ WEATHERINFO LoadWeatherInfo(HANDLE hContact) // getting weather setting from database
// return 0 on success
-int DBGetData(HANDLE hContact, char *setting, DBVARIANT *dbv)
+int DBGetData(HCONTACT hContact, char *setting, DBVARIANT *dbv)
{
if ( db_get_ts(hContact, WEATHERCONDITION, setting, dbv)) {
size_t len = strlen(setting) + 1;
@@ -100,7 +100,7 @@ int DBGetData(HANDLE hContact, char *setting, DBVARIANT *dbv) return 0;
}
-int DBGetStaticString(HANDLE hContact, const char *szModule, const char *valueName, TCHAR *dest, size_t dest_len)
+int DBGetStaticString(HCONTACT hContact, const char *szModule, const char *valueName, TCHAR *dest, size_t dest_len)
{
DBVARIANT dbv;
if ( db_get_ts( hContact, szModule, valueName, &dbv ))
@@ -121,10 +121,10 @@ void EraseAllInfo() {
TCHAR str[255];
int ContactCount = 0;
- HANDLE LastContact = NULL;
+ HCONTACT LastContact = NULL;
DBVARIANT dbv;
// loop through all contacts
- for (HANDLE hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) {
+ for (HCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) {
db_set_w(hContact,WEATHERPROTONAME, "Status",ID_STATUS_OFFLINE);
db_set_w(hContact,WEATHERPROTONAME, "StatusIcon",ID_STATUS_OFFLINE);
db_unset(hContact, "CList", "MyHandle");
@@ -424,7 +424,7 @@ int GetWeatherDataFromDB(const char *szSetting, LPARAM lparam) // remove or display the weather information for a contact
// hContact - the contact in which the info is going to be removed
-void DBDataManage(HANDLE hContact, WORD Mode, WPARAM wParam, LPARAM lParam)
+void DBDataManage(HCONTACT hContact, WORD Mode, WPARAM wParam, LPARAM lParam)
{
LIST<char> arSettings(10);
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 6ccbfb19f0..8444644f7f 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -30,7 +30,7 @@ HGENMENU hMwinMenu; typedef struct
{
- HANDLE hContact;
+ HCONTACT hContact;
HWND hAvt;
BOOL haveAvatar;
} MWinDataType;
@@ -47,7 +47,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara data = (MWinDataType*)mir_calloc(sizeof(MWinDataType));
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data);
- data->hContact = (HANDLE)((LPCREATESTRUCT)lParam)->lpCreateParams;
+ data->hContact = (HCONTACT)((LPCREATESTRUCT)lParam)->lpCreateParams;
data->hAvt = CreateWindow(AVATAR_CONTROL_CLASS, TEXT(""), WS_CHILD,
0, 0, opt.AvatarSize, opt.AvatarSize, hwnd, NULL, hInst, 0);
if (data->hAvt) SendMessage(data->hAvt, AVATAR_SETCONTACT, 0, (LPARAM)data->hContact);
@@ -246,7 +246,7 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara return(TRUE);
}
-static void addWindow(HANDLE hContact)
+static void addWindow(HCONTACT hContact)
{
DBVARIANT dbv;
db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv);
@@ -273,7 +273,7 @@ static void addWindow(HANDLE hContact) db_set_b(hContact, "CList", "Hidden", TRUE);
}
-void removeWindow(HANDLE hContact)
+void removeWindow(HCONTACT hContact)
{
DWORD frameId = db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0);
@@ -284,7 +284,7 @@ void removeWindow(HANDLE hContact) db_unset(hContact, "CList", "Hidden");
}
-void UpdateMwinData(HANDLE hContact)
+void UpdateMwinData(HCONTACT hContact)
{
HWND hwnd = WindowList_Find(hMwinWindowList, hContact);
if (hwnd != NULL)
@@ -294,11 +294,11 @@ void UpdateMwinData(HANDLE hContact) INT_PTR Mwin_MenuClicked(WPARAM wParam,LPARAM lParam)
{
- BOOL addwnd = WindowList_Find(hMwinWindowList, (HANDLE)wParam) == NULL;
+ BOOL addwnd = WindowList_Find(hMwinWindowList, (HCONTACT)wParam) == NULL;
if (addwnd)
- addWindow((HANDLE)wParam);
+ addWindow((HCONTACT)wParam);
else
- removeWindow((HANDLE)wParam);
+ removeWindow((HCONTACT)wParam);
return 0;
}
@@ -307,7 +307,7 @@ int BuildContactMenu(WPARAM wparam,LPARAM lparam) {
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS |
- (db_get_dw((HANDLE)wparam, WEATHERPROTONAME, "mwin", 0) ? CMIF_CHECKED : 0);
+ (db_get_dw((HCONTACT)wparam, WEATHERPROTONAME, "mwin", 0) ? CMIF_CHECKED : 0);
Menu_ModifyItem(hMwinMenu, &mi);
return 0;
}
@@ -372,7 +372,7 @@ void InitMwin(void) strcpy(fontid.prefix, "fnt1");
FontRegisterT(&fontid);
- for (HANDLE hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME))
+ for (HCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME))
if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0))
addWindow(hContact);
@@ -381,7 +381,7 @@ void InitMwin(void) void DestroyMwin(void)
{
- for (HANDLE hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) {
+ for (HCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) {
DWORD frameId = db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0);
if (frameId)
CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0);
diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index d8396532fd..27152b0d9b 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -36,26 +36,17 @@ int WeatherPopup(WPARAM wParam, LPARAM lParam) {
// determine if the popup should display or not
if (opt.UsePopup && opt.UpdatePopup && (!opt.PopupOnChange || (BOOL)lParam) &&
- !db_get_b((HANDLE)wParam, WEATHERPROTONAME, "DPopUp", 0))
+ !db_get_b((HCONTACT)wParam, WEATHERPROTONAME, "DPopUp", 0))
{
- POPUPDATAT ppd = {0};
- WEATHERINFO winfo;
-
- // setup the popup
- ppd.lchContact = (HANDLE)wParam;
-// if ((HANDLE)wParam != NULL) { // for actual contact
- winfo = LoadWeatherInfo((HANDLE)wParam);
- ppd.PluginData = ppd.lchIcon = LoadSkinnedProtoIcon(WEATHERPROTONAME, winfo.status);
- GetDisplay(&winfo, opt.pTitle, ppd.lptzContactName);
- GetDisplay(&winfo, opt.pText, ppd.lptzText);
- ppd.PluginWindowProc = PopupDlgProc;
-// }
-// else { // for preview
-// ppd.lchIcon = LoadSkinnedProtoIcon(WEATHERPROTONAME, ONLINE);
-// strcpy(ppd.lpzContactName, Translate("This is the name of the city"));
-// strcpy(ppd.lpzText, Translate("Here is a short weather description"));
-// ppd.PluginWindowProc = NULL;
-// }
+ WEATHERINFO winfo = LoadWeatherInfo((HCONTACT)wParam);
+
+ // setup the popup
+ POPUPDATAT ppd = { 0 };
+ ppd.lchContact = (HCONTACT)wParam;
+ ppd.PluginData = ppd.lchIcon = LoadSkinnedProtoIcon(WEATHERPROTONAME, winfo.status);
+ GetDisplay(&winfo, opt.pTitle, ppd.lptzContactName);
+ GetDisplay(&winfo, opt.pText, ppd.lptzText);
+ ppd.PluginWindowProc = PopupDlgProc;
ppd.colorBack = (opt.UseWinColors)?GetSysColor(COLOR_BTNFACE):opt.BGColour;
ppd.colorText = (opt.UseWinColors)?GetSysColor(COLOR_WINDOWTEXT):opt.TextColour;
ppd.iSeconds = opt.pDelay;
@@ -129,7 +120,7 @@ int WPShowMessage(TCHAR* lpzText, WORD kind) LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
DWORD ID = 0;
- HANDLE hContact;
+ HCONTACT hContact;
hContact = PUGetContact(hWnd);
switch(message) {
@@ -257,7 +248,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) HMENU hMenu, hMenu1;
RECT pos;
HWND button;
- HANDLE hContact;
+ HCONTACT hContact;
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index a398b748b9..6362a9c65d 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -110,7 +110,7 @@ INT_PTR WeatherLoadIcon(WPARAM wParam,LPARAM lParam) static void __cdecl AckThreadProc(HANDLE param)
{
Sleep(100);
- ProtoBroadcastAck(WEATHERPROTONAME, param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
+ ProtoBroadcastAck(WEATHERPROTONAME, (HCONTACT)param, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
// nothing to do here because weather proto do not need to retrieve contact info form network
@@ -163,7 +163,7 @@ INT_PTR WeatherGetAvatarInfo(WPARAM wParam, LPARAM lParam) }
-void AvatarDownloaded(HANDLE hContact)
+void AvatarDownloaded(HCONTACT hContact)
{
PROTO_AVATAR_INFORMATIONT AI = {0};
AI.cbSize = sizeof(AI);
@@ -176,16 +176,16 @@ void AvatarDownloaded(HANDLE hContact) }
-static void __cdecl WeatherGetAwayMsgThread(HANDLE hContact)
+static void __cdecl WeatherGetAwayMsgThread(void *hContact)
{
Sleep(100);
DBVARIANT dbv;
- if ( !db_get_ts(hContact, "CList", "StatusMsg", &dbv)) {
- ProtoBroadcastAck(WEATHERPROTONAME, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
+ if (!db_get_ts((HCONTACT)hContact, "CList", "StatusMsg", &dbv)) {
+ ProtoBroadcastAck(WEATHERPROTONAME, (HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
db_free( &dbv );
}
- else ProtoBroadcastAck(WEATHERPROTONAME, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0);
+ else ProtoBroadcastAck(WEATHERPROTONAME, (HCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
static INT_PTR WeatherGetAwayMsg(WPARAM wParam, LPARAM lParam)
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index ace0423881..a951d5980b 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -34,7 +34,7 @@ UPDATELIST *UpdateListTail; // retrieve weather info and display / log them
// hContact = current contact
-int UpdateWeather(HANDLE hContact)
+int UpdateWeather(HCONTACT hContact)
{
TCHAR str[256], str2[MAX_TEXT_SIZE];
DBVARIANT dbv;
@@ -219,7 +219,7 @@ int UpdateWeather(HANDLE hContact) // a linked list queue for updating weather station
// this function add a weather contact to the end of queue for update
// hContact = current contact
-void UpdateListAdd(HANDLE hContact)
+void UpdateListAdd(HCONTACT hContact)
{
UPDATELIST *newItem = (UPDATELIST*)mir_alloc(sizeof(UPDATELIST));
newItem->hContact = hContact;
@@ -236,9 +236,9 @@ void UpdateListAdd(HANDLE hContact) // get the first item from the update queue and remove it from the queue
// return value = the contact for next update
-HANDLE UpdateGetFirst()
+HCONTACT UpdateGetFirst()
{
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
WaitForSingleObject(hUpdateMutex, INFINITE);
@@ -283,9 +283,10 @@ void DestroyUpdateList(void) void UpdateAll(BOOL AutoUpdate, BOOL RemoveData)
{
// add all weather contact to the update queue list
- for (HANDLE hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME))
+ for (HCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME))
if ( !db_get_b(hContact,WEATHERPROTONAME, "AutoUpdate",FALSE) || !AutoUpdate) {
- if (RemoveData) DBDataManage((HANDLE)hContact, WDBM_REMOVE, 0, 0);
+ if (RemoveData)
+ DBDataManage((HCONTACT)hContact, WDBM_REMOVE, 0, 0);
UpdateListAdd(hContact);
}
@@ -299,9 +300,9 @@ void UpdateAll(BOOL AutoUpdate, BOOL RemoveData) // wParam = handle for the weather station that is going to be updated
INT_PTR UpdateSingleStation(WPARAM wParam, LPARAM lParam)
{
- if (IsMyContact((HANDLE)wParam)) {
+ if (IsMyContact((HCONTACT)wParam)) {
// add the station to the end of the update queue
- UpdateListAdd((HANDLE)wParam);
+ UpdateListAdd((HCONTACT)wParam);
// if it is not updating, then start the update thread process
// if it is updating, the stations just added to the queue will get
@@ -317,10 +318,10 @@ INT_PTR UpdateSingleStation(WPARAM wParam, LPARAM lParam) // wParam = handle for the weather station that is going to be updated
INT_PTR UpdateSingleRemove(WPARAM wParam, LPARAM lParam)
{
- if (IsMyContact((HANDLE)wParam)) {
+ if (IsMyContact((HCONTACT)wParam)) {
// add the station to the end of the update queue, and also remove old data
- DBDataManage((HANDLE)wParam, WDBM_REMOVE, 0, 0);
- UpdateListAdd((HANDLE)wParam);
+ DBDataManage((HCONTACT)wParam, WDBM_REMOVE, 0, 0);
+ UpdateListAdd((HCONTACT)wParam);
// if it is not updating, then start the update thread process
// if it is updating, the stations just added to the queue will get updated by the already-running process
@@ -372,7 +373,7 @@ INT_PTR UpdateAllRemove(WPARAM wParam,LPARAM lParam) { // getting weather data and save them into the database
// hContact = the contact to get the data
-int GetWeatherData(HANDLE hContact)
+int GetWeatherData(HCONTACT hContact)
{
// get eacnh part of the id's
TCHAR id[256];
diff --git a/plugins/Weather/src/weather_userinfo.cpp b/plugins/Weather/src/weather_userinfo.cpp index 955b46639b..827badd085 100644 --- a/plugins/Weather/src/weather_userinfo.cpp +++ b/plugins/Weather/src/weather_userinfo.cpp @@ -46,7 +46,7 @@ int UserInfoInit(WPARAM wParam, LPARAM lParam) }
else {
// check if it is a weather contact
- if (IsMyContact((HANDLE)lParam)) {
+ if (IsMyContact((HCONTACT)lParam)) {
// register the contact info page
odp.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
odp.pfnDlgProc = DlgProcUIPage;
@@ -64,16 +64,16 @@ INT_PTR CALLBACK DlgProcUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa WEATHERINFO w;
TCHAR str[MAX_TEXT_SIZE];
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
SendMessage(GetDlgItem(hwndDlg,IDC_MOREDETAIL), BUTTONSETASFLATBTN, TRUE, 0);
// save the contact handle for later use
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)hContact);
// load weather info for the contact
- w = LoadWeatherInfo((HANDLE)lParam);
+ w = LoadWeatherInfo((HCONTACT)lParam);
SetDlgItemText(hwndDlg, IDC_INFO1, GetDisplay(&w, TranslateT("Current condition for %n"), str));
SendDlgItemMessage(hwndDlg, IDC_INFOICON, STM_SETICON,
@@ -158,12 +158,12 @@ static int BriefDlgResizer(HWND hwnd, LPARAM lParam, UTILRESIZECONTROL *urc) INT_PTR CALLBACK DlgProcMoreData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static const unsigned tabstops = 48;
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
// save the contact handle for later use
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)hContact);
SendDlgItemMessage(hwndDlg, IDC_MTEXT, EM_AUTOURLDETECT, (WPARAM) TRUE, 0);
@@ -327,7 +327,7 @@ INT_PTR CALLBACK DlgProcMoreData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l // set the title of the dialog and on the which rectangle
// also load brief info into message box
-void LoadBriefInfoText(HWND hwndDlg, HANDLE hContact)
+void LoadBriefInfoText(HWND hwndDlg, HCONTACT hContact)
{
WEATHERINFO winfo;
TCHAR str[4096], str2[4096];
@@ -354,8 +354,8 @@ void LoadBriefInfoText(HWND hwndDlg, HANDLE hContact) int BriefInfo(WPARAM wParam, LPARAM lParam)
{
// make sure that the contact is actually a weather one
- if (IsMyContact((HANDLE)wParam)) {
- HWND hMoreDataDlg = WindowList_Find(hDataWindowList,(HANDLE)wParam);
+ if (IsMyContact((HCONTACT)wParam)) {
+ HWND hMoreDataDlg = WindowList_Find(hDataWindowList, (HCONTACT)wParam);
if (hMoreDataDlg != NULL) {
SetForegroundWindow(hMoreDataDlg);
SetFocus(hMoreDataDlg);
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index a627aec43b..1432bb4c4e 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -96,7 +96,7 @@ void ChangeContactStatus(int con_stat) if (con_stat == 3)
status_code = ID_STATUS_NA;
- for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME))
+ for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME))
db_set_w(hContact, MODULENAME, "Status", status_code);
}
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index 5ce833865b..c1e00d6532 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -104,7 +104,7 @@ void FillFontListThread(void *param) /*****************************************************************************/
void TxtclrLoop()
{
- for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
+ for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
HWND hwndDlg = WindowList_Find(hWindowList, hContact);
SetDlgItemText(hwndDlg, IDC_DATA, _T(""));
InvalidateRect(hwndDlg, NULL, 1);
@@ -114,7 +114,7 @@ void TxtclrLoop() /*****************************************************************************/
void BGclrLoop()
{
- for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
+ for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
HWND hwndDlg = (WindowList_Find(hWindowList, hContact));
SetDlgItemText(hwndDlg, IDC_DATA, _T(""));
SendMessage(GetDlgItem(hwndDlg, IDC_DATA), EM_SETBKGNDCOLOR, 0, BackgoundClr);
@@ -128,7 +128,7 @@ void StartUpdate(void *dummy) StartUpDelay = 1;
Sleep(((db_get_dw(NULL, MODULENAME, START_DELAY_KEY, 0)) * SECOND));
- for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME))
+ for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME))
GetData(hContact);
StartUpDelay = 0;
@@ -138,7 +138,7 @@ void StartUpdate(void *dummy) void ContactLoop(void *dummy)
{
if (StartUpDelay == 0) {
- for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
+ for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
GetData(hContact);
Sleep(10); // avoid 100% CPU
}
@@ -176,7 +176,7 @@ void InitialiseGlobals(void) /*****************************************************************************/
int Doubleclick(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
char *szProto = GetContactProto(hContact);
if ( lstrcmpA(MODULENAME, szProto))
return 0;
@@ -371,7 +371,7 @@ int ModulesLoaded(WPARAM, LPARAM) /*****************************************************************************/
INT_PTR DataWndMenuCommand(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HWND hwndDlg = WindowList_Find(hWindowList, hContact);
if (hwndDlg != NULL) {
DestroyWindow(hwndDlg);
@@ -432,7 +432,7 @@ INT_PTR AddContactMenuCommand(WPARAM, LPARAM) }
/*****************************************************************************/
-int OnTopMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact)
+int OnTopMenuCommand(WPARAM wParam, LPARAM lParam, HCONTACT singlecontact)
{
int ontop = 0;
int done = 0;
@@ -455,7 +455,7 @@ int OnTopMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact) /*****************************************************************************/
INT_PTR WebsiteMenuCommand(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
ptrT url( db_get_tsa(hContact, MODULENAME, "URL"));
if (url)
CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM)url);
@@ -465,7 +465,7 @@ INT_PTR WebsiteMenuCommand(WPARAM wParam, LPARAM lParam) }
/*****************************************************************************/
-int UpdateMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact)
+int UpdateMenuCommand(WPARAM wParam, LPARAM lParam, HCONTACT singlecontact)
{
mir_forkthread(GetData, singlecontact);
return 0;
@@ -474,14 +474,14 @@ int UpdateMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact) /*****************************************************************************/
int ContactMenuItemUpdateData(WPARAM wParam, LPARAM lParam)
{
- UpdateMenuCommand(wParam, lParam, (HANDLE)wParam);
+ UpdateMenuCommand(wParam, lParam, (HCONTACT)wParam);
return 0;
}
/*****************************************************************************/
INT_PTR CntOptionsMenuCommand(WPARAM wParam, LPARAM)
{
- HWND hwndDlg = WindowList_Find(hWindowList, (HANDLE)wParam);
+ HWND hwndDlg = WindowList_Find(hWindowList, (HCONTACT)wParam);
if (hwndDlg) {
DestroyWindow(hwndDlg);
return 0;
@@ -496,7 +496,7 @@ INT_PTR CntOptionsMenuCommand(WPARAM wParam, LPARAM) /*****************************************************************************/
INT_PTR CntAlertMenuCommand(WPARAM wParam, LPARAM)
{
- HWND hwndDlg = WindowList_Find(hWindowList, (HANDLE) wParam);
+ HWND hwndDlg = WindowList_Find(hWindowList, (HCONTACT) wParam);
if (hwndDlg) {
DestroyWindow(hwndDlg);
return 0;
diff --git a/plugins/WebView/src/webview.h b/plugins/WebView/src/webview.h index d74d6de614..73c410bf7d 100644 --- a/plugins/WebView/src/webview.h +++ b/plugins/WebView/src/webview.h @@ -117,7 +117,7 @@ //lets get rid of some warnings
void CodetoSymbol(char *truncated);
-void GetData(HANDLE hContact);
+void GetData(void *param);
void FillFontListThread(void *);
INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -190,8 +190,8 @@ INT_PTR ShowHideContactCommand(WPARAM wParam, LPARAM lParam); INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM lParam);
INT_PTR StpPrcssMenuCommand(WPARAM wParam, LPARAM lParam);
-int UpdateMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact);
-int OnTopMenuCommand(WPARAM wParam, LPARAM lParam, HANDLE singlecontact);
+int UpdateMenuCommand(WPARAM wParam, LPARAM lParam, HCONTACT singlecontact);
+int OnTopMenuCommand(WPARAM wParam, LPARAM lParam, HCONTACT singlecontact);
//
void ChangeContactStatus(int con_stat);
@@ -206,7 +206,7 @@ void RemoveTabs(char *truncated); void FastTagFilter(char *truncated);
void EraseBlock(char *truncated);
void EraseSymbols(char *truncated);
-int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactname, int notpresent);
+int ProcessAlerts(HCONTACT hContact, char *truncated, char *tstr, char *contactname, int notpresent);
INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -223,8 +223,8 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM void AckFunc(void *dummy);
int SiteDeleted(WPARAM wParam, LPARAM lParam);
-int WErrorPopup(HANDLE hContact, TCHAR *textdisplay);
-int WAlertPopup(HANDLE hContact, TCHAR *displaytext);
+int WErrorPopup(HCONTACT hContact, TCHAR *textdisplay);
+int WAlertPopup(HCONTACT hContact, TCHAR *displaytext);
//////////////////////
// wrappers
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 5da24a6c4d..0ab3287d87 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -29,7 +29,7 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) switch (message) {
case WM_COMMAND:
case WM_CONTEXTMENU:
- HANDLE hContact = PUGetContact(hWnd);
+ HCONTACT hContact = PUGetContact(hWnd);
ptrT url( db_get_tsa(hContact, MODULENAME, URL_KEY));
if (message == WM_COMMAND) { // left click
@@ -44,7 +44,7 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if ( db_get_b(NULL, MODULENAME, LCLK_WEB_PGE_KEY, 0)) {
CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM)url);
PUDeletePopup(hWnd);
- db_set_w((HANDLE)wParam, MODULENAME, "Status", ID_STATUS_ONLINE);
+ db_set_w((HCONTACT)wParam, MODULENAME, "Status", ID_STATUS_ONLINE);
}
// dismiss
if ( db_get_b(NULL, MODULENAME, LCLK_DISMISS_KEY, 1))
@@ -65,7 +65,7 @@ int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if ( db_get_b(NULL, MODULENAME, RCLK_WEB_PGE_KEY, 1)) {
CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM)url);
PUDeletePopup(hWnd);
- db_set_w((HANDLE)wParam, MODULENAME, "Status", ID_STATUS_ONLINE);
+ db_set_w((HCONTACT)wParam, MODULENAME, "Status", ID_STATUS_ONLINE);
}
// dismiss
if ( db_get_b(NULL, MODULENAME, RCLK_DISMISS_KEY, 0))
@@ -88,21 +88,21 @@ int WDisplayDataAlert(void *hContact) }
/*****************************************************************************/
-int WAlertPopup(HANDLE hContact, TCHAR *displaytext)
+int WAlertPopup(HCONTACT hContact, TCHAR *displaytext)
{
NotifyEventHooks(hHookAlertPopup, (WPARAM)hContact, (LPARAM)displaytext);
return 0;
}
/*****************************************************************************/
-int WErrorPopup(HANDLE hContact, TCHAR *textdisplay)
+int WErrorPopup(HCONTACT hContact, TCHAR *textdisplay)
{
NotifyEventHooks(hHookErrorPopup, (WPARAM)hContact, (LPARAM) textdisplay);
return 0;
}
/*****************************************************************************/
-int WAlertOSD(HANDLE hContact, TCHAR *displaytext)
+int WAlertOSD(HCONTACT hContact, TCHAR *displaytext)
{
NotifyEventHooks(hHookAlertOSD, (WPARAM)hContact, (LPARAM) displaytext);
return 0;
@@ -115,13 +115,13 @@ int WPopupAlert(WPARAM wParam, LPARAM lParam) if( ((HANDLE)wParam) != NULL) {
DBVARIANT dbv;
- db_get_ts((HANDLE)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv);
+ db_get_ts((HCONTACT)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv);
lstrcpyn(ppd.lptzContactName, dbv.ptszVal, SIZEOF(ppd.lptzContactName));
db_free(&dbv);
}
else lstrcpy(ppd.lptzContactName, _A2T(MODULENAME));
- ppd.lchContact = (HANDLE)wParam;
+ ppd.lchContact = (HCONTACT)wParam;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
TCHAR *displaytext = (TCHAR*)lParam;
@@ -158,7 +158,7 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) POPUPDATA ppd = { 0 };
if (((HANDLE)wParam) != NULL) {
DBVARIANT dbv;
- if ( !db_get_s((HANDLE)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
+ if ( !db_get_s((HCONTACT)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
lstrcpynA(ppd.lptzContactName, dbv.pszVal, SIZEOF(ppd.lptzContactName));
db_free(&dbv);
}
@@ -166,7 +166,7 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) if (ppd.lptzContactName[0] == 0)
strncpy_s(ppd.lptzContactName, SIZEOF(ppd.lptzContactName), MODULENAME, _TRUNCATE);
- ppd.lchContact = (HANDLE)wParam;
+ ppd.lchContact = (HCONTACT)wParam;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
char *displaytext = (char*)lParam;
@@ -205,7 +205,7 @@ int OSDAlert(WPARAM wParam, LPARAM lParam) if (((HANDLE)wParam) != NULL) {
DBVARIANT dbv;
- if ( !db_get_s((HANDLE)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
+ if ( !db_get_s((HCONTACT)wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
strncpy_s(contactname, SIZEOF(contactname), dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
@@ -225,7 +225,7 @@ int OSDAlert(WPARAM wParam, LPARAM lParam) /*****************************************************************************/
int ErrorMsgs(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
TCHAR newdisplaytext[2000], *displaytext = (TCHAR*)lParam;
if ( db_get_b(NULL, MODULENAME, SUPPRESS_ERR_KEY, 0))
@@ -254,7 +254,7 @@ int ErrorMsgs(WPARAM wParam, LPARAM lParam) }
/*****************************************************************************/
-void SaveToFile(HANDLE hContact, char *truncated)
+void SaveToFile(HCONTACT hContact, char *truncated)
{
char *mode;
if (!db_get_b(hContact, MODULENAME, APPEND_KEY, 0))
@@ -299,7 +299,7 @@ void SaveToFile(HANDLE hContact, char *truncated) }
/*****************************************************************************/
-int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactname, int notpresent)
+int ProcessAlerts(HCONTACT hContact, char *truncated, char *tstr, char *contactname, int notpresent)
{
char alertstring[255];
TCHAR displaystring[300];
@@ -479,7 +479,7 @@ int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactnam // file exists?
if ( _taccess(newcachepath, 0) != -1) {
if ((pcachefile = _tfopen(newcachepath, _T("r"))) == NULL)
- WErrorPopup(contactname, TranslateT("Cannot read from file"));
+ WErrorPopup((HCONTACT)contactname, TranslateT("Cannot read from file"));
else {
ZeroMemory(&cachecompare, sizeof(cachecompare));
fread(cachecompare, sizeof(cachecompare), 1, pcachefile);
@@ -488,7 +488,7 @@ int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactnam }
// write to cache
if ((pcachefile = _tfopen(newcachepath, _T("w"))) == NULL)
- WErrorPopup(contactname, TranslateT("Cannot write to file 1"));
+ WErrorPopup((HCONTACT)contactname, TranslateT("Cannot write to file 1"));
else {
fwrite(tempraw, strlen(tempraw), 1, pcachefile); //smaller cache
fclose(pcachefile);
@@ -691,7 +691,7 @@ int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactnam // file exists?
if ( _taccess(newcachepath, 0) != -1) {
if ((pcachefile = _tfopen(newcachepath, _T("r"))) == NULL)
- WErrorPopup(contactname, TranslateT("Cannot read from file"));
+ WErrorPopup((HCONTACT)contactname, TranslateT("Cannot read from file"));
else {
ZeroMemory(&cachecompare, sizeof(cachecompare));
fread(cachecompare, sizeof(cachecompare), 1, pcachefile);
@@ -700,7 +700,7 @@ int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactnam }
// write to cache
if ((pcachefile = _tfopen(newcachepath, _T("w"))) == NULL)
- WErrorPopup(contactname, TranslateT("Cannot write to file 2"));
+ WErrorPopup((HCONTACT)contactname, TranslateT("Cannot write to file 2"));
else {
fwrite(raw, strlen(raw), 1, pcachefile); //smaller cache
db_set_ts(hContact, MODULENAME, CACHE_FILE_KEY, newcachepath);
@@ -814,7 +814,7 @@ int ProcessAlerts(HANDLE hContact, char *truncated, char *tstr, char *contactnam /*****************************************************************************/
int DataWndAlertCommand(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if ( WindowList_Find(hWindowList, hContact))
return 0;
@@ -836,8 +836,10 @@ int DataWndAlertCommand(WPARAM wParam, LPARAM lParam) }
/*****************************************************************************/
-void ReadFromFile(HANDLE hContact)
+void ReadFromFile(void *param)
{
+ HCONTACT hContact = (HCONTACT)param;
+
DBVARIANT dbv;
char truncated[MAXSIZE1];
int AmountWspcRem = 0;
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index 2c166e17ae..24ba98a50b 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -119,16 +119,16 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara static TCHAR tszSizeString[] = _T("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
-static HANDLE FindContactByUrl(HWND hwndDlg)
+static HCONTACT FindContactByUrl(HWND hwndDlg)
{
- HANDLE res = NULL;
+ HCONTACT res = NULL;
TCHAR urltext[300], titlebartxt[300];
int contactcount = 0;
GetDlgItemText(hwndDlg, IDC_OPEN_URL, urltext, SIZEOF(urltext));
GetWindowText(hwndDlg, titlebartxt, SIZEOF(titlebartxt));
- for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
+ for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
ptrT db1( db_get_tsa(hContact, MODULENAME, URL_KEY));
ptrT db2( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY));
@@ -149,13 +149,13 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DBVARIANT dbv;
RECT rc;
TCHAR url[300];
- HANDLE hContact;
+ HCONTACT hContact;
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- HANDLE hContact2 = (HANDLE) lParam;
+ HCONTACT hContact2 = (HCONTACT)lParam;
SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG) hContact2);
WindowList_Add(hWindowList, hwndDlg, hContact2);
@@ -339,7 +339,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_OPEN_URL:
GetDlgItemText(hwndDlg, IDC_OPEN_URL, url, SIZEOF(url));
CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM)url);
- db_set_w((HANDLE)wParam, MODULENAME, "Status", ID_STATUS_ONLINE);
+ db_set_w((HCONTACT)wParam, MODULENAME, "Status", ID_STATUS_ONLINE);
break;
case IDC_UPDATE_BUTTON:
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 4522eee824..b56688180c 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -27,8 +27,9 @@ int Startingup = 1; int AlreadyDownloading = 0;
/*******************/
-void GetData(HANDLE hContact)
+void GetData(void *param)
{
+ HCONTACT hContact = (HCONTACT)param;
int statpos = 0, dispos = 0, statposend = 0;
char*pos;
DBVARIANT dbv;
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index d7606ecb12..fd3246dc47 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -277,7 +277,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l int alertIndex = 0;
int eventIndex = 0;
static int test;
- HANDLE hContact;
+ HCONTACT hContact;
ParentHwnd = GetParent(hwndDlg);
@@ -285,7 +285,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case WM_INITDIALOG:
test = 0;
TranslateDialogDefault(hwndDlg);
- hContact = (HANDLE)lParam;
+ hContact = (HCONTACT)lParam;
SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG) hContact);
@@ -509,7 +509,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l break;
case IDC_ENABLE_ALERTS:
- hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ hContact = (HCONTACT)GetWindowLong(hwndDlg, GWLP_USERDATA);
EnableWindow(GetDlgItem(hwndDlg, IDC_ADD_DATE_NAME), (IsDlgButtonChecked(hwndDlg, IDC_ENABLE_ALERTS)));
if ( IsDlgButtonChecked(hwndDlg, IDC_ADD_DATE_NAME)) {
@@ -631,7 +631,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_ALERT_TYPE:
if (HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_EDITCHANGE) {
- hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ hContact = (HCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA);
int alertIndex = SendDlgItemMessage(hwndDlg, IDC_ALERT_TYPE, CB_GETCURSEL, 0, 0);
if (HIWORD(wParam) == CBN_SELCHANGE) {
@@ -678,7 +678,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_EVENT_TYPE:
if (HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == CBN_EDITCHANGE) {
- HANDLE hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA);
int eventIndex = SendDlgItemMessage(hwndDlg, IDC_EVENT_TYPE, CB_GETCURSEL, 0, 0);
if (HIWORD(wParam) == CBN_SELCHANGE) {
@@ -709,7 +709,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_ALERT_APPLY:
case IDC_OK2:
{
- hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ hContact = (HCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA);
TCHAR buf[MAX_PATH];
eventIndex = db_get_b(hContact, MODULENAME, EVNT_INDEX_KEY, 0);
@@ -815,13 +815,13 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM HWND ParentHwnd = GetParent(hwndDlg);
static int test;
static int test2;
- HANDLE hContact;
+ HCONTACT hContact;
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- hContact = (HANDLE) lParam;
+ hContact = (HCONTACT) lParam;
test = 0;
test2 = 0;
@@ -927,7 +927,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case IDC_CPY_STRINGS:
{
TCHAR string[128];
- hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ hContact = (HCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_START, string, SIZEOF(string));
db_set_ts(hContact, MODULENAME, ALRT_S_STRING_KEY, string);
@@ -1022,7 +1022,7 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break;
}
- hContact = (HANDLE) GetWindowLong(hwndDlg, GWLP_USERDATA);
+ hContact = (HCONTACT) GetWindowLong(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_URL, url, SIZEOF(url));
db_set_ts(hContact, MODULENAME, URL_KEY, url);
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 776c5431e1..717966f75d 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -32,7 +32,7 @@ static char szInvalidChars[] = { '\\', '/', ':', '*', '?', '\"', '<', '>', '|' } int DBSettingChanged(WPARAM wParam, LPARAM lParam)
{
// We can't upload changes to NULL contact
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -60,7 +60,7 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) for (int i=0; i < SIZEOF(szInvalidChars); i++ ) {
TCHAR *p = _tcschr(nick, szInvalidChars[i]);
if (p != NULL) {
- WErrorPopup("ERROR", TranslateT("Invalid symbol present in contact name."));
+ WErrorPopup((HCONTACT)"ERROR", TranslateT("Invalid symbol present in contact name."));
*p = '_';
invalidpresent =1;
}
@@ -111,7 +111,7 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) /*****************************************************************************/
int SiteDeleted(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (lstrcmpA(GetContactProto(hContact), MODULENAME))
return 0;
@@ -152,7 +152,7 @@ INT_PTR OpenCacheDir(WPARAM, LPARAM) mir_sntprintf(cachedirectorypath, SIZEOF(cachedirectorypath), _T("%s")_T(MODULENAME)_T("cache\\%s"), cachepath, cacheend);
if( _taccess(cachedirectorypath, 0) != 0)
- WErrorPopup("ERROR", TranslateT("Cache folder does not exist."));
+ WErrorPopup((HCONTACT)"ERROR", TranslateT("Cache folder does not exist."));
else
ShellExecute(NULL, _T("open"), cachedirectorypath, NULL, NULL, SW_SHOWNORMAL);
return 0;
@@ -163,11 +163,11 @@ INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM lParam) {
FILE *pfile = fopen("psite.bat", "r");
if (pfile == NULL) {
- WErrorPopup("ERROR", TranslateT("Missing \"psite.bat\" file."));
+ WErrorPopup((HCONTACT)"ERROR", TranslateT("Missing \"psite.bat\" file."));
return 0;
}
- ptrT url( db_get_tsa((HANDLE) wParam, MODULENAME, "URL"));
+ ptrT url( db_get_tsa((HCONTACT)wParam, MODULENAME, "URL"));
if (url == NULL)
return 0;
@@ -188,7 +188,7 @@ INT_PTR PingWebsiteMenuCommand(WPARAM wParam, LPARAM lParam) /*****************************************************************************/
INT_PTR StpPrcssMenuCommand(WPARAM wParam, LPARAM)
{
- db_set_b((HANDLE)wParam, MODULENAME, STOP_KEY, 1);
+ db_set_b((HCONTACT)wParam, MODULENAME, STOP_KEY, 1);
return 0;
}
@@ -251,7 +251,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam) // Make sure no contact has offline status for any reason on first time run
if ( db_get_b(NULL, MODULENAME, "FirstTime", 100) == 100) {
- for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME))
+ for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME))
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_ONLINE);
db_set_b(NULL, MODULENAME, "FirstTime", 1);
@@ -341,7 +341,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) int samename = 0;
// search for existing contact
- for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
+ for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME)) {
// check ID to see if the contact already exist in the database
if (!db_get_ts(hContact, MODULENAME, "URL", &dbv)) {
if (!lstrcmpi(psr->nick, dbv.ptszVal)) {
@@ -359,7 +359,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) }
if (psr->nick == NULL) {
- WErrorPopup("ERROR", TranslateT("Please select site in Find/Add contacts..."));
+ WErrorPopup((HCONTACT)"ERROR", TranslateT("Please select site in Find/Add contacts..."));
return 0;
}
@@ -367,7 +367,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) if (psr->cbSize != sizeof(PROTOSEARCHRESULT))
return NULL;
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT hContact = (HCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) MODULENAME);
/////////write to db
@@ -403,7 +403,7 @@ INT_PTR AddToList(WPARAM wParam, LPARAM lParam) TCHAR *Nend = _tcschr(Newnick, '.');
if (Nend) *Nend = '\0';
- for (HANDLE hContact2 = db_find_first(MODULENAME); hContact2 != NULL; hContact2 = db_find_next(hContact2, MODULENAME)) {
+ for (HCONTACT hContact2 = db_find_first(MODULENAME); hContact2 != NULL; hContact2 = db_find_next(hContact2, MODULENAME)) {
if (!db_get_ts(hContact2, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
if (!lstrcmpi(Newnick, dbv.ptszVal)) {
// remove the flag for not on list and hidden, thus make the
@@ -461,6 +461,6 @@ INT_PTR GetInfo(WPARAM, LPARAM) /*****************************************************************************/
void AckFunc(void *dummy)
{
- for (HANDLE hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME))
+ for (HCONTACT hContact = db_find_first(MODULENAME); hContact != NULL; hContact = db_find_next(hContact, MODULENAME))
ProtoBroadcastAck(MODULENAME, hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
diff --git a/plugins/WhenWasIt/src/birthdays.cpp b/plugins/WhenWasIt/src/birthdays.cpp index a99ed2e868..d3615a06f9 100644 --- a/plugins/WhenWasIt/src/birthdays.cpp +++ b/plugins/WhenWasIt/src/birthdays.cpp @@ -82,7 +82,7 @@ void CBirthdays::Realloc(int increaseCapacity) birthdays = (PBirthdayContact *) realloc(birthdays, size * sizeof(PBirthdayContact));
}
-int CBirthdays::Add(HANDLE hContact, HANDLE hClistIcon)
+int CBirthdays::Add(HCONTACT hContact, HANDLE hClistIcon)
{
if ( !Contains(hContact)) {
EnsureCapacity();
@@ -107,12 +107,12 @@ int CBirthdays::Remove(int index) return -1;
}
-int CBirthdays::Remove(HANDLE hContact)
+int CBirthdays::Remove(HCONTACT hContact)
{
return Remove( Index(hContact));
}
-int CBirthdays::Contains(HANDLE hContact) const
+int CBirthdays::Contains(HCONTACT hContact) const
{
for (int i = 0; i < count; i++)
if (birthdays[i]->hContact == hContact)
@@ -121,7 +121,7 @@ int CBirthdays::Contains(HANDLE hContact) const return FALSE;
}
-int CBirthdays::Index(HANDLE hContact) const
+int CBirthdays::Index(HCONTACT hContact) const
{
for (int i = 0; i < count; i++)
if (birthdays[i]->hContact == hContact)
@@ -140,7 +140,7 @@ int CBirthdays::GetAdvancedIconIndex() const return advancedIcon;
}
-HANDLE CBirthdays::GetClistIcon(HANDLE hContact) const
+HANDLE CBirthdays::GetClistIcon(HCONTACT hContact) const
{
int index = Index(hContact);
if ((index >= 0) && (index < count))
diff --git a/plugins/WhenWasIt/src/birthdays.h b/plugins/WhenWasIt/src/birthdays.h index c54042800c..f42b8dc09c 100644 --- a/plugins/WhenWasIt/src/birthdays.h +++ b/plugins/WhenWasIt/src/birthdays.h @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define M_WWI_BIRTHDAYS_H
struct TBirthdayContact{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hClistIcon;
};
@@ -45,19 +45,19 @@ class CBirthdays CBirthdays(int initialSize = 10);
~CBirthdays();
- int Add(HANDLE hContact, HANDLE hClistIcon);
+ int Add(HCONTACT hContact, HANDLE hClistIcon);
int Remove(int index);
- int Remove(HANDLE hContact);
+ int Remove(HCONTACT hContact);
void Clear();
void Destroy();
- int Index(HANDLE hContact) const;
- int Contains(HANDLE hContact) const;
+ int Index(HCONTACT hContact) const;
+ int Contains(HCONTACT hContact) const;
void SetAdvancedIconIndex(int advIcon);
int GetAdvancedIconIndex() const;
- HANDLE GetClistIcon(HANDLE hContact) const;
+ HANDLE GetClistIcon(HCONTACT hContact) const;
int Count() const;
int Size() const;
diff --git a/plugins/WhenWasIt/src/date_utils.cpp b/plugins/WhenWasIt/src/date_utils.cpp index 6c510da4ae..863371eead 100644 --- a/plugins/WhenWasIt/src/date_utils.cpp +++ b/plugins/WhenWasIt/src/date_utils.cpp @@ -33,7 +33,7 @@ bool IsDOBValid(int year, int month, int day) return (year != 0 && month != 0 && day != 0);
}
-int GetContactDOB(HANDLE hContact, int &year, int &month, int &day)
+int GetContactDOB(HCONTACT hContact, int &year, int &month, int &day)
{
year = db_get_w(hContact, "UserInfo", "DOBy", 0);
month = db_get_b(hContact, "UserInfo", "DOBm", 0);
@@ -69,7 +69,7 @@ int GetContactDOB(HANDLE hContact, int &year, int &month, int &day) return DOB_UNKNOWN;
}
-int GetContactAge(HANDLE hContact)
+int GetContactAge(HCONTACT hContact)
{
int year, month, day;
time_t tNow;
@@ -79,7 +79,7 @@ int GetContactAge(HANDLE hContact) return (now->tm_year + 1900) - year;
}
-char GetContactGender(HANDLE hContact)
+char GetContactGender(HCONTACT hContact)
{
char gender = db_get_b(hContact, "UserInfo", "Gender", 'U');
if (gender == 'U')
@@ -185,7 +185,7 @@ void FillStandard(char *&module, char *&sYear, char *&sMonth, char *&sDay) sDay = "DOBd";
}
-int SaveBirthday(HANDLE hContact, int year, int month, int day, int mode)
+int SaveBirthday(HCONTACT hContact, int year, int month, int day, int mode)
{
char *sModule, *sdModule, *sd2Module; //s* = keep, sd* = delete, sd2* = delete
char *sYear, *sdYear, *sd2Year;
diff --git a/plugins/WhenWasIt/src/date_utils.h b/plugins/WhenWasIt/src/date_utils.h index 6b4cfcc7f2..db69702729 100644 --- a/plugins/WhenWasIt/src/date_utils.h +++ b/plugins/WhenWasIt/src/date_utils.h @@ -42,10 +42,10 @@ bool IsDOBValid(int year, int month, int day); unsigned int DaysToBirthday(time_t now, int ctYear, int ctMonth, int ctDay);
int DaysAfterBirthday(time_t now, int ctYear, int ctMonth, int ctDay);
-int GetContactAge(HANDLE hContact);
-int GetContactDOB(HANDLE hContact, int &year, int &month, int &day);
-char GetContactGender(HANDLE hContact);
+int GetContactAge(HCONTACT hContact);
+int GetContactDOB(HCONTACT hContact, int &year, int &month, int &day);
+char GetContactGender(HCONTACT hContact);
-int SaveBirthday(HANDLE hContact, int year, int month, int day, int mode);
+int SaveBirthday(HCONTACT hContact, int year, int month, int day, int mode);
#endif //H_WWI_DATE_UTILS_H
\ No newline at end of file diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index ddbe9fa6b8..dfbd581dd5 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -272,7 +272,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara case IDC_PREVIEW:
{
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
int dtb = rand() % 11; //0..10
int age = rand() % 50 + 1; //1..50
PopupNotifyBirthday(hContact, dtb, age);
@@ -391,15 +391,14 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hWnd, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hWnd);
SetWindowLongPtr(hWnd, GWLP_USERDATA, lParam);
-
{
- HANDLE hContact = (HANDLE) lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
WindowList_Add(hAddBirthdayWndsList, hWnd, hContact);
Utils_RestoreWindowPositionNoSize(hWnd,hContact,ModuleName,"BirthdayWnd");
}
@@ -490,7 +489,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l case IDOK:
{
SYSTEMTIME st;
- HANDLE hContact = (HANDLE) GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hWnd, GWLP_USERDATA);
HWND hDate = GetDlgItem(hWnd, IDC_DATE);
if (DateTime_GetSystemtime(hDate, &st) == GDT_VALID) {
int mode = SendMessage(GetDlgItem(hWnd, IDC_COMPATIBILITY), CB_GETCURSEL, 0, 0); //SAVE modes in date_utils.h are synced
@@ -520,7 +519,7 @@ void AddAnchorWindowToDeferList(HDWP &hdWnds, HWND window, RECT *rParent, WINDOW #define NA TranslateT("N/A")
-TCHAR *GetBirthdayModule(int module, HANDLE hContact)
+TCHAR *GetBirthdayModule(int module, HCONTACT hContact)
{
switch (module) {
case DOB_MBIRTHDAY: return _T("mBirthday");
@@ -570,7 +569,7 @@ INT_PTR CALLBACK BirthdaysCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam }
//only updates the birthday part of the list view entry. Won't update the szProto and the contact name (those shouldn't change anyway :))
-int UpdateBirthdayEntry(HWND hList, HANDLE hContact, int entry, int bShowAll, int bShowCurrentAge, int bAdd)
+int UpdateBirthdayEntry(HWND hList, HCONTACT hContact, int entry, int bShowAll, int bShowCurrentAge, int bAdd)
{
int currentMonth, currentDay;
int res = entry;
@@ -656,14 +655,14 @@ static LRESULT CALLBACK BirthdaysListSubclassProc(HWND hWnd, UINT msg, WPARAM wP case WM_LBUTTONDBLCLK:
{
int count = ListView_GetItemCount(hWnd);
- HANDLE hContact;
+ HCONTACT hContact;
LVITEM item = {0};
item.mask = LVIF_PARAM;
for (int i = 0; i < count; i++) {
if (ListView_GetItemState(hWnd, i, LVIS_SELECTED)) {
item.iItem = i;
ListView_GetItem(hWnd, &item);
- hContact = (HANDLE) item.lParam;
+ hContact = (HCONTACT)item.lParam;
CallService(MS_WWI_ADD_BIRTHDAY, (WPARAM) hContact, 0);
}
}
@@ -687,7 +686,7 @@ int LoadBirthdays(HWND hWnd, int bShowAll) ListView_DeleteAllItems(hList);
int count = 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))
count = UpdateBirthdayEntry(hList, hContact, count, bShowAll, commonData.cShowAgeMode, 1);
SetBirthdaysCount(hWnd);
@@ -747,7 +746,7 @@ INT_PTR CALLBACK DlgProcBirthdays(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa case WWIM_UPDATE_BIRTHDAY:
{//wParam = hContact
HWND hList = GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST);
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
int i;
int count = ListView_GetItemCount(hList);
//int bShowCurrentAge = db_get_b(NULL, ModuleName, "ShowCurrentAge", 0);
@@ -939,7 +938,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar DWORD WINAPI OpenMessageWindowThread(void *data)
{
- HANDLE hContact = (HANDLE) data;
+ HCONTACT hContact = (HCONTACT)data;
CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM) hContact, 0);
CallServiceSync("SRMsg/LaunchMessageWindow", (WPARAM) hContact, 0);
return 0;
@@ -950,7 +949,7 @@ int HandlePopupClick(HWND hWnd, int action) switch (action) {
case 2: //OPEN MESSAGE WINDOW
{
- HANDLE hContact = (HANDLE) PUGetContact(hWnd);
+ HCONTACT hContact = (HCONTACT)PUGetContact(hWnd);
if (hContact) {
DWORD threadID;
HANDLE thread = CreateThread(NULL, NULL, OpenMessageWindowThread, hContact, 0, &threadID);
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp index 9cf7266433..98793832d5 100644 --- a/plugins/WhenWasIt/src/hooked_events.cpp +++ b/plugins/WhenWasIt/src/hooked_events.cpp @@ -68,7 +68,7 @@ static int OnContactSettingChanged(WPARAM wParam, LPARAM lParam) DBCONTACTWRITESETTING *dw = (DBCONTACTWRITESETTING *) lParam;
DBVARIANT dv = dw->value;
if ((strcmp(dw->szModule, DUMMY_MODULE) == 0) && (strcmp(dw->szSetting, DUMMY_SETTING) == 0))
- RefreshContactListIcons((HANDLE)wParam);
+ RefreshContactListIcons((HCONTACT)wParam);
return 0;
}
@@ -152,7 +152,7 @@ int UnhookEvents() /////////////////////////////////////////////////////////////////////////////////////////
-int RefreshContactListIcons(HANDLE hContact)
+int RefreshContactListIcons(HCONTACT hContact)
{
if (hContact == 0)
return 0;
diff --git a/plugins/WhenWasIt/src/notifiers.cpp b/plugins/WhenWasIt/src/notifiers.cpp index 98dbef5e6f..b759b405df 100644 --- a/plugins/WhenWasIt/src/notifiers.cpp +++ b/plugins/WhenWasIt/src/notifiers.cpp @@ -64,7 +64,7 @@ TCHAR *BuildDABText(int dab, TCHAR *name, TCHAR *text, int size) return text;
}
-int PopupNotifyBirthday(HANDLE hContact, int dtb, int age)
+int PopupNotifyBirthday(HCONTACT hContact, int dtb, int age)
{
TCHAR *name = GetContactName(hContact, NULL);
const int MAX_SIZE = 1024;
@@ -111,7 +111,7 @@ int PopupNotifyBirthday(HANDLE hContact, int dtb, int age) return 0;
}
-int PopupNotifyMissedBirthday(HANDLE hContact, int dab, int age)
+int PopupNotifyMissedBirthday(HCONTACT hContact, int dab, int age)
{
TCHAR *name = GetContactName(hContact, NULL);
const int MAX_SIZE = 1024;
@@ -155,7 +155,7 @@ int PopupNotifyMissedBirthday(HANDLE hContact, int dab, int age) return 0;
}
-int DialogNotifyBirthday(HANDLE hContact, int dtb, int age)
+int DialogNotifyBirthday(HCONTACT hContact, int dtb, int age)
{
TCHAR *name = GetContactName(hContact, NULL);
const int MAX_SIZE = 1024;
@@ -181,7 +181,7 @@ int DialogNotifyBirthday(HANDLE hContact, int dtb, int age) return 0;
}
-int DialogNotifyMissedBirthday(HANDLE hContact, int dab, int age)
+int DialogNotifyMissedBirthday(HCONTACT hContact, int dab, int age)
{
TCHAR *name = GetContactName(hContact, NULL);
const int MAX_SIZE = 1024;
@@ -221,7 +221,7 @@ int SoundNotifyBirthday(int dtb) //called with oldClistIcon != -1 from dlg_handlers whtn the extra icon slot changes.
int RefreshAllContactListIcons(int oldClistIcon)
{
- 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 (oldClistIcon != -1)
ExtraIcon_Clear(hWWIExtraIcons, hContact);
diff --git a/plugins/WhenWasIt/src/notifiers.h b/plugins/WhenWasIt/src/notifiers.h index 344774ce02..598421078b 100644 --- a/plugins/WhenWasIt/src/notifiers.h +++ b/plugins/WhenWasIt/src/notifiers.h @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DUMMY_SETTING "refreshIconsDummyVal"
struct TUpcomingBirthday{
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR *name;
TCHAR *message;
int dtb;
@@ -40,13 +40,13 @@ struct TUpcomingBirthday{ typedef TUpcomingBirthday *PUpcomingBirthday;
void PopupNotifyNoBirthdays();
-int PopupNotifyBirthday(HANDLE hContact, int dtb, int age);
-int PopupNotifyMissedBirthday(HANDLE hContact, int dab, int age);
-int DialogNotifyBirthday(HANDLE hContact, int dtb, int age);
-int DialogNotifyMissedBirthday(HANDLE hContact, int dab, int age);
+int PopupNotifyBirthday(HCONTACT hContact, int dtb, int age);
+int PopupNotifyMissedBirthday(HCONTACT hContact, int dab, int age);
+int DialogNotifyBirthday(HCONTACT hContact, int dtb, int age);
+int DialogNotifyMissedBirthday(HCONTACT hContact, int dab, int age);
int SoundNotifyBirthday(int dtb);
-int RefreshContactListIcons(HANDLE hContact);
+int RefreshContactListIcons(HCONTACT hContact);
int RefreshAllContactListIcons(int oldClistIcon = -1);
#endif //M_WWI_NOTIFIERS_H
\ No newline at end of file diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index 5ad63f93d4..c86a52c81b 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -87,7 +87,7 @@ int DestroyServices() returns -1 if notify is not necesarry
returns daysToBirthday if it should notify
*/
-int NotifyContactBirthday(HANDLE hContact, time_t now, int daysInAdvance)
+int NotifyContactBirthday(HCONTACT hContact, time_t now, int daysInAdvance)
{
int year, month, day;
GetContactDOB(hContact, year, month, day);
@@ -100,7 +100,7 @@ int NotifyContactBirthday(HANDLE hContact, time_t now, int daysInAdvance) // returns -1 if notify is not necessary
// returns daysAfterBirthday if it should notify
-int NotifyMissedContactBirthday(HANDLE hContact, time_t now, int daysAfter)
+int NotifyMissedContactBirthday(HCONTACT hContact, time_t now, int daysAfter)
{
if (daysAfter > 0)
{
@@ -169,7 +169,7 @@ INT_PTR ShowListService(WPARAM wParam, LPARAM lParam) INT_PTR AddBirthdayService(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
HWND hWnd = WindowList_Find(hAddBirthdayWndsList, hContact);
if ( !hWnd) {
hWnd = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_ADD_BIRTHDAY), NULL, DlgProcAddBirthday, (LPARAM) hContact);
@@ -194,7 +194,7 @@ DWORD WINAPI RefreshUserDetailsWorkerThread(LPVOID param) int delay = db_get_w(NULL, ModuleName, "UpdateDelay", REFRESH_DETAILS_DELAY);
int res;
- HANDLE hContact = db_find_first();
+ HCONTACT hContact = db_find_first();
while (hContact != NULL) {
res = CallContactService(hContact, PSS_GETINFO, 0, 0);
hContact = db_find_next(hContact);
@@ -301,7 +301,7 @@ int DoImport(TCHAR *fileName) TCHAR *szHandle = buffer;
TCHAR *szProto = delProto + 1;
- HANDLE hContact = GetContactFromID(szHandle, szProto);
+ HCONTACT hContact = GetContactFromID(szHandle, szProto);
if (hContact) {
delProto[0] = tmp;
delAccount[0] = tmp;
@@ -334,7 +334,7 @@ int DoExport(TCHAR *fileName) _ftprintf(fout, _T("%c%s"), _T(COMMENT_CHAR), TranslateT("Warning! Please do not mix Unicode and Ansi exported birthday files. You should use the same version (Ansi/Unicode) of WhenWasIt that was used to export the info.\n"));
_ftprintf(fout, _T("%c%s"), _T(COMMENT_CHAR), TranslateT("This file was exported with a Unicode version of WhenWasIt. Please only use a Unicode version of the plugin to import the birthdays.\n"));
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
int year, month, day;
GetContactDOB(hContact, year, month, day);
if ( IsDOBValid(year, month, day)) {
diff --git a/plugins/WhenWasIt/src/services.h b/plugins/WhenWasIt/src/services.h index 5bc19aca3f..437cc93f73 100644 --- a/plugins/WhenWasIt/src/services.h +++ b/plugins/WhenWasIt/src/services.h @@ -42,8 +42,8 @@ extern int bBirthdayFound; int InitServices();
int DestroyServices();
-int NotifyContactBirthday(HANDLE hContact, time_t now, int daysInAdvance);
-int NotifyMissedContactBirthday(HANDLE hContact, time_t now, int daysAfter);
+int NotifyContactBirthday(HCONTACT hContact, time_t now, int daysInAdvance);
+int NotifyMissedContactBirthday(HCONTACT hContact, time_t now, int daysAfter);
int DoExport(TCHAR *fileName);
int DoImport(TCHAR *fileName);
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index a2f2bb6ade..f09f9ffdca 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -118,7 +118,7 @@ void HexToBin(char *inData, ULONG &size, LPBYTE &outData) i = size;
}
-int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, char *szError, char *szResult, size_t size)
+int GetStringFromDatabase(HCONTACT hContact, char *szModule, char *szSettingName, char *szError, char *szResult, size_t size)
{
DBVARIANT dbv = {0};
int res = 1;
@@ -156,7 +156,7 @@ int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, si #pragma warning (disable: 4312)
-TCHAR *GetContactName(HANDLE hContact, char *szProto)
+TCHAR *GetContactName(HCONTACT hContact, char *szProto)
{
CONTACTINFO ctInfo = { sizeof(ctInfo) };
ctInfo.szProto = (szProto) ? szProto : GetContactProto(hContact);
@@ -176,12 +176,12 @@ TCHAR *GetContactName(HANDLE hContact, char *szProto) return buffer;
}
-TCHAR *GetContactID(HANDLE hContact)
+TCHAR *GetContactID(HCONTACT hContact)
{
return GetContactID(hContact, GetContactProto(hContact));
}
-TCHAR *GetContactID(HANDLE hContact, char *szProto)
+TCHAR *GetContactID(HCONTACT hContact, char *szProto)
{
CONTACTINFO ctInfo = { sizeof(ctInfo) };
ctInfo.szProto = szProto;
@@ -217,9 +217,9 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto) return (!ret) ? buffer : NULL;
}
-HANDLE GetContactFromID(TCHAR *szID, char *szProto)
+HCONTACT GetContactFromID(TCHAR *szID, char *szProto)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *m_szProto = GetContactProto(hContact);
TCHAR *szHandle = GetContactID(hContact, szProto);
if (szHandle) {
@@ -232,7 +232,7 @@ HANDLE GetContactFromID(TCHAR *szID, char *szProto) return NULL;
}
-HANDLE GetContactFromID(TCHAR *szID, wchar_t *szProto)
+HCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto)
{
char protocol[1024];
WideCharToMultiByte(CP_ACP, 0, szProto, -1, protocol, sizeof(protocol), NULL, NULL);
diff --git a/plugins/WhenWasIt/src/utils.h b/plugins/WhenWasIt/src/utils.h index 6468ab63bc..022b79b117 100644 --- a/plugins/WhenWasIt/src/utils.h +++ b/plugins/WhenWasIt/src/utils.h @@ -44,10 +44,10 @@ RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, int size);
-TCHAR *GetContactName(HANDLE hContact, char *szProto);
-TCHAR *GetContactID(HANDLE hContact);
-TCHAR *GetContactID(HANDLE hContact, char *szProto);
-HANDLE GetContactFromID(TCHAR *szID, char *szProto);
-HANDLE GetContactFromID(TCHAR *szID, wchar_t *szProto);
+TCHAR *GetContactName(HCONTACT hContact, char *szProto);
+TCHAR *GetContactID(HCONTACT hContact);
+TCHAR *GetContactID(HCONTACT hContact, char *szProto);
+HCONTACT GetContactFromID(TCHAR *szID, char *szProto);
+HCONTACT GetContactFromID(TCHAR *szID, wchar_t *szProto);
#endif
\ No newline at end of file diff --git a/plugins/WinterSpeak/src/ConfigDatabase.cpp b/plugins/WinterSpeak/src/ConfigDatabase.cpp index 64af1e35f4..0184e7e5d0 100644 --- a/plugins/WinterSpeak/src/ConfigDatabase.cpp +++ b/plugins/WinterSpeak/src/ConfigDatabase.cpp @@ -47,7 +47,7 @@ void ConfigDatabase::setActiveFlag(ActiveFlag flag, bool state) }
//------------------------------------------------------------------------------
-ConfigDatabase::act ConfigDatabase::getActiveUser(HANDLE user) const
+ConfigDatabase::act ConfigDatabase::getActiveUser(HCONTACT user) const
{
ActiveUsersMap::const_iterator iter = m_active_users.find(user);
@@ -69,7 +69,7 @@ ConfigDatabase::act ConfigDatabase::getActiveUser(HANDLE user) const }
//------------------------------------------------------------------------------
-void ConfigDatabase::setActiveUser(HANDLE user, act state)
+void ConfigDatabase::setActiveUser(HCONTACT user, act state)
{
m_active_users[user].status = state.status;
m_active_users[user].message = state.message;
@@ -89,10 +89,8 @@ void ConfigDatabase::load() m_welcome_msg = DBGetContactSettingString(SPEAK, WELCOME_MSG, L"Welcome to Miranda");
// iterate through all the users and add them to the list if active
- HANDLE contact = db_find_first();
-
- while (NULL != contact)
- {
+ HCONTACT contact = db_find_first();
+ while (NULL != contact) {
m_active_users[contact].status = (db_get_b(contact, SPEAK, ACTIVE_STATE, true) != 0);
m_active_users[contact].message = (db_get_b(contact, SPEAK, ACTIVE_MSG, true) != 0);
diff --git a/plugins/WinterSpeak/src/ConfigDatabase.h b/plugins/WinterSpeak/src/ConfigDatabase.h index 5682abf0f0..da8b46dc8f 100644 --- a/plugins/WinterSpeak/src/ConfigDatabase.h +++ b/plugins/WinterSpeak/src/ConfigDatabase.h @@ -26,13 +26,13 @@ public: bool message;
};
- typedef std::map<HANDLE, act> ActiveUsersMap;
+ typedef std::map<HCONTACT, act> ActiveUsersMap;
//--------------------------------------------------------------------------
// Description : get/set the voice description
//--------------------------------------------------------------------------
- VoiceDesc getVoiceDesc() const { return m_voice_desc; }
- void setVoiceDesc(const VoiceDesc &desc) { m_voice_desc = desc; }
+ VoiceDesc getVoiceDesc() const { return m_voice_desc; }
+ void setVoiceDesc(const VoiceDesc &desc) { m_voice_desc = desc; }
//--------------------------------------------------------------------------
// Description : get/set the welcome message
@@ -43,37 +43,36 @@ public: //--------------------------------------------------------------------------
// Description : get/set an status flags
//--------------------------------------------------------------------------
- bool getActiveFlag(ActiveFlag flag) const;
+ bool getActiveFlag(ActiveFlag flag) const;
void setActiveFlag(ActiveFlag flag, bool state);
//--------------------------------------------------------------------------
// Description : get/set the user active flag
//--------------------------------------------------------------------------
- act getActiveUser(HANDLE user) const;
- void setActiveUser(HANDLE user, act state);
- ActiveUsersMap getActiveUsers() const { return m_active_users; }
-
+ act getActiveUser(HCONTACT user) const;
+ void setActiveUser(HCONTACT user, act state);
+ ActiveUsersMap getActiveUsers() const { return m_active_users; }
+
//--------------------------------------------------------------------------
// Description : load/save the settings from the miranda database
//--------------------------------------------------------------------------
void load();
void save();
- private:
+private:
//--------------------------------------------------------------------------
// Description : For some reason this isn't implemented in miranda yet
// Just get a string from the db
- // Parameters : szModule - the entrys' module
- // szSetting - the entrys' setting
- // def - default string if entry doesn't exist
+ // Parameters : szModule - the entrys' module
+ // szSetting - the entrys' setting
+ // def - default string if entry doesn't exist
//--------------------------------------------------------------------------
static std::wstring DBGetContactSettingString(const char *szModule,
const char *szSetting, const WCHAR *def);
- VoiceDesc m_voice_desc;
- unsigned int m_active_flags;
+ VoiceDesc m_voice_desc;
+ unsigned int m_active_flags;
std::wstring m_welcome_msg;
//std::string m_welcome_msg;
- ActiveUsersMap m_active_users;
+ ActiveUsersMap m_active_users;
};
-
diff --git a/plugins/WinterSpeak/src/DialogConfigActive.cpp b/plugins/WinterSpeak/src/DialogConfigActive.cpp index 5d20b91586..8c59b83fca 100644 --- a/plugins/WinterSpeak/src/DialogConfigActive.cpp +++ b/plugins/WinterSpeak/src/DialogConfigActive.cpp @@ -255,7 +255,7 @@ void DialogConfigActive::SetAllContactIcons(HWND hwndList, HWND window) { ConfigDatabase::ActiveUsersMap::const_iterator iter;
for (iter = active_users.begin(); iter != active_users.end(); ++iter)
{
- HANDLE hContact = iter->first;
+ HCONTACT hContact = iter->first;
if(hContact == 0) {
} else {
@@ -331,7 +331,7 @@ void DialogConfigActive::save(HWND window) m_db.setActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat, (IsDlgButtonChecked(window, IDC_ACTIVE_FREEFORCHAT) != 0));
m_db.setActiveFlag(ConfigDatabase::ActiveFlag_Invisible, (IsDlgButtonChecked(window, IDC_ACTIVE_INVISIBLE) != 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(window, IDC_ACTIVE_USERS, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem)
SaveItemMask(GetDlgItem(window, IDC_ACTIVE_USERS), hContact, hItem);
@@ -342,7 +342,7 @@ void DialogConfigActive::save(HWND window) m_db.save();
}
-void DialogConfigActive::SaveItemMask(HWND hwndList, HANDLE hContact, HANDLE hItem) {
+void DialogConfigActive::SaveItemMask(HWND hwndList, HCONTACT hContact, HANDLE hItem) {
ConfigDatabase::act mask;
mask.message = true;
mask.status = true;
diff --git a/plugins/WinterSpeak/src/DialogConfigActive.h b/plugins/WinterSpeak/src/DialogConfigActive.h index 8dbbbd43a9..f1b428972b 100644 --- a/plugins/WinterSpeak/src/DialogConfigActive.h +++ b/plugins/WinterSpeak/src/DialogConfigActive.h @@ -38,7 +38,7 @@ class DialogConfigActive : public MirandaDialog void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int iColumn, int iImage);
void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int iImage);
void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentItem, int *groupChildCount);
- void SaveItemMask(HWND hwndList, HANDLE hContact, HANDLE hItem);
+ void SaveItemMask(HWND hwndList, HCONTACT hContact, HANDLE hItem);
static DialogConfigActive *m_instance;
ConfigDatabase &m_db;
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.cpp b/plugins/WinterSpeak/src/SpeakAnnounce.cpp index 2b9855f61b..e9120f20eb 100644 --- a/plugins/WinterSpeak/src/SpeakAnnounce.cpp +++ b/plugins/WinterSpeak/src/SpeakAnnounce.cpp @@ -72,7 +72,7 @@ void SpeakAnnounce::statusChange(DBCONTACTWRITESETTING *write_setting, HANDLE us }
//------------------------------------------------------------------------------
-void SpeakAnnounce::incomingEvent(HANDLE user, HANDLE event)
+void SpeakAnnounce::incomingEvent(HCONTACT user, HANDLE event)
{
if (m_event_info.isValidEvent(event))
{
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.h b/plugins/WinterSpeak/src/SpeakAnnounce.h index ff681e6fdb..e4980a292a 100644 --- a/plugins/WinterSpeak/src/SpeakAnnounce.h +++ b/plugins/WinterSpeak/src/SpeakAnnounce.h @@ -17,7 +17,7 @@ class SpeakAnnounce //--------------------------------------------------------------------------
// Description : handle an event
//--------------------------------------------------------------------------
- void incomingEvent(HANDLE user, HANDLE event);
+ void incomingEvent(HCONTACT user, HANDLE event);
//--------------------------------------------------------------------------
// Description : handle a protocol state change
diff --git a/plugins/WinterSpeak/src/SpeakConfig.cpp b/plugins/WinterSpeak/src/SpeakConfig.cpp index 40c9d48dbe..605b120f92 100644 --- a/plugins/WinterSpeak/src/SpeakConfig.cpp +++ b/plugins/WinterSpeak/src/SpeakConfig.cpp @@ -33,13 +33,13 @@ void SpeakConfig::update(Subject &subject) }
//------------------------------------------------------------------------------
-bool SpeakConfig::status(const std::wstring &sentence, HANDLE user) {
+bool SpeakConfig::status(const std::wstring &sentence, HCONTACT user) {
return say(sentence, user, false);
}
-bool SpeakConfig::message(const std::wstring &sentence, HANDLE user) {
+bool SpeakConfig::message(const std::wstring &sentence, HCONTACT user) {
return say(sentence, user, true);
}
-bool SpeakConfig::say(const std::wstring &sentence, HANDLE user, bool message)
+bool SpeakConfig::say(const std::wstring &sentence, HCONTACT user, bool message)
{
if (!m_tts.get()){
return false;
@@ -89,11 +89,10 @@ bool SpeakConfig::say(const std::wstring &sentence, HANDLE user, bool message) // if its a user say, then check the users status
if (active)
{
- if(message) {
+ if(message)
active = m_db.getActiveUser(user).message;
- } else {
+ else
active = m_db.getActiveUser(user).status;
- }
}
}
diff --git a/plugins/WinterSpeak/src/SpeakConfig.h b/plugins/WinterSpeak/src/SpeakConfig.h index e1a4cb421a..6894eecfb3 100644 --- a/plugins/WinterSpeak/src/SpeakConfig.h +++ b/plugins/WinterSpeak/src/SpeakConfig.h @@ -8,34 +8,34 @@ class TextToSpeech; class SpeakConfig : public Observer
{
- public:
+public:
SpeakConfig(HINSTANCE instance);
- virtual ~SpeakConfig();
+ virtual ~SpeakConfig();
- //--------------------------------------------------------------------------
- // Description : Called by a subject that this observer is observing
- // to signify a change in state
- // Parameters : subject - the subject that changed
- //--------------------------------------------------------------------------
- virtual void update(Subject &subject);
+ //--------------------------------------------------------------------------
+ // Description : Called by a subject that this observer is observing
+ // to signify a change in state
+ // Parameters : subject - the subject that changed
+ //--------------------------------------------------------------------------
+ virtual void update(Subject &subject);
//--------------------------------------------------------------------------
// Description : speak a sentence
// Parameters : sentence - the sentence to speak
- // user - the user to associate the say with
- // NULL = ignore user
+ // user - the user to associate the say with
+ // NULL = ignore user
// Returns : true - speak successful
// false - speak failed
//--------------------------------------------------------------------------
- bool status(const std::wstring &sentence, HANDLE user = NULL);
- bool message(const std::wstring &sentence, HANDLE user = NULL);
- bool say(const std::wstring &sentence, HANDLE user, bool message);
+ bool status(const std::wstring &sentence, HCONTACT user = NULL);
+ bool message(const std::wstring &sentence, HCONTACT user = NULL);
+ bool say(const std::wstring &sentence, HCONTACT user, bool message);
- private:
- HINSTANCE m_instance;
+private:
+ HINSTANCE m_instance;
ConfigDatabase m_db;
- std::auto_ptr<TextToSpeech> m_tts;
- DialogConfigEngine m_dialog_engine;
- DialogConfigActive m_dialog_active;
+ std::auto_ptr<TextToSpeech> m_tts;
+ DialogConfigEngine m_dialog_engine;
+ DialogConfigActive m_dialog_active;
};
\ No newline at end of file diff --git a/plugins/WinterSpeak/src/main.cpp b/plugins/WinterSpeak/src/main.cpp index 56e7665459..e20c0fa113 100644 --- a/plugins/WinterSpeak/src/main.cpp +++ b/plugins/WinterSpeak/src/main.cpp @@ -31,12 +31,12 @@ PLUGININFOEX pluginInfo={ //-----------------------------------------------------------------------------
INT_PTR status(WPARAM wParam, LPARAM lParam)
{
- return g_speak_config->status(reinterpret_cast<WCHAR *>(lParam), reinterpret_cast<HANDLE>(wParam));
+ return g_speak_config->status(reinterpret_cast<WCHAR *>(lParam), reinterpret_cast<HCONTACT>(wParam));
}
INT_PTR message(WPARAM wParam, LPARAM lParam)
{
- return g_speak_config->message(reinterpret_cast<WCHAR *>(lParam), reinterpret_cast<HANDLE>(wParam));
+ return g_speak_config->message(reinterpret_cast<WCHAR *>(lParam), reinterpret_cast<HCONTACT>(wParam));
}
//-----------------------------------------------------------------------------
@@ -56,7 +56,7 @@ int eventStatusChange(WPARAM wParam, LPARAM lParam) //-----------------------------------------------------------------------------
int eventMessageAdded(WPARAM wParam, LPARAM lParam)
{
- g_speak_announce->incomingEvent(reinterpret_cast<HANDLE>(wParam), reinterpret_cast<HANDLE>(lParam));
+ g_speak_announce->incomingEvent(reinterpret_cast<HCONTACT>(wParam), reinterpret_cast<HANDLE>(lParam));
return 0;
}
diff --git a/plugins/XSoundNotify/src/Common.h b/plugins/XSoundNotify/src/Common.h index c71dd34a4a..106022b842 100644 --- a/plugins/XSoundNotify/src/Common.h +++ b/plugins/XSoundNotify/src/Common.h @@ -23,11 +23,11 @@ struct XSN_Data
{
- HANDLE hContact;
+ HCONTACT hContact;
TCHAR path[MAX_PATH];
BYTE ignore;
- __forceinline XSN_Data(HANDLE _aContact, TCHAR *_path, BYTE _ignore) :
+ __forceinline XSN_Data(HCONTACT _aContact, TCHAR *_path, BYTE _ignore) :
hContact(_aContact)
{
_tcsncpy(path, _path, SIZEOF(path));
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 84b5602a20..ec114a71b2 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -15,7 +15,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP case WM_INITDIALOG:
{
TranslateDialogDefault(hwndDlg);
- HANDLE hContact = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
WindowList_Add(hChangeSoundDlgList, hwndDlg, hContact);
Utils_RestoreWindowPositionNoSize(hwndDlg, hContact, SETTINGSNAME, "ChangeSoundDlg");
@@ -77,7 +77,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP switch (LOWORD(wParam)) {
case IDOK:
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
XSN_Data *p = XSN_Users.find((XSN_Data *)&hContact);
if (p != NULL) {
if (lstrcmpi(p->path, _T(""))) {
@@ -116,7 +116,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP ofn.lpstrDefExt = _T("");
if (GetOpenFileName(&ofn)) {
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
SetDlgItemText(hwndDlg, IDC_CONT_LABEL_SOUND, PathFindFileName(FileName));
XSN_Data *p = XSN_Users.find((XSN_Data *)&hContact);
if (p == NULL)
@@ -134,7 +134,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP case IDC_CONT_BUTTON_TEST_PLAY:
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
XSN_Data *p = XSN_Users.find((XSN_Data *)&hContact);
isIgnoreSound = 0;
if (p == NULL) {
@@ -156,7 +156,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP case IDC_CONT_BUTTON_RESET_SOUND:
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_TEST_PLAY), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_RESET_SOUND), FALSE);
CheckDlgButton(hwndDlg, IDC_CONT_IGNORE_SOUND, BST_UNCHECKED);
@@ -173,7 +173,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP case IDC_CONT_IGNORE_SOUND:
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
XSN_Data *p = XSN_Users.find((XSN_Data *)&hContact);
if (p == NULL) {
DBVARIANT dbv;
@@ -195,7 +195,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP break;
case WM_DESTROY:
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
Utils_SaveWindowPosition(hwndDlg, hContact, SETTINGSNAME, "ChangeSoundDlg");
WindowList_Remove(hChangeSoundDlgList, hwndDlg);
}
@@ -204,7 +204,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP INT_PTR ShowDialog(WPARAM wParam, LPARAM lParam)
{
- HWND hChangeSoundDlg = WindowList_Find(hChangeSoundDlgList, (HANDLE)wParam);
+ HWND hChangeSoundDlg = WindowList_Find(hChangeSoundDlgList, (HCONTACT)wParam);
if (!hChangeSoundDlg) {
hChangeSoundDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONTACTS), 0, DlgProcContactsOptions, (LPARAM)wParam);
ShowWindow(hChangeSoundDlg, SW_SHOW);
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index 339bb93342..c7d98bc589 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -50,7 +50,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l int cursel = SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_PROTO, CB_GETCURSEL, 0, 0);
PROTOACCOUNT *pa = (PROTOACCOUNT *)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_PROTO, CB_GETITEMDATA, cursel, 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)) {
char* szUniqueId = (char*)CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if ((INT_PTR) szUniqueId != CALLSERVICE_NOTFOUND && szUniqueId != NULL) {
DBVARIANT dbvuid = {0};
@@ -85,7 +85,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_OPT_COMBO_USERS:
if ((HIWORD(wParam) == CBN_SELCHANGE) || (HIWORD(wParam) == LBN_SELCHANGE)) {
int cursel = SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETCURSEL, 0, 0);
- HANDLE hContact = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
+ HCONTACT hContact = (HCONTACT)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_CHOOSE_SOUND), TRUE);
DBVARIANT dbv = {0};
if ( !db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv))
@@ -129,7 +129,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (GetOpenFileName(&ofn)) {
SetDlgItemText(hwndDlg, IDC_OPT_LABEL_SOUND, PathFindFileName(FileName));
int cursel = SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETCURSEL, 0, 0);
- HANDLE hContact = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
+ HCONTACT hContact = (HCONTACT)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
XSN_Data *p = XSN_Users.find((XSN_Data *)&hContact);
if (p == NULL)
XSN_Users.insert( new XSN_Data(hContact, FileName, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0));
@@ -149,7 +149,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_OPT_BUTTON_TEST_PLAY:
{
int cursel = SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETCURSEL, 0, 0);
- HANDLE hContact = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
+ HCONTACT hContact = (HCONTACT)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
XSN_Data *p = XSN_Users.find((XSN_Data *)&hContact);
isIgnoreSound = 0;
if (p == NULL) {
@@ -176,7 +176,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l CheckDlgButton(hwndDlg, IDC_OPT_IGNORE_SOUND, BST_UNCHECKED);
SetDlgItemText(hwndDlg, IDC_OPT_LABEL_SOUND, TranslateT("Not set"));
int cursel = SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETCURSEL, 0, 0);
- HANDLE hContact = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
+ HCONTACT hContact = (HCONTACT)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
XSN_Data *p = XSN_Users.find((XSN_Data *)&hContact);
if (p != NULL) {
XSN_Users.remove(p);
@@ -191,7 +191,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_OPT_IGNORE_SOUND:
{
int cursel = SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETCURSEL, 0, 0);
- HANDLE hContact = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
+ HCONTACT hContact = (HCONTACT)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_GETITEMDATA, cursel, 0);
XSN_Data *p = XSN_Users.find((XSN_Data *)&hContact);
if (p == NULL) {
DBVARIANT dbv;
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index 6f63acaa3b..a567a8d580 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -113,9 +113,9 @@ static int ProcessEvent(WPARAM wParam, LPARAM lParam) if (!isReceiveMessage(HANDLE(lParam)))
return 0;
- isIgnoreSound = db_get_b((HANDLE)wParam, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
+ isIgnoreSound = db_get_b((HCONTACT)wParam, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
- if ( !isIgnoreSound && !db_get_ts((HANDLE)wParam, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if ( !isIgnoreSound && !db_get_ts((HCONTACT)wParam, SETTINGSNAME, SETTINGSKEY, &dbv)) {
TCHAR PlaySoundPath[MAX_PATH] = {0};
PathToAbsoluteT(dbv.ptszVal, PlaySoundPath);
SkinPlaySoundFile(PlaySoundPath);
@@ -154,7 +154,7 @@ static int OnLoadInit(WPARAM wParam, LPARAM lParam) static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)wParam;
if (hContact) {
char* szProto = GetContactProto(hContact);
PROTOACCOUNT *pa = ProtoGetAccount(szProto);
diff --git a/plugins/YAMN/src/browser/badconnect.cpp b/plugins/YAMN/src/browser/badconnect.cpp index 7662e0bfd3..06e080d274 100644 --- a/plugins/YAMN/src/browser/badconnect.cpp +++ b/plugins/YAMN/src/browser/badconnect.cpp @@ -117,7 +117,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg,UINT msg,WPARAM wParam,LPARA #ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"BadConnect:ActualAccountSO-read enter\n");
#endif
- int size = strlen(ActualAccount->Name)+strlen(Translate(BADCONNECTTITLE));
+ int size = (int)(strlen(ActualAccount->Name)+strlen(Translate(BADCONNECTTITLE)));
TitleStrA = new char[size];
mir_snprintf(TitleStrA, size, Translate(BADCONNECTTITLE), ActualAccount->Name);
@@ -127,7 +127,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg,UINT msg,WPARAM wParam,LPARA if (ShowPopup)
{
- BadConnectPopup.lchContact=ActualAccount;
+ BadConnectPopup.lchContact=(HCONTACT)ActualAccount;
BadConnectPopup.lchIcon=g_LoadIconEx(3);
BadConnectPopup.colorBack=ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? ActualAccount->BadConnectN.PopupB : GetSysColor(COLOR_BTNFACE);
BadConnectPopup.colorText=ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? ActualAccount->BadConnectN.PopupT : GetSysColor(COLOR_WINDOWTEXT);
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index bc306c1a4b..83bc7a02e3 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -510,7 +510,7 @@ int AddNewMailsToListView(HWND hListView,HACCOUNT ActualAccount,struct CMailNumb lfoundi=0;
}
- NewMailPopup.lchContact=(ActualAccount->hContact != NULL) ? ActualAccount->hContact : ActualAccount;
+ NewMailPopup.lchContact=(ActualAccount->hContact != NULL) ? ActualAccount->hContact : (HCONTACT)ActualAccount;
NewMailPopup.lchIcon=g_LoadIconEx(2);
NewMailPopup.colorBack=nflags & YAMN_ACC_POPC ? ActualAccount->NewMailN.PopupB : GetSysColor(COLOR_BTNFACE);
NewMailPopup.colorText=nflags & YAMN_ACC_POPC ? ActualAccount->NewMailN.PopupT : GetSysColor(COLOR_WINDOWTEXT);
@@ -681,7 +681,7 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR {
POPUPDATAT NewMailPopup ={0};
- NewMailPopup.lchContact=(ActualAccount->hContact != NULL) ? ActualAccount->hContact : ActualAccount;
+ NewMailPopup.lchContact=(ActualAccount->hContact != NULL) ? ActualAccount->hContact : (HCONTACT)ActualAccount;
NewMailPopup.lchIcon=g_LoadIconEx(2);
NewMailPopup.colorBack=nflags & YAMN_ACC_POPC ? ActualAccount->NewMailN.PopupB : GetSysColor(COLOR_BTNFACE);
NewMailPopup.colorText=nflags & YAMN_ACC_POPC ? ActualAccount->NewMailN.PopupT : GetSysColor(COLOR_WINDOWTEXT);
@@ -784,7 +784,7 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR {
POPUPDATAT NoNewMailPopup;
- NoNewMailPopup.lchContact=(ActualAccount->hContact != NULL) ? ActualAccount->hContact : ActualAccount;
+ NoNewMailPopup.lchContact=(ActualAccount->hContact != NULL) ? ActualAccount->hContact : (HCONTACT)ActualAccount;
NoNewMailPopup.lchIcon=g_LoadIconEx(1);
NoNewMailPopup.colorBack=ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC ? ActualAccount->NoNewMailN.PopupB : GetSysColor(COLOR_BTNFACE);
NoNewMailPopup.colorText=ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC ? ActualAccount->NoNewMailN.PopupT : GetSysColor(COLOR_WINDOWTEXT);
@@ -830,7 +830,7 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam //if clicked and it's new mail popup window
if ((HIWORD(wParam)==STN_CLICKED) && (-1 != (PluginParam=CallService(MS_POPUP_GETPLUGINDATA,(WPARAM)hWnd,(LPARAM)&PluginParam))))
{
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
HACCOUNT Account;
if (PluginParam) {
PYAMN_MAILSHOWPARAM MailParam = new YAMN_MAILSHOWPARAM;
@@ -849,15 +849,15 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam } else {
DBVARIANT dbv;
- hContact=(HANDLE)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
+ hContact=(HCONTACT)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
- if (!db_get((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
+ if (!db_get((HCONTACT)hContact,YAMN_DBMODULE,"Id",&dbv))
{
Account=(HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
else
- Account = (HACCOUNT) hContact; //????
+ Account = (HACCOUNT)hContact; //????
#ifdef DEBUG_SYNCHRO
@@ -900,7 +900,7 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam break;
case UM_FREEPLUGINDATA:{
PYAMN_MAILSHOWPARAM mpd = (PYAMN_MAILSHOWPARAM)PUGetPluginData(hWnd);
- HANDLE hContact = 0;
+ HCONTACT hContact = 0;
if ((mpd) && (INT_PTR)mpd != -1)free(mpd);
return FALSE;
}
@@ -914,12 +914,12 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam case WM_YAMN_STOPACCOUNT:
{
HACCOUNT ActualAccount;
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
- hContact=(HANDLE)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
+ hContact=(HCONTACT)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
- if (!db_get((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
+ if (!db_get((HCONTACT) hContact,YAMN_DBMODULE,"Id",&dbv))
{
ActualAccount=(HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)dbv.pszVal);
db_free(&dbv);
@@ -947,12 +947,12 @@ LRESULT CALLBACK NoNewMailPopupProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lPar if ((HIWORD(wParam)==STN_CLICKED) && (msg==WM_COMMAND))
{
HACCOUNT ActualAccount;
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
- hContact=(HANDLE)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
+ hContact=(HCONTACT)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
- if (!db_get((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
+ if (!db_get((HCONTACT)hContact,YAMN_DBMODULE,"Id",&dbv))
{
ActualAccount=(HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)dbv.pszVal);
db_free(&dbv);
@@ -1014,12 +1014,12 @@ LRESULT CALLBACK NoNewMailPopupProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lPar case WM_YAMN_STOPACCOUNT:
{
HACCOUNT ActualAccount;
- HANDLE hContact;
+ HCONTACT hContact;
DBVARIANT dbv;
- hContact=(HANDLE)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
+ hContact=(HCONTACT)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
- if (!db_get((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
+ if (!db_get((HCONTACT) hContact,YAMN_DBMODULE,"Id",&dbv))
{
ActualAccount=(HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)dbv.pszVal);
db_free(&dbv);
@@ -1465,12 +1465,11 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM if (MailParam->mail->Flags & YAMN_MSG_UNSEEN) {
MailParam->mail->Flags&=~YAMN_MSG_UNSEEN; //mark the message as seen
HWND hMailBrowser;
- if (hMailBrowser=WindowList_Find(YAMNVar.NewMailAccountWnd,MailParam->account)) {
+ if (hMailBrowser=WindowList_Find(YAMNVar.NewMailAccountWnd, (HCONTACT)MailParam->account)) {
struct CChangeContent Params={MailParam->account->NewMailN.Flags|YAMN_ACC_MSGP,MailParam->account->NoNewMailN.Flags|YAMN_ACC_MSGP};
SendMessageW(hMailBrowser,WM_YAMN_CHANGECONTENT,(WPARAM)MailParam->account,(LPARAM)&Params);
- } else {
- UpdateMails(NULL,MailParam->account,MailParam->account->NewMailN.Flags,MailParam->account->NoNewMailN.Flags);
}
+ else UpdateMails(NULL,MailParam->account,MailParam->account->NewMailN.Flags,MailParam->account->NoNewMailN.Flags);
}
}
ShowWindow(GetDlgItem(hDlg, IDC_SPLITTER),(MailParam->mail->Flags & YAMN_MSG_BODYRECEIVED)?SW_SHOW:SW_HIDE);
@@ -1737,7 +1736,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM ReadDoneFcn(ActualAccount->AccountAccessSO);
WindowList_Add(YAMNVar.MessageWnds,hDlg,NULL);
- WindowList_Add(YAMNVar.NewMailAccountWnd,hDlg,ActualAccount);
+ WindowList_Add(YAMNVar.NewMailAccountWnd,hDlg, (HCONTACT)ActualAccount);
{
TCHAR accstatus[512];
@@ -2510,7 +2509,7 @@ DWORD WINAPI MailBrowser(LPVOID Param) #endif
ReadDoneFcn(ActualAccount->AccountAccessSO);
- if (NULL != (hMailBrowser=WindowList_Find(YAMNVar.NewMailAccountWnd,ActualAccount)))
+ if (NULL != (hMailBrowser=WindowList_Find(YAMNVar.NewMailAccountWnd, (HCONTACT)ActualAccount)))
WndFound=TRUE;
if ((hMailBrowser==NULL) && ((MyParam.nflags & YAMN_ACC_MSG) || (MyParam.nflags & YAMN_ACC_ICO) || (MyParam.nnflags & YAMN_ACC_MSG)))
{
diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index 16bbafd65a..ebd9c90d2c 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -276,7 +276,7 @@ int RegisterPOP3Plugin(WPARAM,LPARAM) for (Finder=POP3Plugin->FirstAccount;Finder != NULL;Finder=Finder->Next) {
Finder->hContact = NULL;
- for (HANDLE hContact = db_find_first(YAMN_DBMODULE); hContact; hContact = db_find_next(hContact, YAMN_DBMODULE)) {
+ for (HCONTACT hContact = db_find_first(YAMN_DBMODULE); hContact; hContact = db_find_next(hContact, YAMN_DBMODULE)) {
if (!db_get_s(hContact,YAMN_DBMODULE,"Id",&dbv)) {
if ( strcmp( dbv.pszVal, Finder->Name) == 0) {
Finder->hContact = hContact;
@@ -294,7 +294,7 @@ int RegisterPOP3Plugin(WPARAM,LPARAM) if (Finder->hContact == NULL && (Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT)) {
//No account contact found, have to create one
- Finder->hContact =(HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ Finder->hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)Finder->hContact,(LPARAM)YAMN_DBMODULE);
db_set_s(Finder->hContact,YAMN_DBMODULE,"Id",Finder->Name);
db_set_s(Finder->hContact,YAMN_DBMODULE,"Nick",Finder->Name);
diff --git a/plugins/YAMN/src/services.cpp b/plugins/YAMN/src/services.cpp index 21d565ba4d..40484f73e0 100644 --- a/plugins/YAMN/src/services.cpp +++ b/plugins/YAMN/src/services.cpp @@ -65,12 +65,12 @@ static int Service_ContactDoubleclicked(WPARAM wParam, LPARAM lParam) static INT_PTR ContactApplication(WPARAM wParam, LPARAM lParam)
{
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if ( lstrcmpA(szProto, YAMN_DBMODULE))
return 0;
DBVARIANT dbv;
- if ( db_get((HANDLE) wParam, YAMN_DBMODULE, "Id", &dbv))
+ if ( db_get((HCONTACT)wParam, YAMN_DBMODULE, "Id", &dbv))
return 0;
HACCOUNT ActualAccount = (HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal);
@@ -168,12 +168,12 @@ static INT_PTR AccountMailCheck(WPARAM wParam, LPARAM lParam) static INT_PTR ContactMailCheck(WPARAM wParam, LPARAM lParam)
{
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if ( lstrcmpA(szProto, YAMN_DBMODULE))
return 0;
DBVARIANT dbv;
- if ( db_get((HANDLE) wParam, YAMN_DBMODULE, "Id", &dbv))
+ if ( db_get((HCONTACT) wParam, YAMN_DBMODULE, "Id", &dbv))
return 0;
HACCOUNT ActualAccount = (HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal);
@@ -227,12 +227,12 @@ void MainMenuAccountClicked(WPARAM wParam, LPARAM lParam) /*static*/ void ContactDoubleclicked(WPARAM wParam, LPARAM lParam)
{
- char *szProto = GetContactProto((HANDLE)wParam);
+ char *szProto = GetContactProto((HCONTACT)wParam);
if ( lstrcmpA(szProto, YAMN_DBMODULE))
return;
DBVARIANT dbv;
- if ( db_get(( HANDLE )wParam, YAMN_DBMODULE, "Id", &dbv))
+ if ( db_get((HCONTACT)wParam, YAMN_DBMODULE, "Id", &dbv))
return;
HACCOUNT ActualAccount = (HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal);
@@ -483,7 +483,7 @@ void RefreshContact(void) db_set_b(Finder->hContact, "CList", "Hidden", 1);
}
else if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT)) {
- Finder->hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
+ Finder->hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)Finder->hContact, (LPARAM)YAMN_DBMODULE);
db_set_s(Finder->hContact, YAMN_DBMODULE, "Id", Finder->Name);
db_set_s(Finder->hContact, YAMN_DBMODULE, "Nick", Finder->Name);
diff --git a/plugins/YAPP/src/message_pump.h b/plugins/YAPP/src/message_pump.h index fc3d889a0a..6283a0f14b 100644 --- a/plugins/YAPP/src/message_pump.h +++ b/plugins/YAPP/src/message_pump.h @@ -15,7 +15,7 @@ struct PopupData {
int cbSize;
int flags; // OR of PDF_* flags below
- HANDLE hContact;
+ HCONTACT hContact;
HICON hIcon;
union {
char *pszTitle;
diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp index accbc0f630..7b11771414 100644 --- a/plugins/YAPP/src/options.cpp +++ b/plugins/YAPP/src/options.cpp @@ -99,7 +99,7 @@ void ShowExamplePopups() pd.ptzText = TranslateT("Thequickbrownfoxjumpedoverthelazydog.");
ShowPopup(pd);
- 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 (options.av_layout != PAV_NONE && ServiceExists(MS_AV_DRAWAVATAR)) {
AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
if (ace && (ace->dwFlags & AVS_BITMAP_VALID)) {
diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp index 5f73b97421..7089f01b98 100644 --- a/plugins/YAPP/src/popwin.cpp +++ b/plugins/YAPP/src/popwin.cpp @@ -695,7 +695,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa pd->colorBack = MNotifyGetDWord(pwd->hNotify, NFOPT_BACKCOLOR, colBg);
pd->colorText = MNotifyGetDWord(pwd->hNotify, NFOPT_TEXTCOLOR, colSecondLine);
pd->timeout = MNotifyGetDWord(pwd->hNotify, NFOPT_TIMEOUT, options.default_timeout);
- pd->hContact = (HANDLE)MNotifyGetDWord(pwd->hNotify, NFOPT_CONTACT, 0);
+ pd->hContact = (HCONTACT)MNotifyGetDWord(pwd->hNotify, NFOPT_CONTACT, 0);
pd->hIcon = (HICON)MNotifyGetDWord(pwd->hNotify, NFOPT_ICON, 0);
const wchar_t *swzName = MNotifyGetWString(pwd->hNotify, NFOPT_TITLEW, 0);
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp index 3c8e2557c6..808b184990 100644 --- a/plugins/YAPP/src/services.cpp +++ b/plugins/YAPP/src/services.cpp @@ -162,7 +162,7 @@ void ShowPopup(PopupData &pd_in) static INT_PTR GetContact(WPARAM wParam, LPARAM lParam)
{
HWND hwndPop = (HWND)wParam;
- HANDLE hContact;
+ HCONTACT hContact;
if (GetCurrentThreadId() == message_pump_thread_id)
SendMessage(hwndPop, PUM_GETCONTACT, (WPARAM)&hContact, 0);
else {
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index 34cf80857a..6eee2d60eb 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -25,7 +25,7 @@ CLIST_INTERFACE *pcli; HINSTANCE hInst;
int hLangpack;
-HANDLE hForwardFrom, hForwardTo;
+HCONTACT hForwardFrom, hForwardTo;
TCHAR tszForwardTemplate[MAXTEMPLATESIZE];
int iSplit, iSplitMaxSize, iSendParts, iMarkRead, iSendAndHistory, iForwardOnStatus;
@@ -89,7 +89,8 @@ int ProtoAck(WPARAM wparam,LPARAM lparam) */
static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE)wParam, hDBEvent = (HANDLE)lParam;
+ HCONTACT hContact = (HCONTACT)wParam;
+ HANDLE hDBEvent = (HANDLE)lParam;
// is the message sender accepted for forwarding
if (hForwardFrom != 0 && hForwardFrom != hContact)
@@ -209,7 +210,7 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam) strncpy(szMsgPart, szBuf, cbPortion);
szMsgPart[cbPortion] = 0;
- HANDLE hMsgProc = (HANDLE)CallContactService((HANDLE)hForwardTo, PSS_MESSAGE, PREF_UTF, (LPARAM)szMsgPart);
+ HANDLE hMsgProc = (HANDLE)CallContactService(hForwardTo, PSS_MESSAGE, PREF_UTF, (LPARAM)szMsgPart);
MESSAGE_PROC* msgProc = (MESSAGE_PROC*)mir_alloc(sizeof(MESSAGE_PROC));
msgProc->hProcess = hMsgProc;
@@ -235,8 +236,8 @@ extern "C" int __declspec(dllexport) Load() mir_getCLI();
// Load plugin options from DB
- hForwardFrom = (HANDLE)db_get_dw(NULL, "yaRelay", "ForwardFrom", 0);
- hForwardTo = (HANDLE)db_get_dw(NULL, "yaRelay", "ForwardTo", 0);
+ hForwardFrom = (HCONTACT)db_get_dw(NULL, "yaRelay", "ForwardFrom", 0);
+ hForwardTo = (HCONTACT)db_get_dw(NULL, "yaRelay", "ForwardTo", 0);
iForwardOnStatus = db_get_dw(NULL, "yaRelay", "ForwardOnStatus", STATUS_OFFLINE | STATUS_AWAY | STATUS_NA);
diff --git a/plugins/YARelay/src/options.cpp b/plugins/YARelay/src/options.cpp index 4d96a1ca49..eafc4f93b1 100644 --- a/plugins/YARelay/src/options.cpp +++ b/plugins/YARelay/src/options.cpp @@ -50,7 +50,7 @@ static void OptionsFrameEnableControls(HWND hwndDlg) */
static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact;
+ HCONTACT hContact;
int idx;
switch (uMsg) {
case WM_INITDIALOG:
@@ -144,9 +144,9 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (SendMessage(GetDlgItem(hwndDlg, IDC_RADIO_ALL), BM_GETCHECK, 0, 0) == BST_CHECKED)
hForwardFrom = 0;
else
- hForwardFrom = (HANDLE)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_GETITEMDATA, SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_GETCURSEL, 0, 0), 0);
+ hForwardFrom = (HCONTACT)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_GETITEMDATA, SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_FROM), CB_GETCURSEL, 0, 0), 0);
- hForwardTo = (HANDLE)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_GETITEMDATA, SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_GETCURSEL, 0, 0), 0);
+ hForwardTo = (HCONTACT)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_GETITEMDATA, SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_TO), CB_GETCURSEL, 0, 0), 0);
iForwardOnStatus = 0;
if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK1), BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_OFFLINE;
if (SendMessage(GetDlgItem(hwndDlg, IDC_CHECK2), BM_GETCHECK, 0, 0) == BST_CHECKED) iForwardOnStatus |= STATUS_ONLINE;
diff --git a/plugins/YARelay/src/stdafx.h b/plugins/YARelay/src/stdafx.h index cc74ee704e..248f7fe5f1 100644 --- a/plugins/YARelay/src/stdafx.h +++ b/plugins/YARelay/src/stdafx.h @@ -48,7 +48,7 @@ Features: extern HINSTANCE hInst;
-extern HANDLE hForwardFrom, hForwardTo;
+extern HCONTACT hForwardFrom, hForwardTo;
extern TCHAR tszForwardTemplate[MAXTEMPLATESIZE];
extern int iSplit, iSplitMaxSize, iSendParts, iMarkRead, iSendAndHistory, iForwardOnStatus;
diff --git a/plugins/YahooGroups/src/services.cpp b/plugins/YahooGroups/src/services.cpp index e5c1175db4..104ce5a949 100644 --- a/plugins/YahooGroups/src/services.cpp +++ b/plugins/YahooGroups/src/services.cpp @@ -106,7 +106,7 @@ void AddNewGroup(char *newGroup) availableGroups.Add(_strdup(group + 1));
}
-void AddContactToGroup(HANDLE hContact, char *group)
+void AddContactToGroup(HCONTACT hContact, char *group)
{
const int MAX_SIZE = 1024;
wchar_t wide[MAX_SIZE] = {0};
@@ -159,13 +159,13 @@ void CreateGroup(char *group) }
}
-void ProcessContacts(void (*callback)(HANDLE, char *), char *protocol)
+void ProcessContacts(void (*callback)(HCONTACT, char *), char *protocol)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
callback(hContact, protocol);
}
-void YahooMoveCallback(HANDLE hContact, char *unused)
+void YahooMoveCallback(HCONTACT hContact, char *unused)
{
char protocol[128] = {0};
GetContactProtocol(hContact, protocol, sizeof(protocol));
@@ -182,7 +182,7 @@ void YahooMoveCallback(HANDLE hContact, char *unused) }
}
-void ResetGroupCallback(HANDLE hContact, char *protocol)
+void ResetGroupCallback(HCONTACT hContact, char *protocol)
{
char p[128] = {0};
@@ -197,13 +197,11 @@ void ResetGroupCallback(HANDLE hContact, char *protocol) INT_PTR YahooGroupsMoveService(WPARAM wParam, LPARAM lParam)
{
ProcessContacts(YahooMoveCallback, NULL);
-
return 0;
}
INT_PTR YahooGroupsResetService(WPARAM wParam, LPARAM lParam)
{
ProcessContacts(ResetGroupCallback, NULL);
-
return 0;
}
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index 2c2c761d9b..4274f8c38a 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -132,7 +132,7 @@ void HexToBin(char *inData, ULONG &size, LPBYTE &outData) i = size;
}
-int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, char *szError, char *szResult, int size)
+int GetStringFromDatabase(HCONTACT hContact, char *szModule, char *szSettingName, char *szError, char *szResult, int size)
{
DBVARIANT dbv = {0};
int res = 1;
@@ -163,7 +163,7 @@ int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, return res;
}
-int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, WCHAR *szError, WCHAR *szResult, int count)
+int GetStringFromDatabase(HCONTACT hContact, char *szModule, char *szSettingName, WCHAR *szError, WCHAR *szResult, int count)
{
DBVARIANT dbv = {0};
int res = 1;
@@ -204,7 +204,7 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, return GetStringFromDatabase(NULL, ModuleName, szSettingName, szError, szResult, count);
}
-TCHAR *GetContactName(HANDLE hContact, char *szProto)
+TCHAR *GetContactName(HCONTACT hContact, char *szProto)
{
CONTACTINFO ctInfo;
char proto[200];
@@ -240,12 +240,12 @@ TCHAR *GetContactName(HANDLE hContact, char *szProto) return buffer;
}
-void GetContactProtocol(HANDLE hContact, char *szProto, int size)
+void GetContactProtocol(HCONTACT hContact, char *szProto, int size)
{
GetStringFromDatabase(hContact, "Protocol", "p", NULL, szProto, size);
}
-TCHAR *GetContactID(HANDLE hContact)
+TCHAR *GetContactID(HCONTACT hContact)
{
char protocol[256];
GetContactProtocol(hContact, protocol, sizeof(protocol));
@@ -253,7 +253,7 @@ TCHAR *GetContactID(HANDLE hContact) return GetContactID(hContact, protocol);
}
-TCHAR *GetContactID(HANDLE hContact, char *szProto)
+TCHAR *GetContactID(HCONTACT hContact, char *szProto)
{
CONTACTINFO ctInfo;
@@ -322,7 +322,7 @@ HANDLE GetContactFromID(TCHAR *szID, char *szProto) TCHAR *tmp;
int found = 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)) {
GetContactProtocol(hContact, cProtocol, sizeof(cProtocol));
szHandle = GetContactID(hContact, cProtocol);
diff --git a/plugins/YahooGroups/src/utils.h b/plugins/YahooGroups/src/utils.h index 9133633caf..c3dc480dfa 100644 --- a/plugins/YahooGroups/src/utils.h +++ b/plugins/YahooGroups/src/utils.h @@ -44,17 +44,17 @@ void ScreenToClient(HWND hWnd, LPRECT rect); void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors);
RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int anchors);
-int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, char *szError, char *szResult, int size);
-int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, WCHAR *szError, WCHAR *szResult, int count);
+int GetStringFromDatabase(HCONTACT hContact, char *szModule, char *szSettingName, char *szError, char *szResult, int size);
+int GetStringFromDatabase(HCONTACT hContact, char *szModule, char *szSettingName, WCHAR *szError, WCHAR *szResult, int count);
int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, int size);
int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult, int count);
-TCHAR *GetContactName(HANDLE hContact, char *szProto);
-TCHAR *GetContactID(HANDLE hContact);
-TCHAR *GetContactID(HANDLE hContact, char *szProto);
+TCHAR *GetContactName(HCONTACT hContact, char *szProto);
+TCHAR *GetContactID(HCONTACT hContact);
+TCHAR *GetContactID(HCONTACT hContact, char *szProto);
HANDLE GetContactFromID(TCHAR *szID, char *szProto);
HANDLE GetContactFromID(TCHAR *szID, wchar_t *szProto);
-void GetContactProtocol(HANDLE hContact, char *szProto, int size);
+void GetContactProtocol(HCONTACT hContact, char *szProto, int size);
int MyPUShowMessage(char *lpzText, BYTE kind);
diff --git a/plugins/mTextControl/src/services.cpp b/plugins/mTextControl/src/services.cpp index 5f2ce42f52..0afa1df715 100644 --- a/plugins/mTextControl/src/services.cpp +++ b/plugins/mTextControl/src/services.cpp @@ -169,7 +169,7 @@ INT_PTR MText_CreateW(WPARAM wParam, LPARAM lParam) { //---------------------------------------------------------------------------
// allocate text object (advanced)
HANDLE DLL_CALLCONV
-MTI_MTextCreateEx (HANDLE userHandle, HANDLE hContact, void *text, DWORD flags) {
+MTI_MTextCreateEx (HANDLE userHandle, HCONTACT hContact, void *text, DWORD flags) {
TextObject *result = new TextObject;
result->options = TextUserGetOptions(userHandle);
result->ftd = new CFormattedTextDraw;
@@ -337,7 +337,7 @@ INT_PTR MText_GetInterface(WPARAM wParam, LPARAM lParam) { MText->Create = MTI_MTextCreate;
MText->CreateW = MTI_MTextCreateW;
// MText->CreateT = defined inside api
- MText->CreateEx = MTI_MTextCreateEx;
+ MText->CreateEx = MTI_MTextCreateEx;
MText->Measure = MTI_MTextMeasure;
MText->Display = MTI_MTextDisplay;
MText->SetParent = MTI_MTextSetParent;
diff --git a/plugins/mTextControl/src/services.h b/plugins/mTextControl/src/services.h index 589c33cba2..d5efb2ac87 100644 --- a/plugins/mTextControl/src/services.h +++ b/plugins/mTextControl/src/services.h @@ -25,7 +25,7 @@ void UnloadServices(); __declspec(dllexport) HANDLE DLL_CALLCONV MTI_MTextCreate (HANDLE userHandle, char *text);
__declspec(dllexport) HANDLE DLL_CALLCONV MTI_MTextCreateW (HANDLE userHandle, WCHAR *text);
-__declspec(dllexport) HANDLE DLL_CALLCONV MTI_MTextCreateEx (HANDLE userHandle, HANDLE hContact, void *text, DWORD flags);
+__declspec(dllexport) HANDLE DLL_CALLCONV MTI_MTextCreateEx (HANDLE userHandle, HCONTACT hContact, void *text, DWORD flags);
__declspec(dllexport) int DLL_CALLCONV MTI_MTextMeasure (HDC dc, SIZE *sz, HANDLE text);
__declspec(dllexport) int DLL_CALLCONV MTI_MTextDisplay (HDC dc, POINT pos, SIZE sz, HANDLE text);
__declspec(dllexport) int DLL_CALLCONV MTI_MTextSetParent (HANDLE text, HWND hwnd, RECT rect);
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index 56c471ef27..10efe9572e 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -72,7 +72,7 @@ int ProtoAck(WPARAM,LPARAM lparam) int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT) wParam;
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
logmsg("ContactSettingChanged1");
@@ -98,7 +98,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) int ContactStatusChanged(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = (HANDLE) wParam;
+ HCONTACT hContact = (HCONTACT) wParam;
WORD oldStatus = LOWORD(lParam);
WORD newStatus = HIWORD(lParam);
DWORD ann=db_get_dw(NULL,THIS_MODULE,"announce", DEFAULT_ANNOUNCE);
|