diff --git a/funcext/tvclib/ugtkinterface.tsf b/funcext/tvclib/ugtkinterface.tsf index ca25945..a3c9b65 100644 --- a/funcext/tvclib/ugtkinterface.tsf +++ b/funcext/tvclib/ugtkinterface.tsf @@ -3218,6 +3218,18 @@ type tgtkapis = class() //gtk begin if ifstring(p) then 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 begin for i := length(p) downto 1 do @@ -3229,7 +3241,7 @@ type tgtkapis = class() //gtk end end return ;// - end + end tsl_gtk_execsystem(format('nautilus "%s" &',p)); return 1; 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()); return ##_f_(e,f,ptr); end - function exec_command_line(cmd) + function exec_command_line(cmd) //执行linux命令 begin len := 1024; buf_ps := ""; @@ -5172,6 +5184,32 @@ type tgtkapis = class() //gtk end return result; 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 diff --git a/funcext/tvclib/uwindowsinterface.tsf b/funcext/tvclib/uwindowsinterface.tsf index 00ce12b..c807a51 100644 --- a/funcext/tvclib/uwindowsinterface.tsf +++ b/funcext/tvclib/uwindowsinterface.tsf @@ -271,7 +271,8 @@ type twindowsapi = class() function ForegroundWindow(wnd_); begin 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_, 0xFFFFFFFE, 0, 0, 0, 0, 1 .| 2); return 1;