Autor Beitrag
ATS3788
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Mi 27.07.05 14:09 
Hallo beisammen

Ich möchte von einem MutterFenster ( Form) neue Kindfenster erstellen, mit eigenem Handle, Instanz und so,

ähnlich MDI .

Kann mir jemand einen Hinweis geben wie ich die Form richtig kapseln kann.

Danke Tschüss :)


Moderiert von user profile iconraziel: Topic aus Neue Einträge / Hinweise / etc. verschoben am Mi 27.07.2005 um 15:38
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mi 27.07.05 15:19 
Hallo und :welcome: im DF!
Ich bin mir nicht sicher, ob es das ist, was du brauchst, aber ich schreibe es einfach mal. Du kannst Formulare ganz einfach erstellen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
 with TFormTemplate.Create(Application) do try
  Caption:='Handle ist '+IntToStr(Handle);
  ShowModal;
 finally
  Free;
 end;
TFormTemplate erstellt du vorher in Delphi auf ganz normale Weise und nennst es einfach FormTemplate. Wenn du mehrere Fenster erstellen willst, packst du sie noch in ein Array.

Gruß,
maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
ATS3788 Threadstarter
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Do 28.07.05 08:37 
:? Nein das ist nicht was ich meine
Es soll kein modales Fenster sein.
Es sollen mehrere Fesnter sein die ich öffne
und alle mit einem eigen Handle.

Habe schon so was probiert.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
 TFmAnalyse = class(TForm1)
 private
     m_Handle : HWnd;
    procedure CreateParams(var Params : TCreateParams); override;
  public
   FMID : integer;

    constructor  Create(AOwner : TComponent; AFmID : integer);
    destructor   Destroy; override;

  end;


 constructor  TFmAnalyse.Create(AOwner : TComponent; AFmID : integer);

 begin
 m_Handle := TFmAnalyse(AOwner).Handle;

// inherited
 inherited Create(AOwner);
 FMID := AFmID;


 end;

procedure TFmAnalyse.CreateParams( var Params : TCreateParams);
  var
 aCaption : array[0..25] of char;
   begin
   inherited CreateParams(Params);
   Params.WndParent := m_Handle;

 StrPCopy ( ACaption , IntToStr( m_Handle) );

   Params.Caption := aCaption; //

   end;


Nur alle Fenster haben den gleichen Handle.

Moderiert von user profile iconKlabautermann: Delphi-Tags hinzugefügt
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Do 28.07.05 09:00 
Hallo ATS3788,

nur um das mal gekährt zu haben: Warum willst du keine "normale" MDI Anwendung erstellen?

Gruß
Klabautermann
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Do 28.07.05 09:12 
Tino hatte dazu mal ein Tut geschrieben über Pointer in dem gezeigt wird wie sowas geht... www.delphi-forum.de/viewtopic.php?t=10926 Das BeispielProgramm in dem Tut ist wohl das was du suchst.

mfg matze

_________________
si tacuisses, philosophus mansisses.
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Do 28.07.05 10:57 
Wie gesagt, dann pack sie alle in ein Array und benutze statt ShowModal; Show;. Ein eigenes Handle haben sie sowieso :?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
var Fenster : array[0..4] of TFormTemplate;

procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
 for i:=Low(Fenster) to High(Fenster) do begin
  Fenster[i]:=TFormTemplate.Create(Application);
  with Fenster[i] do begin
   Caption:='Handle ist '+IntToStr(Handle);
   Show;
  end;
 end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var i:integer;
begin
 for i:=Low(Fenster) to High(Fenster) do Fenster[i].Free;
end;
TFormTemplate muss natürlich existieren

Gruß,
maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
ATS3788 Threadstarter
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Fr 29.07.05 11:21 
:D
Danke konnte mein Problem lösen.
Kahn
:wink:
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Fr 29.07.05 12:41 
Hi,
user profile iconATS3788 hat folgendes geschrieben:
Danke konnte mein Problem lösen.

könntest du deine Lösung bitte auch hier vorstellen, dammit ein zukünftriger user die das selbe Problem haben hier auch deine Lösung finden kann.

Gruß
Klabautermann