Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 Automation , +
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++ windows.8.app. 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:
 
Control.FromHandle(FindScriptEditorHandle(scriptWindowHandle));
 
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.
 
Thanks
Posted 29-May-13 8:38am
Edited 29-May-13 8:45am
(no name)105.8K
v3

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

  Print Answers RSS
0 OriginalGriff 5,170
1 DamithSL 4,357
2 Maciej Los 3,750
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,851


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 29 May 2013
Copyright © CodeProject, 1999-2014
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