I'd like to know how to grab the Path of the current active window using C#.
i get handle of currnet active window
const int nChars = 256;
int handle = 0;
StringBuilder Buff = new StringBuilder(nChars);
handle = GetForegroundWindow();
now how do i get path of this window?
i.e: Path of "my document" window is
C:\Users\User\Documents
-=-=-==-=-=edit-=-=-=-=-=-
i want to wirte program to monitor "windows explorer" and see Where the user goes?
(i.e:user go to c:\ and then go to program files and then go to Internet Explorer and i want to get this path:C:\Program Files\Internet Explorer.
use a thread...
Add a reference (COM) to "Microsoft Internet Controls"
Prints the title/path of the explorer.exe instance with the main window handle in
handle
.