diff options
author | George Hazan <george.hazan@gmail.com> | 2015-01-16 17:49:54 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-01-16 17:49:54 +0000 |
commit | 85c0b6a96f366bdf0ca334ee7cb1877fb3f2288c (patch) | |
tree | fe07935255b7432938f282419c3ab1378524c02f /src/core | |
parent | 8a09c895c4cd0e9cc87c38181ae2913dba77c30b (diff) |
MEVENT - the strict type for events, they are not HANDLE anymore
git-svn-id: http://svn.miranda-ng.org/main/trunk@11866 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/stdauth/src/auth.cpp | 4 | ||||
-rw-r--r-- | src/core/stdauth/src/authdialogs.cpp | 8 | ||||
-rw-r--r-- | src/core/stdfile/src/file.cpp | 11 | ||||
-rw-r--r-- | src/core/stdfile/src/file.h | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/globals.cpp | 8 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 10 | ||||
-rw-r--r-- | src/core/stdmsg/src/msglog.cpp | 6 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 8 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.h | 28 | ||||
-rw-r--r-- | src/core/stduihist/src/history.cpp | 14 | ||||
-rw-r--r-- | src/core/stdurl/url.cpp | 6 | ||||
-rw-r--r-- | src/core/stdurl/url.h | 2 | ||||
-rw-r--r-- | src/core/stduseronline/src/useronline.cpp | 2 |
13 files changed, 54 insertions, 55 deletions
diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp index bd6a7feb4c..3a1a1d43eb 100644 --- a/src/core/stdauth/src/auth.cpp +++ b/src/core/stdauth/src/auth.cpp @@ -46,10 +46,10 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) {
TCHAR szUid[128] = _T("");
TCHAR szTooltip[256];
- const HANDLE hDbEvent = (HANDLE)lParam;
+ MEVENT hDbEvent = (MEVENT)lParam;
DBEVENTINFO dbei = { sizeof(dbei) };
- db_event_get((HANDLE)lParam, &dbei);
+ db_event_get(lParam, &dbei);
if (dbei.flags & (DBEF_SENT | DBEF_READ) || (dbei.eventType != EVENTTYPE_AUTHREQUEST && dbei.eventType != EVENTTYPE_ADDED))
return 0;
diff --git a/src/core/stdauth/src/authdialogs.cpp b/src/core/stdauth/src/authdialogs.cpp index e1a1865507..4c8c66ce5d 100644 --- a/src/core/stdauth/src/authdialogs.cpp +++ b/src/core/stdauth/src/authdialogs.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hDbEvent = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ MEVENT hDbEvent = (MEVENT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
@@ -34,7 +34,7 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar Button_SetIcon_IcoLib(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details"));
Button_SetIcon_IcoLib(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list"));
- hDbEvent = (HANDLE)lParam;
+ hDbEvent = lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
{
//blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
@@ -149,7 +149,7 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HANDLE hDbEvent = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ MEVENT hDbEvent = (MEVENT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
case WM_INITDIALOG:
@@ -157,7 +157,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP Button_SetIcon_IcoLib(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details"));
Button_SetIcon_IcoLib(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list"));
{
- hDbEvent = (HANDLE)lParam;
+ hDbEvent = lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
//blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 0363ebc851..f61378f3ca 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -109,7 +109,7 @@ static INT_PTR RecvFileCommand(WPARAM, LPARAM lParam) return 0;
}
-void PushFileEvent(MCONTACT hContact, HANDLE hdbe, LPARAM lParam)
+void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam)
{
CLISTEVENT cle = { 0 };
cle.cbSize = sizeof(cle);
@@ -140,11 +140,11 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam) DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = sizeof(DWORD);
dbei.pBlob = (PBYTE)&dwSignature;
- db_event_get((HANDLE)lParam, &dbei);
+ db_event_get(lParam, &dbei);
if (dbei.flags & (DBEF_SENT | DBEF_READ) || dbei.eventType != EVENTTYPE_FILE || dwSignature == 0)
return 0;
- PushFileEvent(wParam, (HANDLE)lParam, 0);
+ PushFileEvent(wParam, lParam, 0);
return 0;
}
@@ -287,7 +287,7 @@ void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANS static void RemoveUnreadFileEvents(void)
{
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hDbEvent = db_event_firstUnread(hContact);
+ MEVENT hDbEvent = db_event_firstUnread(hContact);
while (hDbEvent) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
@@ -399,8 +399,7 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam) mir_free(pszFiles[i]);
mir_free(szDescr);
- HANDLE hdbe = db_event_add(ccs->hContact, &dbei);
-
+ MEVENT hdbe = db_event_add(ccs->hContact, &dbei);
PushFileEvent(ccs->hContact, hdbe, pre->lParam);
mir_free(dbei.pBlob);
return 0;
diff --git a/src/core/stdfile/src/file.h b/src/core/stdfile/src/file.h index 4231cef5e0..1d0c8322b7 100644 --- a/src/core/stdfile/src/file.h +++ b/src/core/stdfile/src/file.h @@ -49,7 +49,7 @@ struct FileDlgData HWND hwndTransfer;
HANDLE fs;
MCONTACT hContact;
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
HANDLE hNotifyEvent;
TCHAR **files;
int send;
diff --git a/src/core/stdmsg/src/globals.cpp b/src/core/stdmsg/src/globals.cpp index f2033c6e00..62fe7fa5e8 100644 --- a/src/core/stdmsg/src/globals.cpp +++ b/src/core/stdmsg/src/globals.cpp @@ -58,17 +58,17 @@ static int OnMetaChanged(WPARAM hMeta, LPARAM) return 0;
}
-static int dbaddedevent(WPARAM hContact, LPARAM lParam)
+static int dbaddedevent(WPARAM hContact, LPARAM hDbEvent)
{
if (hContact) {
HWND h = WindowList_Find(g_dat.hMessageWindowList, hContact);
if (h)
- SendMessage(h, HM_DBEVENTADDED, hContact, lParam);
+ SendMessage(h, HM_DBEVENTADDED, hContact, hDbEvent);
- MCONTACT hEventContact = db_event_getContact((HANDLE)lParam);
+ MCONTACT hEventContact = db_event_getContact(hDbEvent);
if (hEventContact != hContact)
if ((h = WindowList_Find(g_dat.hMessageWindowList, hEventContact)) != NULL)
- SendMessage(h, HM_DBEVENTADDED, hEventContact, lParam);
+ SendMessage(h, HM_DBEVENTADDED, hEventContact, hDbEvent);
}
return 0;
}
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index f0bf138396..ee401f03f4 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -757,7 +757,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP switch (historyMode) {
case LOADHISTORY_COUNT:
for (int i = db_get_w(NULL, SRMMMOD, SRMSGSET_LOADCOUNT, SRMSGDEFSET_LOADCOUNT); i--;) {
- HANDLE hPrevEvent;
+ MEVENT hPrevEvent;
if (dat->hDbEventFirst == NULL)
hPrevEvent = db_event_last(dat->hContact);
else
@@ -782,7 +782,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DWORD firstTime = dbei.timestamp - 60 * db_get_w(NULL, SRMMMOD, SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME);
for (;;) {
- HANDLE hPrevEvent;
+ MEVENT hPrevEvent;
if (dat->hDbEventFirst == NULL)
hPrevEvent = db_event_last(dat->hContact);
else
@@ -800,7 +800,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
}
- HANDLE hdbEvent = db_event_last(dat->hContact);
+ MEVENT hdbEvent = db_event_last(dat->hContact);
if (hdbEvent) {
do {
DBEVENTINFO dbei = { sizeof(dbei) };
@@ -1260,7 +1260,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break;
case DM_APPENDTOLOG: //takes wParam=hDbEvent
- StreamInEvents(hwndDlg, (HANDLE)wParam, 1, 1);
+ StreamInEvents(hwndDlg, wParam, 1, 1);
break;
case DM_SCROLLLOGTOBOTTOM:
@@ -1281,7 +1281,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case HM_DBEVENTADDED:
if (wParam == dat->hContact) {
- HANDLE hDbEvent = (HANDLE)lParam;
+ MEVENT hDbEvent = lParam;
if (dat->hDbEventFirst == NULL)
dat->hDbEventFirst = hDbEvent;
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 8a604a72a0..c25f1bdd2d 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -39,7 +39,7 @@ struct LogStreamData {
int stage;
MCONTACT hContact;
- HANDLE hDbEvent, hDbEventLast;
+ MEVENT hDbEvent, hDbEventLast;
char *buffer;
int bufferOffset, bufferLen;
int eventsToInsert;
@@ -228,7 +228,7 @@ int DbEventIsShown(DBEVENTINFO *dbei) }
//mir_free() the return value
-static char *CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, HANDLE hDbEvent, struct LogStreamData *streamData)
+static char *CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT hDbEvent, struct LogStreamData *streamData)
{
int showColon = 0;
@@ -444,7 +444,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG return 0;
}
-void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend)
+void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend)
{
EDITSTREAM stream = { 0 };
struct LogStreamData streamData = { 0 };
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 2a846769ec..0f3e5e5eb2 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -52,7 +52,7 @@ static int SRMMStatusToPf2(int status) static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
{
DBEVENTINFO dbei = { sizeof(dbei) };
- db_event_get((HANDLE)lParam, &dbei);
+ db_event_get(lParam, &dbei);
if (dbei.flags & (DBEF_SENT | DBEF_READ) || !(dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei)))
return 0;
@@ -89,7 +89,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) CLISTEVENT cle = { sizeof(cle) };
cle.hContact = hContact;
- cle.hDbEvent = (HANDLE)lParam;
+ cle.hDbEvent = lParam;
cle.flags = CLEF_TCHAR;
cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
@@ -179,7 +179,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) else {
CLISTEVENT cle = { sizeof(cle) };
cle.hContact = hContact;
- cle.hDbEvent = (HANDLE)1;
+ cle.hDbEvent = 1;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hIcon = LoadSkinnedIcon(SKINICON_OTHER_TYPING);
cle.pszService = "SRMsg/ReadMessage";
@@ -235,7 +235,7 @@ static void RestoreUnreadMessageAlerts(void) DBEVENTINFO dbei = { sizeof(dbei) };
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- for (HANDLE hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
+ for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
bool autoPopup = false;
dbei.cbBlob = 0;
db_event_get(hDbEvent, &dbei);
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h index 0ce9aea114..45d040d7dc 100644 --- a/src/core/stdmsg/src/msgs.h +++ b/src/core/stdmsg/src/msgs.h @@ -40,7 +40,7 @@ struct SrmmWindowData : public MZeroedObject {}
MCONTACT hContact;
- HANDLE hDbEventFirst, hDbEventLast;
+ MEVENT hDbEventFirst, hDbEventLast;
HBRUSH hBkgBrush;
int splitterPos, originalSplitterPos;
SIZE minEditBoxSize;
@@ -105,26 +105,26 @@ struct CREOleCallback : public IRichEditOleCallback int nextStgId;
STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR * lplpObj);
- STDMETHOD_(ULONG,AddRef) (THIS);
- STDMETHOD_(ULONG,Release) (THIS);
+ STDMETHOD_(ULONG,AddRef)(THIS);
+ STDMETHOD_(ULONG,Release)(THIS);
STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode);
- STDMETHOD(GetNewStorage) (LPSTORAGE FAR * lplpstg);
- STDMETHOD(GetInPlaceContext) (LPOLEINPLACEFRAME FAR * lplpFrame, LPOLEINPLACEUIWINDOW FAR * lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo);
- STDMETHOD(ShowContainerUI) (BOOL fShow);
- STDMETHOD(QueryInsertObject) (LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp);
- STDMETHOD(DeleteObject) (LPOLEOBJECT lpoleobj);
- STDMETHOD(QueryAcceptData) (LPDATAOBJECT lpdataobj, CLIPFORMAT FAR * lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict);
- STDMETHOD(GetClipboardData) (CHARRANGE FAR * lpchrg, DWORD reco, LPDATAOBJECT FAR * lplpdataobj);
- STDMETHOD(GetDragDropEffect) (BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect);
- STDMETHOD(GetContextMenu) (WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE FAR * lpchrg, HMENU FAR * lphmenu) ;
+ STDMETHOD(GetNewStorage)(LPSTORAGE FAR * lplpstg);
+ STDMETHOD(GetInPlaceContext)(LPOLEINPLACEFRAME FAR * lplpFrame, LPOLEINPLACEUIWINDOW FAR * lplpDoc, LPOLEINPLACEFRAMEINFO lpFrameInfo);
+ STDMETHOD(ShowContainerUI)(BOOL fShow);
+ STDMETHOD(QueryInsertObject)(LPCLSID lpclsid, LPSTORAGE lpstg, LONG cp);
+ STDMETHOD(DeleteObject)(LPOLEOBJECT lpoleobj);
+ STDMETHOD(QueryAcceptData)(LPDATAOBJECT lpdataobj, CLIPFORMAT FAR * lpcfFormat, DWORD reco, BOOL fReally, HGLOBAL hMetaPict);
+ STDMETHOD(GetClipboardData)(CHARRANGE FAR *lpchrg, DWORD reco, LPDATAOBJECT FAR * lplpdataobj);
+ STDMETHOD(GetDragDropEffect)(BOOL fDrag, DWORD grfKeyState, LPDWORD pdwEffect);
+ STDMETHOD(GetContextMenu)(WORD seltype, LPOLEOBJECT lpoleobj, CHARRANGE FAR * lpchrg, HMENU FAR * lphmenu) ;
};
INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
int DbEventIsForMsgWindow(DBEVENTINFO *dbei);
-int DbEventIsShown(DBEVENTINFO * dbei);
-void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend);
+int DbEventIsShown(DBEVENTINFO *dbei);
+void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend);
int SendMessageDirect(const TCHAR *szMsg, MCONTACT hContact, char *szProto);
void LoadMsgLogIcons(void);
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index 545c23fa7b..b1d3bc5c49 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -148,7 +148,7 @@ static void FillHistoryThread(void* param) DBEVENTINFO dbei = { sizeof(dbei) };
int oldBlobSize = 0;
- HANDLE hDbEvent = db_event_last(hInfo->hContact);
+ MEVENT hDbEvent = db_event_last(hInfo->hContact);
while (hDbEvent != NULL) {
if (!IsWindow(hInfo->hwnd))
@@ -259,14 +259,14 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP return TRUE;
case IDC_DELETEHISTORY:
- HANDLE hDbevent;
+ MEVENT hDbevent;
{
int index = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETCURSEL, 0, 0);
if (index == LB_ERR)
break;
if (MessageBox(hwndDlg, TranslateT("Are you sure you want to delete this history item?"), TranslateT("Delete history"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
- hDbevent = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0);
+ hDbevent = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0);
db_event_delete(hContact, hDbevent);
SendMessage(hwndDlg, DM_HREBUILD, 0, 0);
}
@@ -279,7 +279,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (sel == LB_ERR) { EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEHISTORY), FALSE); break; }
EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEHISTORY), TRUE);
TCHAR *contactName = pcli->pfnGetContactDisplayName(hContact, 0);
- HANDLE hDbEvent = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0);
+ MEVENT hDbEvent = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0);
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
@@ -305,11 +305,11 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP DBEVENTINFO dbei = { sizeof(dbei) };
int oldBlobSize = 0;
- HANDLE hDbEventStart = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0);
+ MEVENT hDbEventStart = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0);
for (;;) {
- HANDLE hDbEvent = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, ++index, 0);
- if (hDbEvent == (HANDLE)LB_ERR) {
+ MEVENT hDbEvent = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, ++index, 0);
+ if (hDbEvent == LB_ERR) {
index = -1;
continue;
}
diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp index 2eb4783206..f12c170831 100644 --- a/src/core/stdurl/url.cpp +++ b/src/core/stdurl/url.cpp @@ -42,7 +42,7 @@ static INT_PTR ReadUrlCommand(WPARAM, LPARAM lParam) static int UrlEventAdded(WPARAM hContact, LPARAM lParam)
{
DBEVENTINFO dbei = { sizeof(dbei) };
- db_event_get((HANDLE)lParam, &dbei);
+ db_event_get(lParam, &dbei);
if (dbei.flags & (DBEF_SENT|DBEF_READ) || dbei.eventType != EVENTTYPE_URL)
return 0;
@@ -54,7 +54,7 @@ static int UrlEventAdded(WPARAM hContact, LPARAM lParam) CLISTEVENT cle = { sizeof(cle) };
cle.flags = CLEF_TCHAR;
cle.hContact = hContact;
- cle.hDbEvent = (HANDLE)lParam;
+ cle.hDbEvent = lParam;
cle.hIcon = LoadSkinIcon(SKINICON_EVENT_URL);
cle.pszService = "SRUrl/ReadUrl";
cle.ptszTooltip = szTooltip;
@@ -76,7 +76,7 @@ static void RestoreUnreadUrlAlerts(void) cle.flags = CLEF_TCHAR;
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hDbEvent = db_event_firstUnread(hContact);
+ MEVENT hDbEvent = db_event_firstUnread(hContact);
while (hDbEvent) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
diff --git a/src/core/stdurl/url.h b/src/core/stdurl/url.h index d1202d10e2..ec91490ef3 100644 --- a/src/core/stdurl/url.h +++ b/src/core/stdurl/url.h @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct UrlRcvData {
MCONTACT hContact;
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
};
struct UrlSendData {
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index d7737d0099..e0a8801e81 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -64,7 +64,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) cle.cbSize = sizeof(cle);
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hContact = hContact;
- cle.hDbEvent = (HANDLE)(uniqueEventId++);
+ cle.hDbEvent = uniqueEventId++;
cle.hIcon = LoadSkinIcon(SKINICON_OTHER_USERONLINE, false);
cle.pszService = "UserOnline/Description";
mir_sntprintf(tooltip, SIZEOF(tooltip), TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0));
|