var
text: array[0..260] of wideChar;
dll: HMODULE;
proc: THandle;
s: string;
begin
proc:= OpenProcess(PROCESS_QUERY_INFORMATION,False,GetCurrentProcessID);
dll := LoadLibrary('C:\WINDOWS\system32\psapi.dll');
Filename := GetProcAddress(dll,'GetProcessImageFileNameW');
Filename(proc,PChar(@text),260);
s:= text;
ShowMessage(s);
CloseHandle(proc);
FreeLibrary(dll);