Autor Beitrag
Ja-Pa
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 458

Win XP, Suse 9.3
D1, D3, D5 Std, D7 Pro, D2005 Pers, Kylix 3
BeitragVerfasst: So 08.02.04 11:12 
Hallo,

ich möchte (zur Laufzeit :wink:) herausfinden, ob mein Formular für den Benutzer sichtbar ist. Damit möchte ich nicht nur überprüfen, ob es nicht minimiert ist, sonden auch ob es durch andere Formulare verdeckt wird.
Ich hoffe, das ist iregndwie möglich :D

Gruß, Ja-Pa

_________________
Der Autor dieses Textes haftet nicht für Schäden an Soft- oder Hardware
oder Vermögensschäden, die durch das Benutzen des Textes entstehen.
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: So 08.02.04 11:20 
vielleicht kannst du damit was anfangen:

Zitat:
type TFormState = set of (fsCreating, fsVisible, fsShowing, fsModal, fsCreatedMDIChild, fsActivated);
property FormState: TFormState;

Description

Read FormState to determine the state of the form. FormState indicates when the form is in various transitional states or when certain Windows operations have occurred. The following table lists the values that can be included in a form?s state:

Value Meaning

fsCreating The form?s constructor is currently executing.

fsVisible The form?s window is visible. This state is used to update the Visible property.

fsShowing The form?s WindowState property is changing. This state is used to prevent WindowState changes from interfering with a transition that is in progress.

fsModal The form was created as a modal window.

fsCreatedMDIChild The form is an MDI parent window. This state is only set once the MDI client window has been created.

fsActivated The form has received a CM_ACTIVATE message (because it received focus or the application became active) but has not yet called the Activate method to generate an OnActivate event.

(aus der delphi hilfe)

CU

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: So 08.02.04 11:22 
aufgerufen wird das ganze über

ausblenden Delphi-Quelltext
1:
form1.FormState					

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
Ja-Pa Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 458

Win XP, Suse 9.3
D1, D3, D5 Std, D7 Pro, D2005 Pers, Kylix 3
BeitragVerfasst: So 08.02.04 11:34 
Ja, das könnte nützlich sein :D
Danke, werd´s gleich mal ausprobieren...

_________________
Der Autor dieses Textes haftet nicht für Schäden an Soft- oder Hardware
oder Vermögensschäden, die durch das Benutzen des Textes entstehen.
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 08.02.04 16:33 
ausblenden Delphi-Quelltext
1:
2:
if Form1.Visisble then
...
ixtreme
Gast
Erhaltene Danke: 1



BeitragVerfasst: So 08.02.04 16:35 
@luckie:

Was willst du denn mit deinem code erreichen? Das beantwortet auf jedenfall nicht die frage die oben gestellt wurde!

ixtreme.de
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 08.02.04 16:54 
Oh. Ich hatte nur das Topic gelesen. Aber bei der Überdeckung könnte es schwierig werden. Da müsste man kucken ob es aktiv ist, denn nur dan nist es im Vordergrund.
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: So 08.02.04 17:00 
es kann aber auch inaktiv sein und trotzdem im Vordergrund :?
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 08.02.04 17:01 
Aber nur, wenn es den Stil AlwaysOnTop hat oder das einzigste Fenster ist. ;)
ixtreme
Gast
Erhaltene Danke: 1



BeitragVerfasst: So 08.02.04 17:03 
Luckie hat folgendes geschrieben:
Aber nur, wenn es den Stil AlwaysOnTop hat oder das einzigste Fenster ist. ;)


Da ich ja auch so oft verbessert werde: Es heißt "einzige" Fenster!!!

ixtreme.de
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: So 08.02.04 17:03 
naja... glaube nicht...
ist das Fenster nicht auch schon inaktiv, wenn man auf die Taskleiste klickt und ein anders Fenster nur hinter dem eigenen ist?
außer kann es ja im fenster neben einem anderen Programm (auch Fenster) sein...
so einfach ists also nicht...
Ja-Pa Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 458

Win XP, Suse 9.3
D1, D3, D5 Std, D7 Pro, D2005 Pers, Kylix 3
BeitragVerfasst: So 08.02.04 17:21 
@patrick: Tut mir leid, dein Code konnte mir nicht weiterhelfen :cry:

@Luckie: Stimmt nicht. Wenn man zwei nicht maximierte Fenster hat kann das eine auch im Vordergrund sein, auch wenn es nicht activated ist.
OnActivate/Deactivate fällt also raus.

@Fiji-Fighter: Genau. Aber irgendwie muss das doch gehen (und wenn mit Assembler :wink:)
*nachdenk* Man könnte vielleicht auch anhand der Koordinaten überprüfen, ob es sichtbar ist. Also das Fenster ermitteln, das sich bei Form1.Left, Form1.Top befindet. Weiß nicht ob das geht...

_________________
Der Autor dieses Textes haftet nicht für Schäden an Soft- oder Hardware
oder Vermögensschäden, die durch das Benutzen des Textes entstehen.