| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 ti.hwnd = parentWindow; | 61 ti.hwnd = parentWindow; |
| 62 ti.hinst = NULL; | 62 ti.hinst = NULL; |
| 63 ti.uId = (UINT_PTR)parentWindow; | 63 ti.uId = (UINT_PTR)parentWindow; |
| 64 ti.lpszText = const_cast<LPWSTR>(message.c_str()); | 64 ti.lpszText = const_cast<LPWSTR>(message.c_str()); |
| 65 GetClientRect(parentWindow, &ti.rect); | 65 GetClientRect(parentWindow, &ti.rect); |
| 66 | 66 |
| 67 LRESULT res = ::SendMessage(toolTipWindow, TTM_ADDTOOL, 0, (LPARAM)&ti); | 67 LRESULT res = ::SendMessage(toolTipWindow, TTM_ADDTOOL, 0, (LPARAM)&ti); |
| 68 | 68 |
| 69 RECT rect; | 69 RECT rect; |
| 70 GetWindowRect(parentWindow, &rect); | 70 GetWindowRect(parentWindow, &rect); |
| 71 Move(rect.left + (rect.right - rect.left) / 2, rect.top + (rect.bottom - rect.
top) / 2); | 71 MoveToCenter(rect); |
| 72 | 72 |
| 73 SetTextAndIcon(message, title, icon); | 73 SetTextAndIcon(message, title, icon); |
| 74 res = ::SendMessage(toolTipWindow, TTM_TRACKACTIVATE, TRUE, (LPARAM)&ti); | 74 res = ::SendMessage(toolTipWindow, TTM_TRACKACTIVATE, TRUE, (LPARAM)&ti); |
| 75 | 75 |
| 76 return true; | 76 return true; |
| 77 } | 77 } |
| 78 | 78 |
| 79 void NotificationMessage::Hide() | 79 void NotificationMessage::Hide() |
| 80 { | 80 { |
| 81 if (toolTipWindow != 0) | 81 if (toolTipWindow != 0) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 106 | 106 |
| 107 void NotificationMessage::SetParent(HWND parent) | 107 void NotificationMessage::SetParent(HWND parent) |
| 108 { | 108 { |
| 109 parentWindow = parent; | 109 parentWindow = parent; |
| 110 } | 110 } |
| 111 | 111 |
| 112 bool NotificationMessage::IsVisible() | 112 bool NotificationMessage::IsVisible() |
| 113 { | 113 { |
| 114 if (toolTipWindow == 0) | 114 if (toolTipWindow == 0) |
| 115 return false; | 115 return false; |
| 116 return IsWindowVisible(toolTipWindow); | 116 return IsWindowVisible(toolTipWindow) != FALSE; |
| 117 } | 117 } |
| OLD | NEW |