更新目录打开

This commit is contained in:
liujianjun 2025-03-18 17:05:43 +08:00
parent fa201dfc76
commit 254dc0b2cd
7 changed files with 38 additions and 20 deletions

View File

@ -2729,14 +2729,14 @@ type TEditer=class(TCustomcontrol) //
p := it.ScriptPath;
if FileExists("",p)then
begin
for i := length(p)downto 3 do
{for i := length(p)downto 3 do
begin
if p[i]="\\" then
begin
p := p[1:i];
break;
end
end
end}
//_wapi.WinExec('cmd.exe /C start "" "'+p,1);
_wapi.openresourcemanager(p);
end
@ -2975,7 +2975,7 @@ type TEditer=class(TCustomcontrol) //
fl := FileList("",n);
if not(length(fl)=1)then return false;
nn := fl[0,"FileName"];
if(POS("d",fl[0,"Attr"]))then return false;
if(POS("D",fl[0,"Attr"]))then return false;
it := new TPageEditerItem(FPageEditer);
oit := GetCurrentEditer();
if oit then

Binary file not shown.

View File

@ -3787,18 +3787,34 @@ type tgtkapis = class(t_cairo_api) //gtk
begin
if ifstring(p) then
begin
if fileexists("","/usr/bin/nautilus") then
begin
tsl_gtk_exec_system(format('nautilus --select "%s" &',p));
return 1;//
end else
if fileexists("","/usr/bin/caja") then
begin
tsl_gtk_exec_system(format('caja --select "%s" &',p));
return 1;
end else
if fileexists("","/usr/bin/xdg-open") then
begin
cmd := format(%%
target_dir="%s"
if [ -d $target_dir ]; then
xdg-open $target_dir
else
xdg-open $(dirname "$target_dir")
fi
%%,p);
tsl_gtk_exec_system(cmd);
return 1;//
end else
if fileexists("","/usr/bin/zenity") then
begin
tsl_gtk_exec_system(format('zenity --file-selection --filename="%s" --file-selection --multiple &',p));
return 1;//
end
if fileexists("","/usr/bin/caja") then
begin
tsl_gtk_exec_system(format('caja "%s" &',p));
return 1;
end
tsl_gtk_exec_system(format('nautilus "%s" &',p));
return 1;
end
end
end
function tsl_gtk_exec_system(cmd) ;

View File

@ -1332,8 +1332,7 @@ type idispatch=class(iunkown)
IID_IDispatch.readstr("{00020400-0000-0000-C000-000000000046}");
end
if not ptr then
begin
begin
fvtable._setvalue_("GetTypeInfoCount",makeinstance_com(thisfunction(GetTypeInfoCount)));
fvtable._setvalue_("GetTypeInfo",makeinstance_com(thisfunction(GetTypeInfo)));
fvtable._setvalue_("GetIDsOfNames",makeinstance_com(thisfunction(GetIDsOfNames)));
@ -1344,8 +1343,8 @@ type idispatch=class(iunkown)
end
function GetTypeInfoCount(s:pointer;var pctinfo:integer):integer;stdcall;virtual;
begin
return E_NOTIMPL;
echo "\r\n>>>>>>idispatch:",functionname(1);
echo "\r\n>>>>>>idispatch:",functionname(1);
return E_NOTIMPL;
pctinfo := 0;
ns := fcom_mgr.method_names();
if ifarray(ns) and ns then
@ -1364,7 +1363,7 @@ type idispatch=class(iunkown)
end
function GetTypeInfo(s:pointer;iTInfo:integer;lcid:integer;var ppTInfo:pointer):integer;stdcall;virtual;
begin
//echo "\r\n>>>>>>idispatch:",functionname(1),iTInfo," ",lcid," ",ppTInfo;
echo "\r\n>>>>>>idispatch:",functionname(1),iTInfo," ",lcid," ",ppTInfo;
ppTInfo := 0;
return E_NOTIMPL;
if not fcom_mgr.method_names() then return E_NOTIMPL;
@ -1379,7 +1378,7 @@ type idispatch=class(iunkown)
end
function GetIDsOfNames(s:pointer;riid:pointer;rgszNames:pointer;cNames:integer;lcid:integer;var rgDispId:integer):integer;stdcall;virtual;
begin
//echo "\r\n>>>>>>idispatch:",functionname(1)," ",riid," ",lcid," ",cNames;
echo "\r\n>>>>>>idispatch:",functionname(1)," ",riid," ",lcid," ",cNames;
//return E_NOTIMPL;
if cnames>1 then return E_INVALIDARG;
ostr := new tptrarray(rgszNames);
@ -1390,7 +1389,7 @@ type idispatch=class(iunkown)
function Invoke_(s:pointer;dispIdMember:integer;riid:pointer;lcid:integer;wFlags:short;pDispParams:pointer;
pVarResult:pointer;pExcepInfo:pointer;var puArgErr:integer):integer;stdcall;virtual;
begin
//echo "\r\n>>>>>>idispatch:",functionname(1)," ",dispIdMember," ",wFlags," ",pVarResult," err:",pExcepInfo;
echo "\r\n>>>>>>idispatch:",functionname(1)," ",dispIdMember," ",wFlags," ",pVarResult," err:",pExcepInfo;
fname := get_func_id_str(dispIdMember);
if wFlags=2 then
begin
@ -2101,7 +2100,9 @@ begin
global g_func_handles;
if not ifarray(g_func_handles) then g_func_handles := array();
idx := inttostr( int64(f));
r := makeinstance(makeweakref(f));
if g_func_handles[idx] then return g_func_handles[idx];
//r := makeinstance(makeweakref(f));
r := makeinstance(f);
g_func_handles[idx] := r;
return r;
end

View File

@ -12,7 +12,8 @@ type twindowsapi = class()
function openresourcemanager(p); //打开资源管理器
begin
if ifstring(p) then
return WinExec('cmd.exe /C start "" "'+p,1);
//return WinExec('cmd.exe /C start "" "'+p,1);
return WinExec(format('cmd.exe /C start explorer.exe /select, "%s"',p),1);
end
function getclipboardtext(clpd);
begin

Binary file not shown.

Binary file not shown.