I'm working on an application embedding an activex component. This component has several keyboard shortcuts. Some of them are binded to actions which needs to be intercepted by my application before being run.
For example, CTRL+S is binded to the "Save" action, and I have to perform some modifications to the document before the activex component saves it. I have already made a function doing the right save, which looks like :
void Save()
{
PerformModifications();
activexcontrol.Save();
}
My problem is I can't find a way to disable the keyboard shortcut of the activex component, which bypasses my save method. So far, I have tried to :
- bind my own save method to the same shortcut of the activex
- set the KeyPreview property of my form to true
- implement IMessageFilter to intercept WM_KEYDOWN and WM_KEYUP events before the activex handles them
None of those methods worked. Pressing CTRL+S still invokes the activex save method instead of mine.
Is there a way to disable keyboard shortcuts of this component ?