There is no managed equivalent other than the VB implementation. It
ends up calling SetForegroundWindow, but it does a great deal of other setup
as well (getting the window handle, checking to see if it is enabled, etc,
etc), so you might want to use the class in VB.
Note, the Interaction class in the Microsoft.VisualBasic namespace IS
managed code, and is no less native to .NET than any classes you might use
in the System namespace, or anything else. C# is the language, the glue
that you use for calling existing managed code constructs.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"mr peanut" <mr******@discussions.microsoft.comwrote in message
news:F9**********************************@microsof t.com...
>I want to activate an application (Excel) in code. If I reference
microsoft.visualbasic, I could use:
Interaction.AppActivate("Microsoft Excel");
But I wold rather use a native C# approach. I know that
Interaction.MsgBox
has a native analog: MessageBox.Show.
Is there one for AppActivate?