Board index » delphi » Application.Handle in DLL built with Runtime Packages

Application.Handle in DLL built with Runtime Packages

I have EXE and DLL. Both are built with runtime Packages.
In this case Application.Handle=0 and form created in DLL is shown
separately
in task bar.
But Application.Handle>0 if I remove all DLL function calls in EXE or if

I build both projects without runtime packages. Why???

Thanks before,

Ivan Titov

 

Re:Application.Handle in DLL built with Runtime Packages


Quote
Ivan Titov <ivan_ti...@mail.ru> wrote in message

news:3895A124.228DD67F@mail.ru...
Quote
> I have EXE and DLL. Both are built with runtime Packages.
> In this case Application.Handle=0 and form created in DLL is shown
> separately
> in task bar.

to get rid of this, In your DLL , add this procedure

procedure SetHandle(AHWND: THWND); stdcall;
begin
    Application.Handle := AHWND
end;

then in your exe , call this method first. Good luck.

--Chen

Re:Application.Handle in DLL built with Runtime Packages


Quote
Chen Jiangyong wrote:
> Ivan Titov <ivan_ti...@mail.ru> wrote in message
> news:3895A124.228DD67F@mail.ru...
> > I have EXE and DLL. Both are built with runtime Packages.
> > In this case Application.Handle=0 and form created in DLL is shown
> > separately
> > in task bar.
> to get rid of this, In your DLL , add this procedure

> procedure SetHandle(AHWND: THWND); stdcall;
> begin
>     Application.Handle := AHWND
> end;

> then in your exe , call this method first. Good luck.

It works without runtime packages only.
But I need EXE and DLL built with runtime packages.
In this case Application.Handle is already 0 after BEGIN operator in
<exe>.dpr.
Where should I call SetHandle?

Thanks for reply
I hope to get answer again

Ivan Titov

Other Threads