10 #include "wine/winuser16.h"
11 #include "wine/winbase16.h"
15 DEFAULT_DEBUG_CHANNEL(win)
18 /**********************************************************************
19 * WinHelp16 (USER.171)
21 BOOL16 WINAPI WinHelp16( HWND16 hWnd, LPCSTR lpHelpFile, UINT16 wCommand,
24 return WinHelpA( hWnd, lpHelpFile, wCommand,
25 (DWORD)PTR_SEG_TO_LIN(dwData) );
29 /**********************************************************************
30 * WinHelp32A (USER32.579)
32 BOOL WINAPI WinHelpA( HWND hWnd, LPCSTR lpHelpFile, UINT wCommand,
35 static WORD WM_WINHELP = 0;
40 if (wCommand != HELP_QUIT) /* FIXME */
42 if (WinExec("winhelp.exe -x",SW_SHOWNORMAL) <= 32)
45 /* NOTE: Probably, this should be directed yield,
46 to let winhelp open the window in all cases. */
52 WM_WINHELP=RegisterWindowMessageA("WM_WINHELP");
57 hDest = FindWindowA( "MS_WINHELP", NULL );
60 if(wCommand == HELP_QUIT)
68 case HELP_SETCONTENTS:
70 case HELP_CONTEXTPOPUP:
80 dsize = strlen( (LPSTR)dwData )+1;
83 dsize = ((LPMULTIKEYHELP)dwData)->mkSize;
86 dsize = ((LPHELPWININFO)dwData)->wStructSize;
89 WARN( win,"Unknown help command %d\n",wCommand);
93 nlen = strlen(lpHelpFile)+1;
96 size = sizeof(WINHELP) + nlen + dsize;
97 hwh = GlobalAlloc16(0,size);
98 lpwh = GlobalLock16(hwh);
100 lpwh->command = wCommand;
103 strcpy(((char*)lpwh) + sizeof(WINHELP),lpHelpFile);
104 lpwh->ofsFilename = sizeof(WINHELP);
106 lpwh->ofsFilename = 0;
108 memcpy(((char*)lpwh)+sizeof(WINHELP)+nlen,(LPSTR)dwData,dsize);
109 lpwh->ofsData = sizeof(WINHELP)+nlen;
113 return SendMessage16(hDest,WM_WINHELP,hWnd,hwh);
117 /**********************************************************************
118 * WinHelp32W (USER32.580)
120 BOOL WINAPI WinHelpW( HWND hWnd, LPCWSTR helpFile, UINT command,
123 LPSTR file = HEAP_strdupWtoA( GetProcessHeap(), 0, helpFile );
124 BOOL ret = WinHelpA( hWnd, file, command, dwData );
125 HeapFree( GetProcessHeap(), 0, file );