summaryrefslogtreecommitdiffstats
path: root/views/focus/focus_util_win.h
blob: 2c53c68eca66a529b7797e13e347fe30114b4417 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef VIEWS_FOCUS_FOCUS_UTIL_WIN_H_
#define VIEWS_FOCUS_FOCUS_UTIL_WIN_H_
#pragma once

#include <windows.h>

namespace app {
namespace win {
class ScopedProp;
}
}

namespace views {

// Marks the passed |hwnd| as supporting mouse-wheel message rerouting.
// We reroute the mouse wheel messages to such HWND when they are under the
// mouse pointer (but are not the active window). Callers must delete the
// returned object before the window is destroyed (see ScopedProp for details).
app::win::ScopedProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd);

// Forwards mouse wheel messages to the window under it.
// Windows sends mouse wheel messages to the currently active window.
// This causes a window to scroll even if it is not currently under the mouse
// wheel. The following code gives mouse wheel messages to the window under the
// mouse wheel in order to scroll that window. This is arguably a better user
// experience.  The returns value says whether the mouse wheel message was
// successfully redirected.
bool RerouteMouseWheel(HWND window, WPARAM w_param, LPARAM l_param);

}   // namespace views

#endif  // VIEWS_FOCUS_FOCUS_UTIL_WIN_H_