winhelp: Implemented SetHelpOnFile macro.

This commit is contained in:
Eric Pouech 2008-07-12 10:37:01 +02:00 committed by Alexandre Julliard
parent f6e93ea2d3
commit 448fed2055
3 changed files with 17 additions and 3 deletions

View file

@ -2641,5 +2641,6 @@ void HLPFILE_FreeHlpFile(HLPFILE* hlpfile)
HeapFree(GetProcessHeap(), 0, hlpfile->phrases_offsets);
HeapFree(GetProcessHeap(), 0, hlpfile->phrases_buffer);
HeapFree(GetProcessHeap(), 0, hlpfile->topic_map);
HeapFree(GetProcessHeap(), 0, hlpfile->help_on_file);
HeapFree(GetProcessHeap(), 0, hlpfile);
}

View file

@ -132,6 +132,8 @@ typedef struct tagHlpFileFile
unsigned numWindows;
HLPFILE_WINDOWINFO* windows;
HICON hIcon;
LPSTR help_on_file;
} HLPFILE;
/*

View file

@ -2,7 +2,7 @@
* Help Viewer
*
* Copyright 1996 Ulrich Schmid
* Copyright 2002 Eric Pouech
* Copyright 2002, 2008 Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -555,8 +555,14 @@ void CALLBACK MACRO_GotoMark(LPCSTR str)
void CALLBACK MACRO_HelpOn(void)
{
LPCSTR file;
WINE_TRACE("()\n");
MACRO_JumpContents((Globals.wVersion > 4) ? "winhelp32.hlp" : "winhelp.hlp", NULL);
file = Globals.active_win->page->file->help_on_file;
if (!file)
file = (Globals.wVersion > 4) ? "winhlp32.hlp" : "winhelp.hlp";
MACRO_JumpContents(file, NULL);
}
void CALLBACK MACRO_HelpOnTop(void)
@ -890,7 +896,12 @@ void CALLBACK MACRO_SetContents(LPCSTR str, LONG u)
void CALLBACK MACRO_SetHelpOnFile(LPCSTR str)
{
WINE_FIXME("(\"%s\")\n", str);
WINE_TRACE("(\"%s\")\n", str);
HeapFree(GetProcessHeap(), 0, Globals.active_win->page->file->help_on_file);
Globals.active_win->page->file->help_on_file = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1);
if (Globals.active_win->page->file->help_on_file)
strcpy(Globals.active_win->page->file->help_on_file, str);
}
void CALLBACK MACRO_SetPopupColor(LONG u1, LONG u2, LONG u3)