ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
ShellBrowser.SendDropFiles

Sends the passed files to the given window handle. This can be used to open a file in an already running program.

Syntax
Pascal
procedure SendDropFiles(pWindow: HWnd; pFiles: TStrings);
Parameters 
Description 
pWindow: HWnd 
The window handle to send the files to. 
pFiles: TStrings 
A list of absolute paths to send as drop files to the given window. 

Attention: On Windows 8 and higher, depending on the target application, sending files from a 32-bit application to a 64-bit process might not work. In this case, try if sending from a 64-bit application works.

The following examples sends a file to a running Windows Editor window.

  lHwnd := FindWindow('Notepad', nil);
  lFiles := TStringList.Create();
  lFiles.Add('C:WindowsWindowsUpdate.log');
  SendDropFiles(lHwnd, lFiles);