|
|||
|
|||
|
|
When user drags a file using a right mouse button then the context menu is shown when the object is about to be dropped. Usually this menu contains suggestion to copy or move the file but it can be enhance if necessary. Use the TSxDragDropMenu to enhance this menu with your own items. The example below shows how to create "Hard Link" for the file being dragged. The TSxDragDropMenu is very similar to the TSxContextMenu component because it is inherited from TSxContextMenu. We recommend to study TSxContextMenu usage example too. Important note: The Hard Link is a feature of the NTFS file system so this example will work for Windows NT/2000/XP on NTFS volumes only. The DragDrop Menu handler is an ActiveX library like all other Shell Extensions. The first step to do is to create a new ActiveX Library. Create it with the following sequence of operations: open the Repository dialog using File | New | Other... menu, then select the ActiveX tab and click the ActiveX Library icon.
Save the created project.
You can save the project now.
Look on the properties of TSxDragDropMenu component:
Table 1. TSxDragDropMenu component properties Set component properties as shown below:
The next step is to design the menu. Do it as usual with native TPopupMenu designer. Save the project and compile it - it is ready now! As well as any other ActiveX library the Shell+ project requires registration. You can register it in several ways:
To know more about shell extension installation please follow the link. The final step is to test the extension library. Create the new text document on the desktop or in any folder. You can use the New | Text Document context menu for this purpose. Right click the newly created file and drag it to any other folder: Don't forget to uninstall the example when all tests are finished. Note that it is an example only and it will show its confirmation window until you will not unregister it. As well as installation the uninstallation can be done in many ways:
The detailed information about extension uninstallation is available here. 1. The only exception is the TSxTrayIcon component that does not need to be placed on SxDataModule instance. Use links below to download source codes of this example as well as binary files:
|
Components
| Download | Purchase
| Support | About
Us
Copyright © 2016 ALDYN Software. All rights reserved. Copyright © 2001 - 2011 Shell+ Development Group. All rights reserved. |