I tried replacing the Delphi built-in function with my own on-the-fly version.
function ShortCutToTextOverride(ShortCut: TShortCut): string;
begin
if SomeCondition then
Result := Menus.ShortCutToText // after patching the pointer equals ShortCutToTextOverride
else
begin
// My own code goes here
end;
end;
FastcodeAddressPatch(@Menus.ShortCutToText, @ShortCutToTextOverride);
After the fix, the original function is no longer available. Is access to it possible?
source
share