Take a look at the form's 'WindowState' property. In order to make your
application the active one, you'll have to use p/invoke with
'SetForegroundWindow' + 'AttachThreadInput'.
Note that changing the foreground window programmatically may cause
confusion for the user because the input (keyboard, mouse) will be directed
to another window immediately.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
<URL:http://google.com/groups?selm=%23csLmuBlDHA.3504%40TK2MSFTNGP11.phx.gbl>
"Herfried K. Wagner [MVP]" wrote:
Apologies for re-awakenign a long dormant thread but this is exactly the issue
that i`m trying to solve right now in my code.
The query i had was if theres any alternate way to bring ur window to
foregorund with focus without using the " AttachThreadInput -
SetForegroudnWindow" calls, since that seems risky - for example if the I end
up attaching to a foreground window (can be any window in the system !) and
it happens to be hanging ?
I saw the link which suggests changing SystemParametersInfo value for
SetForegroundLockout, will try it out and update regarding the same.
Thanks in advance.
"Herfried K. Wagner [MVP]" wrote: