JAM-Software / RibbonFramework

Delphi wrapper and standalone Designer for the Windows Ribbon Framework
Other
200 stars 58 forks source link

Added event that is fired when the tab changes #71

Open joachimmarder opened 6 years ago

joachimmarder commented 6 years ago

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.

harborsiem commented 1 year ago

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.

joachimmarder commented 1 year ago

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

harborsiem commented 1 year ago

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.