Trigger when stop simulation use c++

I creat a blueprint and need to do something when i click stop simulation like this :

63270-无标题.png

please tell me how to do~~~~

Do you need to handle the stop button or the event of stopping the game? For the latter you can implement your own GameInstance and handle the event there. The GameInsatnce is created for every game and is destroed when game finishes.
For handling a stop button you should dig into the source code