Вниз
Скачать: CL | DM;

Dll & Form   Найти похожие ветки 

 
Mantor   (2003-10-02 13:51) [0]

Данная тема как-то проскакивала в форуме, но решения я так и не нашёл.
Так вот проблема:
создаю dll с формой, в другом приложении вызываю эту форму из dll. При этом предварительно передаю хэндл приложения в dll и присваиваю его в форме. И всё равно форма из dll видна в панели задач вместе с приложением, а мне это не надо.
Как избавиться от этого.


 
Skier ©   (2003-10-02 13:53) [1]


> и присваиваю его в форме.

Это что-то новенькое...

Действуй так : (в DLL)

Application.Handle := HostAppHandle;


 
Radionov Alexey ©   (2003-10-02 13:57) [2]

в help есть раздел
Visibility of Taskbar Buttons
там также что-то говорят про
WS_EX_TOOLWINDOW


 
Radionov Alexey ©   (2003-10-02 13:57) [3]

Сорри, про WS_EX_APPWINDOW :))


 
AbrosimovA ©   (2003-10-02 14:20) [4]

У меня сделано так и в панели задач кнопка только главной формы.

********DialogDLL.dll***********
--------DialogDLL.dpr-----------

library DialogDLL;

uses
SysUtils,
Classes,
About in "About.pas" {AboutBox};

{$R *.res}

exports AboutD;

begin
end.

---------About.pas-----------

unit About;

interface

uses ...;

type
TAboutBox = class(TForm)
OKButton: TButton;
...
procedure OKButtonClick(Sender: TObject);

var
AboutBox: TAboutBox;
function AboutD: boolean;

function AboutD: boolean;
begin
AboutBox := TAboutBox.Create(Application);
AboutBox.ShowModal;
end;

procedure TAboutBox.OKButtonClick(Sender: TObject);
begin
AboutBox.Close;
end;


**********Main.exe***********
----------Pro.pas------------

unit Pro;

uses ...., About;

type TAboutD=function:boolean;stdcall;

type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;//О программе
...

private
{ Private declarations }
DLLHandle: THandle;
ExternalFunctionAboutD: TAboutD;
public
end;
{ Public declarations }

var
Form1: TForm1;
AboutDLL: boolean;

implementation

{$R *.dfm}

procedure TForm1.N1Click(Sender: TObject);
begin
DLLHandle:=LoadLibrary("DialogDLL.dll");
try
@ExternalFunctionAboutD:=GetProcAddress(DLLHandle,PChar("AboutD"));
AboutDLL:=AboutD;
finally
FreeLibrary(DLLHandle);
end;
end;

end.


 
Mantor   (2003-10-02 15:21) [5]

2 Skier

Описка, не в форме а в DLL Application.Handle := AHandle
где AHandle - параметр



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.013 c
1-40461
victorbur
2003-10-02 16:40
2003.10.13
Окно дебагера CPU при запуске


7-40690
Nicky
2003-07-25 13:47
2003.10.13
русская ли винда?


1-40476
k_len
2003-10-02 13:56
2003.10.13
Exception EDBEngineError


14-40621
Ihor Osov'yak
2003-09-24 21:38
2003.10.13
Умей говорить с подчиненными !


3-40308
Skalp
2003-09-23 23:58
2003.10.13
Скудный Local SQL - как изменить структуру таблицы Paradox




   Наверх