This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.

LMDShellFolder.ChDir takes ages to display disconnected network drives

I am using a form with just LMDShellFolder, LMDShellTree, and LMDShellList. LMDShellFolder.ChDir takes ages to display disconnected network drives in the LMDShellTree/LMDShellList. How can I hide or exclude such drives from the display? Or is there a different approach?

Comments

  • edited June 16
    I found no 
    LMDShellFolder1.ShowNetworkFolders := False 
    or 
    LMDShellFolder1.ExcludeDrives ....

    LMDShellFolder1.ExcludeDrives LMS
    LMDShellFolder1.ShowNetworkFolders := LMDShellFolder1.ShowNetworkFolders := 
    LMDShellFolder1.ShowNetworkFolders := False;LMDShellFolder1.ShowNetworkFolders := False;
    LMDShellFolder1.ShowNetworkFolders := False;
  • I can confirm the issue. Need some time to decide what can be done.
  • 1) I've added new IsSlow property to TLMDShellItem class (SFGAO_ISSLOW). It can be theoretically used for filtering, but it seems that it does not set for my network drives.

    2) I've changed the way, a tree node detects, whether it has children (to show [+] expand button). Now it based on SFGAO_HASSUBFOLDER attribute, which should not block the program in case of inaccessible network drives, according to MS documentation. However, this does not solve the issue completely.

    3) I was unable to find good way to filtering out network drives, the only was, which worked for me is to use tree or list OnFilterItem event and set Filtered property to True as follows:

    procedure TForm1.LMDShellList1FilterItem(Sender: TObject;
      ShellItem: TLMDCustomShellItem; var Accept: Boolean);
    begin
      Accept := not ShellItem.DisplayName.Contains('\\');
    end;

    But, as you can see, we looking at DisplayName, which is not a good technical solution.

  • edited August 3
    The first impression is good. After mapping a new network drive, it appeared in neither the tree view nor the list. Isn't there some way to configure this so that it applies only to disconnected drives??
  • > Isn't there some way to configure this so that it applies only to disconnected drives??

    No. As I understand after experimentation, Windows itself don't know whether drive is connected or not.
  • Ok. Thank you for your support. You can close this case.
Sign In or Register to comment.