HINSTANCE hInst = NULL;
HMODULE hUIDLL = NULL;
-HWND (WINAPI *pHtmlHelp)(HWND, LPCWSTR, UINT, LPDWORD);
HWND hHiddenWnd, hGUIWnd;
#if KBHOOK
static HHOOK hhook;
TCHAR start_path_plugins[MAX_DPATH];
TCHAR start_path_new1[MAX_DPATH]; /* AF2005 */
TCHAR start_path_new2[MAX_DPATH]; /* AMIGAFOREVERDATA */
-TCHAR help_file[MAX_DPATH];
TCHAR bootlogpath[MAX_DPATH];
TCHAR logpath[MAX_DPATH];
bool winuaelog_temporary_enable;
inputdevice_add_inputcode (AKS_ENTERGUI, 1, NULL);
break;
case ID_ST_HELP:
- HtmlHelp (NULL, help_file, 0, NULL);
+ HtmlHelp(NULL);
break;
case ID_ST_QUIT:
uae_quit ();
return 1;
}
-static HINSTANCE hRichEdit = NULL, hHtmlHelp = NULL;
-
-int WIN32_CleanupLibraries (void)
+static int WIN32_CleanupLibraries(void)
{
- if (hRichEdit)
- FreeLibrary (hRichEdit);
-
- if (hHtmlHelp)
- FreeLibrary (hHtmlHelp);
-
if (hUIDLL)
- FreeLibrary (hUIDLL);
- CoUninitialize ();
+ FreeLibrary(hUIDLL);
+ CoUninitialize();
return 1;
}
-/* HtmlHelp Initialization - optional component */
-int WIN32_InitHtmlHelp (void)
-{
- const TCHAR *chm = _T("WinUAE.chm");
- int result = 0;
- _stprintf(help_file, _T("%s%s"), start_path_data, chm);
- if (!zfile_exists (help_file))
- _stprintf(help_file, _T("%s%s"), start_path_exe, chm);
- if (zfile_exists (help_file)) {
- if (hHtmlHelp = LoadLibrary (_T("HHCTRL.OCX"))) {
- pHtmlHelp = (HWND(WINAPI *)(HWND, LPCWSTR, UINT, LPDWORD))GetProcAddress (hHtmlHelp, "HtmlHelpW");
- result = 1;
- }
- }
- return result;
-}
-
const struct winuae_lang langs[] =
{
{ LANG_AFRIKAANS, _T("Afrikaans") },
if (pSetCurrentProcessExplicitAppUserModelID)
pSetCurrentProcessExplicitAppUserModelID (WINUAEAPPNAME);
- hRichEdit = LoadLibrary (_T("RICHED32.DLL"));
return 1;
}
}
#endif
WIN32_InitLang ();
- WIN32_InitHtmlHelp ();
unicode_init ();
can_D3D11(false);
if (betamessage ()) {
menu2 = GetSubMenu (menu, 0);
drvmenu = GetSubMenu (menu2, 1);
cdmenu = GetSubMenu (menu2, 2);
- EnableMenuItem (menu2, ID_ST_HELP, pHtmlHelp ? MF_ENABLED : MF_GRAYED);
+ EnableMenuItem (menu2, ID_ST_HELP, MF_ENABLED);
i = 0;
while (drvs[i] >= 0) {
TCHAR s[MAX_DPATH];
int gui_active, gui_left;
static struct newresource *panelresource;
int dialog_inhibit;
+static HMODULE hHtmlHelp;
-#undef HtmlHelp
-#ifndef HH_DISPLAY_TOPIC
-#define HH_DISPLAY_TOPIC 0
-#endif
-
-extern HWND(WINAPI *pHtmlHelp)(HWND, LPCWSTR, UINT, LPDWORD);
-
-void HtmlHelp(HWND a, LPCWSTR b, UINT c, const TCHAR *d)
+void HtmlHelp(const TCHAR *panel)
{
- if (pHtmlHelp) {
- (*pHtmlHelp)(a, b, c, (LPDWORD)d);
- } else {
- if (gui_message_multibutton(1, _T("Help file is not installed locally, do you want to open online version? (http://www.winuae.net/help/)")) == 1) {
- HINSTANCE h = ShellExecute(NULL, _T("open"), _T("http://www.winuae.net/help/"), NULL, NULL, SW_SHOWNORMAL);
- if ((INT_PTR)h <= 32) {
- TCHAR szMessage[MAX_DPATH];
- WIN32GUI_LoadUIString(IDS_NOHELP, szMessage, MAX_DPATH);
- gui_message(szMessage);
+ TCHAR help_file[MAX_DPATH];
+ int found = -1;
+ const TCHAR *ext[] = { _T("chm"), _T("pdf"), NULL };
+ const TCHAR *chm = _T("WinUAE");
+ for (int i = 0; ext[i] != NULL; i++) {
+ _stprintf(help_file, _T("%s%s.%s"), start_path_data, chm, ext[i]);
+ if (!zfile_exists(help_file)) {
+ _stprintf(help_file, _T("%s%s.%s"), start_path_exe, chm, ext[i]);
+ }
+ if (zfile_exists(help_file)) {
+ found = i;
+ break;
+ }
+ }
+ if (found == 0) {
+ if (!hHtmlHelp) {
+ hHtmlHelp = LoadLibrary(_T("HHCTRL.OCX"));
+ }
+ if (hHtmlHelp) {
+ HWND(WINAPI * pHtmlHelp)(HWND, LPCWSTR, UINT, LPDWORD);
+ pHtmlHelp = (HWND(WINAPI *)(HWND, LPCWSTR, UINT, LPDWORD))GetProcAddress(hHtmlHelp, "HtmlHelpW");
+ if (pHtmlHelp) {
+ pHtmlHelp(NULL, help_file, 0, (LPDWORD)panel);
+ return;
}
}
}
+ if (found <= 0) {
+ _tcscpy(help_file, _T("https://www.winuae.net/help/"));
+ if (panel) {
+ _tcscat(help_file, _T("#"));
+ _tcscat(help_file, panel);
+ }
+ }
+ HINSTANCE h = ShellExecute(NULL, _T("open"), help_file, NULL, NULL, SW_SHOWNORMAL);
+ if ((INT_PTR)h <= 32) {
+ TCHAR szMessage[MAX_DPATH];
+ WIN32GUI_LoadUIString(IDS_NOHELP, szMessage, MAX_DPATH);
+ gui_message(szMessage);
+ }
}
extern TCHAR help_file[MAX_DPATH];
ShowWindow (GetDlgItem (hDlg, IDC_PANEL_FRAME_OUTER), !fullpanel ? SW_SHOW : SW_HIDE);
ShowWindow (GetDlgItem (hDlg, IDC_PANELTREE), !fullpanel ? SW_SHOW : SW_HIDE);
ShowWindow (panelDlg, SW_SHOW);
- ew (hDlg, IDHELP, (pHtmlHelp && ppage[currentpage].help) || !pHtmlHelp ? TRUE : FALSE);
+ ew (hDlg, IDHELP, TRUE);
ToolTipHWND = CreateWindowEx (WS_EX_TOPMOST,
TOOLTIPS_CLASS, NULL,
exit_gui (1);
return TRUE;
case IDHELP:
- if ((pHtmlHelp && ppage[currentpage].help) || !pHtmlHelp)
- HtmlHelp(NULL, help_file, HH_DISPLAY_TOPIC, ppage[currentpage].help);
+ HtmlHelp(ppage[currentpage].help);
return TRUE;
case IDOK:
updatePanel (-1, 0);