3

I am trying to open windows 7 help from a .Net form application to a specific bookmark, at printer installation for example.

I tried to open it in the same whay that I open Control Panel applets (Back & Restore in the example below).

ProcessStartInfo startInfo = new ProcessStartInfo(@"c:\windows\system32\control.exe", "/name Microsoft.BackupAndRestore");

startInfo.UseShellExecute = true;

Process.Start(startInfo);

But it doesn't work. I didn't succeed neither to open the .exe. Does anyone know how to do this?

annavk
  • 33
  • 4
  • Did you get an error or exception? If so what was it? That would help. – kprobst Nov 07 '11 at 18:51
  • No exception. Just nothing happens, neither a process of help is starting. – annavk Nov 07 '11 at 18:59
  • Interesting. So no process is created? What are you getting back from `Process.Start`? Anything? If the app you're starting is failing silently after creation it might have written something to the event log. – kprobst Nov 07 '11 at 19:00

1 Answers1

0

IIRC HelpPane.exe works with .h1s files so if you have full path to such a file you can just use for example Process.Start (@"C:\myDir\myhelpfile.h1s"); to open it.

According to MS another option (most likely the recommenced one) is to host the HelpPane (which is basically a COM object!) - for details see http://msdn.microsoft.com/en-us/library/ms728715%28v=VS.85%29.aspx

Other important MSDN links are:

From the above links:

The Help Pane API can only be used to display the Windows Help content set. It can be customized by OEMs, system builders, and enterprise customers under license agreement, but cannot be used by third-party programs. Displaying content that is not part of the Windows Help content set is not supported.

Depending on what you want to achieve you might need to first sign a license agreement with MS...

EDIT - as per comments:

To display a specific topic you need to call the method DisplayTask of the COM object with the URL of that topic.

EDIT 2 - as per comments the final solution:

Add a reference to C:\Windows\System32\HelpPaneProxy.dll to the project then you can use the HelpPane like this

HxHelpPane pHelpPane = new HxHelpPane(); 
pHelpPane.DisplayTask("mshelp://windows/?id=e725b43f-94e4-4410-98e7-cc87ab2739aa");
Yahia
  • 69,653
  • 9
  • 115
  • 144
  • I got the following exception : System.ComponentModel.Win32Exception was unhandled Message=The system cannot find the file specified – annavk Nov 07 '11 at 19:06
  • I actually want to open windows help on a specific chapter, like Printers intallation, after searching I found that helpPane is used for help presentation to windows 7. That's why I try to open this API, is there any other way to achieve this? – annavk Nov 07 '11 at 19:16
  • @annavk follow the links above... for displaying specific topics you need to know "URL" of the topic see esp. http://msdn.microsoft.com/en-us/library/ms728704%28v=VS.85%29.aspx – Yahia Nov 07 '11 at 19:18
  • That's correct. Thanks @Yahia I add a reference C:\Windows\System32\HelpPaneProxy.dll to my project and then with the code bellow the help opened. `HxHelpPane pHelpPane = new HxHelpPane(); pHelpPane.DisplayTask("mshelp://windows/?id=e725b43f-94e4-4410-98e7-cc87ab2739aa");` – annavk Nov 07 '11 at 19:39
  • @annavk glad that I was of help :-) please don't forget to upvote/mark as accepted any answer that was usefeull. – Yahia Nov 07 '11 at 19:42