Hi:

I would like to activate / un-acitvate my app's from time to time. I like
to do some action whenever the app is activated and in there the I will
un-activate it, waiting for external signal to activate it and do the same
action again and again. I put the action in the (main) Form.Activated event
handler, it does once. I have to click other application, in order to have my
app to lose focus, and click my app to get activated again to fire the
Activated handler

How do I un-acitivate the app, if possible, so it wil be ready to get
activated again and again automatically.

Re: How to Un-Activate an app by Justin

Justin
Sat Nov 06 20:40:30 CST 2004

You have to set the focus to another application. I don't think there
are any out of the box APIs for setting the focus to another application,
so I'd recommend grabbing something off of pinvoke.net


--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Joe Ridge" <JoeRidge@discussions.microsoft.com> wrote in message
news:169CCCF9-5EB8-4FF9-9CB0-833CBF395A18@microsoft.com...
> Hi:
>
> I would like to activate / un-acitvate my app's from time to time. I like
> to do some action whenever the app is activated and in there the I will
> un-activate it, waiting for external signal to activate it and do the same
> action again and again. I put the action in the (main) Form.Activated event
> handler, it does once. I have to click other application, in order to have my
> app to lose focus, and click my app to get activated again to fire the
> Activated handler
>
> How do I un-acitivate the app, if possible, so it wil be ready to get
> activated again and again automatically.
>
>



Re: How to Un-Activate an app by SteveWonderful

SteveWonderful
Sat Nov 06 21:42:03 CST 2004

Thanks, Justin:

OK, that confirms what I thought. It seems winForm just cannot get itself
out of focus and deactivated. I will go pinvoke.net to see if there is any
other thought.


"Justin Rogers" wrote:

> You have to set the focus to another application. I don't think there
> are any out of the box APIs for setting the focus to another application,
> so I'd recommend grabbing something off of pinvoke.net
>
>
> --
> Justin Rogers
> DigiTec Web Consultants, LLC.
> Blog: http://weblogs.asp.net/justin_rogers
>
> "Joe Ridge" <JoeRidge@discussions.microsoft.com> wrote in message
> news:169CCCF9-5EB8-4FF9-9CB0-833CBF395A18@microsoft.com...
> > Hi:
> >
> > I would like to activate / un-acitvate my app's from time to time. I like
> > to do some action whenever the app is activated and in there the I will
> > un-activate it, waiting for external signal to activate it and do the same
> > action again and again. I put the action in the (main) Form.Activated event
> > handler, it does once. I have to click other application, in order to have my
> > app to lose focus, and click my app to get activated again to fire the
> > Activated handler
> >
> > How do I un-acitivate the app, if possible, so it wil be ready to get
> > activated again and again automatically.
> >
> >
>
>
>

RE: How to Un-Activate an app by RonBarone

RonBarone
Tue Nov 09 09:40:07 CST 2004

You could just add a public method to the form that does your "activation"
call.

public void CustomProcess
{
if(!this.Focused)
this.Focus();
// TODO: put activation code here
}


"Joe Ridge" wrote:

> Hi:
>
> I would like to activate / un-acitvate my app's from time to time. I like
> to do some action whenever the app is activated and in there the I will
> un-activate it, waiting for external signal to activate it and do the same
> action again and again. I put the action in the (main) Form.Activated event
> handler, it does once. I have to click other application, in order to have my
> app to lose focus, and click my app to get activated again to fire the
> Activated handler
>
> How do I un-acitivate the app, if possible, so it wil be ready to get
> activated again and again automatically.
>
>