Is there a way to close a particular instance of explorer with C#?

后端 未结 4 2065
故里飘歌
故里飘歌 2020-12-01 19:17

I\'m looking for a way to close a Windows explorer window that\'s open to a certain folder. Say c:\\users\\bob\\folder. I can close all explorers with the code below, but th

4条回答
  •  孤街浪徒
    2020-12-01 19:43

    I would try importing user32.dll and calling FindWindow or FindWindowByCaption, followed by a call to DestroyWindow.

    Info about FindWindow is here: http://www.pinvoke.net/default.aspx/user32.findwindow

提交回复
热议问题