Such a feature does not exist. That switch is intended for the user, not for the programmer!
If it were exposed in a way that a developer could switch it on automatically, that would remove their incentive to fix broken applications and make them compliant with newer versions of Windows, in turn forcing Microsoft to support badly broken applications forever.
The real solution is to fix the application so that it doesn't require compatibility shims to be applied in order to run. Remember that these compatibility switches restore broken behavior of previous Windows versions, and if your program relies upon them in order to work, that's evidence that it never should have worked in the first place because it was doing something that it should never have been doing. The fact that it ever worked on the original version of Windows is/was the bug, not the fact that it doesn't work on the current version of Windows.
To get started debugging the problem, take the advice from the linked blog article and use the Application Compatibility Toolkit to see all of the shims that are applied for whatever compatibility level your application requires, then apply them one at a time until you find the critical one. Once you've identified the culprit, go in and fix your code. Yes, I know it's not fun, but that's the price of maintenance programming (and, more accurately, not doing things right the first time). All of us on Stack Overflow are here to help if you run into problems trying to repair the brain-damaged code.