试一下这个函数:<br>function HWndToFileName(Handle: HWnd): string;<br>var<br> hInstance: THandle;<br> nSize: Cardinal;<br> Buff: array[0..MAX_PATH - 1] of Char;<br><br>begin<br> Result := '';<br> hInstance := GetWindowLong(Handle, GWL_HINSTANCE);<br> if hInstance <> 0 then<br> begin<br> nSize := MAX_PATH;<br> nSize := GetModuleFileName(hInstance, @Buff, nSize);<br> if nSize <> 0 then<br> SetString(Result, Buff, nSize);<br> end; <br>end;