hhctrl.ocx: When called as a program, quit when HtmlHelp call fails.
This commit is contained in:
parent
f1b7bb4eaa
commit
4cf842e75d
|
@ -349,6 +349,7 @@ int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
|
|||
int len, buflen, mapid = -1;
|
||||
WCHAR *filename;
|
||||
char *endq = NULL;
|
||||
HWND hwnd;
|
||||
|
||||
hh_process = TRUE;
|
||||
|
||||
|
@ -404,12 +405,18 @@ int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
|
|||
|
||||
/* Open a specific help topic */
|
||||
if(mapid != -1)
|
||||
HtmlHelpW(GetDesktopWindow(), filename, HH_HELP_CONTEXT, mapid);
|
||||
hwnd = HtmlHelpW(GetDesktopWindow(), filename, HH_HELP_CONTEXT, mapid);
|
||||
else
|
||||
HtmlHelpW(GetDesktopWindow(), filename, HH_DISPLAY_TOPIC, 0);
|
||||
hwnd = HtmlHelpW(GetDesktopWindow(), filename, HH_DISPLAY_TOPIC, 0);
|
||||
|
||||
heap_free(filename);
|
||||
|
||||
if (!hwnd)
|
||||
{
|
||||
ERR("Failed to open HTML Help file '%s'.\n", szCmdLine);
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (GetMessageW(&msg, 0, 0, 0))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
|
|
Loading…
Reference in New Issue