I know there's plenty ways of enumerating computers and devices on a network, but how do I show just computers available for Windows file sharing? I need to provide a tree view of network computers and their shared folders. I know I could use existing shell controls for this, but I would rather keep it in my own tree view. It will only list those computers on the network which have shared folders. Past the computers and their shared folders, I can do the individual directory listing part myself. I just need to know how to get the computer list and their shared folder lists.
WNetOpenEnum will give you all the computers on the network
The WNetOpenEnum function starts an enumeration of network resources or existing connections. You can continue the enumeration by calling the WNetEnumResource function.
NetShareEnum will you all shares on a machine.
Retrieves information about each shared resource on a server.
You can use the combination of both to filter out what you don't want