neology Posted August 24, 2008 Share Posted August 24, 2008 i wonder how to get the image path of active processes running on my pc. Somebody, please help me.. Link to comment Share on other sites More sharing options...
FlintBrenick Posted August 24, 2008 Share Posted August 24, 2008 I'm guessing that what you are trying to ask is, how do you get the directory path of a process that is currently running? If this is what you're asking then, I have no idea. I'd like to know that personally though. So if anyone has any ideas, I would like to hear them too. Link to comment Share on other sites More sharing options...
rasim Posted August 24, 2008 Share Posted August 24, 2008 i wonder how to get the image path of active processes running on my pc. Somebody, please help me..Welcome! Try this: $GetPath = _ProcessGetLocation("notepad.exe") If $GetPath = -1 Then MsgBox(16, "Error", "Unable get process path") Else MsgBox(0, "Success", $GetPath) EndIf Func _ProcessGetLocation($sProc = @ScriptFullPath) Local $iPID = ProcessExists($sProc) If $iPID = 0 Then Return SetError(1, 0, -1) Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID) If $aProc[0] = 0 Then Return SetError(1, 0, -1) Local $vStruct = DllStructCreate('int[1024]') DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int*', 0) Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048) If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '') Return $aReturn[3] EndFunc Link to comment Share on other sites More sharing options...
ravendawson Posted December 19, 2010 Share Posted December 19, 2010 i wonder how to get the image path of active processes running on my pc. Somebody, please help me..I don't quite get what you mean by "image path of active processes". Are you looking for Application.ExecutablePath Property or something else? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now