Hi George,
I have done what you are looking to do many times.
I believe the WindowInteractionClose command chain actually gets run as the window is closing - probably not what you are looking for. I made the same mistake when I tried to implement the same behavior.
I have accomplished this by attaching my command to "BundleClose" before "Close". If memory serves correctly, BundleClose is run right after an agent clicks the Mark Done button.
commandManager.InsertCommandToChainOfCommandBefore("BundleClose", "Close",
new List<CommandActivator>() { new CommandActivator() {
CommandType = typeof(CaseReleaseCustomCommand), Name = "CaseReleaseCustomCommand"
}});
Also something that confused me at first, inside of your custom command if you return true - this cancels the command chain / prevents any further actions in the chain from running. If you return false, this is considered a "success" and the command chain continues.
Whenever I have trouble figuring out where to attach my commands I do this - I run IWS, perform the action I am interested in attaching my behavior to, then look in the IWS logs. The IWS logs will reveal what CommandChains were run.
Regards,
Andrew