AutoActions (OpenSource Windows Utility)

AutoActions is a free, open source program for Windows that enables users to make changes to the system when certain programs or apps are run or closed, or when states change.

Designed primarily for games and entertainment apps, AutoActions may be used to run or close programs, enable HDR, or change the resolution of the display.

Check it out