locked
How to get access to my ToolWindowPane object with an IVsWindowFrame pointer? RRS feed

  • Question

  • Hi All,

    I created a VsPackage of a ToolWindow, in which I defined a subclass of ToolWindowPane to represent my tool window object.

    I also created an VSIX extension, where I capture mouse event in editor windows. I want to get access to my tool window object in this VSIX extension. What I have now is a pointer of IVsWindowFrame, which is the frame of my tool-window pane. How do I get my tool-window from this pointer.

    I get my IVsWindowFrame pointer as follows. It is a valid pointer and really points to my tool-window.

    IVsUIShell shell = (IVsUIShell)ServiceProvider.GetService(typeof(SVsUIShell));
    IVsWindowFrame frame;
    Guid guid = new Guid(ToolWindow.GuidList.guidToolWindowPersistanceString);
    shell.FindToolWindow((uint)__VSFINDTOOLWIN.FTW_fForceCreate, ref guid, out frame);
    frame.Show();
    I would like to execute some methods on my tool-window object of ToolWindowPane subclass. How do I get a reference to it?

    Regards,

    Zheng


    Zheng Dong

    Wednesday, August 15, 2012 2:22 AM

Answers

All replies