How can I open a help file (chm or so) from my GUI developed in VC++ 2008?

若如初见. 提交于 2019-12-24 03:00:16

问题


I'm trying to add some help to my GUI developed in VC++ 2008. I want to compile a chm file, or a hlp file that can be accessed from my menu. Anyone can give me any idea about how to do this?

Thanks a lot


回答1:


Under HKLM\Software\Microsoft\Windows\HTMLHelp , create an entry
named help.chm
value C:\path to\help file.chm

Then to open the chm at a particular topic call

 HtmlHelp(m_hWnd, "Help.chm", HH_DISPLAY_TOPIC, NULL);



回答2:


You could just ShellExecute the .chm file. That will open it.

ShellExecute( hWnd, _T( "open" ), _T( "help.chm" ), NULL, NULL, SW_NORMAL );



回答3:


Sorry, I misunderstood your question earlier.

For opening the Help file, you can use WinHelp

Some Links:

First (PDF)
Second
Third

There are some issues with WinHelp in Windows Vista and Win2K8, For details on how to deal with them, Look here




回答4:


If you are using managed C++:

In the namespace

System.Windows.Forms

you can find the class Help with static methods ShowHelp, ShopHelpIndex

More info: http://msdn.microsoft.com/en-us/library/system.windows.forms.help.aspx

If you are using unmanaged C++ (WIN32 api):

You can just launch the *.chm file. Example how to do it you can find here: How do I call ::CreateProcess in c++ to launch a Windows executable? . Or here http://www.codeproject.com/KB/system/newbiespawn.aspx



来源:https://stackoverflow.com/questions/1226876/how-can-i-open-a-help-file-chm-or-so-from-my-gui-developed-in-vc-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!