Changeset 2119 for trunk/eraser
- Timestamp:
- 5/15/2010 10:30:48 AM (3 years ago)
- Location:
- trunk/eraser/Eraser.Shell
- Files:
-
- 2 edited
-
CtxMenu.cpp (modified) (4 diffs)
-
CtxMenu.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser.Shell/CtxMenu.cpp
r2075 r2119 123 123 } 124 124 125 //Check whether pDataObj is NULL: if so, it is a directory background click 126 else if (pDataObj == NULL) 127 { 128 InvokeReason = INVOKEREASON_DIRECTORY_BACKGROUND; 129 130 //Translate the drop path to a location on the filesystem. 131 wchar_t dropTargetPath[MAX_PATH]; 132 if (!SHGetPathFromIDList(pidlFolder, dropTargetPath)) 133 return E_FAIL; 134 135 DragDropDestinationDirectory = dropTargetPath; 136 137 //We can't do anything else. The data object is null. 138 return S_OK; 139 } 140 125 141 //Check pidlFolder for the drop path, if it exists. This is for drag-and-drop 126 142 //context menus. … … 211 227 //only items which are applicable. 212 228 Actions applicableActions = GetApplicableActions(); 229 230 //If we have no actions that the user can execute, just return an error code. 231 if (!applicableActions) 232 return E_INVALIDARG; 233 213 234 VerbMenuIndices.clear(); 214 235 if (applicableActions & ACTION_ERASE) … … 596 617 case INVOKEREASON_DRAGDROP: 597 618 result |= ACTION_SECURE_MOVE; 619 break; 620 case INVOKEREASON_DIRECTORY_BACKGROUND: 621 result |= ACTION_SECURE_PASTE; 598 622 } 599 623 … … 614 638 } 615 639 } 640 641 //Check that the clipboard has files for querying. 642 if (OpenClipboard(NULL)) 643 { 644 UINT clipboardFormat = 0; 645 while ((clipboardFormat = EnumClipboardFormats(clipboardFormat)) != 0) 646 if (clipboardFormat == CF_HDROP) 647 break; 648 649 if (clipboardFormat != CF_HDROP) 650 result &= ~ACTION_SECURE_PASTE; 651 CloseClipboard(); 652 } 653 else 654 result &= ~ACTION_SECURE_PASTE; 616 655 617 656 return static_cast<Actions>(result); -
trunk/eraser/Eraser.Shell/CtxMenu.h
r2015 r2119 50 50 { 51 51 INVOKEREASON_FILEFOLDER, 52 INVOKEREASON_DIRECTORY_BACKGROUND, 52 53 INVOKEREASON_DRAGDROP, 53 54 INVOKEREASON_RECYCLEBIN … … 62 63 ACTION_SEPERATOR_1, 63 64 ACTION_SECURE_MOVE = 1 << 3, 65 ACTION_SECURE_PASTE = 1 << 4 64 66 }; 65 67
Note: See TracChangeset
for help on using the changeset viewer.
