Q: TDirectoryListBox, making click behave like double-click

I want the Delphi 16-bit DirectoryListBox1.directory to change
immediately when the user clicks on a path in the list box, not only
once the user has "double-clicked". Any component writer done this one

The issue explained
I think all people are not expecting to have to click twice. They are
surprised that the program did not change as they wanted. They in fact
look, select and "click", but have not looked at the DirLabel as well
to confirm whether the thing did what they asked.

Would it be best if this "forced" double click happened whenever the
directory has no further subdirectories or no files that the user
specified as wild cards. Applying this rule to the listbox means that:

  - The user has to do as little clicking as
     possible to get the  directory that he/she wants.
  - Users are much less likely to get confused
    as to what they have selected and what not.
  - Users never click on a folder only to find "Oh, there's
    nothing there"
  - The clicking will be automatic where appropriate so
    the user sees straight away what there is and what not.

How to program this
There is an OnClick() event handler in DirectoryListBox. I was hoping
there would be an "accept" method that would "take" the value as the
DirectoryListBox1.directory whatever is currently hightlighted. A
DirectoryListBox1.click method would also have done it, but there
appears to be no such method.

Perhaps there a way in the API to send a "click" message to the
DirectoryListBox1.handle using SendMessage()?

The Selected property determines whether a path in the list is
selected and a SelCount returns number of paths in the box.

What the current index is of the currently highlighted item I can find
out using the ItemIndex property, which is part of TListBox. So
Items[ItemIndex] gives the current highlighed item.

To show this in a label, I say:


Howver, I find that this only returns the current path section, not
the entire path string.

   Example: 'backup'.

If I had the entire drive & path string,

      e.g. "c:\delphi\app\backup\subs\"  and not just "subs",

then I could set the

  DirectoryListBox1.directory:= NewPath,

where NewPath would be this string. If this was in the OnClick event,
that might work magic.

At first the directory property appears not helpful here, only once
the user has double clicked will the directory property be set
correctly. So adding the newly identified item to the existing
directory path would be correct only when the column is the same.

Ideal it would be if there was a way to identify the number of
directories down, then one might step back using the SelectedIndex-1
until one got to the root, and then one might put the substrings
together to get the entire path. After that, one could
programmatically determine whether this was an appropriate time to
"force double-click" for the user or not.

The big question:
Who knows how to get the entire path string out of the listbox without
using FileListBox1.directory?

FileListBox1.directory and FileListBox1.dirlabel themselves are not
the answer in this instance. Basically we need another method because
we are trying to amend the behaviour when the user clicks.

Email appreciated. I respond to every email.