chenxu Posted April 30, 2008 Share Posted April 30, 2008 Can us get the executable path by the pid of a running process? Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 30, 2008 Share Posted April 30, 2008 hi, $Pfad = _ProcessGetPath("firefox.exe") MsgBox(0, "", "Prozesspfad: " & $Pfad) Func _ProcessGetPath($PID) If IsString($PID) Then $PID = ProcessExists($PID) $Path = DllStructCreate("char[1000]") $dll = DllOpen("Kernel32.dll") $handle = DllCall($dll, "int", "OpenProcess", "dword", 0x0400 + 0x0010, "int", 0, "dword", $PID) $ret = DllCall("Psapi.dll", "long", "GetModuleFileNameEx", "long", $handle[0], "int", 0, "ptr", DllStructGetPtr($Path), "long", DllStructGetSize($Path)) $ret = DllCall($dll, "int", "CloseHandle", "hwnd", $handle[0]) DllClose($dll) Return DllStructGetData($Path, 1) EndFunc Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
chenxu Posted May 1, 2008 Author Share Posted May 1, 2008 Thanks very much, it works for me 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