Undo command routing problem
in our product we provide a tool window File Structure that is bound to the currently opened document (IVsTextBuffer) and enables for certain code modification like moving methods, surrounding code with regions etc. We would like the Undo command to be available when this tool window is focused, i.e. the user should be able to re-arrange code in the tool window and then press Ctrl-Z to undo his changes. Currently, the Undo command only works when the code editor has focus. What is the recommended way to achieve this?
We've tried to implement IOleCommandTarget in the tool window, and when the user press Ctrl-Z, we're indeed receiving QueryStatus for 'cmdidUndo' command. In respond to this, we return OLECMDF.OLECMDF_ENABLED | OLECMDF.OLECMDF_SUPPORTED flags. However, the problem is that our Exec method doesn't get called for 'cmdidUndo', in spite of our QueryStatus indicating that the command is available. Is there anything else we should undertake in order for the Undo command to be routed to out tool window's Exec method?
Thanks in advance.

