Take the 2-minute tour ×

I have WPF application. After testing my app on Windows7 and realized that opening help does not work.

Basically to open chm help file I call:


And nothing happens. I have also tried my app on Vista SP1, same result. I'm admin in both OS'es

I have googled this problem, but have not found solution to it.

Is there way to solve this problem?

Have you experienced this types of incompatibilities.

Thank You!

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

have you tried ShellExecute ?

using System.Runtime.InteropServices;

[DllImport("shell32.dll", CharSet = CharSet.Auto)] static extern bool ShellExecuteEx(ref SHELLEXECUTEINFO lpExecInfo);

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
    public int cbSize;
    public uint fMask;
    public IntPtr hwnd;
    public string lpVerb;
    public string lpFile;
    public string lpParameters;
    public string lpDirectory;
    public int nShow;
    public IntPtr hInstApp;
    public IntPtr lpIDList;
    public string lpClass;
    public IntPtr hkeyClass;
    public uint dwHotKey;
    public IntPtr hIcon;
    public IntPtr hProcess;

and you can try to start process with :

        info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info);
        info.lpVerb = "open";
        info.lpFile = "help.chm";
        info.nShow = 5;
        info.fMask = 12;

        ShellExecuteEx(ref info);


share|improve this answer
What's the difference between pinvoking ShellExecute directly and calling ProcessStart(ProcessStartInfo) with UseShellExecute=true ? –  Nir May 14 '09 at 11:24
add comment

This SO thread should help you. Also, here's a pretty detailed article on UAC and how to elevate.

share|improve this answer
add comment

Is it just .chm files? If so it may not be opening because, by default, chm files in untrusted locations are blocked. See: KB902225. From this article it appears that you may be able to unblock them programmatically, even if it's just by launching Sysinternals streams.exe first (as referenced in the article).

share|improve this answer
add comment

Your Answer


