Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hook and eat
#1
Hi gintaras, Hi all

i try to adapt the mouse hook you gave in the AltMouseTriggers function.

As I play with it, i often now have freezed laptop, so I ask before screwing all.

I want to "eat" RButtonDown in firefox for example, and don't act on any other program.
But handling firefox "eating" mouse button should be done in an external function DoAction.

Is this code correct to do so? Is it mandatory to use ret to achieve that?

Code:
Copy      Help
if(getopt(nargs)=0)
    int+ g_mhook=SetWindowsHookEx(WH_MOUSE_LL &AltMouseTriggers _hinst 0)
    opt waitmsg 1
    AddTrayIcon "mouse.ico" "My mouse triggers" ;;remove this line if tray icon is not needed
    wait -1 -V g_mhook
    ret

if(nCode<0) goto g1
if(m.flags&LLMHF_INJECTED) goto g1 ;;not user-generated

sel wParam
     case [WM_LBUTTONDOWN]
     _s.getwinclass(win(mouse))
         if(StrCompare(_s "Mozilla*WindowClass))
                _i=DoAction("Firefox") ;;!!!!!<----action done in DoAction function, must eat mouse click.!!!!!
               if(_i=1) ret _i; else goto g1
     else goto g1



g1
ret CallNextHookEx(g_mhook nCode wParam m)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)