Home > Software engineering >  Through SHCreateShellFolderView IShellView get XP desktop
Through SHCreateShellFolderView IShellView get XP desktop

Time:09-17

 
IShellFolder * PSF.
If (SUCCEEDED (SHGetDesktopFolder (& amp; PSF)))
{
Into SHGetDesktopFolder OutputDebugStringA (" ");
IShellView * psve;
SFV_CREATE SFV;
SFV. CbSize=sizeof (SFV_CREATE);
SFV. PSFVCB=NULL;
SFV. PSHF=PSF;
SFV. PsvOuter=NULL;/* */
If (SUCCEEDED (SHCreateShellFolderView (& amp; SFV, (IShellView * *) & amp; Psve)))
{
Into CreateViewObject OutputDebugStringA (" ");
IEnumIDList * pedl;
LPITEMIDLIST pidlItem;
If (SUCCEEDED (PSF - & gt; EnumObjects (hExplorer SHCONTF_NONFOLDERS, & amp; Pedl)))
{
Into pedl OutputDebugStringA (" ");
int index=0;
Do
{
Int bindex=0;
STRRET STR.
Pedl - & gt; Next (index++, & amp; PidlItem, (ULONG *) & amp; Bindex);
If (SUCCEEDED (PSF - & gt; GetDisplayNameOf (pidlItem SHGDN_FORPARSING, & amp; STR)))
{

TCHAR szItem [MAX_PATH];
StrRetToBuf (& amp; STR, pidlItem szItem MAX_PATH);
If (isReviseFile (szItem))
{
OutputDebugString (szItem);
Psve - & gt; SelectItem (pidlItem SVSI_DESELECT);

}
}
} while (pidlItem!=NULL);
}
Psve - & gt; Release ();
}
PSF - & gt; Release ();
}

CodePudding user response:


Although ishellview is not NULL but the implementation of the code have no effect
Psve - & gt; SelectItem (pidlItem SVSI_DESELECT);

CodePudding user response:

Access problem?

CodePudding user response:

refer to the second floor zhao4zhong1 response:
permissions problem?
I this is written in COM components by regsvr32 registered automatically loaded into the resource manager, a bit not understand permissions problem is how to return a responsibility

CodePudding user response:

GetLastError?

CodePudding user response:

reference 4 floor zhao4zhong1 response:
GetLastError?
getlasterror (), the return value is zero, is really don't understand ah

CodePudding user response:

Don't sink

CodePudding user response:

By bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps bumps

CodePudding user response:

You this is to create a new shell view (similar to write a resource manager), your code on the desktop will not have influence, this is design behavior,

CodePudding user response:

refer to the eighth floor jiangsheng response:
you this is to create a new shell view (similar to write a resource manager), your code on the desktop will not have impact, it is design behavior,
wow really ishellview... don't know how to get the table

CodePudding user response:

refer to the eighth floor jiangsheng response:
you this is to create a new shell view (similar to write a resource manager), your code on the desktop will not have impact, it is design behavior,
say so IShellFolder * PSF.
PSF - & gt; CreateViewObject (hExplorer IID_IShellView, (void * *) & amp; Psve)
By way of creating shellview is also a custom can't operate the file on the desktop

CodePudding user response:

refer to the eighth floor jiangsheng response:
you this is to create a new shell view (similar to write a resource manager), your code on the desktop will not have influence, this is the design behavior,

I see on the MSDN IShellFolder: : CreateViewObject can create system ishellview whether have what condition I this kind of method to create or there is no effect on the desktop
To support this request, create an object that exposes the interface indicated by riid and return a pointer To that interface.

The primary purpose of this method is to provide Windows Explorer with the folder object's folder view object. Windows Explorer requests a folder view object by setting riid to IID_IShellView. The folder view object displays the contents of the folder in the Windows Explorer folder view. The folder view object must be independent of the Shell folder object, because Windows Explorer may call this method more than once to create multiple folder view objects. A new view object must be created each time this method is called. Your folder object can respond in one of two ways to this request. It can:

Create a custom folder view object and return a pointer to its IShellView interface.
Create a system folder view object and return a pointer to its IShellView interface.

CodePudding user response:

Start Vista desktop can use IShellWindows access,
XP Desktop without API, you can check whether have SysListView32 window on the Desktop, if so, there are big probability is the defview Desktop, this item under XP data is pidl, but note that the user can use the Active Desktop defview another window on the surface of the table,

CodePudding user response:

This is to create the new is not existing desktop, I also for this problem for a long time,,,
  • Related