1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-07 08:34:06 +02:00

Refactor -1 in hook to NativeMethods.HOOK_HANDLED & include example.html in project file

This commit is contained in:
chylex 2017-04-14 14:24:37 +02:00
parent 829d69485a
commit 6e262334ed
3 changed files with 3 additions and 1 deletions

View File

@ -98,7 +98,7 @@ private void StopMouseHook(){
private IntPtr MouseHookProc(int nCode, IntPtr wParam, IntPtr lParam){
if (nCode == 0 && wParam.ToInt32() == NativeMethods.WM_MOUSEWHEEL && browser.Bounds.Contains(PointToClient(Cursor.Position)) && !ContainsFocus && !owner.ContainsFocus){
browser.SendMouseWheelEvent(0, 0, 0, NativeMethods.GetHookWheelDelta(lParam), CefEventFlags.None);
return new IntPtr(-1);
return NativeMethods.HOOK_HANDLED;
}
return NativeMethods.CallNextHookEx(mouseHook, nCode, wParam, lParam);

View File

@ -9,6 +9,7 @@ namespace TweetDck.Core.Utils{
[SuppressMessage("ReSharper", "MemberCanBePrivate.Local")]
static class NativeMethods{
public static readonly IntPtr HWND_BROADCAST = new IntPtr(0xFFFF);
public static readonly IntPtr HOOK_HANDLED = new IntPtr(-1);
public const int HWND_TOPMOST = -1;
public const uint SWP_NOACTIVATE = 0x0010;

View File

@ -328,6 +328,7 @@
<Content Include="Resources\Scripts\code.js" />
<Content Include="Resources\Scripts\notification.js" />
<Content Include="Resources\Scripts\pages\error.html" />
<Content Include="Resources\Scripts\pages\example.html" />
<Content Include="Resources\Scripts\plugins.browser.js" />
<Content Include="Resources\Scripts\plugins.js" />
<Content Include="Resources\Scripts\plugins.notification.js" />