Is it possible to set an application's windows compatibility mode at run-time?

1.1k Views Asked by At

We are using a 3rd party library that sometimes does not work correctly on Win7. WE know how to configure this at installation time, but we'd also like to consider setting it at run time. Is this possible, or does that context have to be set prior to launch? (I think there is a slim to none chance, but figured I would ask anyway)

(C++ application - not that it really matters)

2

There are 2 best solutions below

1
On BEST ANSWER

The compatibility settings can't be changed once the application is running.

However, what you could do is have a launcher application that makes sure the compatibility settings are correct and then launches your application. Of course, you need to make sure the launcher application doesn't have compatibility problems.

2
On

The compatibility settings are merely preprocessor macros that block out parts of the Win32 API in the header files that are not available on the selected platform.

However because the entire API is provided by DLLs you can determine what OS is running at run-time and then get the necessary platform specific entry points using LoadLibrary and GetProcAddress.