Try
CliCount!
Rightclick the tray menu to change the title to watch and reset the counters.
Skrommel
;CliCount.ahk
; Count clicks in a user defined window
;Skrommel @ 2008
#NoEnv
#SingleInstance,Force
#Persistent,On
SetTitleMatchMode,2
applicationname=CliCount
OnExit,EXIT
Gosub,TRAYMENU
buttons=lrm
IniRead,title,%applicationname%.ini,Settings,title
If title=Error
title=
Loop,Parse,buttons
{
IniRead,%A_LoopField%button,%applicationname%.ini,Settings,%A_LoopField%button
If %A_LoopField%button=ERROR
%A_LoopField%button=0
}
Return
~*LButton::
~*RButton::
~*MButton::
StringTrimLeft,hotkey,A_ThisHotkey,2
MouseGetPos,,,mwin
WinGetTitle,mtitle,ahk_id %mwin%
IfInString,mtitle,%title%
%hotkey%+=1
Return
TRAYMENU:
Menu,Tray,NoStandard
Menu,Tray,DeleteAll
Menu,Tray,Add,%applicationname%,SHOW
Menu,Tray,Add,
Menu,Tray,Default,%applicationname%
Menu,Tray,Add,E&xit,EXIT
Menu,Tray,Tip,%applicationname%
Return
SHOW:
InputBox,newtitle,%applicationname%,Left:`t%lbutton%`nRight:`t%rbutton%`nMiddle:`t%mbutton%`n`nPart of Window Caption:,,,,,,,,%title%
If ErrorLevel=1
Return
title=%newtitle%
MsgBox,4,%applicationname%,Reset counters?
IfMsgBox,No
Return
lbutton=0
rbutton=0
mbutton=0
Return
EXIT:
IniWrite,%title%,%applicationname%.ini,Settings,title
IniWrite,%lbutton%,%applicationname%.ini,Settings,lbutton
IniWrite,%rbutton%,%applicationname%.ini,Settings,rbutton
IniWrite,%mbutton%,%applicationname%.ini,Settings,mbutton
ExitApp