How to disable the program compatibility assistant in Windows 7 and Vista

Sometimes the program compatibility messages in Vista and Windows 7 can be useful. A lot of the time, however, they are just annoying. Did you know that you can turn them off?

This is the message I'm talking about:

This program might not have installed correctly
Reinstall using recommended settings
This program installed correctly

You can disable it temporarily by stopping the Program Compatibility Assistant Service. Or you can disable it permanently by disabling the service. You can also disable it via policy. (more info)