15 /**********************************************************************
16 * WinHelp16 (USER.171)
18 BOOL16 WINAPI
WinHelp16( HWND16 hWnd
, LPCSTR lpHelpFile
, UINT16 wCommand
,
21 return WinHelp32A( hWnd
, lpHelpFile
, wCommand
,
22 (DWORD
)PTR_SEG_TO_LIN(dwData
) );
26 /**********************************************************************
27 * WinHelp32A (USER32.579)
29 BOOL32 WINAPI
WinHelp32A( HWND32 hWnd
, LPCSTR lpHelpFile
, UINT32 wCommand
,
32 static WORD WM_WINHELP
= 0;
37 if (wCommand
!= HELP_QUIT
) /* FIXME */
39 if (WinExec32("winhelp.exe -x",SW_SHOWNORMAL
) <= 32)
42 /* NOTE: Probably, this should be directed yield,
43 to let winhelp open the window in all cases. */
49 WM_WINHELP
=RegisterWindowMessage32A("WM_WINHELP");
54 hDest
= FindWindow32A( "MS_WINHELP", NULL
);
56 if(wCommand
== HELP_QUIT
)
63 case HELP_SETCONTENTS
:
65 case HELP_CONTEXTPOPUP
:
75 dsize
= strlen( (LPSTR
)dwData
)+1;
78 dsize
= ((LPMULTIKEYHELP
)dwData
)->mkSize
;
81 dsize
= ((LPHELPWININFO
)dwData
)->wStructSize
;
84 WARN( win
,"Unknown help command %d\n",wCommand
);
88 nlen
= strlen(lpHelpFile
)+1;
91 size
= sizeof(WINHELP
) + nlen
+ dsize
;
92 hwh
= GlobalAlloc16(0,size
);
93 lpwh
= GlobalLock16(hwh
);
95 lpwh
->command
= wCommand
;
98 strcpy(((char*)lpwh
) + sizeof(WINHELP
),lpHelpFile
);
99 lpwh
->ofsFilename
= sizeof(WINHELP
);
101 lpwh
->ofsFilename
= 0;
103 memcpy(((char*)lpwh
)+sizeof(WINHELP
)+nlen
,(LPSTR
)dwData
,dsize
);
104 lpwh
->ofsData
= sizeof(WINHELP
)+nlen
;
108 return SendMessage16(hDest
,WM_WINHELP
,hWnd
,hwh
);
112 /**********************************************************************
113 * WinHelp32W (USER32.580)
115 BOOL32 WINAPI
WinHelp32W( HWND32 hWnd
, LPCWSTR helpFile
, UINT32 command
,
118 LPSTR file
= HEAP_strdupWtoA( GetProcessHeap(), 0, helpFile
);
119 BOOL32 ret
= WinHelp32A( hWnd
, file
, command
, dwData
);
120 HeapFree( GetProcessHeap(), 0, file
);