Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Aus der DLL heraus das Handle der Hostanwendung ermitteln? (https://www.delphipraxis.net/102504-aus-der-dll-heraus-das-handle-der-hostanwendung-ermitteln.html)

MartinA 2. Nov 2007 12:41

Re: Aus der DLL heraus das Handle der Hostanwendung ermittel
 
Hallo,

ggf. löst folgendes das Problem:
Code:

function EnumThreadWndProc(wnd: HWND; ResultWnd: PInteger): Boolean; stdcall;
begin
  ResultWnd^ := wnd;
  Result := False;
end;


function GetThreadMainWindow(ThreadId: DWORD): HWND;
begin
  Result := 0;
  EnumThreadWindows(ThreadId, @EnumThreadWndProc, Integer(@Result));
end;


handle := GetThreadMainWindow(GetCurrentThreadId());
Gruß
Martin


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:04 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz