win: Add "balloon-clicked" event for Tray

This commit is contained in:
Cheng Zhao 2014-11-28 18:50:31 +08:00
parent 8097cb2b9e
commit 210c97f957
8 changed files with 22 additions and 0 deletions

View file

@ -71,6 +71,10 @@ void NotifyIcon::HandleClickEvent(const gfx::Point& cursor_pos,
ui::MENU_SOURCE_MOUSE));
}
void NotifyIcon::HandleBalloonClickEvent() {
NotifyBalloonClicked();
}
void NotifyIcon::ResetIcon() {
NOTIFYICONDATA icon_data;
InitIconData(&icon_data);

View file

@ -35,6 +35,9 @@ class NotifyIcon : public TrayIcon {
// otherwise displays the context menu if there is one.
void HandleClickEvent(const gfx::Point& cursor_pos, bool left_button_click);
// Handles a click on the balloon from the user.
void HandleBalloonClickEvent();
// Re-creates the status tray icon now after the taskbar has been created.
void ResetIcon();

View file

@ -132,6 +132,10 @@ LRESULT CALLBACK NotifyIconHost::WndProc(HWND hwnd,
return TRUE;
switch (lparam) {
case TB_INDETERMINATE:
win_icon->HandleBalloonClickEvent();
return TRUE;
case WM_LBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_CONTEXTMENU: