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

  • SEARCH
  • Home
  • 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 8025735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:15:40+00:00 2026-06-04T23:15:40+00:00

I’m having pretty abnormal work in my application. I’m using following code to enumerate

  • 0

I’m having pretty abnormal work in my application. I’m using following code to enumerate all namespaces and some root namespaces – such as Nethood work pretty slow – over one minute to load (!!) That happens only on Win7, on older system loading is OK.

I’m using this functions, from MustangPeak library:

function TNamespace.EnumerateFolder(MessageWnd: HWnd; Folders, NonFolders,
  IncludeHidden: Boolean; EnumFunc: TEnumFolderCallback;
  UserData: Pointer): integer;
var
  Enum: IEnumIDList;
  Flags: Longword;
  Fetched: Longword;
  Item: PItemIDList;
  Terminate: Boolean;
  OldError: integer;
  OldWow64: Pointer;
begin
  Result := 0;

  OldError := SetErrorMode(SEM_FAILCRITICALERRORS or SEM_NOOPENFILEERRORBOX);
  try
    if Assigned(ShellFolder) then
    begin
      if Assigned(EnumFunc) then
      begin
        Terminate := False;
        Flags := 0;
        if Folders then
          Flags := Flags or SHCONTF_FOLDERS;
        if NonFolders then
          Flags := Flags or SHCONTF_NONFOLDERS;
        if IncludeHidden then
          Flags := Flags or SHCONTF_INCLUDEHIDDEN;

    // --- This is new added
    Flags := Flags or SHCONTF_ENABLE_ASYNC;

        if Valid then
        begin
          OldWow64 := Wow64RedirectDisable;
          try

            if ShellFolder.EnumObjects(MessageWnd, Flags, Enum) = NOERROR  then
            begin
              // Vista Enum is nil every once in a while
              if Assigned(Enum) then
              begin
                while (Enum.Next(1, Item, Fetched) = NOERROR) and not Terminate do
                begin
                  if EnumFunc(MessageWnd, Item, Self, UserData, Terminate) then
                   Inc(Result)
                end
              end
            end
          finally
            Wow64RedirectRevert(OldWow64)
          end
        end
      end
    end
  finally
    SetErrorMode(OldError);
  end
end;

Now I read in MSDN doc that in Win7 new async flag has been supported in order to get results instantly but then to receive other results when system read it.

That flag is called SHCONTF_ENABLE_ASYNC and I added it in code on place I’ve marked with (// — This is new added)

Problem is because I don’t know how to catch events when I receive updates.

How to hook on newly received items? Is there some event (message etc.) that system (object) sends to some control or structure etc.

Thanks!

  • 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-04T23:15:41+00:00Added an answer on June 4, 2026 at 11:15 pm

    SHCONTF_ENABLE_ASYNC does not make the enumeration itself asynchronous. It simply lets IShellFolder know that you are monitoring for asynchronous change notifications outside of IShellFolder, such as with SHChangeNotifyRegister(), so the enumeration does not need to return everything at one time as the change notifications will let you know when items are added/removed/changed in real-time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.