I'm using the Windows Shell API to access Network machines and their folders.
shellFolder.EnumObjects(hwnd, grfFlags, out enumIdList);
....
int result = shellEnum.Next(celt, out itemPidl, out numFetched);
I'm using the IShellFolder.EnumObjects()
method, which works great and I can get a list of machines in my Network.
However, when I try to get folders from these networks, it works only when there is no need of authentication to the machine. If there is a need of authentication, the method returns 0x80004005
(E_FAIL
).
Windows File Explorer shows a prompt to "Enter Network Credentials" for these machines. How can I show the same prompt from my WPF program and continue based on user's credentials?