diff --git a/Windows.Shell/ShellDropTarget.cs b/Windows.Shell/ShellDropTarget.cs index feb4d4f6..25c19513 100644 --- a/Windows.Shell/ShellDropTarget.cs +++ b/Windows.Shell/ShellDropTarget.cs @@ -20,9 +20,9 @@ namespace Vanara.Windows.Shell /// Create a .NET application project. /// Delete the Program.cs file that includes the Main method. /// Create a new class and derive it from with the attributes in the example below. + /// Ensure the project is built as "X86". /// - /// Example: - /// [Guid("<Your GUID here>"), ClassInterface(ClassInterfaceType.None)] + /// [Guid("<Your GUID here>"), ClassInterface(ClassInterfaceType.None)] ///public class MyDropTarget : ShellDropTarget ///{ /// // In your constructor, be sure to override the DragEnter and DragDrop events and set the effect you desire. @@ -77,14 +77,14 @@ namespace Vanara.Windows.Shell /// new MyDropTarget().Run(TimeSpan.FromSeconds(30)); /// break; /// - /// // Unregister this out-of-proc server from handling the DropTarget. This can be ommitted if done by an installer. + /// // Unregister this out-of-proc server from handling the DropTarget. This can be omitted if done by an installer. /// case "unregister": /// using (var progid = new ProgId(progID, false)) /// progid.Verbs.Remove(verbName); /// ShellRegistrar.UnregisterLocalServer<MyDropTarget>(false); /// break; /// - /// // Register this out-of-proc server to handle the DropTarget. This can be ommitted if done by an installer. + /// // Register this out-of-proc server to handle the DropTarget. This can be omitted if done by an installer. /// default: /// ShellRegistrar.RegisterLocalServer<MyDropTarget>("MyTestDropTarget", systemWide: false); /// using (var progid = new ProgId(progID, false)) @@ -99,7 +99,7 @@ namespace Vanara.Windows.Shell ///} /// /// - public abstract class ShellDropTarget : ComObject, IDropTarget, IInitializeCommand + public abstract class ShellDropTarget : ShellCommand, IDropTarget, IInitializeCommand { private DataObject lastDataObject; private DROPEFFECT lastEffect = DROPEFFECT.DROPEFFECT_NONE; @@ -127,20 +127,6 @@ namespace Vanara.Windows.Shell /// public event DragEventHandler DragOver; - /// Gets the name of the command returned by IInitializeCommand.Initialize. - /// - /// The name of the command as found in the registry. This value is until IInitializeCommand.Initialize - /// is called by the host. - /// - public string CommandName { get; private set; } - - /// Gets the properties exposed through IInitializeCommand.Initialize. - /// - /// Gets a instance. This value is until IInitializeCommand.Initialize is - /// called by the host. - /// - public PropertyBag Properties { get; private set; } - /// HRESULT IDropTarget.DragEnter(IDataObject pDataObj, uint grfKeyState, Point pt, ref DROPEFFECT pdwEffect) { @@ -177,14 +163,7 @@ namespace Vanara.Windows.Shell var drgevent = CreateDragEventArgs(pDataObj, grfKeyState, pt, pdwEffect); DragDrop?.Invoke(this, drgevent); pdwEffect = (DROPEFFECT)drgevent.Effect; - return HRESULT.S_OK; - } - - /// - HRESULT IInitializeCommand.Initialize(string pszCommandName, IPropertyBag ppb) - { - CommandName = pszCommandName; - Properties = new PropertyBag(ppb); + CancelTimeout(); return HRESULT.S_OK; }