How to record from standalone app built for windows10 automatically?

I’m trying to record the play on standalone app built for windows10.
Also I hope that recording starts automatically when app is launched.
Any video format is OK (mp4 is better). Audio isn’t needed.

Is there a good way?

If it is an option to launch the game from script (.bat, .ps etc.), then you can launch game, and then launch your capture program with recording parameter.