wine/windows/winhelp.c
Alexandre Julliard 889f74244d Release 970415
Mon Apr 14 11:22:54 1997  John Harvey <john@division.co.uk>

	* [graphics/win16drv/init.c]
	Minor changes to help debug problems.

	* [if1632/dummy.c] [if1632/gdi.spec]
	Dummy routines for StartPage, EndPage, SetAbortProc, AbortProc.

	* [misc/printdrv.c] [if1632/gdi.spec] [include/windows.h]
	StartDoc16, EndDoc16 new functions.

Sun Apr 13 11:18:35 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [memory/virtual.c]
	Implemented MapViewOfFile.

	* [debugger/dbg.y]
	Added 'info maps' command.

Fri Apr 11 16:34:08 1997  Frans van Dorsselaer <devel@rulhmpc58.LeidenUniv.nl>

	* [controls/edit.c] [controls/EDIT.TODO]
	Started restructuring.  Performance improvements.
	Fixed:	wordwrap, scrollbar handling, scrolling, painting,
		EditWndProc() is now reentrant, wordbreak procs,
		better compliance to specs.
	New:	margins, format rectangle.

	* [controls/widgets.c]
	Changed the cursor for the edit control class to an I-beam.

	* [include/callback.h]
	Added 32 bit wordbreak callback.

Mon Apr  7 20:53:28 1997  Albrecht Kleine  <kleine@ak.sax.de>

	* [objects/metafile.c]
	Added handling of some more metafile records: 
	META_CREATEREGION, META_INVERTREGION etc.

Sat Apr  5 09:23:02 MET DST 1997 Sven Verdoolaege <skimo@breughel.ufsia.ac.be>

	* [loader/signal.c]
	Define kernel sigaction ourselves instead of getting it
	from the kernel source.

Wed Apr  2 21:05:00 1997  Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>

	* [control/menu.c]
	Fix return value range for GetMenuState.

	* [files/file.c]
	Always fill out ofs->szPathName in FILE_DoOpenFile.

	* [memory/string.c]
	Add debug option string.

	* [objects/cursoricon.c]
	Fix return value for DestroyIcon32.

Mon Mar 31 17:16:12 1997  Alex Korobka <alex@trantor.pharm.sunysb.edu>

	* [DEVELOPERS-HINTS] [misc/*] [windows/*] [graphics/*]
	Added description of the source tree. Moved several
	files to fit it.

	* [misc/shell.c]
	Use Win32 heap functions.
1997-04-15 17:19:52 +00:00

112 lines
2.7 KiB
C

/*
* Windows Help
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "windows.h"
#include "heap.h"
#include "ldt.h"
/**********************************************************************
* WinHelp16 (USER.171)
*/
BOOL16 WinHelp16( HWND16 hWnd, LPCSTR lpHelpFile, UINT16 wCommand,
DWORD dwData )
{
return WinHelp32A( hWnd, lpHelpFile, wCommand,
(DWORD)PTR_SEG_TO_LIN(dwData) );
}
/**********************************************************************
* WinHelp32A (USER32.578)
*/
BOOL32 WinHelp32A( HWND32 hWnd, LPCSTR lpHelpFile, UINT32 wCommand,
DWORD dwData )
{
static WORD WM_WINHELP=0;
HWND32 hDest;
LPWINHELP lpwh;
HGLOBAL16 hwh;
int size,dsize,nlen;
if (wCommand != HELP_QUIT) /* FIXME */
if(WinExec32("winhelp.exe -x",SW_SHOWNORMAL)<=32)
return FALSE;
/* FIXME: Should be directed yield, to let winhelp open the window */
Yield();
if(!WM_WINHELP) {
WM_WINHELP=RegisterWindowMessage32A("WM_WINHELP");
if(!WM_WINHELP)
return FALSE;
}
hDest = FindWindow32A( "MS_WINHELP", NULL );
if(!hDest)
if(wCommand == HELP_QUIT)
return TRUE;
else
return FALSE;
switch(wCommand)
{
case HELP_CONTEXT:
case HELP_CONTENTS:
case HELP_SETCONTENTS:
case HELP_CONTEXTPOPUP:
case HELP_FORCEFILE:
case HELP_HELPONHELP:
case HELP_QUIT:
dsize=0;
break;
case HELP_KEY:
case HELP_PARTIALKEY:
case HELP_COMMAND:
dsize = strlen( (LPSTR)dwData )+1;
break;
case HELP_MULTIKEY:
dsize = ((LPMULTIKEYHELP)dwData)->mkSize;
break;
case HELP_SETWINPOS:
dsize = ((LPHELPWININFO)dwData)->wStructSize;
break;
default:
fprintf(stderr,"Unknown help command %d\n",wCommand);
return FALSE;
}
if(lpHelpFile)
nlen = strlen(lpHelpFile)+1;
else
nlen = 0;
size = sizeof(WINHELP) + nlen + dsize;
hwh = GlobalAlloc16(0,size);
lpwh = GlobalLock16(hwh);
lpwh->size = size;
lpwh->command = wCommand;
if(nlen) {
lpwh->ofsFilename = sizeof(WINHELP);
strcpy(((char*)lpwh) + sizeof(WINHELP),lpHelpFile);
}
if(dsize) {
memcpy(((char*)lpwh)+sizeof(WINHELP)+nlen,(LPSTR)dwData,dsize);
lpwh->ofsData = sizeof(WINHELP)+nlen;
} else
lpwh->ofsData = 0;
GlobalUnlock16(hwh);
return SendMessage16(hDest,WM_WINHELP,hWnd,hwh);
}
/**********************************************************************
* WinHelp32W (USER32.579)
*/
BOOL32 WinHelp32W( HWND32 hWnd, LPCWSTR helpFile, UINT32 command,
DWORD dwData )
{
LPSTR file = HEAP_strdupWtoA( GetProcessHeap(), 0, helpFile );
BOOL32 ret = WinHelp32A( hWnd, file, command, dwData );
HeapFree( GetProcessHeap(), 0, file );
return ret;
}