Код
#Include "windows.bi"
#Include "win/psapi.bi"
Dim msg As MSG
Dim As hwnd hwnd
Dim As integer pid
Dim As handle hProcess
Dim As ZString*128 szName
hwnd = CreateWindowEx(0,"#32770","",WS_VISIBLE Or WS_OVERLAPPEDWINDOW,100,100,300,300,0,0,0,0)
GetWindowThreadProcessId(hWnd, @pID)
hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE,pID)
GetModuleFileNameEx(hProcess, NULL, @szName, MAX_PATH)
CloseHandle(hProcess)
MessageBox(0,"FileName = " & szName & !"\r\nPID=" & pID,"",0)
While GetMessage(@msg,0,0,0)
DispatchMessage(@msg)
If msg.message=WM_COMMAND Then Exit While
Wend