Try
WaitForIt!
It prevents accidental clicking on popup windows or when using "snap to" mouse settings.
To change the delay, just edit the delay= line in the code.
Skrommel
;WaitForIt.ahk
; Prevent accidental clicking on popup windows or when using "snap to" mouse settings
;Skrommel @ 2008
delay=1000 ;Time to wait in milliseconds
#SingleInstance,Force
SetWinDelay,0
Gui,+LastFound +OwnDialogs
hWnd:=WinExist()
DllCall("RegisterShellHookWindow",UInt,hWnd)
msgNum:=DllCall("RegisterWindowMessage", Str,"SHELLHOOK")
OnMessage(msgNum,"ShellMessage")
active:=WinActive("A")
OnExit,EXIT
Return
LBUtton::
MouseGetPos,mx,my,mwin,mctrl
If (mwin=active)
{
If (A_TickCount-activated>delay)
MouseClick,L,,,1,0,D,
}
Else
MouseClick,L,,,1,0,D,
Return
~LButton Up::
Return
ShellMessage(wParam,lParam)
{
Global active,activated,mwin,delay
If wParam=4 ;HSHELL_WINDOWACTIVATED=4 HSHELL_WINDOWCREATED=1
IfWinExist,ahk_id %lParam%
{
active:=lParam
activated:=A_TickCount
}
If (active=mwin)
activated:=A_TickCount-delay
}
EXIT:
DllCall( "DeregisterShellHookWindow", UInt,hWnd ) ; Redundant, I guess!
ExitApp