03-05-2013, 05:24 PM
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?
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?
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)