Posted by Digisoul in SWF Studio V3 on Jun 26 2008, 06:25 pm

Is it there any way to make difference between Processes and Servicees ??? e.g smss.exe is a name of Windows's Service. and some of viruses hav also same name. so how can i mange to close smss.exe(process) not service ? wen ever i tried to close the process "with ssCore.SysTools.killApp({application:"smss.exe")}); its act on service not on process????


Posted by northcode in SWF Studio V3 on Jun 26 2008, 07:42 pm

SysTools.killApp tries to kill every process with the name you specify and that includes any service that happes to have that name, it may just be tryingh to kill the service before any other running processes.

You could try getting a list of windows with ssCore.SysInfo.getWindowList(assuming the application has a window, even a hidden one) and then use ssCore.SysTools.killProcess to kill only specific processes.


Posted by Digisoul in SWF Studio V3 on Jun 27 2008, 06:29 pm

Thanks! i split the return.result, but how can i assume it in ssCore.SysTools.killApp? ssCore.SysInfo.getWindowList gives the (total info) string and i m unable to use this string in ssCore.SysTools.killApp ???


Posted by northcode in SWF Studio V3 on Jun 29 2008, 07:17 pm

SysTools.killProcess wants a process id. You have to use the showProcessId flag in the call to SysInfo.getWindowList to get that. Once you have the process id you want, you can pass it to SysTools.killProcess to kill any specific process you like.


ssCore.init();
ssDefaults.synchronousCommands = true;

var r = ssCore.SysInfo.getWindowList({showHidden:true, showProcessId:true});

var list = r.result.split('\r');

for (i=0; i<list.length; i++)
{
   a = list[i].split("\t");
   
   var hwnd = a[0];
   var status = a[1];
   var caption = s[2];
   var classname = a[3];
   var pid = a[4];
   
   // you can identify the process you want to kill by it's
   // window class name or caption, this example looks for a 
   // window with a class name of "something" and kills it

   if (classname == " <B>something</B>") 
   {
      ssCore.SysTools.killProcess({processId:pid, force:true});
   }

}


Posted by Digisoul in SWF Studio V3 on Jul 02 2008, 09:46 am

thanks Tim, Its worked for me! and sorry for the late thankz :-)