Executable of our application exports NvOptimusEnablement:
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
However, Nvidia Control Panel auto-selects Integrated GPU. Interesting, that once application is run, actual GPU seems to be a discrete one. Which suggests a bug in the Control Panel.
Tested with 358.91