diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-17 08:35:51 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-17 08:35:51 +0000 |
commit | ee2e419778605a5445474a33a29f2cfbb7eed245 (patch) | |
tree | 404194e1d202f6433693f3833792e940c04e2d7e /plugins/YAPP/popwin.cpp | |
parent | 1ca120b165c2f2d9f521a04bfc31c7956d2ce422 (diff) |
bunch of fixes for various memory-related problems
git-svn-id: http://svn.miranda-ng.org/main/trunk@1001 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YAPP/popwin.cpp')
-rw-r--r-- | plugins/YAPP/popwin.cpp | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/plugins/YAPP/popwin.cpp b/plugins/YAPP/popwin.cpp index 50e99cdd36..682a3f7b05 100644 --- a/plugins/YAPP/popwin.cpp +++ b/plugins/YAPP/popwin.cpp @@ -523,6 +523,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa //}
}
return 0;
+
case WM_DESTROY:
if(pwd->mouse_in) global_mouse_in--;
@@ -546,8 +547,8 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa }
mir_free(pwd); pwd = 0; pd = 0;
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
-
break;
+
case PUM_UPDATERGN:
// round corners
if(pwd->is_round) {
@@ -566,32 +567,24 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa return TRUE;
case PUM_MOVE:
- {
- if(options.animate) {
- KillTimer(hwnd, ID_MOVETIMER);
- pwd->new_x = (int)wParam;
- pwd->new_y = (int)lParam;
- SetTimer(hwnd, ID_MOVETIMER, 10, 0);
- } else {
- SetWindowPos(hwnd, 0, (int)wParam, (int)lParam, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
- if (!IsWindowVisible(hwnd)) {
- ShowWindow(hwnd, SW_SHOWNOACTIVATE);
- UpdateWindow(hwnd);
- }
+ if(options.animate) {
+ KillTimer(hwnd, ID_MOVETIMER);
+ pwd->new_x = (int)wParam;
+ pwd->new_y = (int)lParam;
+ SetTimer(hwnd, ID_MOVETIMER, 10, 0);
+ } else {
+ SetWindowPos(hwnd, 0, (int)wParam, (int)lParam, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
+ if (!IsWindowVisible(hwnd)) {
+ ShowWindow(hwnd, SW_SHOWNOACTIVATE);
+ UpdateWindow(hwnd);
}
}
return TRUE;
+
case PUM_SETTEXT:
- {
- mir_free(pd->pszText);
- if(lParam)
- pd->pwzText = mir_wstrdup((wchar_t *)lParam);
- else
- pd->pwzText = NULL;
- // mir_free((void *)lParam); // freed in message pump in case the window has gone
- InvalidateRect(hwnd, 0, TRUE);
- RepositionWindows();
- }
+ replaceStrT(pd->ptzText, (TCHAR*)lParam);
+ InvalidateRect(hwnd, 0, TRUE);
+ RepositionWindows();
return TRUE;
case PUM_GETCONTACT:
|