Re: GetWinFileName
- From: Geoffrey Summerhayes <sumrnot@xxxxxxxxx>
- Date: Fri, 9 May 2008 06:15:18 -0700 (PDT)
On May 8, 4:40 pm, battles <batt...@xxxxxxxxxxxxxx> wrote:
Thanks. Just didn't need this - GetModuleFileNameExA.
Here is what I was able to come up with:
uses PSAPI
function GetWindowExeName(PassedHandle: THandle): String;
var StrngLen: Integer; ProcID: Cardinal; ProcHndl: THandle;
begin
GetWindowThreadProcessID(PassedHandle, @ProcID);
ProcHndl := OpenProcess(PROCESS_QUERY_INFORMATION or
PROCESS_VM_READ, FALSE, ProcID);
SetLength(Result, 250);
StrngLen := GetModuleFileNameEx(ProcHndl, 0, PChar(Result), 250);
SetLength(Result, StrngLen);
Play nice, blah, blah, dire consequences, yadda, yadda, Oooooh!
CloseHandle(ProcHndl);
end;
---
Geoff
.
- Follow-Ups:
- Re: GetWinFileName
- From: Maarten Wiltink
- Re: GetWinFileName
- References:
- GetWinFileName
- From: battles
- Re: GetWinFileName
- From: Geoffrey Summerhayes
- Re: GetWinFileName
- From: battles
- Re: GetWinFileName
- From: Geoffrey Summerhayes
- Re: GetWinFileName
- From: battles
- GetWinFileName
- Prev by Date: Re: GetWinFileName
- Next by Date: Re: GetWinFileName
- Previous by thread: Re: GetWinFileName
- Next by thread: Re: GetWinFileName
- Index(es):
Relevant Pages
|