2 * Help Viewer Implementation
4 * Copyright 2005 James Hawkins
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #include "wine/unicode.h"
35 #include "webbrowser.h"
37 /* Window type defaults */
39 #define WINTYPE_DEFAULT_X 280
40 #define WINTYPE_DEFAULT_Y 100
41 #define WINTYPE_DEFAULT_WIDTH 740
42 #define WINTYPE_DEFAULT_HEIGHT 640
43 #define WINTYPE_DEFAULT_NAVWIDTH 251
45 typedef struct tagHHInfo
47 HH_WINTYPEW *pHHWinType;
56 extern HINSTANCE hhctrl_hinstance;
58 static LPWSTR HH_ANSIToUnicode(LPCSTR ansi)
63 count = MultiByteToWideChar(CP_ACP, 0, ansi, -1, NULL, 0);
64 unicode = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WCHAR));
65 MultiByteToWideChar(CP_ACP, 0, ansi, -1, unicode, count);
70 /* Loads a string from the resource file */
71 static LPWSTR HH_LoadString(DWORD dwID)
76 iSize = LoadStringW(hhctrl_hinstance, dwID, NULL, 0);
77 iSize += 2; /* some strings (tab text) needs double-null termination */
79 string = HeapAlloc(GetProcessHeap(), 0, iSize * sizeof(WCHAR));
80 LoadStringW(hhctrl_hinstance, dwID, string, iSize);
87 static const WCHAR szChildClass[] = {
88 'H','H',' ','C','h','i','l','d',0
91 static const WCHAR szEmpty[] = {0};
93 static void Child_OnPaint(HWND hWnd)
99 hdc = BeginPaint(hWnd, &ps);
101 /* Only paint the Navigation pane, identified by the fact
102 * that it has a child window
104 if (GetWindow(hWnd, GW_CHILD))
106 GetClientRect(hWnd, &rc);
108 /* set the border color */
109 SelectObject(hdc, GetStockObject(DC_PEN));
110 SetDCPenColor(hdc, GetSysColor(COLOR_BTNSHADOW));
112 /* Draw the top and right borders */
113 MoveToEx(hdc, 0, 0, NULL);
114 LineTo(hdc, rc.right - 1, 0);
115 LineTo(hdc, rc.right - 1, rc.bottom);
117 /* Fill in the background, taking the border lines into account */
120 FillRect(hdc, &rc, GetSysColorBrush(COLOR_3DFACE));
126 LRESULT CALLBACK Child_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
134 return DefWindowProcW(hWnd, message, wParam, lParam);
140 static void HH_RegisterChildWndClass(HHInfo *pHHInfo)
144 wcex.cbSize = sizeof(WNDCLASSEXW);
146 wcex.lpfnWndProc = (WNDPROC)Child_WndProc;
149 wcex.hInstance = pHHInfo->hInstance;
150 wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION);
151 wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW);
152 wcex.hbrBackground = (HBRUSH)(COLOR_3DFACE);
153 wcex.lpszMenuName = NULL;
154 wcex.lpszClassName = szChildClass;
155 wcex.hIconSm = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION);
157 RegisterClassExW(&wcex);
164 static void TB_AddButton(TBBUTTON *pButtons, DWORD dwIndex, DWORD dwID)
166 /* FIXME: Load the correct button bitmaps */
167 pButtons[dwIndex].iBitmap = STD_PRINT;
168 pButtons[dwIndex].idCommand = dwID;
169 pButtons[dwIndex].fsState = TBSTATE_ENABLED;
170 pButtons[dwIndex].fsStyle = BTNS_BUTTON;
171 pButtons[dwIndex].dwData = 0;
172 pButtons[dwIndex].iString = 0;
175 static void TB_AddButtonsFromFlags(TBBUTTON *pButtons, DWORD dwButtonFlags, LPDWORD pdwNumButtons)
179 if (dwButtonFlags & HHWIN_BUTTON_EXPAND)
180 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_EXPAND);
182 if (dwButtonFlags & HHWIN_BUTTON_BACK)
183 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_BACK);
185 if (dwButtonFlags & HHWIN_BUTTON_FORWARD)
186 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_FORWARD);
188 if (dwButtonFlags & HHWIN_BUTTON_STOP)
189 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_STOP);
191 if (dwButtonFlags & HHWIN_BUTTON_REFRESH)
192 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_REFRESH);
194 if (dwButtonFlags & HHWIN_BUTTON_HOME)
195 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_HOME);
197 if (dwButtonFlags & HHWIN_BUTTON_SYNC)
198 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_SYNC);
200 if (dwButtonFlags & HHWIN_BUTTON_OPTIONS)
201 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_OPTIONS);
203 if (dwButtonFlags & HHWIN_BUTTON_PRINT)
204 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_PRINT);
206 if (dwButtonFlags & HHWIN_BUTTON_JUMP1)
207 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_JUMP1);
209 if (dwButtonFlags & HHWIN_BUTTON_JUMP2)
210 TB_AddButton(pButtons,(*pdwNumButtons)++, IDTB_JUMP2);
212 if (dwButtonFlags & HHWIN_BUTTON_ZOOM)
213 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_ZOOM);
215 if (dwButtonFlags & HHWIN_BUTTON_TOC_NEXT)
216 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_TOC_NEXT);
218 if (dwButtonFlags & HHWIN_BUTTON_TOC_PREV)
219 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_TOC_PREV);
222 static BOOL HH_AddToolbar(HHInfo *pHHInfo)
225 HWND hwndParent = pHHInfo->pHHWinType->hwndHelp;
227 TBBUTTON buttons[IDTB_TOC_PREV - IDTB_EXPAND];
229 DWORD dwStyles, dwExStyles;
230 DWORD dwNumButtons, dwIndex;
232 if (pHHInfo->pHHWinType->fsWinProperties & HHWIN_PARAM_TB_FLAGS)
233 toolbarFlags = pHHInfo->pHHWinType->fsToolBarFlags;
235 toolbarFlags = HHWIN_DEF_BUTTONS;
237 TB_AddButtonsFromFlags(buttons, toolbarFlags, &dwNumButtons);
239 dwStyles = WS_CHILDWINDOW | WS_VISIBLE | TBSTYLE_FLAT |
240 TBSTYLE_WRAPABLE | TBSTYLE_TOOLTIPS | CCS_NODIVIDER;
241 dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR;
243 hToolbar = CreateWindowExW(dwExStyles, TOOLBARCLASSNAMEW, NULL, dwStyles,
244 0, 0, 0, 0, hwndParent, NULL,
245 pHHInfo->hInstance, NULL);
249 SendMessageW(hToolbar, TB_SETBITMAPSIZE, 0, MAKELONG(ICON_SIZE, ICON_SIZE));
250 SendMessageW(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
251 SendMessageW(hToolbar, WM_SETFONT, (WPARAM)pHHInfo->hFont, TRUE);
253 /* FIXME: Load correct icons for all buttons */
254 tbAB.hInst = HINST_COMMCTRL;
255 tbAB.nID = IDB_STD_LARGE_COLOR;
256 SendMessageW(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&tbAB);
258 for (dwIndex = 0; dwIndex < dwNumButtons; dwIndex++)
260 LPWSTR szBuf = HH_LoadString(buttons[dwIndex].idCommand);
261 DWORD dwLen = strlenW(szBuf);
262 szBuf[dwLen + 2] = 0; /* Double-null terminate */
264 buttons[dwIndex].iString = (DWORD)SendMessageW(hToolbar, TB_ADDSTRINGW, 0, (LPARAM)szBuf);
265 HeapFree(GetProcessHeap(), 0, szBuf);
268 SendMessageW(hToolbar, TB_ADDBUTTONSW, dwNumButtons, (LPARAM)&buttons);
269 SendMessageW(hToolbar, TB_AUTOSIZE, 0, 0);
270 ShowWindow(hToolbar, SW_SHOW);
272 pHHInfo->pHHWinType->hwndToolBar = hToolbar;
276 /* Navigation Pane */
278 #define TAB_PADDING 2
279 #define TAB_TOP_PADDING 8
280 #define TAB_RIGHT_PADDING 4
282 static void NP_GetNavigationRect(HHInfo *pHHInfo, RECT *rc)
284 HWND hwndParent = pHHInfo->pHHWinType->hwndHelp;
285 HWND hwndToolbar = pHHInfo->pHHWinType->hwndToolBar;
286 RECT rectWND, rectTB;
288 GetClientRect(hwndParent, &rectWND);
289 GetClientRect(hwndToolbar, &rectTB);
292 rc->top = rectTB.bottom;
293 rc->bottom = rectWND.bottom - rectTB.bottom;
295 if (pHHInfo->pHHWinType->fsValidMembers & HHWIN_PARAM_NAV_WIDTH)
296 rc->right = pHHInfo->pHHWinType->iNavWidth;
298 rc->right = WINTYPE_DEFAULT_NAVWIDTH;
301 static void NP_CreateTab(HINSTANCE hInstance, HWND hwndTabCtrl, DWORD dwStrID, DWORD dwIndex)
304 LPWSTR tabText = HH_LoadString(dwStrID);
306 tie.mask = TCIF_TEXT;
307 tie.pszText = tabText;
309 TabCtrl_InsertItemW(hwndTabCtrl, dwIndex, &tie);
310 HeapFree(GetProcessHeap(), 0, tabText);
313 static BOOL HH_AddNavigationPane(HHInfo *pHHInfo)
315 HWND hWnd, hwndTabCtrl;
316 HWND hwndParent = pHHInfo->pHHWinType->hwndHelp;
317 DWORD dwStyles = WS_CHILDWINDOW | WS_VISIBLE;
318 DWORD dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR;
322 NP_GetNavigationRect(pHHInfo, &rc);
324 hWnd = CreateWindowExW(dwExStyles, szChildClass, szEmpty, dwStyles,
325 rc.left, rc.top, rc.right, rc.bottom,
326 hwndParent, NULL, pHHInfo->hInstance, NULL);
330 hwndTabCtrl = CreateWindowExW(dwExStyles, WC_TABCONTROLW, szEmpty, dwStyles,
331 TAB_PADDING, TAB_TOP_PADDING,
332 rc.right - TAB_PADDING - TAB_RIGHT_PADDING,
333 rc.bottom - TAB_PADDING - TAB_TOP_PADDING,
334 hWnd, NULL, pHHInfo->hInstance, NULL);
338 if (pHHInfo->pHHWinType->pszToc)
339 NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_CONTENTS, dwIndex++);
341 if (pHHInfo->pHHWinType->pszIndex)
342 NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_INDEX, dwIndex++);
344 if (pHHInfo->pHHWinType->fsWinProperties & HHWIN_PROP_TAB_SEARCH)
345 NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_SEARCH, dwIndex++);
347 if (pHHInfo->pHHWinType->fsWinProperties & HHWIN_PROP_TAB_FAVORITES)
348 NP_CreateTab(pHHInfo->hInstance, hwndTabCtrl, IDS_FAVORITES, dwIndex++);
350 SendMessageW(hwndTabCtrl, WM_SETFONT, (WPARAM)pHHInfo->hFont, TRUE);
352 pHHInfo->hwndTabCtrl = hwndTabCtrl;
353 pHHInfo->pHHWinType->hwndNavigation = hWnd;
359 static void HP_GetHTMLRect(HHInfo *pHHInfo, RECT *rc)
361 HWND hwndParent = pHHInfo->pHHWinType->hwndHelp;
362 HWND hwndToolbar = pHHInfo->pHHWinType->hwndToolBar;
363 HWND hwndNavigation = pHHInfo->pHHWinType->hwndNavigation;
364 RECT rectTB, rectWND, rectNP;
366 GetClientRect(hwndParent, &rectWND);
367 GetClientRect(hwndToolbar, &rectTB);
368 GetClientRect(hwndNavigation, &rectNP);
370 rc->left = rectNP.right;
371 rc->top = rectTB.bottom;
372 rc->right = rectWND.right - rectNP.right;
373 rc->bottom = rectWND.bottom - rectTB.bottom;
376 static BOOL HH_AddHTMLPane(HHInfo *pHHInfo)
379 HWND hwndParent = pHHInfo->pHHWinType->hwndHelp;
380 DWORD dwStyles = WS_CHILDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN;
381 DWORD dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_CLIENTEDGE;
384 HP_GetHTMLRect(pHHInfo, &rc);
386 hWnd = CreateWindowExW(dwExStyles, szChildClass, szEmpty, dwStyles,
387 rc.left, rc.top, rc.right, rc.bottom,
388 hwndParent, NULL, pHHInfo->hInstance, NULL);
392 if (!WB_EmbedBrowser(pHHInfo->pWBInfo, hWnd))
395 /* store the pointer to the HH info struct */
396 SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)pHHInfo);
398 ShowWindow(hWnd, SW_SHOW);
401 pHHInfo->pHHWinType->hwndHTML = hWnd;
407 static void Help_OnSize(HWND hWnd, LPARAM lParam)
409 HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, GWLP_USERDATA);
415 /* Only resize the Navigation pane vertically */
418 NP_GetNavigationRect(pHHInfo, &rc);
419 SetWindowPos(pHHInfo->pHHWinType->hwndNavigation, HWND_TOP, 0, 0,
420 rc.right, rc.bottom, SWP_NOMOVE);
422 GetClientRect(pHHInfo->pHHWinType->hwndNavigation, &rc);
423 SetWindowPos(pHHInfo->hwndTabCtrl, HWND_TOP, 0, 0,
424 rc.right - TAB_PADDING - TAB_RIGHT_PADDING,
425 rc.bottom - TAB_PADDING - TAB_TOP_PADDING, SWP_NOMOVE);
428 HP_GetHTMLRect(pHHInfo, &rc);
429 SetWindowPos(pHHInfo->pHHWinType->hwndHTML, HWND_TOP, 0, 0,
430 LOWORD(lParam), HIWORD(lParam), SWP_NOMOVE);
433 LRESULT CALLBACK Help_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
441 Help_OnSize(hWnd, lParam);
444 hdc = BeginPaint(hWnd, &ps);
452 return DefWindowProcW(hWnd, message, wParam, lParam);
458 static BOOL HH_CreateHelpWindow(HHInfo *pHHInfo)
461 HINSTANCE hInstance = pHHInfo->hInstance;
462 RECT winPos = pHHInfo->pHHWinType->rcWindowPos;
464 DWORD dwStyles, dwExStyles;
465 DWORD x, y, width, height;
467 static const WCHAR windowClassW[] = {
468 'H','H',' ', 'P','a','r','e','n','t',0
471 wcex.cbSize = sizeof(WNDCLASSEXW);
472 wcex.style = CS_HREDRAW | CS_VREDRAW;
473 wcex.lpfnWndProc = (WNDPROC)Help_WndProc;
476 wcex.hInstance = hInstance;
477 wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION);
478 wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW);
479 wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
480 wcex.lpszMenuName = NULL;
481 wcex.lpszClassName = windowClassW;
482 wcex.hIconSm = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION);
484 RegisterClassExW(&wcex);
486 /* Read in window parameters if available */
487 if (pHHInfo->pHHWinType->fsValidMembers & HHWIN_PARAM_STYLES)
488 dwStyles = pHHInfo->pHHWinType->dwStyles;
490 dwStyles = WS_OVERLAPPEDWINDOW | WS_VISIBLE |
491 WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
493 if (pHHInfo->pHHWinType->fsValidMembers & HHWIN_PARAM_EXSTYLES)
494 dwExStyles = pHHInfo->pHHWinType->dwExStyles;
496 dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_APPWINDOW |
497 WS_EX_WINDOWEDGE | WS_EX_RIGHTSCROLLBAR;
499 if (pHHInfo->pHHWinType->fsValidMembers & HHWIN_PARAM_RECT)
503 width = winPos.right - x;
504 height = winPos.bottom - y;
508 x = WINTYPE_DEFAULT_X;
509 y = WINTYPE_DEFAULT_Y;
510 width = WINTYPE_DEFAULT_WIDTH;
511 height = WINTYPE_DEFAULT_HEIGHT;
514 hWnd = CreateWindowExW(dwExStyles, windowClassW, pHHInfo->pHHWinType->pszCaption,
515 dwStyles, x, y, width, height, NULL, NULL, hInstance, NULL);
519 ShowWindow(hWnd, SW_SHOW);
522 /* store the pointer to the HH info struct */
523 SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)pHHInfo);
525 pHHInfo->pHHWinType->hwndHelp = hWnd;
529 static void HH_CreateFont(HHInfo *pHHInfo)
533 GetObjectW(GetStockObject(ANSI_VAR_FONT), sizeof(LOGFONTW), &lf);
534 lf.lfWeight = FW_NORMAL;
536 lf.lfUnderline = FALSE;
538 pHHInfo->hFont = CreateFontIndirectW(&lf);
541 static void HH_InitRequiredControls(DWORD dwControls)
543 INITCOMMONCONTROLSEX icex;
545 icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
546 icex.dwICC = dwControls;
547 InitCommonControlsEx(&icex);
550 /* Creates the whole package */
551 static BOOL HH_CreateViewer(HHInfo *pHHInfo)
553 HH_CreateFont(pHHInfo);
555 if (!HH_CreateHelpWindow(pHHInfo))
558 HH_InitRequiredControls(ICC_BAR_CLASSES);
560 if (!HH_AddToolbar(pHHInfo))
563 HH_RegisterChildWndClass(pHHInfo);
565 if (!HH_AddNavigationPane(pHHInfo))
568 if (!HH_AddHTMLPane(pHHInfo))
574 static HHInfo *HH_OpenHH(HINSTANCE hInstance, LPWSTR szCmdLine)
576 HHInfo *pHHInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HHInfo));
578 pHHInfo->pHHWinType = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HH_WINTYPEW));
579 pHHInfo->pCHMInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(CHMInfo));
580 pHHInfo->pWBInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(WBInfo));
581 pHHInfo->hInstance = hInstance;
582 pHHInfo->szCmdLine = szCmdLine;
587 static void HH_Close(HHInfo *pHHInfo)
592 /* Free allocated strings */
593 if (pHHInfo->pHHWinType)
595 HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszType);
596 HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszCaption);
597 HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszToc);
598 HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszType);
599 HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszIndex);
600 HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszFile);
601 HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszHome);
602 HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszJump1);
603 HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszJump2);
604 HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszUrlJump1);
605 HeapFree(GetProcessHeap(), 0, (LPWSTR)pHHInfo->pHHWinType->pszUrlJump2);
608 HeapFree(GetProcessHeap(), 0, pHHInfo->pHHWinType);
609 HeapFree(GetProcessHeap(), 0, pHHInfo->szCmdLine);
611 if (pHHInfo->pCHMInfo)
613 CHM_CloseCHM(pHHInfo->pCHMInfo);
614 HeapFree(GetProcessHeap(), 0, pHHInfo->pCHMInfo);
617 if (pHHInfo->pWBInfo)
619 WB_UnEmbedBrowser(pHHInfo->pWBInfo);
620 HeapFree(GetProcessHeap(), 0, pHHInfo->pWBInfo);
624 static void HH_OpenDefaultTopic(HHInfo *pHHInfo)
627 LPCWSTR defTopic = pHHInfo->pHHWinType->pszFile;
629 CHM_CreateITSUrl(pHHInfo->pCHMInfo, defTopic, url);
630 WB_Navigate(pHHInfo->pWBInfo, url);
633 static BOOL HH_OpenCHM(HHInfo *pHHInfo)
635 if (!CHM_OpenCHM(pHHInfo->pCHMInfo, pHHInfo->szCmdLine))
638 if (!CHM_LoadWinTypeFromCHM(pHHInfo->pCHMInfo, pHHInfo->pHHWinType))
644 /* FIXME: Check szCmdLine for bad arguments */
645 int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
650 if (OleInitialize(NULL) != S_OK)
653 pHHInfo = HH_OpenHH(hInstance, HH_ANSIToUnicode(szCmdLine));
654 if (!pHHInfo || !HH_OpenCHM(pHHInfo) || !HH_CreateViewer(pHHInfo))
660 HH_OpenDefaultTopic(pHHInfo);
662 while (GetMessageW(&msg, 0, 0, 0))
664 TranslateMessage(&msg);
665 DispatchMessageW(&msg);
669 HeapFree(GetProcessHeap(), 0, pHHInfo);