Einzelnen Beitrag anzeigen

Benutzerbild von c113plpbr
c113plpbr

Registriert seit: 18. Nov 2003
Ort: localhost
674 Beiträge
 
Delphi 2005 Professional
 
#1

GetWindowModuleFileName gibt nichts zurück

  Alt 21. Nov 2004, 17:36
Ich versuche per GetWindowModuleFileName den Namen (& Pfad) eines Programms über das FensterHandle herauszufinden, doch leider gibt die Funktion nichts zurück.
Mein Code sieht in etwa so aus:
Delphi-Quellcode:
var
  hWnd_ : HWND;
  fname : PAnsiChar;
begin
  fname := nil;
  hWnd_ := FindWindow('Notepad', nil);
  if(hWnd_ = 0)then
  begin
    Application.MessageBox('FindWindow failed!', '', 0);
    exit;
  end;

  GetWindowModuleFileNameA(hWnd_, fname, MAX_PATH);

  Application.MessageBox(fname, 'fname', 0);
end;
Die "fname"-Message bleib immer leer. Weis jemand woran das liegt?

ciao & thx, Philipp
Philipp
There is never enough time to do all the nothing you want.
*HABENWILL*
  Mit Zitat antworten Zitat