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