Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Library: Windows API / MS.NET Framework API (https://www.delphipraxis.net/20-library-windows-api-ms-net-framework-api/)
-   -   Prism Das bekannte HInstance ermitteln (https://www.delphipraxis.net/14367-das-bekannte-hinstance-ermitteln.html)

sakura 7. Jan 2004 21:58


Das bekannte HInstance ermitteln
 
Alle, die HInstance in einer Delphi.NET Anwendung benötigen, sollten sich die folgenden Funktionen mal anschauen.

Delphi-Quellcode:
uses
  System.Runtime.InteropServices,
  System.Reflection;

function HInstance: Integer;
begin
  Result := Marshal.GetHInstance(Assembly.GetCallingAssembly.GetModules[0]).ToInt32;
end;

function HInstanceAsIntPtr: IntPtr;
begin
  Result := Marshal.GetHInstance(Assembly.GetCallingAssembly.GetModules[0]);
end;
...:cat:...

[edit=Chakotay1308]Klassifizierung angepasst. Mfg, Chakotay1308[/edit]


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:10 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