<p>For example if I'm working on Visual Studio 2008, I want the values devenv and 2008 or 9.</p>

<p>The version number is very important...</p>

This
project
demonstrates the two functions you need:
EnumWindows
and
GetWindowtext