In Word I use the following to get a handle on the active application window. Would something similar be possible for Studio?
Imports Microsoft.Office.Interop
Public appWord As Word.Application
Return DirectCast(System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application"), Word.Application)