Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/NotificationMessage.cpp

Issue 11557015: Tooltip notification. Check for update fixes. (Closed)
Patch Set: Nits addressed Created Oct. 7, 2013, 9:50 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .hgsubstate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/NotificationMessage.cpp
===================================================================
--- a/src/plugin/NotificationMessage.cpp
+++ b/src/plugin/NotificationMessage.cpp
@@ -3,9 +3,8 @@
#include "NotificationMessage.h"
-NotificationMessage::NotificationMessage(HWND parent)
+NotificationMessage::NotificationMessage(HWND parent): parentWindow(parent)
{
- parentWindow = parent;
toolTipWindow = 0;
InitializeCommonControls();
};
@@ -39,13 +38,13 @@
SetWindowPos(toolTipWindow, HWND_TOPMOST,0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- TOOLINFOW ti;
+ TOOLINFOW ti = {};
ti.cbSize = sizeof(TOOLINFOW);
ti.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_TRANSPARENT;
ti.hwnd = toolTipWindow;
ti.hinst = NULL;
ti.uId = (UINT_PTR)parentWindow;
- ti.lpszText = const_cast<LPWSTR>(message.c_str());
+ ti.lpszText = const_cast<LPWSTR>(message.c_str());
GetClientRect(parentWindow, &ti.rect);
LRESULT res = ::SendMessage(toolTipWindow, TTM_ADDTOOL, 0, (LPARAM)&ti);
@@ -77,8 +76,7 @@
bool NotificationMessage::SetTextAndIcon(std::wstring text, std::wstring title, int icon)
{
- TOOLINFOW ti;
- memset(&ti, 0, sizeof(TOOLINFOW));
+ TOOLINFOW ti = {};
ti.cbSize = sizeof(TOOLINFOW);
ti.hwnd = toolTipWindow;
ti.hinst = NULL;
« no previous file with comments | « .hgsubstate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld