mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
UPD: Use native delete function when call from context menu under Windows (fixes problem with UAC)
This commit is contained in:
parent
89e7e5547d
commit
3233eeebdc
2 changed files with 11 additions and 16 deletions
|
|
@ -262,6 +262,7 @@ var
|
|||
bHandled : Boolean = False;
|
||||
ZVerb: array[0..255] of char;
|
||||
sVerb : String;
|
||||
Result: HRESULT;
|
||||
FormCommands: IFormCommands;
|
||||
begin
|
||||
try
|
||||
|
|
@ -384,15 +385,7 @@ begin
|
|||
begin
|
||||
sVerb := StrPas(ZVerb);
|
||||
|
||||
if SameText(sVerb, sCmdVerbDelete) then
|
||||
begin
|
||||
if ssShift in GetKeyShiftState then
|
||||
frmMain.Commands.cm_Delete('recyclesettingrev')
|
||||
else
|
||||
frmMain.Commands.cm_Delete('recyclesetting');
|
||||
bHandled := True;
|
||||
end
|
||||
else if SameText(sVerb, sCmdVerbRename) then
|
||||
if SameText(sVerb, sCmdVerbRename) then
|
||||
begin
|
||||
if FFiles.Count = 1 then
|
||||
with FFiles[0] do
|
||||
|
|
@ -452,15 +445,18 @@ begin
|
|||
FillChar(cmici, SizeOf(cmici), #0);
|
||||
with cmici do
|
||||
begin
|
||||
cbSize := sizeof(cmici);
|
||||
cbSize := SizeOf(cmici);
|
||||
hwnd := FParent.Handle;
|
||||
lpVerb := PChar(PtrUInt(cmd - 1));
|
||||
nShow := SW_NORMAL;
|
||||
end;
|
||||
OleCheckUTF8(FShellMenu1.InvokeCommand(cmici));
|
||||
|
||||
Result:= FShellMenu1.InvokeCommand(cmici);
|
||||
if not (Succeeded(Result) or (Result = COPYENGINE_E_USER_CANCELLED)) then
|
||||
OleErrorUTF8(Result);
|
||||
|
||||
// Reload after possible changes on the filesystem.
|
||||
if SameText(sVerb, sCmdVerbLink) then
|
||||
if SameText(sVerb, sCmdVerbLink) or SameText(sVerb, sCmdVerbDelete) then
|
||||
frmMain.ActiveFrame.FileSource.Reload(frmMain.ActiveFrame.CurrentPath);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,11 +34,8 @@ uses
|
|||
}
|
||||
|
||||
const
|
||||
{ NewMenu Object (Creates a "New" context menu for a Shell item) }
|
||||
CLSID_NewMenu: TGUID = '{D969A300-E7FF-11d0-A93B-00A0C90F2719}';
|
||||
|
||||
// QueryContextMenu uFlags
|
||||
CMF_FINDHACK = $00000080;
|
||||
CMF_FINDHACK = $00000080;
|
||||
|
||||
SEE_MASK_UNICODE = $00004000; //Correction
|
||||
SEE_MASK_HMONITOR = $00200000;
|
||||
|
|
@ -55,6 +52,8 @@ const
|
|||
// CMIC_MASK_FLAG_SEP_VDM = SEE_MASK_FLAG_SEPVDM; ??
|
||||
// CMIC_MASK_HASTITLE = SEE_MASK_HASTITLE; ??
|
||||
|
||||
// User canceled the current action
|
||||
COPYENGINE_E_USER_CANCELLED: HRESULT = $80270000;
|
||||
|
||||
{ IPersistFolder3 Interface }
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue