1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
In main class header:
HMODULE m_hOCX;
#include <htmlhelp.h>
typedef HWND (WINAPI *LPFNHTMLHELP)(HWND, LPCSTR, UINT, DWORD_PTR);
void __fastcall TfrmMain::mnHelpContentClick(TObject *Sender)
{
AnsiString sHelpFile = <application_path>+"MyHelpFile.chm";
LPFNHTMLHELP lpfnHtmlHelp;
if (m_hOCX==NULL)
m_hOCX = (HMODULE)LoadLibrary(_T("hhctrl.ocx")); // HtmlHelp ActiveX
if (m_hOCX) {
lpfnHtmlHelp = (LPFNHTMLHELP)GetProcAddress(m_hOCX, ATOM_HTMLHELP_API_ANSI);
if (lpfnHtmlHelp != NULL)
lpfnHtmlHelp(NULL,
sHelpFile.c_str(),
HH_DISPLAY_TOPIC,
0);
}
} |
Partager