if you add your custom button on UIBB toolbar then uibb must be using some WDcomponent you haev to place your code in process_event method of that wdcomponent.
but if you add it at toolbar of FPM_OIF_COMPONENT then it will trigger for all uibb you can place your code in any uibb WDcomponent in your configuration.