14 /**********************************************************************
15 * WinHelp16 (USER.171)
17 BOOL16 WinHelp16( HWND16 hWnd, LPCSTR lpHelpFile, UINT16 wCommand,
20 return WinHelp32A( hWnd, lpHelpFile, wCommand,
21 (DWORD)PTR_SEG_TO_LIN(dwData) );
25 /**********************************************************************
26 * WinHelp32A (USER32.578)
28 BOOL32 WinHelp32A( HWND32 hWnd, LPCSTR lpHelpFile, UINT32 wCommand,
31 static WORD WM_WINHELP=0;
36 if (wCommand != HELP_QUIT) /* FIXME */
37 if(WinExec32("winhelp.exe -x",SW_SHOWNORMAL)<=32)
39 /* FIXME: Should be directed yield, to let winhelp open the window */
42 WM_WINHELP=RegisterWindowMessage32A("WM_WINHELP");
46 hDest = FindWindow32A( "MS_WINHELP", NULL );
48 if(wCommand == HELP_QUIT)
56 case HELP_SETCONTENTS:
57 case HELP_CONTEXTPOPUP:
66 dsize = strlen( (LPSTR)dwData )+1;
69 dsize = ((LPMULTIKEYHELP)dwData)->mkSize;
72 dsize = ((LPHELPWININFO)dwData)->wStructSize;
75 fprintf(stderr,"Unknown help command %d\n",wCommand);
79 nlen = strlen(lpHelpFile)+1;
82 size = sizeof(WINHELP) + nlen + dsize;
83 hwh = GlobalAlloc16(0,size);
84 lpwh = GlobalLock16(hwh);
86 lpwh->command = wCommand;
89 strcpy(((char*)lpwh) + sizeof(WINHELP),lpHelpFile);
90 lpwh->ofsFilename = sizeof(WINHELP);
92 lpwh->ofsFilename = 0;
94 memcpy(((char*)lpwh)+sizeof(WINHELP)+nlen,(LPSTR)dwData,dsize);
95 lpwh->ofsData = sizeof(WINHELP)+nlen;
99 return SendMessage16(hDest,WM_WINHELP,hWnd,hwh);
103 /**********************************************************************
104 * WinHelp32W (USER32.579)
106 BOOL32 WinHelp32W( HWND32 hWnd, LPCWSTR helpFile, UINT32 command,
109 LPSTR file = HEAP_strdupWtoA( GetProcessHeap(), 0, helpFile );
110 BOOL32 ret = WinHelp32A( hWnd, file, command, dwData );
111 HeapFree( GetProcessHeap(), 0, file );