0
votes

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?

1
In general, ActiveX controls on PPT slides are only active when in SlideShow view, so this may be a non-starter for you. - Steve Rindsberg
@SteveRindsberg, thanks for the reply. Can you tell any other way in which I can listen to mouse events in the presentation/designer view. - Zunair Zubair
Other than trapping the selection change event, none that I know of, and I don't think that'll do for what you're after. - Steve Rindsberg
Can this be done using a mouse hook? - Zunair Zubair
Possibly, but I don't know. - Steve Rindsberg

1 Answers

1
votes

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.