RibbonFramework icon indicating copy to clipboard operation
RibbonFramework copied to clipboard

Added event that is fired when the tab changes

Open joachimmarder opened this issue 7 years ago • 3 comments

The Event Tracing for Windows (ETW) must be used to achieve this. Described here: https://msdn.microsoft.com/en-us/library/windows/desktop/jj662752%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

Seems quite complex though.

joachimmarder avatar Oct 20 '17 07:10 joachimmarder

You have to cast interface IUIEventingManager from IUIFramework in procedure TUIRibbon.LoadFramework (cast variable FFramework with Supports function to IUIEventingManager global variable). Then you have to implement the interface IUIEventLogger with function OnUIEvent like you want. Connect this class to SetEventLogger from the IUIEventingManager global variable. Destroy IUIEventingManager before you destroying IUIFramework. I hope this helps.

harborsiem avatar Apr 05 '23 07:04 harborsiem

Thanks for the explanation. Have you already tried this successfully, @harborsiem?

joachimmarder avatar Apr 06 '23 12:04 joachimmarder

I have done it in a C# implementation of the Windows Ribbon Framework. In this project there is a folder called Ribbon. Here you can find in the Ribbon.cs (function InitFramework) the initialization of the IUIEventingManager and mainly in the classes EventLogger.cs and EventLoggerEventArgs.cs other things for doing the events. See also the WIKI. I am not a Delphi programmer anymore. I have done a little bit of Delphi programming very long time ago.

harborsiem avatar Apr 06 '23 16:04 harborsiem