views:

469

answers:

2

What's the best way to display Windows' character map applet from my .NET (C#) application? I know it's an optional component, so I want to display a message to the user if they don't have it installed.

I've tried using

ShellExecute( 0, "OPEN", "charmap.exe", "", "", 0 );

but all that happens is my app loses focus and character map doesn't open. As a test, I tried "calc.exe", and it works, as does using "charmap.exe" from the Run dialog. What am I missing?

A: 

How about Process.Start("charmap.exe"), catching the exception if it isn't installed?

try
{
    Process.Start("charmap.exe");
}
catch (Win32Exception e)
{
    // show message
}
Marc Gravell
A: 

Process.Start is what I was looking for. Thanks, Marc.

Michael Itzoe