#TargetControlError

Avoid errors when target control is not found.

#TargetControlError OnOff

Parameters

OnOff (optional)

When parameter is omitted, it defaults to Off. On/1 = throw if control not found, Off/0 = don't throw if control not found.

Example

#TargetControlError
(myGui:=Gui()).Show()
ControlFocus "this control does not exist and no error is shown","ahk_id " myGui.hwnd
myGui.Destroy()