Hi,
A mutex is a good idea, now the tricky part is set the focus to that other
process , I proposed using SetActiveWindow API call but as you mentioned you
need to be attached to the calling thread's message queue.
I'm using SetForegroundWindow to do this in a pocketPC application and it
works great:
[DllImport("user32dll",EntryPoint="SetForegroundWin dow")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
Hope this help,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Herfried K. Wagner [MVP]" <hirf.nosp@m.activevb.de> wrote in message
news:ulbi06DfDHA.1736@TK2MSFTNGP12.phx.gbl...[color=blue]
> Hello,
>
> "Fergus Cooney" <filter-1@tesco.net> schrieb:[color=green]
> > aoProcList = GetProcessesByName (sProcessName) 'At least 1.[/color]
>
> Notice that _different_ applications can have the same name. I would use[/color]
a[color=blue]
> 'Mutex' for detecting other instances of the application:
>
>[/color]
http://groups.google.de/groups?selm=...TNGP09.phx.gbl[color=blue]
>
> --
> Herfried K. Wagner
> MVP · VB Classic, VB.NET
>
http://www.mvps.org/dotnet
>
>[/color]