Click here to Skip to main content
13,050,319 members (133,698 online)
Rate this:
Please Sign up or sign in to vote.
Is there a way to access visual studio 2010 and 2012 query results pane from Addin?

I am not referring to query window from Menu - Data - Transact SQL Editor - new query. I am thinking from Server explore - expand some database - expand tables, right click on table and choose new query. After you select what tables will be included, check couple of columns and choose execute. New window will open. That window is Document class I know, but not able to get contents of controls or pane's or even panels from that class. At the bottom you can see a pane with rows and columns.

I need to access that pane or grid control if it's possible. Or even better somehow over reflection to retrieve a cell value of a selected cell in that query results window?

I already built addin for VS, but having trouble to retrieve cell's value from that grid. Tried with reflection but cannot get to the bottom of the problem which or even where this pane or grid control is.

And this is for VS 2012. How can I extract control or wpf I am not sure what is, from active document in VS 2012 since it's returning WindowBase type? Not sure what type of control that is, since it's showing me from spy++ So I need that control when you open sql query editor from SQL - T-SQL - new query. Essentially I need results tab and accessing cell value when results from query are displayed in grid. Is it possible to retrieve some of those values? And by this I am referring to the control or wpf that I mentioned and also those cell values. The reason I am asking this is because in VS 2010 you can pool control from window handle of that active window like this:


private static IntPtr FindScriptEditorHandle(IntPtr scriptWindowHandle)
            return NativeMethods.FindWindowEx(scriptWindowHandle, IntPtr.Zero, null, null);

But in VS 2012 I get null for a return value of control. I know that is not a control, but don't know what is it.

I was able to get IWindowFrame, since that frame is having these interfaces IOleDocument, IOleDocumentView, IEnumOleDocumentViews; I wasn't able to obtain IVsCodeWindow.

Posted 29-May-13 7:38am
Updated 29-May-13 7:45am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 29 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100