From 8ac50e588c3497c7616647d6b167be814677330e Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Thu, 1 Jan 2015 19:24:09 +0000 Subject: useless message removed (by ghazan) git-svn-id: http://svn.miranda-ng.org/main/trunk@11717 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_aniavatars.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'plugins/Clist_modern') diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index 94e6adf3aa..3f27ffccec 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -51,7 +51,6 @@ enum { AAM_RESUME, //async remobe previous flag. repaints if required AAM_REMOVEAVATAR, //sync WPARAM: if y more then wParam, LPARAM: shift up to lParam( remove if values is same) AAM_SETPARENT, //async WPARAM: handle of new parent window - AAM_SELFDESTROY, //sync AAM_RENDER, //sync AAM_LAST, }; @@ -66,7 +65,8 @@ struct ANIAVA_OBJECT : public MZeroedObject ~ANIAVA_OBJECT() { - SendMessage(hWindow, AAM_SELFDESTROY, 0, 0); + if (hWindow) + DestroyWindow(hWindow); } }; @@ -727,9 +727,6 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR _AniAva_RenderAvatar(dat, (HDC)wParam, (RECT*)lParam); return 0; - case AAM_SELFDESTROY: - return DestroyWindow(hwnd); - case WM_CREATE: dat = (ANIAVA_WINDOWINFO *)mir_calloc(sizeof(ANIAVA_WINDOWINFO)); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)dat); @@ -793,7 +790,7 @@ int AniAva_AddAvatar(MCONTACT hContact, TCHAR * szFilename, int width, int heigt if (pavi->ObjectSize.cx == width && pavi->ObjectSize.cy == heigth) hwnd = pavi->hWindow; else { - SendMessage(pavi->hWindow, AAM_SELFDESTROY, 0, 0); + DestroyWindow(pavi->hWindow); pavi->hWindow = NULL; _AniAva_RealRemoveAvatar(pavi->dwAvatarUniqId); pavi->dwAvatarUniqId = 0; @@ -867,12 +864,9 @@ int AniAva_RemoveAvatar(MCONTACT hContact) mir_cslock lck(s_CS); ANIAVA_OBJECT *pai = FindAvatarByContact(hContact); - if (pai) { - if (pai->hWindow) - SendMessage(pai->hWindow, AAM_SELFDESTROY, 0, 0); - + if (pai) s_Objects.remove(pai); - } + return 1; } @@ -889,7 +883,7 @@ int AniAva_RemoveInvalidatedAvatars() if (pai.hWindow && pai.bInvalidPos) { SendMessage(pai.hWindow, AAM_STOP, 0, 0); pai.bInvalidPos = 0; - SendMessage(pai.hWindow, AAM_SELFDESTROY, 0, 0); + DestroyWindow(pai.hWindow); pai.hWindow = NULL; } } -- cgit v1.2.3