Autor Beitrag
bms
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Mi 17.03.04 15:51 
Es gibt zwei Varianten wie man ein Fenster über alle stellen kann. Die eine ist die Delphivariante

ausblenden Delphi-Quelltext
1:
Form1.Formstyle := fsStayOnTop;					


die ander ist die API Variante

ausblenden Delphi-Quelltext
1:
SetWindowPos(Form1.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE);					


Meine Frage ist jetzt: unterscheiden die sich? ist fsStayOnTop nur eine gekapselte Variante der API Version? Oder ist die API Variante mächtiger? Ich würde nicht fragen wenn ich da nicht meine Beobachtungen gemacht hätte. Allerdings kann ich mit das nicht vorstellen.
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Mi 17.03.04 18:11 
probieren geht über studieren:
mach doch ein projekt mit der API variante und ein projekt mit der anderen variante.
starte beide programme und schau welches "mächtiger" ist.
(nicht vergessen ins forum zu schreiben damit alle etwas davon haben :D )

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
bms Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Mi 17.03.04 22:42 
Ist ja der Grund wieso ich frage. Eigentlich halte ich die für gleichwertig, nur ist es mir in der Vergangenheit zwei mal passiert, daß die Delphi Variante nicht den gewünschen Erfolg hatte, bei der API Variante bleib das Formular oben. Es war so, daß andere Fenster, die auch TopMost waren, mein Formular überdeckten. Nachdem ich die API Variante genommen habe war mein Fenster oben.

Aber das ganze ist bereits Monate und Jahre zurück, so das ich mich an die Einzelheiten nicht mehr ganz erinnern kann. Nur muß ich wieder ein Tool schreiben das immer oben bleibt, auch über anderen TopMost Fenstern. Und da hab ich micht an das Problem erinnert. Klar kann ich das testen, nur ist das nicht so einfach. Mein Formular kann die ganze Zeit oben sein und irgendwann wird ein Programm gestartet, daß anscheinend eine höhere Priorität zu haben scheint. Schon wird mein Fenster verdeckt.

Es kostet mich keine Mühe die API Variante zu nehmen. Es war eher eine Wissensfrage.
Alexander F
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 149

Win XP, Win 2000
D6 PE, D7 Prof, D8 Prof
BeitragVerfasst: Do 18.03.04 12:04 
Eigentlich müsste die Delphi-Variante auf der API-VAriante basieren...
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Do 18.03.04 12:11 
aus forms.pas:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
case FormStyle of
//...
    fsStayOnTop:
      SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or
       SWP_NOSIZE or SWP_NOACTIVATE);
bms Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Do 18.03.04 18:50 
Dann was es wohl ein Zufall, daß die API Variante mir stärker vorkamm. Hab mir aber schon gedacht, daß es nur gekapselt ist.