'获取某个进程的软件文件名，不带文件夹
#Include  Once "win\tlhelp32.bi"

Function GetParentProcname(dwPID as DWord) as String
   Dim p as WINBOOL, Proc as PROCESSENTRY32, hSnap as HANDLE
   hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
   If hSnap = 0 Then Exit Function
   Proc.dwSize = SizeOf(PROCESSENTRY32)
   p = Process32First(hSnap, @Proc)
   While p
      If Proc.th32ProcessID = dwPID Then
         Function = Proc.szExeFile
         CloseHandle hSnap : Exit Function
      End If
      p = Process32Next(hSnap, @Proc)
   Wend
   CloseHandle hSnap
End Function