Question

Is there a way for a VS Package/Extension to get the VisualStudio main UI thread in any way during runtime? Equally, is it possible to get the Handle for it, for example to display a message box with the proper Parent/Owner being set?

Was it helpful?

Solution

To answer my own Question - there's a Microsoft.VisualStudio.Shell.ThreadHelper class that provides access to the VS UI thread and for the handle, one can use the IVsUIShell.GetDialogOwnerHwnd() helper method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top