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
);
57 if(wCommand
== HELP_QUIT
)
65 case HELP_SETCONTENTS
:
67 case HELP_CONTEXTPOPUP
:
77 dsize
= strlen( (LPSTR
)dwData
)+1;
80 dsize
= ((LPMULTIKEYHELP
)dwData
)->mkSize
;
83 dsize
= ((LPHELPWININFO
)dwData
)->wStructSize
;
86 WARN( win
,"Unknown help command %d\n",wCommand
);
90 nlen
= strlen(lpHelpFile
)+1;
93 size
= sizeof(WINHELP
) + nlen
+ dsize
;
94 hwh
= GlobalAlloc16(0,size
);
95 lpwh
= GlobalLock16(hwh
);
97 lpwh
->command
= wCommand
;
100 strcpy(((char*)lpwh
) + sizeof(WINHELP
),lpHelpFile
);
101 lpwh
->ofsFilename
= sizeof(WINHELP
);
103 lpwh
->ofsFilename
= 0;
105 memcpy(((char*)lpwh
)+sizeof(WINHELP
)+nlen
,(LPSTR
)dwData
,dsize
);
106 lpwh
->ofsData
= sizeof(WINHELP
)+nlen
;
110 return SendMessage16(hDest
,WM_WINHELP
,hWnd
,hwh
);
114 /**********************************************************************
115 * WinHelp32W (USER32.580)
117 BOOL32 WINAPI
WinHelp32W( HWND32 hWnd
, LPCWSTR helpFile
, UINT32 command
,
120 LPSTR file
= HEAP_strdupWtoA( GetProcessHeap(), 0, helpFile
);
121 BOOL32 ret
= WinHelp32A( hWnd
, file
, command
, dwData
);
122 HeapFree( GetProcessHeap(), 0, file
);