Autor Beitrag
DOCa Cola
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

Vista x64
D2007
BeitragVerfasst: Do 06.01.05 16:00 
Gibt es eine möglichkeit z.B den Windows Editor (notepad.exe) als neues MDI Child für meine MDI Applikation "einzufangen"?

gruß DOCa Cola
DOCa Cola Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

Vista x64
D2007
BeitragVerfasst: Do 06.01.05 16:55 
Btw. hier ist meine bisherige idee dazu, die leider nicht funktioniert...
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var
  NoteWindow : HWND;
begin
  NoteWindow := FindWindow('SciCalc',nil);
  setwindowlong(NoteWindow,GWL_STYLE,GetWindowLong(NoteWindow, GWL_STYLE) or WS_CHILD);
  CreateMDIWindow('name','123',WS_CHILD or WS_CAPTION or WS_SIZEBOX or WS_VISIBLE or WS_CLIPSIBLINGS or WS_OVERLAPPEDWINDOW,10,10,100,100,NoteWindow,self.Handle,0);


Zuletzt bearbeitet von DOCa Cola am Do 06.01.05 17:14, insgesamt 1-mal bearbeitet
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Do 06.01.05 17:15 
ein paar Verbesserungen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  NoteWindow := FindWindow(nil,'Unbenannt - Editor');
  if NoteWindow <> 0 then
  begin
    setwindowlong(NoteWindow,GWL_STYLE,GetWindowLong(NoteWindow, GWL_STYLE) or WS_CHILD);
    CreateMDIWindow('asd','123',0,10,10,100,100,NoteWindow,MainForm.Handle,0);
  end else
  Showmessage('0!');

Leider wird das Fenster nicht angezeigt.


EDIT: [b]-Tags im Sourcecode entfernt
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Do 06.01.05 17:32 
Nchmals eine Verbesserung. Durch die ShowMessages erkennt man, dass der Aufruf von CreateMDIWindow fehlschlägt.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
var NoteWindow: HWND;
Baby: TMDIChild;
begin
  NoteWindow := FindWindow(nil,'Unbenannt - Editor');
  if NoteWindow <> 0 then
  begin
    setwindowlong(NoteWindow,GWL_STYLE,GetWindowLong(NoteWindow, GWL_STYLE) or WS_CHILD);
    MainForm.CreateMDIChild('Baby');


    if CreateMDIWindow(nil,'Baby',0,10,10,100,100,NoteWindow,MainForm.Handle,0) = 0
     then ShowMessage('0-2');
  end else
  Showmessage('0-1');
end;
DOCa Cola Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

Vista x64
D2007
BeitragVerfasst: Fr 07.01.05 14:14 
ok, das ist schonmal etwas, ich hätte eigentlich mal früher schauen sollen ob ein fehler zurückgeliefert wird. trotzdem, scheint als brauchen wir hier einen mdi profi der das mal unter die lupe nimmt. ;) scheint komplexer zu sein als ich anfangs dachte

gruß DOCa Cola