#8804
CrashNBurn
Member

I didn’t want to disable the Find Highlight.
My request was to to automatically clear the Find Highlight when the Find Dialog was closed — if a checkbox on the find dialog was checked: [x] Clear Highlights.

I solved it with AutoHotKey. The original AHK solution was Kludgy and didn’t work consistently.

Perhaps someone else will find some use for it.
Fixed clean code:

;;
;; Script: EE_AutoClearFindHighlight.ahk
;; Author: MwM - Crash&Burn, 2010
;; Usage::
;; Automatically clear the Find Highlight when EmEditor's
;; Find Dialog is closed with the [Close] Button.
;;
;; Does not clear the Find Highlight if ESC, or the
;; Find Dialog's TitleBar [X] is used, nor if a modifier
;; key is held down when clicking [Close] (i.e. Shift)
;;
#SingleInstance, Force
#NoEnv
SetBatchLInes, -1

#ifWinActive, Find ahk_class #32770
{
~LButton::
; $ESC::
{
aParent := DllCall( "GetParent", UInt, WinExist("A") )
aParent := (( !aParent ) ? WinExist("A") : aParent )
WinGetClass, aClass, ahk_id \%aParent\%
if( aClass <> "EmEditorMainFrame3" )
return
if( A_ThisHotKey == "LButton" )
{
MouseGetPos, ,, aFind, aControl
if( aControl <> "Button16" )
return
KeyWait, LButton
Sleep, 50
ifWinExist, ahk_id \%aFind\%
return
WinWaitActive, ahk_class EmEditorMainFrame3
Send, !{F3}
}
;; If one wanted the Find Highlight to clear on ESC
;; Remove comment block below, and uncomment ESC above.
/*
*
else
if( A_ThisHotKey == "$ESC" ) ;; Not clearing Find Highlight on ESC, atm
{
Send, {ESC}
Sleep, 50
ifWinExist, ahk_id \%aFind\%
return
WinWaitActive, ahk_class EmEditorMainFrame3
Send, !{F3}
}
*
*/
return
}
return
}