From: Hans on
I'm looking for a way to do the following:

When I click or double-click a file or folder in Windows
Explorer, *before* the default action takes place, write
the name and path of the file or folder to
C:\ShellClick.txt

It can be implemented with a dll or exe running in the
background, but I prefer a dll.

A code sample would be nice but a third-party tool that
accomplishes this would be good too. Thanks
From: claus.kick on
On 3 Sep., 01:38, Hans <nore...(a)noreply.net> wrote:
> I'm looking for a way to do the following:
>
> When I click or double-click a file or folder in Windows
> Explorer, *before* the default action takes place, write
> the name and path of the file or folder to
> C:\ShellClick.txt
>
> It can be implemented with a dll or exe running in the
> background, but I prefer a dll.

Read up on:
SetWindowsHookEx()?
From: Christian ASTOR on
On 3 sep, 01:38, Hans <nore...(a)noreply.net> wrote:

> When I click or double-click a file or folder in Windows
> Explorer, *before* the default action takes place, write
> the name and path of the file or folder to
> C:\ShellClick.txt
> It can be implemented with a dll or exe running in the
> background, but I prefer a dll.

You don't need any DLL.
You can use a WH_MOUSE_LL hook, then WindowFromPoint() and
ListView_HitTest()-ListView_GetItem() with VirtualAllocEx()-
WriteProcessMemory()-ReadProcessMemory()
From: Hans on
Christian ASTOR wrote, On 9/3/2009 5:39 AM:
> On 3 sep, 01:38, Hans <nore...(a)noreply.net> wrote:
>
>> When I click or double-click a file or folder in Windows
>> Explorer, *before* the default action takes place, write
>> the name and path of the file or folder to
>> C:\ShellClick.txt
>> It can be implemented with a dll or exe running in the
>> background, but I prefer a dll.
>
> You don't need any DLL.
> You can use a WH_MOUSE_LL hook, then WindowFromPoint() and
> ListView_HitTest()-ListView_GetItem() with VirtualAllocEx()-
> WriteProcessMemory()-ReadProcessMemory()

How would it be handled if not by a dll? A process running
in the background? Know of any code projects that use such
methods? Thanks
From: Christian ASTOR on
On 3 sep, 21:58, Hans <nore...(a)noreply.net> wrote:
> Christian ASTOR wrote, On 9/3/2009 5:39 AM:
> > You don't need any DLL.
> > You can use a WH_MOUSE_LL hook, then WindowFromPoint() and
> > ListView_HitTest()-ListView_GetItem() with VirtualAllocEx()-
> > WriteProcessMemory()-ReadProcessMemory()
>
> How would it be handled if not by a dll?  A process running
> in the background?  Know of any code projects that use such
> methods?  Thanks

Yes, a WH_MOUSE_LL hook is global with an exe without DLL, unlike
WH_MOUSE
I've tested this method on XP. The only difficulty is for the double-
click, replaced by WM_LBUTTONDOWN + test MSLLHOOKSTRUCT.time with
GetDoubleClickTime())