Autor Beitrag
Tobias1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 454

Win 98, XP Prof
D3 Prof, D2005 Prof
BeitragVerfasst: Do 03.02.05 11:46 
Ich habe ein Problem mit StayonTop: form2 ist ein Fenster, das immer im Vordergrund sein soll, also stayontop; beim Hauptfenster Form1 habe ich normal eingestellt; wenn man bei Form2 auf Form1 klickt geht Form2 in den Hintergrund. Was habe ich falsch gemacht :?:
Aprpos: was ist eigentlich MDI?

_________________
Auch das schlechteste Buch hat seine gute Seite: die letzte. (John Osborne)
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Do 03.02.05 12:35 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  // Fenster in den Vordergrund bringen (BringToFront wird von Win2k und XP abgelehnt)
  SetWindowPos(Hnd, HWND_TOPMOST, Self.Left, Self.Top, Self.Width, Self.Height, SWP_NOSIZE);

  // Fenster wieder einen normalen Status in der WindowZOrder zuweisen (NOTOPMOST)
  SetWindowPos(Hnd, HWND_NOTOPMOST, Self.Left, Self.Top, Self.Width, Self.Height, SWP_NOSIZE);


Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.

_________________
Stellen Sie sich bitte Zirkusmusik vor.
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Do 03.02.05 12:53 
StayonTop ruft doch auch nur SetWindowPos(Hnd, HWND_TOPMOST,...)auf
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Do 03.02.05 12:56 
Stimmt schon..

Hier StayOnTop von TForm:
ausblenden Quelltext
1:
SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE);					


Macht aber n paar Sachen anders.
Ich würde behaupten, daß es an dem Parameter SWP_NOACTIVE liegt, der zuläßt, daß das Fenster zwar Top sein kann aber nicht zwangsweise aktiv sein muß.
Wenn jetzt also ein Fenster selektiert wird, daß aktiv werden kann, verschiebt sich die Z- Order, weil das aktive Fenster ne höhere Prio hat. Aber ehrlich gesagt hab ich keine Ahnung. *gg* Alles nur Vermutungen.

Bei mir hat zumindest das mal *auf vorherigen Thread deut* geholfen :)

_________________
Stellen Sie sich bitte Zirkusmusik vor.
ase
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 203

Gentoo, Windows 9X, ME, 2k, NT, XP
Delphi 7 Prof., PHP 5 (Eclipse 3 SDK)
BeitragVerfasst: Do 03.02.05 13:05 
Servus

MDI = Multi Document Interface

Bedeutet nichts anders als das du ein Hauptfenster hast, welches dir sozusagen als Desktop für weitere Fenster (Children) dient. Ein Beispiel wäre Word 97. Du hast das Hauptfenster namens Word und dieses Fenster hat mehrere Unterfenster, die Dokumente. Des is MDI.

_________________
-EN
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: So 27.03.05 12:41 
Alos bei mir verschwindet das Fenster nicht.