Differences

This shows you the differences between the selected revisions of the page.

dragext 2013-02-24 dragext 2022-10-21 (current)
Line 1: Line 1:
====== Drag&drop Shell Extension ====== ====== Drag&drop Shell Extension ======
-WinSCP drag&drop shell extension is extension of the operation system (or rather Windows Explorer). It allows you to drag files from WinSCP directly to any folder (Windows Explorer window). Without it WinSCP needs to download the files first to temporary directory and only after that Windows Explorer transfers the files to their destination. While this happens transparently, it has several drawbacks.+WinSCP drag&drop shell extension is extension of the operation system (or rather Windows File Explorer). It allows you to drag files from WinSCP directly to any folder (Windows File Explorer window).
-Note that with or without the extension you can always transfer files directly by dragging them between local and remote panels of [[ui_commander|Commander interface]].+Note that with or without the extension you can always transfer files directly by dragging them between local and remote panels of [[ui_commander|Commander interface]]. With [[ui_pref_dragdrop#fake_file|some limitations]], you can also drag files out of WinSCP even without the extension.
-===== Installation and Set up ===== +===== [[installation]] Installation and Set up ===== 
-The extension is installed by WinSCP [[installation|installer]] by default (the portable WinSCP executable does not include the extension and it cannot be downloaded separately).+The extension is installed by WinSCP [[ui_installer_selecttasks|installer]] by default (the portable WinSCP executable does not include the extension and it cannot be downloaded separately).
-If you install the extension you may need to restart your computer to make it operational. ((Actually you need to restart the Windows Explorer only. You can achieve that by logging off and on your Windows account. You can even force Explorer restart by killing ''explorer.exe'' process (do it on your risk).))+Newly installed extension is loaded only the next time you log in to Windows. So you may need to restart your machine or log off and log in again to load it.((Alternatively you can restart ''explorer'' process manually, by killing it from //Task Manager// and running it again.))
-To check that the extension is loaded, run WinSCP and display //[[ui_pref_dragdrop|Drag&drop tab]]// of Preferences window. If the //Use shell extension// checkbox is enabled (not grayed), the extension is loaded.+To check that the extension is loaded, run WinSCP and display //[[ui_pref_dragdrop|Drag&drop page]]// of Preferences window.
-To tell WinSCP to use the extension, select //[[ui_pref_dragdrop#shell_extension_mode|Use shell extension]]// checkbox. Note that unselecting it (or rather selecting //[[ui_pref_dragdrop#temporary_folder_mode|Use temporary folder]]// checkbox) does not uninstall the extension. It will be still loaded into memory and will be loaded every time the operating system starts up. +To tell WinSCP to use the extension, select //[[ui_pref_dragdrop#fake_file|Determine drop target by dragging a fake file]]// checkbox. Note that unselecting it (or rather selecting //[[ui_pref_dragdrop#temporary|Download files via temporary folder]]// checkbox) does not uninstall the extension. It will be still loaded into memory and will be loaded every time the operating system starts up.
-===== Drawbacks ===== +===== [[drawbacks]] Drawbacks ===== 
-When the extension is enabled in WinSCP the only destination application you can drag files to is Windows Explorer (this includes Desktop). Of course you can still drag files within WinSCP.+When the extension is enabled in WinSCP the only destination application you can drag files to is Windows File Explorer (this includes Desktop). Of course you can still drag files within WinSCP.
-In addition, as the files are actually transferred directly to the target folder, not "dropped" on the target window, the Window Explorer will not place them on the spot, where you have dropped them. Instead they will appear on automatically selected position.+In addition, as the files are actually transferred directly to the target folder, not "dropped" on the target window, the Window File Explorer will not place them on the spot, where you have dropped them. Instead they will appear on automatically selected position.
===== Security Considerations ===== ===== Security Considerations =====
-Note that the extension is registered in the operating system (or rather Windows Explorer) and thus it is loaded into memory even if you do not use WinSCP.+Note that the extension is registered in the operating system (or rather Windows File Explorer) and thus it is loaded into memory even if you do not use WinSCP.
===== Technical Background ===== ===== Technical Background =====
Line 25: Line 25:
This chapter is for those who are curious why WinSCP needs shell extension to allow direct downloads using drag&drop. This chapter is for those who are curious why WinSCP needs shell extension to allow direct downloads using drag&drop.
-Here is short explanation: Windows drag&drop mechanics does not allow source application of drag&drop operation to find out easily, where the files are dropped. It is up to target application (Windows Explorer usually) to transfer files to destination. It is rather reasonable, because source application can hardly transfer files to all possible destinations. Keep in mind that you can drop files not only to a directory, but even to ZIP file (or any other archive), remote directory (via [[FTP]], [[SFTP]], [[SCP]], ...), trash, ... +Here is short explanation: Windows drag&drop mechanics does not allow source application of drag&drop operation to find out easily, where the files are dropped. It is up to target application (Windows File Explorer usually) to transfer files to destination. It is rather reasonable, because source application can hardly transfer files to all possible destinations. Keep in mind that you can drop files not only to a directory, but even to ZIP file (or any other archive), remote directory (via [[FTP]], [[SFTP]], [[SCP]], ...), trash, ...
-Obviously even Windows Explorer (or any other target application, like WinZip) cannot download files from any possible source (particularly it does not know [[SFTP]]/[[SCP]]).+Obviously even Windows File Explorer (or any other target application, like WinZip) cannot download files from any possible source (particularly it does not know [[SFTP]]/[[SCP]]).
-When the extension is not installed, WinSCP uses a trick to allow drag&drop downloads. It tells Windows Explorer that the files are in temporary folder (from where Windows Explorer knows how to get the files) and a moment before the Windows Explorer starts to copy files from there, WinSCP downloads the files there. +When the extension is not installed, WinSCP uses a trick to allow drag&drop downloads. It tells Windows File Explorer that the files are in temporary folder (from where Windows File Explorer knows how to get the files) and a moment before the Windows File Explorer starts to copy files from there, WinSCP downloads the files there.
-To allow direct drag&drop downloads, the shell extension was developed. It misuses Windows Explorer CopyHook's. [[&url(mscopyhook)|CopyHook]] is a COM object (DLL library) that is called by Windows Explorer whenever directory (not file) is transferred within file system. When you drag anything from WinSCP, it creates empty dummy folder in temporary directory and pretends that you as user drag that directory. Once your drop it to Windows Explorer, it calls the CopyHook's (including the WinSCP shell extension), telling it what and where was dragged. This way WinSCP knows the actual destination. It cancels the drag&drop operation, so the dummy directory is not copied by Windows Explorer and transfers your actual selection to now-known destination.+To allow direct drag&drop downloads, the shell extension was developed. It misuses Windows File Explorer CopyHook's. [[https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/bb776048(v=vs.85)|CopyHook]] is a COM object (DLL library) that is called by Windows File Explorer whenever directory (not file) is transferred within file system. When you drag anything from WinSCP, it creates empty dummy folder in temporary directory and pretends that you as user drag that directory. Once your drop it to Windows File Explorer, it calls the CopyHook's (including the WinSCP shell extension), telling it what and where was dragged. This way WinSCP knows the actual destination. It cancels the drag&drop operation, so the dummy directory is not copied by Windows File Explorer and transfers your actual selection to now-known destination.
-This on the other hand explains why with the extension you cannot drag files to any other application except for the Windows Explorer. No other application would call the CopyHook.+This on the other hand explains why with the extension you cannot drag files to any other application except for the Windows File Explorer. No other application would call the CopyHook.

Last modified: by 188.192.62.37