Autor Beitrag
grilly
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 27



BeitragVerfasst: So 15.04.07 21:37 
Hallo
Ich arbeite zur zeit an einem Program das wie eine Art Windowsersatz für mich darstellen soll.
Wenn ich zb. Notepad starte möchte ich, dass sich der frame in einem panel oä. öffnet und auch dort drin bleibt.

Danke für alle konstruktiven Antworten!


Moderiert von user profile iconChristian S.: Topic aus Sonstiges (Delphi) verschoben am So 15.04.2007 um 21:37
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: So 15.04.07 21:49 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var hw : hwnd;
begin
 Hw:=FindWindow(nil,'Unbenannt - Editor');
 if hw<>0 then Windows.SetParent(hw, Handle);
end;


Geht aber nur mit Forms, nicht mit Panels: Suche in: Delphi-Forum, Delphi-Library MDI ANWENDUNG Suche in: Delphi-Forum, Delphi-Library CHILDWINDOW
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 15.04.07 22:16 
Doch na klar geht das auch mit Panels.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var hw : hwnd;
begin
 Hw:=FindWindow(nil,'Unbenannt - Editor');
 if hw<>0 then Windows.SetParent(hw, panel1.Handle);
end;

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: So 15.04.07 22:28 
Probier das mal aus...auf meinem Computer geht das nicht.

edit: Geht doch, mein problem beim testen war das die Grösse des Panels wohl nciht wesentlich kleiner sein darf als die Grösse des Fensters.
grilly Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 27



BeitragVerfasst: Mo 16.04.07 06:35 
Wow, Danke für die schnellen antworten!

Ich hab das ganze jetzt mal so gelöst:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
 shellexecute(1,'open','"C:\Programme\Mozilla Firefox\firefox.exe"','','',SW_show);
 sleep(100);
 panel1.SetFocus;
 Hw:=FindWindow(nil,'Mozilla Firefox');
 if hw<>0 then Windows.SetParent(hw, panel1.Handle);


Weiß jemand vllt noch zufällig wie ich die Titelleiste von dieser externen Anwendung wegmache?
Habe folgendes bei den Schweizern gefunden, kriege das aber nicht auch externe Anwendungen umgeschieben.^
www.swissdelphicente...e/showcode.php?id=11

Moderiert von user profile iconmatze: Code- durch Delphi-Tags ersetzt
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 18.04.07 00:43 
Du solltest dazu die Delphi-Hilfe oder das MSDN durchforsten. Und zwar nach den Begriffen Suche im MSDN SETWINDOWLONG und Suche im MSDN GETWINDOWLONG. Das ganze ist nicht so einfach allerdings. Und du wirst auch mehr als diese beiden Begriffe benötigen, allerdings stellt SetWindowlong den Einstieg ein. Von da an wirst genügeng Querverweise bekommen.

Schau dir den Code aus dem SDC an und versuche zu verstehen was er macht. Das kannst du dann portieren.

Die Variable Handle gegen die des zu skinnenden Fensters auszutauschen reicht nicht! Denn z.B. die Grössenveränderung in der vorletzten Zeile kannst du ja nur über einen API Befehl machen.
grilly Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 27



BeitragVerfasst: Mi 18.04.07 17:03 
Danke ich werds probiern.
Wenn jemanden interssiert hier mal ein pic (schon a bissl älter und qualitätsverlust wegen .jpg):

Moderiert von user profile iconTino: Screenshot von imageshack als Anhang eingefügt.
Einloggen, um Attachments anzusehen!
Taktaky
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25



BeitragVerfasst: Do 20.09.07 11:16 
Mit dem Code kann man das fremde Programm in Panel einbinden, bleibt jedoch beweglich!

wie kann man es fixieren und sein Titelleiste ausblenden?