|
On 12/06/2011 14.54, Lorenzo Donati wrote:
On 12/06/2011 13.18, KHMan wrote:On 6/12/2011 5:52 PM, steve donovan wrote:On Sun, Jun 12, 2011 at 11:06 AM, Lorenzo Donati wrote: [snip]Add a method path() to return the actual process path in the file system. I don't know if this is easy to do (maybe not, since autoit doesn't have it), but it could be possible since Sysinternals' "ProcessExplorer" shows it.Ah, I see what you mean: the existing get_process_name() method gives the exe name but not the full path. I will investigate this further.GetModuleFileNameWAre you sure? From [1] it seems that GetModuleFileNameW is just the Unicode version of GetModuleFileName. Excerpt from [1] (emphasis mine): "Retrieves the fully-qualified path for the file that contains the specified module. THE MODULE MUST HAVE BEEN LOADED BY THE CURRENT PROCESS." The current process here is the lua interpreter running the script where winapi's get_processes() is called. So this shouldn't be able to return the path of an arbitrary process active on the system and whose pid is returned by get_processes(). Am I missing something? -- Lorenzo [1] http://msdn.microsoft.com/en-us/library/ms683197%28v=vs.85%29.aspx
I pushed "send" a bit too early, sorry. In the same page [1] above, the text continues saying:"To locate the file for a module that was loaded by another process, use the GetModuleFileNameEx function."
Is GetModuleFileNameEx which you meant? -- Lorenzo