0

I'm trying to close the docked find window in Visual Studio 2019 via a DTE script.

This is the window I'm talking about: Image of the window I'm talking about here

I thought it would be "vsWindowKindFindReplace" but I just get a null when I try to get it.

KiraHoneybee
  • 495
  • 3
  • 12

1 Answers1

0

I'm guessing you are trying to automate a task of some sort.

I'm not familiar with DTE. So it might be easier to do it with that.

If you use Spy++, you'll see that the "Find" control is not an HWND. VS just has a single window and custom draws everything. However, if you use the Inpsect tool, you'll find that the close button on the Find control does have an accessibility ID - "CloseButton" . And you can programmatically navigate the Visual Studio accessibility tree to find it and click it

selbie
  • 100,020
  • 15
  • 103
  • 173
  • Yep, I tried to spy it and couldn't. Do you happen to know how you focus on and click via an accessibility ID in javascript? I'm trying to close a bunch of specific windows in visual studio with a press of esc. – KiraHoneybee Apr 23 '21 at 00:44