Windows 7 Detecting "XP Mode" in Win 7

I want to cross check if my application is running under "WinXP" mode in Windows 7.

Is there any native API available to perform the same.

The use case - My application runs on Win Xp but can't run on Win7 due to library which doesn't support Win 7. Before I decide to switch to new upgraded library, I want to check if my application can run under "XP mode".

Please note - I am currently not allowing my application to run on Remote Desktop connection. I want to have a special expection to allow the same only for "Win XP" mode in Windows 7. Is there any way to do this?

Thanks in Advance,

This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.