Get folder path from Explorer window

前端 未结 2 1820
攒了一身酷
攒了一身酷 2020-12-06 07:02

I have a pointer to an opened Explorer Window and i want to know its full path.

For Example:

int hWnd = FindWindow(null, \"Directory\");
2条回答
  •  余生分开走
    2020-12-06 07:17

    If you run spy++ and target Expolrer window you will see that Title or Caption of that window usually reflects the current directory opened by user

    So what you need is that using window handle you need to get its caption. I would suggest following links that will guide you

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/fd03235e-22af-41a4-aa95-2806b3cb1114/win32-getting-a-window-title-from-a-hwnd?forum=csharpgeneral

    How to get the name of an External window in C# Application?

提交回复
热议问题