Gibt es eine Möglichkeit,aus einem Prozess den Pfad auszulesen?
Dankeschön,
Dankeschön
Gibt es eine Möglichkeit,aus einem Prozess den Pfad auszulesen?
Dankeschön,
Dankeschön
Ja:
[autoit]
MsgBox(0, '', _ProcessGetLocation(@AutoItPID))
Func _ProcessGetLocation($iPID)
; SmOke_N, Larry
; GetModuleFileNameExW
Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID)
If $aProc[0] = 0 Then Return SetError(1, 0, '')
Local $vStruct = DllStructCreate('int[1024]')
DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0)
Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameExW', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'wstr', '', 'int', 2048)
If $aReturn[0] = 0 Then Return SetError(2, 0, '')
Return $aReturn[3]
EndFunc
Parameter des Programs: http://www.autoitscript.com/forum/index.php?showtopic=88214&hl=_GetCommandLineFromPID
Alles anzeigenJa:
[autoit][/autoit] [autoit][/autoit] [autoit]
MsgBox(0, '', _ProcessGetLocation(@AutoItPID))Func _ProcessGetLocation($iPID)
[/autoit]
; SmOke_N, Larry
; GetModuleFileNameExW
Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID)
If $aProc[0] = 0 Then Return SetError(1, 0, '')
Local $vStruct = DllStructCreate('int[1024]')
DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0)
Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameExW', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'wstr', '', 'int', 2048)
If $aReturn[0] = 0 Then Return SetError(2, 0, '')
Return $aReturn[3]
EndFuncParameter des Programs: http://www.autoitscript.com/forum/index.php?showtopic=88214&hl=_GetCommandLineFromPID
Und was ist denn mit deinem Beitrag hier: http://www.autoitscript.com/forum/index.php?showtopic=76919&view=findpost&p=557243?
UEZ
Das funktioniert nicht so gut. Bei mir kommt alles, aber den Antworten nach hat das ja viele Probleme.