Home All Groups Group Topic Archive Search About

Bring my FORM to front??

Author
6 Oct 2006 9:12 AM
M O J O
Hi,

I have an application where I've implemented a global hotkey, so no matter
what other application is in front (have focus), my app will react when the
key combination is pressed. This works fine.

My problem is now that the form I want to show, does not come to the front.

I've tried to set Topmost to true, but then the form doesn't recieve focus.

How can I bring my form to front and give it focus eventhough another
applicetion (like Outlook) is in front (have focus)??

Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

:o)

M O J O

Author
6 Oct 2006 10:55 AM
rowe_newsgroups
Won't BringToFront or Focus do this?

Thanks,

Seth Rowe

M O J O wrote:
Show quoteHide quote
> Hi,
>
> I have an application where I've implemented a global hotkey, so no matter
> what other application is in front (have focus), my app will react when the
> key combination is pressed. This works fine.
>
> My problem is now that the form I want to show, does not come to the front.
>
> I've tried to set Topmost to true, but then the form doesn't recieve focus.
>
> How can I bring my form to front and give it focus eventhough another
> applicetion (like Outlook) is in front (have focus)??
>
> Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
> :o)
>
> M O J O
Author
6 Oct 2006 2:00 PM
Herfried K. Wagner [MVP]
"M O J O" <M***@discussions.microsoft.com> schrieb:
> I have an application where I've implemented a global hotkey, so no matter
> what other application is in front (have focus), my app will react when
> the
> key combination is pressed. This works fine.
>
> My problem is now that the form I want to show, does not come to the
> front.

P/invoke 'AttachThreadInput' + 'SetForegroundWindow'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
7 Oct 2006 3:03 PM
M O J O
Hi Herfried,

Thanks for once again helping me out here!

:o)

M O J O

Show quoteHide quote
"Herfried K. Wagner [MVP]" wrote:

> "M O J O" <M***@discussions.microsoft.com> schrieb:
> > I have an application where I've implemented a global hotkey, so no matter
> > what other application is in front (have focus), my app will react when
> > the
> > key combination is pressed. This works fine.
> >
> > My problem is now that the form I want to show, does not come to the
> > front.
>
> P/invoke 'AttachThreadInput' + 'SetForegroundWindow'.
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
>
>