encontre este code
Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Private Declare Function GetWindowWord Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long) As Integer
Const GWW_HINSTANCE = (-6)
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim ModuleName As String, FileName As String, hInst As Long
'create a buffer
ModuleName = String$(128, Chr$(0))
'get the hInstance application:
hInst = GetWindowWord(Me.hwnd, GWW_HINSTANCE)
'get the ModuleFileName:
'enter the following two lines as one, single line:
ModuleName = Left$(ModuleName, GetModuleFileName(hInst, ModuleName, Len(ModuleName)))
'set graphics mode to persistent
Me.AutoRedraw = True
'show the module filename
Me.Print "Module Filename: " + ModuleName
End Sub
he cambiado el valor de la variable Module Name por el del proceso pero no me devuelve la ruta completa, siempre se keda a cachos
por ejemplo
C:\Archivos de progr
en vez de C:\Archivos de Programa
saludos