RegisterCommandHandler(
AHandlerProc: THookedCommandEvent; // your event
AHandlerData: pointer; // nil, or whatever you want
AFlags: THookedCommandFlags);
THookedCommandFlag = (
hcfInit, // run before On[User]CommandProcess (outside UndoBlock / should not do execution)
hcfPreExec, // Run before CommandProcessor (unless handled by On[User]CommandProcess)
hcfPostExec, // Run after CommandProcessor (unless handled by On[User]CommandProcess)
hcfFinish // Run at the very end
);