Eugene,
You want close windows mean close other external applications ?
If yes, I used this system (can post source but tomorrow, because need "extract" it from more source files)
I run tasks, and save program list to text CSV file,
Code: Select all
RunShell('/C TaskList.Exe /V /FO CSV > tasklist.csv',,.T.,.T.)
aTasks := DC_Csv2Array('tasklist.csv')
and read to arr
and with modify
Code: Select all
ARemove( aTasks,1 )
aHeader:={"Image Name","PID","Session Name","Session#","Mem Usage","Status","User Name","CPU Time","Window Title"}
aWidths := Array(Len(aTasks[1]))
AFill(aWidths,10)
aWidths[1] := 25
aWidths[2] := 5
aWidths[3] := 5
aWidths[4] := 6
aWidths[9] := 40
note ! I had problem with header on France localisation Windows 10, then need use "own" header because some umlauts was problem when read CSV
then search if some of programs for example Acrord.exe is running
when found, taskkill him.
Code: Select all
RunShell('/F /IM ' + "mview.exe",'C:\windows\system32\TaskKill.Exe',.t.,.f.)
When some problems on 64bit windows, can use NIRCMD utility, which are 32 and also 64 bit.
Maybe something as this can help you.
Viktor