Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8049219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:43:44+00:00 2026-06-05T06:43:44+00:00

I am trying to create a shell tree control. I do not want all

  • 0

I am trying to create a shell tree control. I do not want all the items that return from IShellFilder::EnumObjects call to display on the tree as I need to filter items such as the Recycle Bin and the Control Panel for example.

My code looks like this:

IShellFolder* pDesktopFolder=NULL;
SHGetDesktopFolder(&pDesktopFolder);


LPITEMIDLIST pidlParent=NULL;
IShellFolder* pParentFolder = NULL;
pDesktopFolder->BindToObject(pidlParent,NULL, IID_IShellFolder, (LPVOID*)&pParentFolder);

IEnumIDList* pEnumIDList = NULL;
    SHCONTF SHFlag=NULL;
    SHFlag=SHCONTF_FOLDERS | SHCONTF_INIT_ON_FIRST_NEXT | SHCONTF_NONFOLDERS  | SHCONTF_INCLUDEHIDDEN;

HRESULT hr= pParentFolder->EnumObjects(NULL, SHFlag, &pEnumIDList);

if (NOERROR == hr)
{
     LPITEMIDLIST pidl = NULL, pidlAbs;
     CString csFileType;
     HTREEITEM hItem=NULL;
     while (NOERROR == pEnumIDList->Next(1, &pidl, NULL))
     {
        //Filter out control panel, recycle bin items and other non usable items
     }
}

I don’t want to get the display name of each item and do a string comparison on that since names can change depending on the OS language.

Can the filtering be done based on the CLSID of each item? And whats the best way of doing it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:43:46+00:00Added an answer on June 5, 2026 at 6:43 am

    Solved:

    I did this and its working, yet I need to see where can I get a list of GUIDs for other folders:

    ULONG nEaten=0;
        LPITEMIDLIST PidlCPanel;
        ULONG nCPAttrib = 0;
        HRESULT hr = pFolder->ParseDisplayName(NULL, NULL, _T("::{26EE0668-A00A-44D7-9371-BEB064C98683}"), &nEaten, &PidlCPanel, &nCPAttrib);
        BOOL bRes = ILIsEqual(pidl, PidlCPanel);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a shell script that pulls a line from a
I've been trying to use the pipe() system call to create a shell that
I'm trying to create a shell script that shall convert certain Files according to
I am not a Solaris expert and I am trying to create a shell
I'm trying to create a new launchagent file that will execute a shell script
I'm trying to create a shell script that runs a command and plays music
I am trying to create a shell script that is able to run the
I'm trying to create a shell (nothing serious just messing around) and want to
I am trying to create my own shell that is a shell replacement for
Im trying to create a bourne shell script that will take 0 or more

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.