سؤال

I am creating a PowerPoint 2010 add-in created with the help of Visual Studio Tools for Office.

This add-in helps the user to create charts and customize them easily. It also provides a custom menu on right clicking or double clicking the chart. I tried to use the Application.WindowBeforeRightClick and Application.WindowBeforeDoubleClick events provided by PowerPoint but they don't get fired(because of a bug that Microsoft hasn't fixed since PowerPoint 2007).

Now, in order to show my custom menus I am thinking of making an ActiveX control and embed it on my PowerPoint slide. This control will interact with the mouse for events like MouseOver, MouseUp, MouseDown, WindowBeforeDoubleClick, WindowBeforeRightClick etc.

I am not sure if this is possible. If it is then how to write an ActiveX control for PowerPoint in VSTO environment using C#? Also how to make it invisible and responsive at the same time?

هل كانت مفيدة؟

المحلول

Yes you can hook the mouse, there are libraries out there that make this easy.

One I've tried is "MouseKeyboardActivityMonitor" - searching for that on the web should provide a link.

It has an "AppHook" rather than a "GlobalHook" so you can just listen to the PowerPoint editor window.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top