parent
2e6a766d09
commit
a60b46689f
|
|
@ -3218,6 +3218,18 @@ type tgtkapis = class() //gtk
|
||||||
begin
|
begin
|
||||||
if ifstring(p) then
|
if ifstring(p) then
|
||||||
begin
|
begin
|
||||||
|
if fileexists("","/usr/bin/zenity") then
|
||||||
|
begin
|
||||||
|
for i := length(p) downto 1 do
|
||||||
|
begin
|
||||||
|
if p[i]="/" then
|
||||||
|
begin
|
||||||
|
tsl_gtk_execsystem(format('zenity --file-selection --filename="%s" &',p[1:i]));
|
||||||
|
break;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return ;//
|
||||||
|
end
|
||||||
if fileexists("","/usr/bin/caja") then
|
if fileexists("","/usr/bin/caja") then
|
||||||
begin
|
begin
|
||||||
for i := length(p) downto 1 do
|
for i := length(p) downto 1 do
|
||||||
|
|
@ -3229,7 +3241,7 @@ type tgtkapis = class() //gtk
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return ;//
|
return ;//
|
||||||
end
|
end
|
||||||
tsl_gtk_execsystem(format('nautilus "%s" &',p));
|
tsl_gtk_execsystem(format('nautilus "%s" &',p));
|
||||||
return 1;
|
return 1;
|
||||||
end
|
end
|
||||||
|
|
@ -5147,7 +5159,7 @@ type tgtkapis = class() //gtk
|
||||||
_f_ := static function(var e:string;f:integer;ptr:pointer):pointer;cdecl;external getfuncptrbyname("libc",functionname());
|
_f_ := static function(var e:string;f:integer;ptr:pointer):pointer;cdecl;external getfuncptrbyname("libc",functionname());
|
||||||
return ##_f_(e,f,ptr);
|
return ##_f_(e,f,ptr);
|
||||||
end
|
end
|
||||||
function exec_command_line(cmd)
|
function exec_command_line(cmd) //执行linux命令
|
||||||
begin
|
begin
|
||||||
len := 1024;
|
len := 1024;
|
||||||
buf_ps := "";
|
buf_ps := "";
|
||||||
|
|
@ -5172,6 +5184,32 @@ type tgtkapis = class() //gtk
|
||||||
end
|
end
|
||||||
return result;
|
return result;
|
||||||
end
|
end
|
||||||
|
function get_proc_comand(); //获得进程命令行
|
||||||
|
begin
|
||||||
|
tempdir := sysgetenv("HOME")+"/.tslvcl/proc/"+inttostr(datetoint(date()))+"-"+inttostr(integer(time()*24*60*60));
|
||||||
|
f := tempdir+"/1.txt";
|
||||||
|
CreateDirWithFileName(f);
|
||||||
|
dir := %% /proc/%%;
|
||||||
|
d := filelist("",dir+"*");
|
||||||
|
f2b := tempdir+"/";
|
||||||
|
r := array();
|
||||||
|
for i,v in d do
|
||||||
|
begin
|
||||||
|
n := v["FileName"];
|
||||||
|
if n="." or n=".." then continue;
|
||||||
|
f := dir+n+"/cmdline";
|
||||||
|
if not fileexists("",f) then continue;
|
||||||
|
//sz := filesize("",f);
|
||||||
|
f2 := f2b+n;
|
||||||
|
filecopy("",f,"",f2);
|
||||||
|
ri := readfile(rwraw(),"",f2,0,filesize("",f2),fd);
|
||||||
|
if ri=1 and fd then
|
||||||
|
begin
|
||||||
|
r[n] := replacetext(fd,"\0"," ");
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return r;
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,8 @@ type twindowsapi = class()
|
||||||
function ForegroundWindow(wnd_);
|
function ForegroundWindow(wnd_);
|
||||||
begin
|
begin
|
||||||
if not (wnd_>0 or wnd_<0) then return 0;
|
if not (wnd_>0 or wnd_<0) then return 0;
|
||||||
ShowWindow(wnd_,1);
|
if GetForegroundWindow()=wnd_ then return 1;
|
||||||
|
ShowWindow(wnd_,8);
|
||||||
SetWindowPos(wnd_, 0xFFFFFFFF, 0, 0, 0, 0, 1 .| 2);
|
SetWindowPos(wnd_, 0xFFFFFFFF, 0, 0, 0, 0, 1 .| 2);
|
||||||
SetWindowPos(wnd_, 0xFFFFFFFE, 0, 0, 0, 0, 1 .| 2);
|
SetWindowPos(wnd_, 0xFFFFFFFE, 0, 0, 0, 0, 1 .| 2);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue