1
I have the following situation: I have a project, which calls a DLL and this has a form. Until that moment 'OK', performs the call and displays the form, only one thing that bothers me visually is that in the system tray is two applications open, one from the project and the other from the DLL.
Opening the form in ShowModal
, and squeezing Ctrl+tab for the project, it gives focus but can’t access anything.
My question is how to leave only in an application in the system’s flag.
Coding of the DLL
library ChamadaForm;
uses
SysUtils,
Forms,
Classes;
{$R *.res}
procedure exibir; stdcall;
var
frm : TForm;
begin
frm := TForm.Create(nil);
frm.ShowModal;
freeAndNil(frm);
end;
exports
exibir;
begin
end.
Call of the DLL in the Project.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
exibir : procedure; stdcall;
handle: THandle;
begin
handle := LoadLibrary('ChamadaForm.dll');
if Handle <> 0 then
begin
@exibir := GetProcAddress (Handle, 'exibir');
if @exibir <> nil then
exibir;
FreeLibrary (Handle);
end;
end;
end.
Hello @Junior, in this case I believe that it would not work because it does not have an appication.run a DLL is called in the main app.
– Leandro Paixão
Press
Ctrl+Alt+F11
will be presented the Project Manager, then press on itCtrl+V
(shortcut to View Source).– Junior Moreira