You'll need to parse the "ConfigurationType" attribute in the .vcproj file. An attribute of the <VisualStudioProject><Configurations><Configuration>
element. It is "2" for a DLL project, "4" for a static library project. Beware that different configurations can have different values for this attribute, albeit that this will be very unusual.
You in general reverse-engineer these things by making a copy of the .vcproj file, make a change in the Project + Property pages, use File + SaveAll and then compare the two .vcproj files to see what changed.
Do watch out a bit for putting a lot of effort into such an old version of Visual Studio. Eight years is a very long time in software engineering, especially so after the C++11 standard was released. The C++ project file format dramatically changed at VS2010, now a .vcxproj file that joined the rest of the languages in VS by supporting builds through MSBuild. You are bound to have to redo all this when you upgrade your VS version some day. Better do that now since it sure won't be any easier doing it later when you came to depend on your tool.