10 #include "wine/winuser16.h"
11 #include "wine/winbase16.h"
16 /**********************************************************************
17 * WinHelp16 (USER.171)
19 BOOL16 WINAPI
WinHelp16( HWND16 hWnd
, LPCSTR lpHelpFile
, UINT16 wCommand
,
22 return WinHelpA( hWnd
, lpHelpFile
, wCommand
,
23 (DWORD
)PTR_SEG_TO_LIN(dwData
) );
27 /**********************************************************************
28 * WinHelp32A (USER32.579)
30 BOOL WINAPI
WinHelpA( HWND hWnd
, LPCSTR lpHelpFile
, UINT wCommand
,
33 static WORD WM_WINHELP
= 0;
38 if (wCommand
!= HELP_QUIT
) /* FIXME */
40 if (WinExec("winhelp.exe -x",SW_SHOWNORMAL
) <= 32)
43 /* NOTE: Probably, this should be directed yield,
44 to let winhelp open the window in all cases. */
50 WM_WINHELP
=RegisterWindowMessageA("WM_WINHELP");
55 hDest
= FindWindowA( "MS_WINHELP", NULL
);
58 if(wCommand
== HELP_QUIT
)
66 case HELP_SETCONTENTS
:
68 case HELP_CONTEXTPOPUP
:
78 dsize
= strlen( (LPSTR
)dwData
)+1;
81 dsize
= ((LPMULTIKEYHELP
)dwData
)->mkSize
;
84 dsize
= ((LPHELPWININFO
)dwData
)->wStructSize
;
87 WARN( win
,"Unknown help command %d\n",wCommand
);
91 nlen
= strlen(lpHelpFile
)+1;
94 size
= sizeof(WINHELP
) + nlen
+ dsize
;
95 hwh
= GlobalAlloc16(0,size
);
96 lpwh
= GlobalLock16(hwh
);
98 lpwh
->command
= wCommand
;
101 strcpy(((char*)lpwh
) + sizeof(WINHELP
),lpHelpFile
);
102 lpwh
->ofsFilename
= sizeof(WINHELP
);
104 lpwh
->ofsFilename
= 0;
106 memcpy(((char*)lpwh
)+sizeof(WINHELP
)+nlen
,(LPSTR
)dwData
,dsize
);
107 lpwh
->ofsData
= sizeof(WINHELP
)+nlen
;
111 return SendMessage16(hDest
,WM_WINHELP
,hWnd
,hwh
);
115 /**********************************************************************
116 * WinHelp32W (USER32.580)
118 BOOL WINAPI
WinHelpW( HWND hWnd
, LPCWSTR helpFile
, UINT command
,
121 LPSTR file
= HEAP_strdupWtoA( GetProcessHeap(), 0, helpFile
);
122 BOOL ret
= WinHelpA( hWnd
, file
, command
, dwData
);
123 HeapFree( GetProcessHeap(), 0, file
);