AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Pfad der eigenen Anwendung - ohne Application. Param...
Thema durchsuchen
Ansicht
Themen-Optionen

Pfad der eigenen Anwendung - ohne Application. Param...

Ein Thema von tn249 · begonnen am 1. Aug 2005 · letzter Beitrag vom 14. Feb 2008
Antwort Antwort
Benutzerbild von thule
thule

Registriert seit: 4. Okt 2007
13 Beiträge
 
#1

Re: Pfad der eigenen Anwendung - ohne Application. Param...

  Alt 14. Feb 2008, 15:37
Ich habe mein Problem mit Hilfe des Prozessmanagements gelößt:

Delphi-Quellcode:
uses
  PSAPI, TlHelp32;

function GetProcessExeName(hProcess: THandle): String;
var
  ModuleEntry: TModuleEntry32;
  hModuleEntry: THandle;
  ProcessId: Cardinal;
begin
  if hProcess = INVALID_HANDLE_VALUE then Exit;
  ProcessId := GetWindowThreadProcessId(hProcess);
  hModuleEntry := CreateToolHelp32Snapshot(TH32CS_SNAPMODULE, ProcessId);
  ModuleEntry.dwSize := SizeOf(TModuleEntry32);
  Module32First(hModuleEntry, ModuleEntry);
  Result := MOduleEntry.szExePath;
  CloseHandle(hModuleEntry);
end;

//Bsp:
 EXE_Dir_String := ExtractFilePath(GetProcessExeName(0));
//scheint gut zu functionieren.
Gruß
Open is human
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:08 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz