c++ - How to distinguish between items returned by EnumObjects of IShellFolder -


i trying computers in workgroup using shell

hresult hr = s_ok; ulong celtfetched; lpitemidlist pidlitems = null; lpitemidlist netitemidlst = null; ishellfolder* pfolder = null; ienumidlist* penumids = null; ishellfolder* pdesktopfolder = null; lpitemidlist full_pid;  hr = shgetmalloc(&pmalloc); hr = shgetdesktopfolder(&pdesktopfolder); hr = shgetspecialfolderlocation(null, csidl_computersnearme, &netitemidlst); hr = pdesktopfolder->bindtoobject(netitemidlst, null,                                    iid_ishellfolder, (void **)&pfolder);  if(succeeded(hr)) {   hr = pfolder->enumobjects(null, shcontf_nonfolders, &penumids);    if(succeeded(hr))   {     strret strdisplayname;     while((hr = penumids->next(1, &pidlitems, &celtfetched)) == s_ok && celtfetched > 0)     {       hr = pfolder->getdisplaynameof(pidlitems, shgdn_normal, &strdisplayname);       if(succeeded(hr))       {         wprintf(l"%s\n", strdisplayname.polestr);       }     }   } } 

but returns computers, media devices, , streaming devices (is name?). say, computer called osofem on workgroup... strret::polestr returns strings osofem (which computer), osofem (i think streaming device), , osofem:example@email.com: (which windows media player).

my question how can distinguish computer? of course, there names can't used because 2 same name returned...


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -