Código
'veran en vb6 con esta api no tengo ningun problema : Private Declare Function GetModuleFileNameExA Lib "PSAPI.DLL" (ByVal _ hProcess As Long, _ ByVal hModule As Long, ByVal _ lpFilename As String, _ ByVal nSize As Long) As Long
y adapte la api en .net de esta forma
Código
<System.Runtime.InteropServices.DllImport("PSAPI.DLL")> _ Private Shared Function GetModuleFileNameExA(ByVal hWnd As System.IntPtr, ByVal hModule As Int32, ByVal lpFilename As String, ByVal nSize As Int32) As Integer End Function
pero al querer adquirir la ruta de cierto proceso no sale nada porque sera ?
mi codigo
Código
Dim Proceso As Process, ret As Integer, hola As String For Each Proceso In Process.GetProcesses If Proceso.ProcessName = "notepad" Then hola = Space(255) ret = GetModuleFileNameExA(Proceso.Handle, 0, hola, 255) MsgBox(Len(Microsoft.VisualBasic.Left(hola, ret))) ' no optengo nada ?? Else End If Next
Alguna sugerencia. gracias ..