hhctrl.ocx: Add support for specifying window names with HH_HELP_CONTEXT.

This commit is contained in:
Erich Hoover 2012-10-03 09:22:11 -06:00 committed by Alexandre Julliard
parent d1c363424d
commit 317f26beef
1 changed files with 15 additions and 3 deletions

View File

@ -244,21 +244,33 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
return info->WinType.hwndHelp;
}
case HH_HELP_CONTEXT: {
HHInfo *info;
WCHAR *window = NULL;
HHInfo *info = NULL;
LPWSTR url;
if (!filename)
return NULL;
if (!resolve_filename(filename, fullname, MAX_PATH, NULL, NULL))
if (!resolve_filename(filename, fullname, MAX_PATH, NULL, &window))
{
WARN("can't find %s\n", debugstr_w(filename));
return 0;
}
info = CreateHelpViewer(NULL, fullname, caller);
if (window)
info = find_window(window);
info = CreateHelpViewer(info, fullname, caller);
if(!info)
{
heap_free(window);
return NULL;
}
if(!info->WinType.pszType)
info->WinType.pszType = info->stringsW.pszType = window;
else
heap_free(window);
url = FindContextAlias(info->pCHMInfo, data);
if(!url)