14 /**********************************************************************
15 * WinHelp16 (USER.171)
17 BOOL16 WINAPI
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 WINAPI
WinHelp32A( HWND32 hWnd
, LPCSTR lpHelpFile
, UINT32 wCommand
,
31 static WORD WM_WINHELP
= 0;
36 if (wCommand
!= HELP_QUIT
) /* FIXME */
38 if (WinExec32("winhelp.exe -x",SW_SHOWNORMAL
) <= 32)
41 /* NOTE: Probably, this should be directed yield,
42 to let winhelp open the window in all cases. */
48 WM_WINHELP
=RegisterWindowMessage32A("WM_WINHELP");
53 hDest
= FindWindow32A( "MS_WINHELP", NULL
);
55 if(wCommand
== HELP_QUIT
)
62 case HELP_SETCONTENTS
:
64 case HELP_CONTEXTPOPUP
:
74 dsize
= strlen( (LPSTR
)dwData
)+1;
77 dsize
= ((LPMULTIKEYHELP
)dwData
)->mkSize
;
80 dsize
= ((LPHELPWININFO
)dwData
)->wStructSize
;
83 fprintf(stderr
,"Unknown help command %d\n",wCommand
);
87 nlen
= strlen(lpHelpFile
)+1;
90 size
= sizeof(WINHELP
) + nlen
+ dsize
;
91 hwh
= GlobalAlloc16(0,size
);
92 lpwh
= GlobalLock16(hwh
);
94 lpwh
->command
= wCommand
;
97 strcpy(((char*)lpwh
) + sizeof(WINHELP
),lpHelpFile
);
98 lpwh
->ofsFilename
= sizeof(WINHELP
);
100 lpwh
->ofsFilename
= 0;
102 memcpy(((char*)lpwh
)+sizeof(WINHELP
)+nlen
,(LPSTR
)dwData
,dsize
);
103 lpwh
->ofsData
= sizeof(WINHELP
)+nlen
;
107 return SendMessage16(hDest
,WM_WINHELP
,hWnd
,hwh
);
111 /**********************************************************************
112 * WinHelp32W (USER32.579)
114 BOOL32 WINAPI
WinHelp32W( HWND32 hWnd
, LPCWSTR helpFile
, UINT32 command
,
117 LPSTR file
= HEAP_strdupWtoA( GetProcessHeap(), 0, helpFile
);
118 BOOL32 ret
= WinHelp32A( hWnd
, file
, command
, dwData
);
119 HeapFree( GetProcessHeap(), 0, file
);