Delphi_Fix_SetFocus
SetFocus is broken in Delphi. I created a safe alternative for Delphi’s SetFocus. This tool does the batch replace.
- Active · last change 10-29-2026
- ★ 10 on GitHub
README
Alternative for Delphi's broken SetFocus
CanFocus is broken in Delphi. It has always been.
Try to set focus on a visual control that is disabled or is invisible or simply is not focusable, and the program will crash. This tool batch replaces Delphi’s SetFocus with a safer alternative.
Full project description here
To compile it you need the LightSaber library and FastMM4. The Debug build also uses the optional Autopilot for Delphi bridge, which lets an AI assistant drive the running app.

