Jordan Russell
2007-08-29 18:28:40 UTC
Is there a way to prevent an application from running in compatibility
mode on Vista?
My application detects Windows Vista by calling GetVersionEx and
checking for a major version number >= 6. Most of the time this works
fine, however if my application is launched from another application
that is running in XP compatibility mode, the GetVersionEx call in my
application will return a major version number of 5, causing it to think
it isn't running on Vista.
Is there something I can stick in my application's manifest to tell
Windows "never run this application in compatibility mode"?
(Note: I already have a "requestedExecutionLevel" element.)
Failing that, what is the preferred method of detecting the true Windows
version? i.e. Is there a GetVersion-like API that will always return 6
on Vista, regardless of whether the calling application is running in
compatibility mode? (Currently I'm reading the version number on
kernel32.dll, but that seems like a horrible hack.)
Thanks.
mode on Vista?
My application detects Windows Vista by calling GetVersionEx and
checking for a major version number >= 6. Most of the time this works
fine, however if my application is launched from another application
that is running in XP compatibility mode, the GetVersionEx call in my
application will return a major version number of 5, causing it to think
it isn't running on Vista.
Is there something I can stick in my application's manifest to tell
Windows "never run this application in compatibility mode"?
(Note: I already have a "requestedExecutionLevel" element.)
Failing that, what is the preferred method of detecting the true Windows
version? i.e. Is there a GetVersion-like API that will always return 6
on Vista, regardless of whether the calling application is running in
compatibility mode? (Currently I'm reading the version number on
kernel32.dll, but that seems like a horrible hack.)
Thanks.
--
Jordan Russell
Jordan Russell