Application focus question problem

R

Rhy Mednick

I have a Windows forms application that I'm creating and the application has
several child forms. The child forms are always displayed above the main
form but they are not MDI children because I want to restrict them to the
form area of the main form. I'd like to hild the child windows when the
application loses focus, but I can't seem to figure out how. I can use the
Activate and Deactivate events of the forms to find out when they get or
lose focus, but I want events like that on an application level. Do any of
you know if there is a mechanism to do this?

Thanks.
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi Rhy,

Only windows (form and controls) has focus. There is notion of *forground
process*, which is releated to dynamic priority boosting. However it is all
about windows again. Forground process is a process, which is assosiated
with the foreground window. So don't look for such a event at Applicaiton
level.
 
R

Rhy Mednick

Ok, so now I know where *not* to look...;-)


Stoitcho Goutsev (100) said:
Hi Rhy,

Only windows (form and controls) has focus. There is notion of *forground
process*, which is releated to dynamic priority boosting. However it is
all
about windows again. Forground process is a process, which is assosiated
with the foreground window. So don't look for such a event at Applicaiton
level.

--
HTH
Stoitcho Goutsev (100) [C# MVP]


Rhy Mednick said:
I have a Windows forms application that I'm creating and the application has
several child forms. The child forms are always displayed above the main
form but they are not MDI children because I want to restrict them to the
form area of the main form. I'd like to hild the child windows when the
application loses focus, but I can't seem to figure out how. I can use the
Activate and Deactivate events of the forms to find out when they get or
lose focus, but I want events like that on an application level. Do any of
you know if there is a mechanism to do this?

Thanks.
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi Rhy,

What I wanted to say is that you already know the solution and that is
Activate and Deactivate events of the form. I assume you have some kind of
main form. hook on its events it is the same as if you had those events on
the application level. In case of multiple UI threads. Hook on each threads
'main' form

--

Stoitcho Goutsev (100) [C# MVP]


Rhy Mednick said:
Ok, so now I know where *not* to look...;-)


Stoitcho Goutsev (100) said:
Hi Rhy,

Only windows (form and controls) has focus. There is notion of *forground
process*, which is releated to dynamic priority boosting. However it is
all
about windows again. Forground process is a process, which is assosiated
with the foreground window. So don't look for such a event at Applicaiton
level.

--
HTH
Stoitcho Goutsev (100) [C# MVP]


Rhy Mednick said:
I have a Windows forms application that I'm creating and the
application
has
several child forms. The child forms are always displayed above the main
form but they are not MDI children because I want to restrict them to the
form area of the main form. I'd like to hild the child windows when the
application loses focus, but I can't seem to figure out how. I can use the
Activate and Deactivate events of the forms to find out when they get or
lose focus, but I want events like that on an application level. Do
any
of
you know if there is a mechanism to do this?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top