Is it possible to get the process id of a visual studio instance through the DTE mDte variable? Refer to code below.
private static DTE mDte;
public static void OpenVisualStudio()
{
Type visualStudioType = Type.GetTypeFromProgID("VisualStudio.DTE.10.0");
mDte = Activator.CreateInstance(visualStudioType) as DTE;
if (mDte != null)
{
mDte.MainWindow.Visible = true;
}
// get process id of visual studio instance through mDte
}