Programmatically forcing the NVidia GPU over Integrated graphics

I’m just going out on a limb here but the Control Panel is a GUI to an underlying data file. What the user enters there is stored somewhere on the computer. Have your app jump into that file and modify the appropriate data as required.