ReactOS  0.4.15-dev-5130-gc1c1279
help.c
Go to the documentation of this file.
1 /*
2  * Help Viewer Implementation
3  *
4  * Copyright 2005 James Hawkins
5  * Copyright 2007 Jacek Caban for CodeWeavers
6  * Copyright 2011 Owen Rudge for CodeWeavers
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21  */
22 
23 #include "hhctrl.h"
24 
25 #include "wingdi.h"
26 #include "commctrl.h"
27 #include "wininet.h"
28 
29 #include "wine/debug.h"
30 
31 #include "resource.h"
32 
34 
36 static void ExpandContract(HHInfo *pHHInfo);
37 
38 /* Window type defaults */
39 
40 #define WINTYPE_DEFAULT_X 280
41 #define WINTYPE_DEFAULT_Y 100
42 #define WINTYPE_DEFAULT_WIDTH 740
43 #define WINTYPE_DEFAULT_HEIGHT 640
44 #define WINTYPE_DEFAULT_NAVWIDTH 250
45 
46 #define TAB_TOP_PADDING 8
47 #define TAB_RIGHT_PADDING 4
48 #define TAB_MARGIN 8
49 #define EDIT_HEIGHT 20
50 
52 
53 static const WCHAR szEmpty[] = {0};
54 
56  const char *html_code;
58 };
59 
60 /*
61  * Table mapping the conversion between HTML encoded symbols and their ANSI code page equivalent.
62  * Note: Add additional entries in proper alphabetical order (a binary search is used on this table).
63  */
65 {
66  {"AElig", 0xC6},
67  {"Aacute", 0xC1},
68  {"Acirc", 0xC2},
69  {"Agrave", 0xC0},
70  {"Aring", 0xC5},
71  {"Atilde", 0xC3},
72  {"Auml", 0xC4},
73  {"Ccedil", 0xC7},
74  {"ETH", 0xD0},
75  {"Eacute", 0xC9},
76  {"Ecirc", 0xCA},
77  {"Egrave", 0xC8},
78  {"Euml", 0xCB},
79  {"Iacute", 0xCD},
80  {"Icirc", 0xCE},
81  {"Igrave", 0xCC},
82  {"Iuml", 0xCF},
83  {"Ntilde", 0xD1},
84  {"Oacute", 0xD3},
85  {"Ocirc", 0xD4},
86  {"Ograve", 0xD2},
87  {"Oslash", 0xD8},
88  {"Otilde", 0xD5},
89  {"Ouml", 0xD6},
90  {"THORN", 0xDE},
91  {"Uacute", 0xDA},
92  {"Ucirc", 0xDB},
93  {"Ugrave", 0xD9},
94  {"Uuml", 0xDC},
95  {"Yacute", 0xDD},
96  {"aacute", 0xE1},
97  {"acirc", 0xE2},
98  {"acute", 0xB4},
99  {"aelig", 0xE6},
100  {"agrave", 0xE0},
101  {"amp", '&'},
102  {"aring", 0xE5},
103  {"atilde", 0xE3},
104  {"auml", 0xE4},
105  {"brvbar", 0xA6},
106  {"ccedil", 0xE7},
107  {"cedil", 0xB8},
108  {"cent", 0xA2},
109  {"copy", 0xA9},
110  {"curren", 0xA4},
111  {"deg", 0xB0},
112  {"divide", 0xF7},
113  {"eacute", 0xE9},
114  {"ecirc", 0xEA},
115  {"egrave", 0xE8},
116  {"eth", 0xF0},
117  {"euml", 0xEB},
118  {"frac12", 0xBD},
119  {"frac14", 0xBC},
120  {"frac34", 0xBE},
121  {"gt", '>'},
122  {"iacute", 0xED},
123  {"icirc", 0xEE},
124  {"iexcl", 0xA1},
125  {"igrave", 0xEC},
126  {"iquest", 0xBF},
127  {"iuml", 0xEF},
128  {"laquo", 0xAB},
129  {"lt", '<'},
130  {"macr", 0xAF},
131  {"micro", 0xB5},
132  {"middot", 0xB7},
133  {"nbsp", ' '},
134  {"not", 0xAC},
135  {"ntilde", 0xF1},
136  {"oacute", 0xF3},
137  {"ocirc", 0xF4},
138  {"ograve", 0xF2},
139  {"ordf", 0xAA},
140  {"ordm", 0xBA},
141  {"oslash", 0xF8},
142  {"otilde", 0xF5},
143  {"ouml", 0xF6},
144  {"para", 0xB6},
145  {"plusmn", 0xB1},
146  {"pound", 0xA3},
147  {"quot", '"'},
148  {"raquo", 0xBB},
149  {"reg", 0xAE},
150  {"sect", 0xA7},
151  {"shy", 0xAD},
152  {"sup1", 0xB9},
153  {"sup2", 0xB2},
154  {"sup3", 0xB3},
155  {"szlig", 0xDF},
156  {"thorn", 0xFE},
157  {"times", 0xD7},
158  {"uacute", 0xFA},
159  {"ucirc", 0xFB},
160  {"ugrave", 0xF9},
161  {"uml", 0xA8},
162  {"uuml", 0xFC},
163  {"yacute", 0xFD},
164  {"yen", 0xA5},
165  {"yuml", 0xFF}
166 };
167 
169 {
170  return ((info->WinType.fsWinProperties & HHWIN_PROP_TRI_PANE) && !info->WinType.fNotExpanded);
171 }
172 
173 /* Loads a string from the resource file */
174 #ifdef __REACTOS__
176 {
177  LPWSTR string = NULL;
178  LPCWSTR stringresource;
179  int iSize;
180 
181  iSize = LoadStringW(hhctrl_hinstance, dwID, (LPWSTR)&stringresource, 0);
182 
183  string = heap_alloc((iSize + 2) * sizeof(WCHAR)); /* some strings (tab text) needs double-null termination */
184  memcpy(string, stringresource, iSize * sizeof(WCHAR));
185  string[iSize] = UNICODE_NULL;
186 
187  return string;
188 }
189 #else
191 {
192  LPWSTR string = NULL;
193  LPCWSTR stringresource;
194  int iSize;
195 
196  iSize = LoadStringW(hhctrl_hinstance, dwID, (LPWSTR)&stringresource, 0);
197 
198  string = heap_alloc((iSize + 2) * sizeof(WCHAR)); /* some strings (tab text) needs double-null termination */
199  memcpy(string, stringresource, iSize*sizeof(WCHAR));
200  string[iSize] = 0;
201 
202  return string;
203 }
204 #endif
205 
207 {
208  VARIANT url;
209  HRESULT hres;
210 
211  TRACE("%s\n", debugstr_w(surl));
212 
213  V_VT(&url) = VT_BSTR;
214  V_BSTR(&url) = SysAllocString(surl);
215 
216  hres = IWebBrowser2_Navigate2(info->web_browser->web_browser, &url, 0, 0, 0, 0);
217 
218  VariantClear(&url);
219 
220  if(FAILED(hres))
221  TRACE("Navigation failed: %08x\n", hres);
222 
223  return hres;
224 }
225 
227 {
228  ChmPath chm_path;
229  BOOL ret;
230  HRESULT hres;
231 
232  static const WCHAR url_indicator[] = {':', '/', '/', 0};
233 
234  TRACE("%s\n", debugstr_w(surl));
235 
236  if (wcsstr(surl, url_indicator)) {
237  hres = navigate_url(info, surl);
238  if(SUCCEEDED(hres))
239  return TRUE;
240  } /* look up in chm if it doesn't look like a full url */
241 
242  SetChmPath(&chm_path, info->pCHMInfo->szFile, surl);
243  ret = NavigateToChm(info, chm_path.chm_file, chm_path.chm_index);
244 
245  heap_free(chm_path.chm_file);
246  heap_free(chm_path.chm_index);
247 
248  return ret;
249 }
250 
252 {
253  static const WCHAR url_format[] =
254  {'m','k',':','@','M','S','I','T','S','t','o','r','e',':','%','s',':',':','%','s','%','s',0};
255  static const WCHAR slash[] = {'/',0};
256  static const WCHAR empty[] = {0};
257  WCHAR full_path[MAX_PATH];
258 
259  TRACE("%s %p %s\n", debugstr_w(file), buf, debugstr_w(index));
260 
261  if (!GetFullPathNameW(file, ARRAY_SIZE(full_path), full_path, NULL)) {
262  WARN("GetFullPathName failed: %u\n", GetLastError());
263  return FALSE;
264  }
265 
266  wsprintfW(buf, url_format, full_path, (!index || index[0] == '/') ? empty : slash, index);
267  return TRUE;
268 }
269 
271 {
273 
274  TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index));
275 
276  if ((!info->web_browser) || !AppendFullPathURL(file, buf, index))
277  return FALSE;
278 
279  return SUCCEEDED(navigate_url(info, buf));
280 }
281 
282 static void DoSync(HHInfo *info)
283 {
285  HRESULT hres;
286  BSTR url;
287 
288  hres = IWebBrowser2_get_LocationURL(info->web_browser->web_browser, &url);
289 
290  if (FAILED(hres))
291  {
292  WARN("get_LocationURL failed: %08x\n", hres);
293  return;
294  }
295 
296  /* If we're not currently viewing a page in the active .chm file, abort */
297  if ((!AppendFullPathURL(info->WinType.pszFile, buf, NULL)) || (lstrlenW(buf) > lstrlenW(url)))
298  {
300  return;
301  }
302 
303  if (lstrcmpiW(buf, url) > 0)
304  {
305  static const WCHAR delimW[] = {':',':','/',0};
306  const WCHAR *index;
307 
308  index = wcsstr(url, delimW);
309 
310  if (index)
311  ActivateContentTopic(info->tabs[TAB_CONTENTS].hwnd, index + 3, info->content); /* skip over ::/ */
312  }
313 
315 }
316 
317 /* Size Bar */
318 
319 #define SIZEBAR_WIDTH 4
320 
321 static const WCHAR szSizeBarClass[] = {
322  'H','H',' ','S','i','z','e','B','a','r',0
323 };
324 
325 /* Draw the SizeBar */
326 static void SB_OnPaint(HWND hWnd)
327 {
328  PAINTSTRUCT ps;
329  HDC hdc;
330  RECT rc;
331 
332  hdc = BeginPaint(hWnd, &ps);
333 
334  GetClientRect(hWnd, &rc);
335 
336  /* dark frame */
337  rc.right += 1;
338  rc.bottom -= 1;
340 
341  /* white highlight */
343  MoveToEx(hdc, rc.right, 1, NULL);
344  LineTo(hdc, 1, 1);
345  LineTo(hdc, 1, rc.bottom - 1);
346 
347 
348  MoveToEx(hdc, 0, rc.bottom, NULL);
349  LineTo(hdc, rc.right, rc.bottom);
350 
351  EndPaint(hWnd, &ps);
352 }
353 
355 {
356  SetCapture(hWnd);
357 }
358 
360 {
361  HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
362  POINT pt;
363 
364  pt.x = (short)LOWORD(lParam);
365  pt.y = (short)HIWORD(lParam);
366 
367  /* update the window sizes */
368  pHHInfo->WinType.iNavWidth += pt.x;
369  Help_OnSize(hWnd);
370 
371  ReleaseCapture();
372 }
373 
375 {
376  /* ignore WM_MOUSEMOVE if not dragging the SizeBar */
377  if (!(wParam & MK_LBUTTON))
378  return;
379 }
380 
382 {
383  switch (message)
384  {
385  case WM_LBUTTONDOWN:
387  break;
388  case WM_LBUTTONUP:
390  break;
391  case WM_MOUSEMOVE:
393  break;
394  case WM_PAINT:
395  SB_OnPaint(hWnd);
396  break;
397  default:
399  }
400 
401  return 0;
402 }
403 
404 static void HH_RegisterSizeBarClass(HHInfo *pHHInfo)
405 {
406  WNDCLASSEXW wcex;
407 
408  wcex.cbSize = sizeof(WNDCLASSEXW);
409  wcex.style = 0;
411  wcex.cbClsExtra = 0;
412  wcex.cbWndExtra = sizeof(LONG_PTR);
416  wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
417  wcex.lpszMenuName = NULL;
420 
421  RegisterClassExW(&wcex);
422 }
423 
424 static void SB_GetSizeBarRect(HHInfo *info, RECT *rc)
425 {
426  RECT rectWND, rectTB, rectNP;
427 
428  GetClientRect(info->WinType.hwndHelp, &rectWND);
429  GetClientRect(info->WinType.hwndToolBar, &rectTB);
430  GetClientRect(info->WinType.hwndNavigation, &rectNP);
431 
432  SetRect(rc, rectNP.right, rectTB.bottom, SIZEBAR_WIDTH, rectWND.bottom - rectTB.bottom);
433 }
434 
435 static BOOL HH_AddSizeBar(HHInfo *pHHInfo)
436 {
437  HWND hWnd;
438  HWND hwndParent = pHHInfo->WinType.hwndHelp;
439  DWORD dwStyles = WS_CHILDWINDOW | WS_OVERLAPPED;
441  RECT rc;
442 
443  if (navigation_visible(pHHInfo))
444  dwStyles |= WS_VISIBLE;
445 
446  SB_GetSizeBarRect(pHHInfo, &rc);
447 
448  hWnd = CreateWindowExW(dwExStyles, szSizeBarClass, szEmpty, dwStyles,
449  rc.left, rc.top, rc.right, rc.bottom,
451  if (!hWnd)
452  return FALSE;
453 
454  /* store the pointer to the HH info struct */
455  SetWindowLongPtrW(hWnd, 0, (LONG_PTR)pHHInfo);
456 
457  pHHInfo->hwndSizeBar = hWnd;
458  return TRUE;
459 }
460 
461 /* Child Window */
462 
463 static const WCHAR szChildClass[] = {
464  'H','H',' ','C','h','i','l','d',0
465 };
466 
468 {
469  PAINTSTRUCT ps;
470  HDC hdc;
471  RECT rc;
472 
473  hdc = BeginPaint(hWnd, &ps);
474 
475  /* Only paint the Navigation pane, identified by the fact
476  * that it has a child window
477  */
478  if (GetWindow(hWnd, GW_CHILD))
479  {
480  GetClientRect(hWnd, &rc);
481 
482  /* set the border color */
483  SelectObject(hdc, GetStockObject(DC_PEN));
485 
486  /* Draw the top border */
487  LineTo(hdc, rc.right, 0);
488 
490  MoveToEx(hdc, 0, 1, NULL);
491  LineTo(hdc, rc.right, 1);
492  }
493 
494  EndPaint(hWnd, &ps);
495 
496  return 0;
497 }
498 
499 static void ResizeTabChild(HHInfo *info, int tab)
500 {
501  HWND hwnd = info->tabs[tab].hwnd;
502  INT width, height;
503  RECT rect, tabrc;
504  DWORD cnt;
505 
506  GetClientRect(info->WinType.hwndNavigation, &rect);
507  SendMessageW(info->hwndTabCtrl, TCM_GETITEMRECT, 0, (LPARAM)&tabrc);
508  cnt = SendMessageW(info->hwndTabCtrl, TCM_GETROWCOUNT, 0, 0);
509 
510  rect.left = TAB_MARGIN;
511  rect.top = TAB_TOP_PADDING + cnt*(tabrc.bottom-tabrc.top) + TAB_MARGIN;
512  rect.right -= TAB_RIGHT_PADDING + TAB_MARGIN;
513  rect.bottom -= TAB_MARGIN;
514  width = rect.right-rect.left;
515  height = rect.bottom-rect.top;
516 
517  SetWindowPos(hwnd, NULL, rect.left, rect.top, width, height,
519 
520  switch (tab)
521  {
522  case TAB_INDEX: {
523  int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
524  int border_width = GetSystemMetrics(SM_CXBORDER);
525  int edge_width = GetSystemMetrics(SM_CXEDGE);
526 
527  /* Resize the tab widget column to perfectly fit the tab window and
528  * leave sufficient space for the scroll widget.
529  */
531  width-scroll_width-2*border_width-2*edge_width);
532 
533  break;
534  }
535  case TAB_SEARCH: {
536  int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
537  int border_width = GetSystemMetrics(SM_CXBORDER);
538  int edge_width = GetSystemMetrics(SM_CXEDGE);
539  int top_pos = 0;
540 
541  SetWindowPos(info->search.hwndEdit, NULL, 0, top_pos, width,
543  top_pos += EDIT_HEIGHT + TAB_MARGIN;
544  SetWindowPos(info->search.hwndList, NULL, 0, top_pos, width,
545  height-top_pos, SWP_NOZORDER | SWP_NOACTIVATE);
546  /* Resize the tab widget column to perfectly fit the tab window and
547  * leave sufficient space for the scroll widget.
548  */
549  SendMessageW(info->search.hwndList, LVM_SETCOLUMNWIDTH, 0,
550  width-scroll_width-2*border_width-2*edge_width);
551 
552  break;
553  }
554  }
555 }
556 
558 {
560  RECT rect;
561 
562  if(!info || hwnd != info->WinType.hwndNavigation)
563  return 0;
564 
566  SetWindowPos(info->hwndTabCtrl, HWND_TOP, 0, 0,
567  rect.right - TAB_RIGHT_PADDING,
568  rect.bottom - TAB_TOP_PADDING, SWP_NOMOVE);
569 
573  return 0;
574 }
575 
577 {
579  int tab_id, tab_index, i;
580 
581  TRACE("%p\n", hwnd);
582 
583  if (!info)
584  return 0;
585 
586  if(info->tabs[info->current_tab].hwnd)
587  ShowWindow(info->tabs[info->current_tab].hwnd, SW_HIDE);
588 
589  tab_id = (int) SendMessageW(info->hwndTabCtrl, TCM_GETCURSEL, 0, 0);
590  /* convert the ID of the tab to an index in our tab list */
591  tab_index = -1;
592  for (i=0; i<TAB_NUMTABS; i++)
593  {
594  if (info->tabs[i].id == tab_id)
595  {
596  tab_index = i;
597  break;
598  }
599  }
600  if (tab_index == -1)
601  {
602  FIXME("Tab ID %d does not correspond to a valid index in the tab list.\n", tab_id);
603  return 0;
604  }
605  info->current_tab = tab_index;
606 
607  if(info->tabs[info->current_tab].hwnd)
608  ShowWindow(info->tabs[info->current_tab].hwnd, SW_SHOW);
609 
610  return 0;
611 }
612 
613 static LRESULT OnTopicChange(HHInfo *info, void *user_data)
614 {
615  LPCWSTR chmfile = NULL, name = NULL, local = NULL;
616  ContentItem *citer;
617  SearchItem *siter;
618  IndexItem *iiter;
619 
620  if(!user_data || !info)
621  return 0;
622 
623  switch (info->current_tab)
624  {
625  case TAB_CONTENTS:
626  citer = (ContentItem *) user_data;
627  name = citer->name;
628  local = citer->local;
629  while(citer) {
630  if(citer->merge.chm_file) {
631  chmfile = citer->merge.chm_file;
632  break;
633  }
634  citer = citer->parent;
635  }
636  break;
637  case TAB_INDEX:
638  iiter = (IndexItem *) user_data;
639  if(iiter->nItems == 0) {
640  FIXME("No entries for this item!\n");
641  return 0;
642  }
643  if(iiter->nItems > 1) {
644  int i = 0;
645  LVITEMW lvi;
646 
647  SendMessageW(info->popup.hwndList, LVM_DELETEALLITEMS, 0, 0);
648  for(i=0;i<iiter->nItems;i++) {
649  IndexSubItem *item = &iiter->items[i];
650  WCHAR *name = iiter->keyword;
651 
652  if(!item->name)
653  item->name = GetDocumentTitle(info->pCHMInfo, item->local);
654  if(item->name)
655  name = item->name;
656  memset(&lvi, 0, sizeof(lvi));
657  lvi.iItem = i;
658  lvi.mask = LVIF_TEXT|LVIF_PARAM;
659  lvi.cchTextMax = lstrlenW(name)+1;
660  lvi.pszText = name;
661  lvi.lParam = (LPARAM) item;
662  SendMessageW(info->popup.hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi);
663  }
664  ShowWindow(info->popup.hwndPopup, SW_SHOW);
665  return 0;
666  }
667  name = iiter->items[0].name;
668  local = iiter->items[0].local;
669  chmfile = iiter->merge.chm_file;
670  break;
671  case TAB_SEARCH:
672  siter = (SearchItem *) user_data;
673  name = siter->filename;
674  local = siter->filename;
675  chmfile = info->pCHMInfo->szFile;
676  break;
677  default:
678  FIXME("Unhandled operation for this tab!\n");
679  return 0;
680  }
681 
682  if(!chmfile)
683  {
684  FIXME("No help file found for this item!\n");
685  return 0;
686  }
687 
688  TRACE("name %s loal %s\n", debugstr_w(name), debugstr_w(local));
689 
690  NavigateToChm(info, chmfile, local);
691  return 0;
692 }
693 
694 /* Capture the Enter/Return key and send it up to Child_WndProc as an NM_RETURN message */
696 {
698 
699  if(message == WM_KEYUP && wParam == VK_RETURN)
700  {
701  NMHDR nmhdr;
702 
703  nmhdr.hwndFrom = hWnd;
704  nmhdr.code = NM_RETURN;
706  }
707  return editWndProc(hWnd, message, wParam, lParam);
708 }
709 
711 {
712  switch (message)
713  {
714  case WM_PAINT:
715  return Child_OnPaint(hWnd);
716  case WM_SIZE:
717  return Child_OnSize(hWnd);
718  case WM_NOTIFY: {
720  NMHDR *nmhdr = (NMHDR*)lParam;
721 
722  switch(nmhdr->code) {
723  case TCN_SELCHANGE:
724  return OnTabChange(hWnd);
725  case TVN_SELCHANGEDW:
726  return OnTopicChange(info, (void*)((NMTREEVIEWW *)lParam)->itemNew.lParam);
727  case TVN_ITEMEXPANDINGW: {
728  TVITEMW *item = &((NMTREEVIEWW *)lParam)->itemNew;
729  HWND hwndTreeView = info->tabs[TAB_CONTENTS].hwnd;
730 
732  if (item->state & TVIS_EXPANDED)
733  {
734  item->iImage = HHTV_FOLDER;
735  item->iSelectedImage = HHTV_FOLDER;
736  }
737  else
738  {
739  item->iImage = HHTV_OPENFOLDER;
740  item->iSelectedImage = HHTV_OPENFOLDER;
741  }
743  return 0;
744  }
745  case NM_DBLCLK:
746  if(!info)
747  return 0;
748  switch(info->current_tab)
749  {
750  case TAB_INDEX:
751  return OnTopicChange(info, (void*)((NMITEMACTIVATE *)lParam)->lParam);
752  case TAB_SEARCH:
753  return OnTopicChange(info, (void*)((NMITEMACTIVATE *)lParam)->lParam);
754  }
755  break;
756  case NM_RETURN:
757  if(!info)
758  return 0;
759  switch(info->current_tab) {
760  case TAB_INDEX: {
761  HWND hwndList = info->tabs[TAB_INDEX].hwnd;
762  LVITEMW lvItem;
763 
764  lvItem.iItem = (int) SendMessageW(hwndList, LVM_GETSELECTIONMARK, 0, 0);
765  lvItem.mask = TVIF_PARAM;
766  SendMessageW(hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
767  OnTopicChange(info, (void*) lvItem.lParam);
768  return 0;
769  }
770  case TAB_SEARCH: {
771  if(nmhdr->hwndFrom == info->search.hwndEdit) {
772  char needle[100];
773  DWORD i, len;
774 
775  len = GetWindowTextA(info->search.hwndEdit, needle, sizeof(needle));
776  if(!len)
777  {
778  FIXME("Unable to get search text.\n");
779  return 0;
780  }
781  /* Convert the requested text for comparison later against the
782  * lower case version of HTML file contents.
783  */
784  for(i=0;i<len;i++)
785  needle[i] = tolower(needle[i]);
786  InitSearch(info, needle);
787  return 0;
788  }else if(nmhdr->hwndFrom == info->search.hwndList) {
789  HWND hwndList = info->search.hwndList;
790  LVITEMW lvItem;
791 
792  lvItem.iItem = (int) SendMessageW(hwndList, LVM_GETSELECTIONMARK, 0, 0);
793  lvItem.mask = TVIF_PARAM;
794  SendMessageW(hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
795  OnTopicChange(info, (void*) lvItem.lParam);
796  return 0;
797  }
798  break;
799  }
800  }
801  break;
802  }
803  break;
804  }
805  default:
807  }
808 
809  return 0;
810 }
811 
812 static void HH_RegisterChildWndClass(HHInfo *pHHInfo)
813 {
814  WNDCLASSEXW wcex;
815 
816  wcex.cbSize = sizeof(WNDCLASSEXW);
817  wcex.style = 0;
818  wcex.lpfnWndProc = Child_WndProc;
819  wcex.cbClsExtra = 0;
820  wcex.cbWndExtra = sizeof(LONG_PTR);
824  wcex.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
825  wcex.lpszMenuName = NULL;
828 
829  RegisterClassExW(&wcex);
830 }
831 
832 /* Toolbar */
833 
834 #define ICON_SIZE 20
835 
837 {
838  HMENU menu, submenu;
841  POINT coords;
842  RECT rect;
843  DWORD index;
844 
846 
847  if (!menu)
848  return;
849 
850  submenu = GetSubMenu(menu, 0);
851 
852  /* Update the Show/Hide menu item */
853  item.cbSize = sizeof(MENUITEMINFOW);
855  item.fType = MFT_STRING;
856  item.fState = MF_ENABLED;
857 
858  if (info->WinType.fNotExpanded)
859  item.dwTypeData = HH_LoadString(IDS_SHOWTABS);
860  else
861  item.dwTypeData = HH_LoadString(IDS_HIDETABS);
862 
863  SetMenuItemInfoW(submenu, IDTB_EXPAND, FALSE, &item);
864  heap_free(item.dwTypeData);
865 
866  /* Find the index toolbar button */
867  button.cbSize = sizeof(TBBUTTONINFOW);
868  button.dwMask = TBIF_COMMAND;
869  index = SendMessageW(info->WinType.hwndToolBar, TB_GETBUTTONINFOW, IDTB_OPTIONS, (LPARAM) &button);
870 
871  if (index == -1)
872  return;
873 
874  /* Get position */
875  SendMessageW(info->WinType.hwndToolBar, TB_GETITEMRECT, index, (LPARAM) &rect);
876 
877  coords.x = rect.left;
878  coords.y = rect.bottom;
879 
880  ClientToScreen(info->WinType.hwndToolBar, &coords);
881  TrackPopupMenu(submenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_NOANIMATION, coords.x, coords.y, 0, info->WinType.hwndHelp, NULL);
882 }
883 
884 static void TB_OnClick(HWND hWnd, DWORD dwID)
885 {
887 
888  switch (dwID)
889  {
890  case IDTB_STOP:
891  DoPageAction(info->web_browser, WB_STOP);
892  break;
893  case IDTB_REFRESH:
894  DoPageAction(info->web_browser, WB_REFRESH);
895  break;
896  case IDTB_BACK:
897  DoPageAction(info->web_browser, WB_GOBACK);
898  break;
899  case IDTB_HOME:
900  NavigateToChm(info, info->pCHMInfo->szFile, info->WinType.pszHome);
901  break;
902  case IDTB_FORWARD:
903  DoPageAction(info->web_browser, WB_GOFORWARD);
904  break;
905  case IDTB_PRINT:
906  DoPageAction(info->web_browser, WB_PRINT);
907  break;
908  case IDTB_EXPAND:
909  case IDTB_CONTRACT:
911  break;
912  case IDTB_SYNC:
913  DoSync(info);
914  break;
915  case IDTB_OPTIONS:
917  break;
918  case IDTB_NOTES:
919  case IDTB_CONTENTS:
920  case IDTB_INDEX:
921  case IDTB_SEARCH:
922  case IDTB_HISTORY:
923  case IDTB_FAVORITES:
924  /* These are officially unimplemented as of the Windows 7 SDK */
925  break;
926  case IDTB_BROWSE_FWD:
927  case IDTB_BROWSE_BACK:
928  case IDTB_JUMP1:
929  case IDTB_JUMP2:
930  case IDTB_CUSTOMIZE:
931  case IDTB_ZOOM:
932  case IDTB_TOC_NEXT:
933  case IDTB_TOC_PREV:
934  break;
935  }
936 }
937 
938 static void TB_AddButton(TBBUTTON *pButtons, DWORD dwIndex, DWORD dwID, DWORD dwBitmap)
939 {
940  pButtons[dwIndex].iBitmap = dwBitmap;
941  pButtons[dwIndex].idCommand = dwID;
942  pButtons[dwIndex].fsState = TBSTATE_ENABLED;
943  pButtons[dwIndex].fsStyle = BTNS_BUTTON;
944  pButtons[dwIndex].dwData = 0;
945  pButtons[dwIndex].iString = 0;
946 }
947 
948 static void TB_AddButtonsFromFlags(HHInfo *pHHInfo, TBBUTTON *pButtons, DWORD dwButtonFlags, LPDWORD pdwNumButtons)
949 {
950  int nHistBitmaps = 0, nStdBitmaps = 0, nHHBitmaps = 0;
951  HWND hToolbar = pHHInfo->WinType.hwndToolBar;
952  TBADDBITMAP tbAB;
953  DWORD unsupported;
954 
955  /* Common bitmaps */
956  tbAB.hInst = HINST_COMMCTRL;
957  tbAB.nID = IDB_HIST_LARGE_COLOR;
958  nHistBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&tbAB);
959  tbAB.nID = IDB_STD_LARGE_COLOR;
960  nStdBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&tbAB);
961  /* hhctrl.ocx bitmaps */
962  tbAB.hInst = hhctrl_hinstance;
963  tbAB.nID = IDB_HHTOOLBAR;
964  nHHBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, HHTB_NUMBITMAPS, (LPARAM)&tbAB);
965 
966  *pdwNumButtons = 0;
967 
968  unsupported = dwButtonFlags & (HHWIN_BUTTON_BROWSE_FWD |
973  if (unsupported)
974  FIXME("got asked for unsupported buttons: %06x\n", unsupported);
975 
976  if (dwButtonFlags & HHWIN_BUTTON_EXPAND)
977  {
978  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_EXPAND, nHHBitmaps + HHTB_EXPAND);
979  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_CONTRACT, nHHBitmaps + HHTB_CONTRACT);
980 
981  if (pHHInfo->WinType.fNotExpanded)
982  pButtons[1].fsState |= TBSTATE_HIDDEN;
983  else
984  pButtons[0].fsState |= TBSTATE_HIDDEN;
985  }
986 
987  if (dwButtonFlags & HHWIN_BUTTON_BACK)
988  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_BACK, nHistBitmaps + HIST_BACK);
989 
990  if (dwButtonFlags & HHWIN_BUTTON_FORWARD)
991  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_FORWARD, nHistBitmaps + HIST_FORWARD);
992 
993  if (dwButtonFlags & HHWIN_BUTTON_STOP)
994  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_STOP, nHHBitmaps + HHTB_STOP);
995 
996  if (dwButtonFlags & HHWIN_BUTTON_REFRESH)
997  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_REFRESH, nHHBitmaps + HHTB_REFRESH);
998 
999  if (dwButtonFlags & HHWIN_BUTTON_HOME)
1000  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_HOME, nHHBitmaps + HHTB_HOME);
1001 
1002  if (dwButtonFlags & HHWIN_BUTTON_SYNC)
1003  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_SYNC, nHHBitmaps + HHTB_SYNC);
1004 
1005  if (dwButtonFlags & HHWIN_BUTTON_OPTIONS)
1006  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_OPTIONS, nStdBitmaps + STD_PROPERTIES);
1007 
1008  if (dwButtonFlags & HHWIN_BUTTON_PRINT)
1009  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_PRINT, nStdBitmaps + STD_PRINT);
1010 }
1011 
1012 static BOOL HH_AddToolbar(HHInfo *pHHInfo)
1013 {
1014  HWND hToolbar;
1015  HWND hwndParent = pHHInfo->WinType.hwndHelp;
1016  DWORD toolbarFlags;
1018  DWORD dwStyles, dwExStyles;
1019  DWORD dwNumButtons, dwIndex;
1020 
1022  toolbarFlags = pHHInfo->WinType.fsToolBarFlags;
1023  else
1024  toolbarFlags = HHWIN_DEF_BUTTONS;
1025 
1028 
1029  hToolbar = CreateWindowExW(dwExStyles, TOOLBARCLASSNAMEW, NULL, dwStyles,
1030  0, 0, 0, 0, hwndParent, NULL,
1032  if (!hToolbar)
1033  return FALSE;
1034  pHHInfo->WinType.hwndToolBar = hToolbar;
1035 
1037  SendMessageW(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
1038  SendMessageW(hToolbar, WM_SETFONT, (WPARAM)pHHInfo->hFont, TRUE);
1039 
1040  TB_AddButtonsFromFlags(pHHInfo, buttons, toolbarFlags, &dwNumButtons);
1041 
1042  for (dwIndex = 0; dwIndex < dwNumButtons; dwIndex++)
1043  {
1044  LPWSTR szBuf = HH_LoadString(buttons[dwIndex].idCommand);
1045  DWORD dwLen = lstrlenW(szBuf);
1046  szBuf[dwLen + 1] = 0; /* Double-null terminate */
1047 
1048  buttons[dwIndex].iString = (DWORD)SendMessageW(hToolbar, TB_ADDSTRINGW, 0, (LPARAM)szBuf);
1049  heap_free(szBuf);
1050  }
1051 
1052  SendMessageW(hToolbar, TB_ADDBUTTONSW, dwNumButtons, (LPARAM)buttons);
1053  SendMessageW(hToolbar, TB_AUTOSIZE, 0, 0);
1055  ShowWindow(hToolbar, SW_SHOW);
1056 
1057  return TRUE;
1058 }
1059 
1060 /* Navigation Pane */
1061 
1062 static void NP_GetNavigationRect(HHInfo *pHHInfo, RECT *rc)
1063 {
1064  HWND hwndParent = pHHInfo->WinType.hwndHelp;
1065  HWND hwndToolbar = pHHInfo->WinType.hwndToolBar;
1066  RECT rectWND, rectTB;
1067 
1068  GetClientRect(hwndParent, &rectWND);
1069  GetClientRect(hwndToolbar, &rectTB);
1070 
1071  rc->left = 0;
1072  rc->top = rectTB.bottom;
1073  rc->bottom = rectWND.bottom - rectTB.bottom;
1074 
1075  if (!(pHHInfo->WinType.fsValidMembers & HHWIN_PARAM_NAV_WIDTH) &&
1076  pHHInfo->WinType.iNavWidth == 0)
1077  {
1079  }
1080 
1081  rc->right = pHHInfo->WinType.iNavWidth;
1082 }
1083 
1085 {
1086  TCITEMW tie;
1087  LPWSTR tabText = HH_LoadString(index);
1088  DWORD ret;
1089 
1090  tie.mask = TCIF_TEXT;
1091  tie.pszText = tabText;
1092 
1093  ret = SendMessageW( hwndTabCtrl, TCM_INSERTITEMW, index, (LPARAM)&tie );
1094 
1095  heap_free(tabText);
1096  return ret;
1097 }
1098 
1100 {
1101  HWND hWnd, hwndTabCtrl;
1102  HWND hwndParent = info->WinType.hwndHelp;
1103  DWORD dwStyles = WS_CHILDWINDOW;
1105  RECT rc;
1106 
1107  if (navigation_visible(info))
1108  dwStyles |= WS_VISIBLE;
1109 
1110  NP_GetNavigationRect(info, &rc);
1111 
1112  hWnd = CreateWindowExW(dwExStyles, szChildClass, szEmpty, dwStyles,
1113  rc.left, rc.top, rc.right, rc.bottom,
1115  if (!hWnd)
1116  return FALSE;
1117 
1119 
1120  hwndTabCtrl = CreateWindowExW(dwExStyles, WC_TABCONTROLW, szEmpty, dwStyles | WS_VISIBLE,
1121  0, TAB_TOP_PADDING,
1122  rc.right - TAB_RIGHT_PADDING,
1123  rc.bottom - TAB_TOP_PADDING,
1125  if (!hwndTabCtrl)
1126  return FALSE;
1127 
1128  if (*info->WinType.pszToc)
1129  info->tabs[TAB_CONTENTS].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_CONTENTS);
1130 
1131  if (*info->WinType.pszIndex)
1132  info->tabs[TAB_INDEX].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_INDEX);
1133 
1134  if (info->WinType.fsWinProperties & HHWIN_PROP_TAB_SEARCH)
1135  info->tabs[TAB_SEARCH].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_SEARCH);
1136 
1137  if (info->WinType.fsWinProperties & HHWIN_PROP_TAB_FAVORITES)
1138  info->tabs[TAB_FAVORITES].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_FAVORITES);
1139 
1140  SendMessageW(hwndTabCtrl, WM_SETFONT, (WPARAM)info->hFont, TRUE);
1141 
1142  info->hwndTabCtrl = hwndTabCtrl;
1143  info->WinType.hwndNavigation = hWnd;
1144  return TRUE;
1145 }
1146 
1147 /* HTML Pane */
1148 
1149 static void HP_GetHTMLRect(HHInfo *info, RECT *rc)
1150 {
1151  RECT rectTB, rectWND, rectNP, rectSB;
1152 
1153  GetClientRect(info->WinType.hwndHelp, &rectWND);
1154  GetClientRect(info->hwndSizeBar, &rectSB);
1155 
1156  rc->left = 0;
1157  rc->top = 0;
1158  if (navigation_visible(info))
1159  {
1160  GetClientRect(info->WinType.hwndNavigation, &rectNP);
1161  rc->left += rectNP.right + rectSB.right;
1162  }
1163  if (info->WinType.fsWinProperties & HHWIN_PROP_TRI_PANE)
1164  {
1165  GetClientRect(info->WinType.hwndToolBar, &rectTB);
1166  rc->top += rectTB.bottom;
1167  }
1168  rc->right = rectWND.right - rc->left;
1169  rc->bottom = rectWND.bottom - rc->top;
1170 }
1171 
1172 static BOOL HH_AddHTMLPane(HHInfo *pHHInfo)
1173 {
1174  HWND hWnd;
1175  HWND hwndParent = pHHInfo->WinType.hwndHelp;
1178  RECT rc;
1179 
1180  HP_GetHTMLRect(pHHInfo, &rc);
1181 
1182  hWnd = CreateWindowExW(dwExStyles, szChildClass, szEmpty, dwStyles,
1183  rc.left, rc.top, rc.right, rc.bottom,
1185  if (!hWnd)
1186  return FALSE;
1187 
1188  if (!InitWebBrowser(pHHInfo, hWnd))
1189  return FALSE;
1190 
1191  /* store the pointer to the HH info struct */
1192  SetWindowLongPtrW(hWnd, 0, (LONG_PTR)pHHInfo);
1193 
1195  UpdateWindow(hWnd);
1196 
1197  pHHInfo->WinType.hwndHTML = hWnd;
1198  return TRUE;
1199 }
1200 
1202 {
1203  HIMAGELIST hImageList;
1204  HBITMAP hBitmap;
1205  HWND hWnd;
1206 
1207  if(info->tabs[TAB_CONTENTS].id == -1)
1208  return TRUE; /* No "Contents" tab */
1210  | TVS_SHOWSELALWAYS | TVS_HASBUTTONS, 50, 50, 100, 100,
1211  info->WinType.hwndNavigation, NULL, hhctrl_hinstance, NULL);
1212  if(!hWnd) {
1213  ERR("Could not create treeview control\n");
1214  return FALSE;
1215  }
1216 
1217  hImageList = ImageList_Create(16, 16, ILC_COLOR32, 0, HHTV_NUMBITMAPS);
1219  ImageList_Add(hImageList, hBitmap, NULL);
1221 
1222  info->contents.hImageList = hImageList;
1223  info->tabs[TAB_CONTENTS].hwnd = hWnd;
1226 
1227  return TRUE;
1228 }
1229 
1231 {
1232  char hidden_column[] = "Column";
1233  LVCOLUMNA lvc;
1234 
1235  if(info->tabs[TAB_INDEX].id == -1)
1236  return TRUE; /* No "Index" tab */
1239  info->WinType.hwndNavigation, NULL, hhctrl_hinstance, NULL);
1240  if(!info->tabs[TAB_INDEX].hwnd) {
1241  ERR("Could not create ListView control\n");
1242  return FALSE;
1243  }
1244  memset(&lvc, 0, sizeof(lvc));
1245  lvc.mask = LVCF_TEXT;
1246  lvc.pszText = hidden_column;
1247  if(SendMessageW(info->tabs[TAB_INDEX].hwnd, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1248  {
1249  ERR("Could not create ListView column\n");
1250  return FALSE;
1251  }
1252 
1254  ShowWindow(info->tabs[TAB_INDEX].hwnd, SW_HIDE);
1255 
1256  return TRUE;
1257 }
1258 
1260 {
1261  HWND hwndList, hwndEdit, hwndContainer;
1262  char hidden_column[] = "Column";
1263  WNDPROC editWndProc;
1264  LVCOLUMNA lvc;
1265 
1266  if(info->tabs[TAB_SEARCH].id == -1)
1267  return TRUE; /* No "Search" tab */
1269  WS_CHILD, 0, 0, 0, 0, info->WinType.hwndNavigation,
1271  if(!hwndContainer) {
1272  ERR("Could not create search window container control.\n");
1273  return FALSE;
1274  }
1276  | WS_VISIBLE | ES_LEFT | SS_NOTIFY, 0, 0, 0, 0,
1277  hwndContainer, NULL, hhctrl_hinstance, NULL);
1278  if(!hwndEdit) {
1279  ERR("Could not create search ListView control.\n");
1280  return FALSE;
1281  }
1282  if(SendMessageW(hwndEdit, WM_SETFONT, (WPARAM) info->hFont, (LPARAM) FALSE) == -1)
1283  {
1284  ERR("Could not set font for edit control.\n");
1285  return FALSE;
1286  }
1288  if(!editWndProc) {
1289  ERR("Could not redirect messages for edit control.\n");
1290  return FALSE;
1291  }
1295  | LVS_REPORT | LVS_NOCOLUMNHEADER, 0, 0, 0, 0,
1296  hwndContainer, NULL, hhctrl_hinstance, NULL);
1297  if(!hwndList) {
1298  ERR("Could not create search ListView control.\n");
1299  return FALSE;
1300  }
1301  memset(&lvc, 0, sizeof(lvc));
1302  lvc.mask = LVCF_TEXT;
1303  lvc.pszText = hidden_column;
1304  if(SendMessageW(hwndList, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1305  {
1306  ERR("Could not create ListView column\n");
1307  return FALSE;
1308  }
1309 
1310  info->search.hwndEdit = hwndEdit;
1311  info->search.hwndList = hwndList;
1312  info->search.hwndContainer = hwndContainer;
1313  info->tabs[TAB_SEARCH].hwnd = hwndContainer;
1314 
1315  SetWindowLongPtrW(hwndContainer, 0, (LONG_PTR)info);
1316 
1318 
1319  return TRUE;
1320 }
1321 
1322 /* The Index tab's sub-topic popup */
1323 
1325 {
1326  int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
1327  int border_width = GetSystemMetrics(SM_CXBORDER);
1328  int edge_width = GetSystemMetrics(SM_CXEDGE);
1329  INT width, height;
1330  RECT rect;
1331 
1332  if(!info)
1333  return;
1334 
1335  GetClientRect(info->popup.hwndPopup, &rect);
1336  SetWindowPos(info->popup.hwndCallback, HWND_TOP, 0, 0,
1337  rect.right, rect.bottom, SWP_NOMOVE);
1338 
1339  rect.left = TAB_MARGIN;
1341  rect.right -= TAB_RIGHT_PADDING + TAB_MARGIN;
1342  rect.bottom -= TAB_MARGIN;
1343  width = rect.right-rect.left;
1344  height = rect.bottom-rect.top;
1345 
1346  SetWindowPos(info->popup.hwndList, NULL, rect.left, rect.top, width, height,
1348 
1349  SendMessageW(info->popup.hwndList, LVM_SETCOLUMNWIDTH, 0,
1350  width-scroll_width-2*border_width-2*edge_width);
1351 }
1352 
1354 {
1356 
1357  switch (message)
1358  {
1359  case WM_SIZE:
1361  return 0;
1362  case WM_DESTROY:
1364  return 0;
1365  case WM_CLOSE:
1367  return 0;
1368 
1369  default:
1371  }
1372 
1373  return 0;
1374 }
1375 
1377 {
1378  switch (message)
1379  {
1380  case WM_NOTIFY: {
1381  NMHDR *nmhdr = (NMHDR*)lParam;
1382  switch(nmhdr->code)
1383  {
1384  case NM_DBLCLK: {
1386  IndexSubItem *iter;
1387 
1388  if(info == 0 || lParam == 0)
1389  return 0;
1390  iter = (IndexSubItem*) ((NMITEMACTIVATE *)lParam)->lParam;
1391  if(iter == 0)
1392  return 0;
1393  NavigateToChm(info, info->index->merge.chm_file, iter->local);
1394  ShowWindow(info->popup.hwndPopup, SW_HIDE);
1395  return 0;
1396  }
1397  case NM_RETURN: {
1399  IndexSubItem *iter;
1400  LVITEMW lvItem;
1401 
1402  if(info == 0)
1403  return 0;
1404 
1405  lvItem.iItem = (int) SendMessageW(info->popup.hwndList, LVM_GETSELECTIONMARK, 0, 0);
1406  lvItem.mask = TVIF_PARAM;
1407  SendMessageW(info->popup.hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
1408  iter = (IndexSubItem*) lvItem.lParam;
1409  NavigateToChm(info, info->index->merge.chm_file, iter->local);
1410  ShowWindow(info->popup.hwndPopup, SW_HIDE);
1411  return 0;
1412  }
1413  }
1414  break;
1415  }
1416  default:
1418  }
1419 
1420  return 0;
1421 }
1422 
1424 {
1425  static const WCHAR szPopupChildClass[] = {'H','H',' ','P','o','p','u','p',' ','C','h','i','l','d',0};
1426  static const WCHAR windowCaptionW[] = {'S','e','l','e','c','t',' ','T','o','p','i','c',':',0};
1427  static const WCHAR windowClassW[] = {'H','H',' ','P','o','p','u','p',0};
1428  HWND hwndList, hwndPopup, hwndCallback;
1429  char hidden_column[] = "Column";
1430  WNDCLASSEXW wcex;
1431  LVCOLUMNA lvc;
1432 
1433  if(info->tabs[TAB_INDEX].id == -1)
1434  return TRUE; /* No "Index" tab */
1435 
1436  wcex.cbSize = sizeof(WNDCLASSEXW);
1437  wcex.style = CS_HREDRAW | CS_VREDRAW;
1439  wcex.cbClsExtra = 0;
1440  wcex.cbWndExtra = sizeof(LONG_PTR);
1441  wcex.hInstance = hhctrl_hinstance;
1444  wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
1445  wcex.lpszMenuName = NULL;
1446  wcex.lpszClassName = windowClassW;
1448  RegisterClassExW(&wcex);
1449 
1450  wcex.cbSize = sizeof(WNDCLASSEXW);
1451  wcex.style = 0;
1453  wcex.cbClsExtra = 0;
1454  wcex.cbWndExtra = sizeof(LONG_PTR);
1455  wcex.hInstance = hhctrl_hinstance;
1458  wcex.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1459  wcex.lpszMenuName = NULL;
1460  wcex.lpszClassName = szPopupChildClass;
1462  RegisterClassExW(&wcex);
1463 
1466  windowClassW, windowCaptionW, WS_POPUPWINDOW
1469  CW_USEDEFAULT, 300, 200, info->WinType.hwndHelp,
1471  if (!hwndPopup)
1472  return FALSE;
1473 
1475  szPopupChildClass, szEmpty, WS_CHILDWINDOW | WS_VISIBLE,
1476  0, 0, 0, 0,
1477  hwndPopup, NULL, hhctrl_hinstance, NULL);
1478  if (!hwndCallback)
1479  return FALSE;
1480 
1481  ShowWindow(hwndPopup, SW_HIDE);
1484  | LVS_NOCOLUMNHEADER, 50, 50, 100, 100,
1485  hwndCallback, NULL, hhctrl_hinstance, NULL);
1486  if(!hwndList) {
1487  ERR("Could not create popup ListView control\n");
1488  return FALSE;
1489  }
1490  memset(&lvc, 0, sizeof(lvc));
1491  lvc.mask = LVCF_TEXT;
1492  lvc.pszText = hidden_column;
1493  if(SendMessageW(hwndList, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1494  {
1495  ERR("Could not create popup ListView column\n");
1496  return FALSE;
1497  }
1498 
1499  info->popup.hwndCallback = hwndCallback;
1500  info->popup.hwndPopup = hwndPopup;
1501  info->popup.hwndList = hwndList;
1502  SetWindowLongPtrW(hwndPopup, 0, (LONG_PTR)info);
1503  SetWindowLongPtrW(hwndCallback, 0, (LONG_PTR)info);
1504 
1506  ShowWindow(hwndList, SW_SHOW);
1507 
1508  return TRUE;
1509 }
1510 
1511 /* Viewer Window */
1512 
1513 static void ExpandContract(HHInfo *pHHInfo)
1514 {
1515  RECT r, nav;
1516 
1517  pHHInfo->WinType.fNotExpanded = !pHHInfo->WinType.fNotExpanded;
1518  GetWindowRect(pHHInfo->WinType.hwndHelp, &r);
1519  NP_GetNavigationRect(pHHInfo, &nav);
1520 
1521  /* hide/show both the nav bar and the size bar */
1522  if (pHHInfo->WinType.fNotExpanded)
1523  {
1525  ShowWindow(pHHInfo->hwndSizeBar, SW_HIDE);
1526  r.left = r.left + nav.right;
1527 
1530  }
1531  else
1532  {
1534  ShowWindow(pHHInfo->hwndSizeBar, SW_SHOW);
1535  r.left = r.left - nav.right;
1536 
1539  }
1540 
1541  MoveWindow(pHHInfo->WinType.hwndHelp, r.left, r.top, r.right-r.left, r.bottom-r.top, TRUE);
1542 }
1543 
1545 {
1546  HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
1547  DWORD dwSize;
1548  RECT rc;
1549 
1550  if (!pHHInfo)
1551  return 0;
1552 
1553  if (navigation_visible(pHHInfo))
1554  {
1555  NP_GetNavigationRect(pHHInfo, &rc);
1556  SetWindowPos(pHHInfo->WinType.hwndNavigation, HWND_TOP, 0, 0,
1557  rc.right, rc.bottom, SWP_NOMOVE);
1558 
1559  SB_GetSizeBarRect(pHHInfo, &rc);
1560  SetWindowPos(pHHInfo->hwndSizeBar, HWND_TOP, rc.left, rc.top,
1561  rc.right, rc.bottom, SWP_SHOWWINDOW);
1562 
1563  }
1564 
1565  HP_GetHTMLRect(pHHInfo, &rc);
1566  SetWindowPos(pHHInfo->WinType.hwndHTML, HWND_TOP, rc.left, rc.top,
1567  rc.right, rc.bottom, SWP_SHOWWINDOW);
1568 
1569  /* Resize browser window taking the frame size into account */
1571  ResizeWebBrowser(pHHInfo, rc.right - dwSize, rc.bottom - dwSize);
1572 
1573  return 0;
1574 }
1575 
1577 {
1578  if (!info->WinType.hwndHelp)
1579  return;
1580 
1581  WARN("Only the size of the window is currently updated.\n");
1582  if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT)
1583  {
1584  RECT *rect = &info->WinType.rcWindowPos;
1585  INT x, y, width, height;
1586 
1587  x = rect->left;
1588  y = rect->top;
1589  width = rect->right - x;
1590  height = rect->bottom - y;
1591  SetWindowPos(info->WinType.hwndHelp, NULL, rect->left, rect->top, width, height,
1593  }
1594 }
1595 
1597 {
1598  switch (message)
1599  {
1600  case WM_COMMAND:
1601  if (HIWORD(wParam) == BN_CLICKED)
1603  break;
1604  case WM_SIZE:
1605  return Help_OnSize(hWnd);
1606  case WM_CLOSE:
1608  return 0;
1609  case WM_DESTROY:
1610  if(hh_process)
1611  PostQuitMessage(0);
1612  break;
1613 
1614  default:
1616  }
1617 
1618  return 0;
1619 }
1620 
1622 {
1623  HWND hWnd;
1624  RECT winPos = info->WinType.rcWindowPos;
1625  WNDCLASSEXW wcex;
1626  DWORD dwStyles, dwExStyles;
1627  DWORD x, y, width = 0, height = 0;
1628  LPCWSTR caption;
1629 
1630  static const WCHAR windowClassW[] = {
1631  'H','H',' ', 'P','a','r','e','n','t',0
1632  };
1633 
1634  wcex.cbSize = sizeof(WNDCLASSEXW);
1635  wcex.style = CS_HREDRAW | CS_VREDRAW;
1636  wcex.lpfnWndProc = Help_WndProc;
1637  wcex.cbClsExtra = 0;
1638  wcex.cbWndExtra = sizeof(LONG_PTR);
1639  wcex.hInstance = hhctrl_hinstance;
1640 #ifdef __REACTOS__
1641  wcex.hIcon = LoadIconW(hhctrl_hinstance, MAKEINTRESOURCEW(IDI_HHICON));
1642 #else
1644 #endif
1646  wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
1647  wcex.lpszMenuName = NULL;
1648  wcex.lpszClassName = windowClassW;
1649 #ifdef __REACTOS__
1650  wcex.hIconSm = NULL;
1651 #else
1653 #endif
1654 
1655  RegisterClassExW(&wcex);
1656 
1657  /* Read in window parameters if available */
1658  if (info->WinType.fsValidMembers & HHWIN_PARAM_STYLES)
1659  {
1660  dwStyles = info->WinType.dwStyles;
1661  if (!(info->WinType.dwStyles & WS_CHILD))
1662  dwStyles |= WS_OVERLAPPEDWINDOW;
1663  }
1664  else
1665  dwStyles = WS_OVERLAPPEDWINDOW | WS_VISIBLE |
1667 
1668  if (info->WinType.fsValidMembers & HHWIN_PARAM_EXSTYLES)
1669  dwExStyles = info->WinType.dwExStyles;
1670  else
1671  dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_APPWINDOW |
1673 
1674  if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT)
1675  {
1676  x = winPos.left;
1677  y = winPos.top;
1678  width = winPos.right - x;
1679  height = winPos.bottom - y;
1680  }
1681  if (!width || !height)
1682  {
1683  x = WINTYPE_DEFAULT_X;
1684  y = WINTYPE_DEFAULT_Y;
1687  }
1688 
1689  if (!(info->WinType.fsWinProperties & HHWIN_PROP_TRI_PANE) && info->WinType.fNotExpanded)
1690  {
1691  if (!(info->WinType.fsValidMembers & HHWIN_PARAM_NAV_WIDTH) &&
1692  info->WinType.iNavWidth == 0)
1693  {
1694  info->WinType.iNavWidth = WINTYPE_DEFAULT_NAVWIDTH;
1695  }
1696 
1697  x += info->WinType.iNavWidth;
1698  width -= info->WinType.iNavWidth;
1699  }
1700 
1701 
1702  caption = info->WinType.pszCaption;
1703  if (!*caption) caption = info->pCHMInfo->defTitle;
1704 
1705  hWnd = CreateWindowExW(dwExStyles, windowClassW, caption, dwStyles, x, y, width, height,
1706  info->WinType.hwndCaller, NULL, hhctrl_hinstance, NULL);
1707  if (!hWnd)
1708  return FALSE;
1709 
1711  UpdateWindow(hWnd);
1712 
1713  /* store the pointer to the HH info struct */
1715 
1716  info->WinType.hwndHelp = hWnd;
1717  return TRUE;
1718 }
1719 
1720 static void HH_CreateFont(HHInfo *pHHInfo)
1721 {
1722  LOGFONTW lf;
1723 
1725  lf.lfWeight = FW_NORMAL;
1726  lf.lfItalic = FALSE;
1727  lf.lfUnderline = FALSE;
1728 
1729  pHHInfo->hFont = CreateFontIndirectW(&lf);
1730 }
1731 
1732 static void HH_InitRequiredControls(DWORD dwControls)
1733 {
1734  INITCOMMONCONTROLSEX icex;
1735 
1736  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
1737  icex.dwICC = dwControls;
1738  InitCommonControlsEx(&icex);
1739 }
1740 
1741 /* Creates the whole package */
1742 static BOOL CreateViewer(HHInfo *pHHInfo)
1743 {
1744  HH_CreateFont(pHHInfo);
1745 
1746  if (!HH_CreateHelpWindow(pHHInfo))
1747  return FALSE;
1748 
1750 
1751  if (!HH_AddToolbar(pHHInfo))
1752  return FALSE;
1753 
1754  HH_RegisterChildWndClass(pHHInfo);
1755 
1756  if (!HH_AddNavigationPane(pHHInfo))
1757  return FALSE;
1758 
1759  HH_RegisterSizeBarClass(pHHInfo);
1760 
1761  if (!HH_AddSizeBar(pHHInfo))
1762  return FALSE;
1763 
1764  if (!HH_AddHTMLPane(pHHInfo))
1765  return FALSE;
1766 
1767  if (!AddContentTab(pHHInfo))
1768  return FALSE;
1769 
1770  if (!AddIndexTab(pHHInfo))
1771  return FALSE;
1772 
1773  if (!AddIndexPopup(pHHInfo))
1774  return FALSE;
1775 
1776  if (!AddSearchTab(pHHInfo))
1777  return FALSE;
1778 
1779  InitContent(pHHInfo);
1780  InitIndex(pHHInfo);
1781 
1782  pHHInfo->viewer_initialized = TRUE;
1783  return TRUE;
1784 }
1785 
1787 {
1788  heap_free(stringsW->pszType);
1789  heap_free(stringsW->pszCaption);
1790  heap_free(stringsW->pszToc);
1791  heap_free(stringsW->pszIndex);
1792  heap_free(stringsW->pszFile);
1793  heap_free(stringsW->pszHome);
1794  heap_free(stringsW->pszJump1);
1795  heap_free(stringsW->pszJump2);
1796  heap_free(stringsW->pszUrlJump1);
1797  heap_free(stringsW->pszUrlJump2);
1798 }
1799 
1801 {
1802  heap_free(stringsA->pszType);
1803  heap_free(stringsA->pszCaption);
1804  heap_free(stringsA->pszToc);
1805  heap_free(stringsA->pszIndex);
1806  heap_free(stringsA->pszFile);
1807  heap_free(stringsA->pszHome);
1808  heap_free(stringsA->pszJump1);
1809  heap_free(stringsA->pszJump2);
1810  heap_free(stringsA->pszUrlJump1);
1811  heap_free(stringsA->pszUrlJump2);
1812  heap_free(stringsA->pszCustomTabs);
1813 }
1814 
1816 {
1817  TRACE("(%p)\n", info);
1818 
1819  if (!info)
1820  return;
1821 
1822  list_remove(&info->entry);
1823 
1824  wintype_stringsA_free(&info->stringsA);
1825  wintype_stringsW_free(&info->stringsW);
1826 
1827  if (info->pCHMInfo)
1828  CloseCHM(info->pCHMInfo);
1829 
1832  ReleaseIndex(info);
1834 
1835  if(info->contents.hImageList)
1836  ImageList_Destroy(info->contents.hImageList);
1837  if(info->WinType.hwndHelp)
1838  DestroyWindow(info->WinType.hwndHelp);
1839 
1840  heap_free(info);
1841  OleUninitialize();
1842 }
1843 
1845 {
1846  HHInfo *tmp_info;
1847  unsigned int i;
1848 
1849  if(!info)
1850  {
1851  info = heap_alloc_zero(sizeof(HHInfo));
1852  list_add_tail(&window_list, &info->entry);
1853  }
1854 
1855  /* Set the invalid tab ID (-1) as the default value for all
1856  * of the tabs, this matches a failed TCM_INSERTITEM call.
1857  */
1858  for (i = 0; i < ARRAY_SIZE(info->tabs); i++)
1859  info->tabs[i].id = -1;
1860 
1862 
1863  info->pCHMInfo = OpenCHM(filename);
1864  if(!info->pCHMInfo) {
1866  return NULL;
1867  }
1868 
1869  if (!LoadWinTypeFromCHM(info)) {
1871  return NULL;
1872  }
1873  info->WinType.hwndCaller = caller;
1874 
1875  /* If the window is already open then load the file in that existing window */
1876  if ((tmp_info = find_window(info->WinType.pszType)) && tmp_info != info)
1877  {
1879  return CreateHelpViewer(tmp_info, filename, caller);
1880  }
1881 
1882  if(!info->viewer_initialized && !CreateViewer(info)) {
1884  return NULL;
1885  }
1886 
1887  return info;
1888 }
1889 
1890 /*
1891  * Search the table of HTML entities and return the corresponding ANSI symbol.
1892  */
1893 static char find_html_symbol(const char *entity, int entity_len)
1894 {
1896  int min = 0, dir;
1897 
1898  while(min <= max)
1899  {
1900  int pos = (min+max)/2;
1901  const char *encoded_symbol = html_encoded_symbols[pos].html_code;
1902  dir = strncmp(encoded_symbol, entity, entity_len);
1903  if(dir == 0 && !encoded_symbol[entity_len]) return html_encoded_symbols[pos].ansi_symbol;
1904  if(dir < 0)
1905  min = pos+1;
1906  else
1907  max = pos-1;
1908  }
1909  return 0;
1910 }
1911 
1912 /*
1913  * Decode a string containing HTML encoded characters into a unicode string.
1914  */
1915 WCHAR *decode_html(const char *html_fragment, int html_fragment_len, UINT code_page)
1916 {
1917  const char *h = html_fragment, *amp, *sem;
1918  char symbol, *tmp;
1919  int len, tmp_len = 0;
1920  WCHAR *unicode_text;
1921 
1922  tmp = heap_alloc(html_fragment_len+1);
1923  while(1)
1924  {
1925  symbol = 0;
1926  amp = strchr(h, '&');
1927  if(!amp) break;
1928  len = amp-h;
1929  /* Copy the characters prior to the HTML encoded character */
1930  memcpy(&tmp[tmp_len], h, len);
1931  tmp_len += len;
1932  amp++; /* skip ampersand */
1933  sem = strchr(amp, ';');
1934  /* Require a semicolon after the ampersand */
1935  if(!sem)
1936  {
1937  h = amp;
1938  tmp[tmp_len++] = '&';
1939  continue;
1940  }
1941  /* Find the symbol either by using the ANSI character number (prefixed by the pound symbol)
1942  * or by searching the HTML entity table */
1943  len = sem-amp;
1944  if(amp[0] == '#')
1945  {
1946  char *endnum = NULL;
1947  int tmp;
1948 
1949  tmp = (char) strtol(amp, &endnum, 10);
1950  if(endnum == sem)
1951  symbol = tmp;
1952  }
1953  else
1954  symbol = find_html_symbol(amp, len);
1955  if(!symbol)
1956  {
1957  FIXME("Failed to translate HTML encoded character '&%.*s;'.\n", len, amp);
1958  h = amp;
1959  tmp[tmp_len++] = '&';
1960  continue;
1961  }
1962  /* Insert the new symbol */
1963  h = sem+1;
1964  tmp[tmp_len++] = symbol;
1965  }
1966  /* Convert any remaining characters */
1967  len = html_fragment_len-(h-html_fragment);
1968  memcpy(&tmp[tmp_len], h, len);
1969  tmp_len += len;
1970  tmp[tmp_len++] = 0; /* NULL-terminate the string */
1971 
1972  len = MultiByteToWideChar(code_page, 0, tmp, tmp_len, NULL, 0);
1973  unicode_text = heap_alloc(len*sizeof(WCHAR));
1974  MultiByteToWideChar(code_page, 0, tmp, tmp_len, unicode_text, len);
1975  heap_free(tmp);
1976  return unicode_text;
1977 }
1978 
1979 /* Find the HTMLHelp structure for an existing window title */
1981 {
1982  HHInfo *info;
1983 
1985  {
1986  if (lstrcmpW(info->WinType.pszType, window) == 0)
1987  return info;
1988  }
1989  return NULL;
1990 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
HWND hwndToolBar
Definition: htmlhelp.h:353
#define IDC_SIZEWE
Definition: winuser.h:689
DWORD fsValidMembers
Definition: htmlhelp.h:343
char ansi_symbol
Definition: help.c:57
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define TBIF_COMMAND
Definition: commctrl.h:1224
#define TCM_GETCURSEL
Definition: commctrl.h:4062
void InitSearch(HHInfo *info, const char *needle) DECLSPEC_HIDDEN
Definition: search.c:222
#define WS_POPUPWINDOW
Definition: pedump.c:638
#define WINTYPE_DEFAULT_NAVWIDTH
Definition: help.c:44
void InitIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:265
static BOOL HH_AddSizeBar(HHInfo *pHHInfo)
Definition: help.c:435
#define IDTB_FAVORITES
Definition: htmlhelp.h:142
void wintype_stringsW_free(struct wintype_stringsW *stringsW)
Definition: help.c:1786
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define HHWIN_BUTTON_REFRESH
Definition: htmlhelp.h:103
#define WINTYPE_DEFAULT_WIDTH
Definition: help.c:42
#define HHWIN_PROP_TAB_FAVORITES
Definition: htmlhelp.h:67
GLint GLint GLsizei width
Definition: gl.h:1546
#define LONG_PTR
Definition: treelist.c:79
#define HHWIN_BUTTON_SYNC
Definition: htmlhelp.h:109
#define max(a, b)
Definition: svc.c:63
#define HHWIN_BUTTON_BACK
Definition: htmlhelp.h:100
Definition: tftpd.h:59
#define WB_PRINT
Definition: hhctrl.h:52
#define MFT_STRING
Definition: winuser.h:741
#define MIIM_FTYPE
Definition: winuser.h:724
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
#define WC_TREEVIEWW
Definition: commctrl.h:3243
ChmPath merge
Definition: hhctrl.h:81
#define WC_EDITW
Definition: commctrl.h:4687
CHMInfo * OpenCHM(LPCWSTR szFile)
Definition: chm.c:626
#define HHWIN_DEF_BUTTONS
Definition: htmlhelp.h:122
char * pszToc
Definition: hhctrl.h:161
static BOOL AppendFullPathURL(LPCWSTR file, LPWSTR buf, LPCWSTR index)
Definition: help.c:251
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1330
WCHAR * pszJump1
Definition: hhctrl.h:151
#define GW_CHILD
Definition: winuser.h:758
int cbWndExtra
Definition: winuser.h:3210
static const WCHAR szChildClass[]
Definition: help.c:463
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define WM_LBUTTONDOWN
Definition: winuser.h:1766
void ReleaseContent(HHInfo *info)
Definition: content.c:325
#define HHWIN_BUTTON_EXPAND
Definition: htmlhelp.h:99
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:448
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2284
#define LVCF_TEXT
Definition: commctrl.h:2588
#define WB_STOP
Definition: hhctrl.h:51
#define MK_LBUTTON
Definition: winuser.h:2357
static LRESULT Help_OnSize(HWND hWnd)
Definition: help.c:1544
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:206
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define IDTB_CUSTOMIZE
Definition: htmlhelp.h:145
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
#define TPM_LEFTALIGN
Definition: winuser.h:2367
WCHAR * pszType
Definition: hhctrl.h:145
#define SW_HIDE
Definition: winuser.h:762
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define TB_ADDSTRINGW
Definition: commctrl.h:1132
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define HHWIN_BUTTON_JUMP1
Definition: htmlhelp.h:116
#define WHITE_PEN
Definition: wingdi.h:905
#define WINTYPE_DEFAULT_HEIGHT
Definition: help.c:43
#define LVS_REPORT
Definition: commctrl.h:2262
#define HHTB_EXPAND
Definition: resource.h:49
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define TAB_FAVORITES
Definition: hhctrl.h:119
static void SB_OnLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:354
char * pszUrlJump1
Definition: hhctrl.h:167
void DoPageAction(WebBrowserContainer *, DWORD) DECLSPEC_HIDDEN
Definition: webbrowser.c:753
static const WCHAR windowClassW[]
Definition: actctx.c:633
#define WB_GOBACK
Definition: hhctrl.h:46
static LRESULT OnTopicChange(HHInfo *info, void *user_data)
Definition: help.c:613
#define TVS_LINESATROOT
Definition: commctrl.h:3249
#define WARN(fmt,...)
Definition: debug.h:112
#define MAKELPARAM(l, h)
Definition: winuser.h:3998
#define IDTB_PRINT
Definition: htmlhelp.h:132
static void HH_InitRequiredControls(DWORD dwControls)
Definition: help.c:1732
struct ContentItem * parent
Definition: hhctrl.h:60
DWORD button
Definition: button.c:166
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:35
#define WC_LISTVIEWW
Definition: commctrl.h:2257
BOOL WINAPI UpdateWindow(_In_ HWND)
HWND hWnd
Definition: settings.c:17
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define HHWIN_PARAM_NAV_WIDTH
Definition: htmlhelp.h:89
HHInfo * CreateHelpViewer(HHInfo *info, LPCWSTR filename, HWND caller)
Definition: help.c:1844
WCHAR * pszJump2
Definition: hhctrl.h:152
LONG top
Definition: windef.h:307
#define IDS_FAVORITES
Definition: resource.h:35
static BOOL AddIndexTab(HHInfo *info)
Definition: help.c:1230
#define IDS_INDEX
Definition: resource.h:33
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
LPWSTR pszText
Definition: commctrl.h:4023
#define TAB_CONTENTS
Definition: hhctrl.h:116
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define CS_HREDRAW
Definition: winuser.h:648
#define TAB_NUMTABS
Definition: hhctrl.h:120
#define HHTV_OPENFOLDER
Definition: resource.h:63
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
LPWSTR local
Definition: hhctrl.h:67
#define SM_CXEDGE
Definition: winuser.h:1002
BOOL InitWebBrowser(HHInfo *, HWND) DECLSPEC_HIDDEN
Definition: webbrowser.c:670
#define HWND_TOP
Definition: winuser.h:1197
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
HICON hIcon
Definition: winuser.h:3212
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define HHTV_FOLDER
Definition: resource.h:62
BOOL LoadWinTypeFromCHM(HHInfo *info)
Definition: chm.c:344
#define IDTB_EXPAND
Definition: htmlhelp.h:125
char * pszCaption
Definition: hhctrl.h:160
#define IDI_APPLICATION
Definition: winuser.h:699
UINT_PTR WPARAM
Definition: windef.h:207
HINSTANCE hInst
Definition: commctrl.h:1059
#define WS_CHILD
Definition: pedump.c:617
OLECHAR * BSTR
Definition: compat.h:2152
struct _WNDCLASSEXW WNDCLASSEXW
#define HHTB_STOP
Definition: resource.h:44
#define TCIF_TEXT
Definition: commctrl.h:3971
#define GetWindowLongPtrW
Definition: winuser.h:4819
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3271
#define HHWIN_BUTTON_STOP
Definition: htmlhelp.h:102
#define IDB_HIST_LARGE_COLOR
Definition: commctrl.h:1069
LONG left
Definition: windef.h:306
#define SWP_NOZORDER
Definition: winuser.h:1237
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:270
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WINTYPE_DEFAULT_Y
Definition: help.c:41
static void SB_GetSizeBarRect(HHInfo *info, RECT *rc)
Definition: help.c:424
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define SM_CXFRAME
Definition: winuser.h:988
BYTE fsStyle
Definition: commctrl.h:952
GLuint coords
Definition: glext.h:7368
DWORD fsToolBarFlags
Definition: htmlhelp.h:362
#define WS_CLIPCHILDREN
Definition: pedump.c:619
char * pszJump1
Definition: hhctrl.h:165
const char * filename
Definition: ioapi.h:135
void ReleaseSearch(HHInfo *info) DECLSPEC_HIDDEN
Definition: search.c:235
LONG right
Definition: windef.h:308
char * pszCustomTabs
Definition: hhctrl.h:169
#define lstrlenW
Definition: compat.h:609
static void SB_OnPaint(HWND hWnd)
Definition: help.c:326
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:58
#define VK_RETURN
Definition: winuser.h:2191
#define IDTB_JUMP1
Definition: htmlhelp.h:143
static const WCHAR szSizeBarClass[]
Definition: help.c:321
DWORD WINAPI GetSysColor(_In_ int)
static void ExpandContract(HHInfo *pHHInfo)
Definition: help.c:1513
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
#define STD_PRINT
Definition: commctrl.h:1085
#define TCM_GETROWCOUNT
Definition: commctrl.h:4093
#define HHWIN_BUTTON_OPTIONS
Definition: htmlhelp.h:110
LPWSTR chm_index
Definition: hhctrl.h:56
#define LVM_SETCOLUMNWIDTH
Definition: commctrl.h:2646
#define TB_GETITEMRECT
Definition: commctrl.h:1133
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static const WCHAR szEmpty[]
Definition: help.c:53
int nItems
Definition: hhctrl.h:83
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPSTR pszText
Definition: commctrl.h:2556
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define IDTB_JUMP2
Definition: htmlhelp.h:144
#define ILC_COLOR32
Definition: commctrl.h:358
ChmPath merge
Definition: hhctrl.h:68
#define IDTB_FORWARD
Definition: htmlhelp.h:134
#define LVIF_TEXT
Definition: commctrl.h:2309
int cchTextMax
Definition: commctrl.h:2366
#define IDTB_HOME
Definition: htmlhelp.h:130
UINT code
Definition: winuser.h:3149
#define IDTB_CONTRACT
Definition: htmlhelp.h:126
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
static void DisplayPopupMenu(HHInfo *info)
Definition: help.c:836
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
static LRESULT CALLBACK Help_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:1596
#define CCS_NODIVIDER
Definition: commctrl.h:2248
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
HINSTANCE hInstance
Definition: charmap.c:20
#define BTNS_BUTTON
Definition: commctrl.h:998
static void NP_GetNavigationRect(HHInfo *pHHInfo, RECT *rc)
Definition: help.c:1062
#define IDTB_CONTENTS
Definition: htmlhelp.h:138
static struct html_encoded_symbol html_encoded_symbols[]
Definition: help.c:64
LPCWSTR lpszMenuName
Definition: winuser.h:3215
Definition: actctx.c:387
#define IDTB_NOTES
Definition: htmlhelp.h:135
void UpdateHelpWindow(HHInfo *info)
Definition: help.c:1576
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define TVM_SETITEMW
Definition: commctrl.h:3493
#define HIST_BACK
Definition: commctrl.h:1100
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
#define HHWIN_BUTTON_HOME
Definition: htmlhelp.h:104
DWORD fsWinProperties
Definition: htmlhelp.h:344
#define MIIM_STATE
Definition: winuser.h:716
unsigned int BOOL
Definition: ntddk_ex.h:94
#define HHTV_NUMBITMAPS
Definition: resource.h:64
#define TB_AUTOSIZE
Definition: commctrl.h:1137
static LRESULT Child_OnPaint(HWND hWnd)
Definition: help.c:467
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
static struct _test_info info[]
Definition: SetCursorPos.c:19
if SUCCEEDED(hr)
#define debugstr_w
Definition: kernel32.h:32
#define IDTB_BACK
Definition: htmlhelp.h:129
#define HHWIN_BUTTON_BROWSE_FWD
Definition: htmlhelp.h:105
#define TPM_TOPALIGN
Definition: winuser.h:2373
#define TVS_HASBUTTONS
Definition: commctrl.h:3247
static BOOL navigation_visible(HHInfo *info)
Definition: help.c:168
LPARAM lParam
Definition: commctrl.h:2368
#define FIXME(fmt,...)
Definition: debug.h:111
#define HHWIN_PARAM_STYLES
Definition: htmlhelp.h:86
#define TVM_SETIMAGELIST
Definition: commctrl.h:3446
void ResizeWebBrowser(HHInfo *, DWORD, DWORD) DECLSPEC_HIDDEN
Definition: webbrowser.c:744
#define MENU_POPUP
Definition: resource.h:39
#define CW_USEDEFAULT
Definition: winuser.h:225
#define GWLP_USERDATA
Definition: treelist.c:63
UINT mask
Definition: commctrl.h:4020
#define IDTB_STOP
Definition: htmlhelp.h:127
WCHAR * pszToc
Definition: hhctrl.h:147
#define IDTB_TOC_PREV
Definition: htmlhelp.h:148
static LRESULT Child_OnSize(HWND hwnd)
Definition: help.c:557
#define MAKELONG(a, b)
Definition: typedefs.h:249
static BOOL AddSearchTab(HHInfo *info)
Definition: help.c:1259
#define TCM_INSERTITEMW
Definition: commctrl.h:4047
#define WB_REFRESH
Definition: hhctrl.h:50
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
static void DoSync(HHInfo *info)
Definition: help.c:282
#define HHTB_HOME
Definition: resource.h:46
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
#define HHWIN_BUTTON_ZOOM
Definition: htmlhelp.h:118
static DWORD NP_CreateTab(HINSTANCE hInstance, HWND hwndTabCtrl, DWORD index)
Definition: help.c:1084
static HWND hwndParent
Definition: cryptui.c:300
#define COLOR_MENU
Definition: winuser.h:911
unsigned char
Definition: typeof.h:29
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1418
BOOL hh_process
Definition: hhctrl.c:42
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
static void HH_CreateFont(HHInfo *pHHInfo)
Definition: help.c:1720
#define HIST_FORWARD
Definition: commctrl.h:1101
LONG_PTR LPARAM
Definition: windef.h:208
int cbClsExtra
Definition: winuser.h:3209
#define TVN_ITEMEXPANDINGW
Definition: commctrl.h:3700
#define GRAY_BRUSH
Definition: wingdi.h:898
#define TAB_TOP_PADDING
Definition: help.c:46
#define WB_GOFORWARD
Definition: hhctrl.h:47
GLuint index
Definition: glext.h:6031
unsigned int dir
Definition: maze.c:112
INT_PTR iString
Definition: commctrl.h:959
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define TVN_SELCHANGEDW
Definition: commctrl.h:3648
#define SW_SHOW
Definition: winuser.h:769
#define WS_EX_LEFT
Definition: winuser.h:391
#define TCM_GETITEMRECT
Definition: commctrl.h:4059
#define TAB_RIGHT_PADDING
Definition: help.c:47
DWORD_PTR dwData
Definition: commctrl.h:958
LPCWSTR lpszClassName
Definition: winuser.h:3216
#define WM_DESTROY
Definition: winuser.h:1599
#define SIZEBAR_WIDTH
Definition: help.c:319
WCHAR * pszUrlJump2
Definition: hhctrl.h:154
int iBitmap
Definition: commctrl.h:949
#define IDTB_BROWSE_FWD
Definition: htmlhelp.h:136
#define WINTYPE_DEFAULT_X
Definition: help.c:40
WCHAR * GetDocumentTitle(CHMInfo *info, LPCWSTR document)
Definition: chm.c:572
#define HHTB_REFRESH
Definition: resource.h:45
#define CS_VREDRAW
Definition: winuser.h:653
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TCN_SELCHANGE
Definition: commctrl.h:4132
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
static void TB_OnClick(HWND hWnd, DWORD dwID)
Definition: help.c:884
void ActivateContentTopic(HWND hWnd, LPCWSTR filename, ContentItem *item)
Definition: content.c:330
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
#define WS_OVERLAPPED
Definition: pedump.c:615
#define SS_NOTIFY
Definition: winuser.h:351
#define ICON_SIZE
Definition: help.c:834
static BOOL HH_AddToolbar(HHInfo *pHHInfo)
Definition: help.c:1012
#define HHWIN_BUTTON_INDEX
Definition: htmlhelp.h:112
#define LIST_INIT(head)
Definition: queue.h:197
const char * html_code
Definition: help.c:56
__wchar_t WCHAR
Definition: xmlstorage.h:180
char * pszJump2
Definition: hhctrl.h:166
#define WM_SIZE
Definition: winuser.h:1601
WCHAR * decode_html(const char *html_fragment, int html_fragment_len, UINT code_page)
Definition: help.c:1915
HBRUSH hbrBackground
Definition: winuser.h:3214
LONG HRESULT
Definition: typedefs.h:79
UINT cbSize
Definition: winuser.h:3206
static const WCHAR url[]
Definition: encode.c:1432
#define SWP_NOACTIVATE
Definition: winuser.h:1232
WCHAR * pszHome
Definition: hhctrl.h:150
LPWSTR chm_file
Definition: hhctrl.h:55
Definition: hhctrl.h:185
LPWSTR pszText
Definition: commctrl.h:2365
WINE_DEFAULT_DEBUG_CHANNEL(htmlhelp)
#define MF_ENABLED
Definition: winuser.h:128
#define WM_CLOSE
Definition: winuser.h:1611
#define MAX_PATH
Definition: compat.h:34
#define WM_KEYUP
Definition: winuser.h:1706
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define LVS_SINGLESEL
Definition: commctrl.h:2266
#define HHWIN_BUTTON_PRINT
Definition: htmlhelp.h:111
int WINAPI GetSystemMetrics(_In_ int)
#define BN_CLICKED
Definition: winuser.h:1915
unsigned long DWORD
Definition: ntddk_ex.h:95
#define HHWIN_BUTTON_CONTENTS
Definition: htmlhelp.h:108
#define HHTB_SYNC
Definition: resource.h:47
#define HHWIN_PARAM_EXSTYLES
Definition: htmlhelp.h:87
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
HWND hwndNavigation
Definition: htmlhelp.h:354
#define HHWIN_PROP_TAB_SEARCH
Definition: htmlhelp.h:65
#define TB_ADDBITMAP
Definition: commctrl.h:1056
HINSTANCE hInstance
Definition: winuser.h:3211
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
#define WM_PAINT
Definition: winuser.h:1610
#define IDTB_INDEX
Definition: htmlhelp.h:139
static BOOL HH_AddNavigationPane(HHInfo *info)
Definition: help.c:1099
UINT mask
Definition: commctrl.h:2360
static void SB_OnMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:374
static void ResizeTabChild(HHInfo *info, int tab)
Definition: help.c:499
static LRESULT CALLBACK Child_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:710
HWND hwndTreeView
Definition: eventvwr.c:84
#define IDTB_BROWSE_BACK
Definition: htmlhelp.h:137
int ret
char * pszType
Definition: hhctrl.h:159
static BOOL AddContentTab(HHInfo *info)
Definition: help.c:1201
#define HHWIN_BUTTON_SEARCH
Definition: htmlhelp.h:113
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
void ReleaseHelpViewer(HHInfo *info)
Definition: help.c:1815
#define index(s, c)
Definition: various.h:29
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
LPWSTR keyword
Definition: hhctrl.h:80
#define IDTB_SEARCH
Definition: htmlhelp.h:140
HDC hdc
Definition: main.c:9
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define STD_PROPERTIES
Definition: commctrl.h:1081
int idCommand
Definition: commctrl.h:950
HH_WINTYPEW WinType
Definition: hhctrl.h:188
#define COLOR_BTNFACE
Definition: winuser.h:922
#define V_VT(A)
Definition: oleauto.h:211
BOOL fNotExpanded
Definition: htmlhelp.h:363
#define WC_TABCONTROLW
Definition: commctrl.h:3935
#define HHWIN_BUTTON_HISTORY
Definition: htmlhelp.h:114
#define TB_ADDBUTTONSW
Definition: commctrl.h:1266
#define LVM_GETSELECTIONMARK
Definition: commctrl.h:2788
uint32_t entry
Definition: isohybrid.c:63
#define HHWIN_BUTTON_JUMP2
Definition: htmlhelp.h:117
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define SM_CXBORDER
Definition: winuser.h:958
GLenum GLsizei len
Definition: glext.h:6722
static void SB_OnLButtonUp(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:359
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1136
#define HHWIN_PARAM_TB_FLAGS
Definition: htmlhelp.h:92
Definition: _list.h:228
HCURSOR hCursor
Definition: winuser.h:3213
#define IDB_STD_LARGE_COLOR
Definition: commctrl.h:1065
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1730
#define TAB_SEARCH
Definition: hhctrl.h:118
static IHTMLWindow2 * window
Definition: events.c:77
static BOOL HH_AddHTMLPane(HHInfo *pHHInfo)
Definition: help.c:1172
UINT style
Definition: winuser.h:3207
HWND hwndFrom
Definition: winuser.h:3147
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
static LPWSTR HH_LoadString(DWORD dwID)
Definition: help.c:190
static BOOL HH_CreateHelpWindow(HHInfo *info)
Definition: help.c:1621
#define V_BSTR(A)
Definition: oleauto.h:226
#define TAB_INDEX
Definition: hhctrl.h:117
static LRESULT OnTabChange(HWND hwnd)
Definition: help.c:576
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static void TB_AddButton(TBBUTTON *pButtons, DWORD dwIndex, DWORD dwID, DWORD dwBitmap)
Definition: help.c:938
static void TB_AddButtonsFromFlags(HHInfo *pHHInfo, TBBUTTON *pButtons, DWORD dwButtonFlags, LPDWORD pdwNumButtons)
Definition: help.c:948
WNDPROC lpfnWndProc
Definition: winuser.h:3208
#define GWLP_WNDPROC
Definition: treelist.c:66
char string[160]
Definition: util.h:11
#define TVIS_EXPANDED
Definition: commctrl.h:3284
#define LVM_DELETEALLITEMS
Definition: commctrl.h:2413
#define local
Definition: zutil.h:30
#define TB_GETBUTTONINFOW
Definition: commctrl.h:1257
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2896
#define ERR(fmt,...)
Definition: debug.h:110
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
#define IDB_HHTREEVIEW
Definition: resource.h:59
#define HHWIN_BUTTON_TOC_PREV
Definition: htmlhelp.h:120
#define NM_RETURN
Definition: commctrl.h:132
HWND hwndEdit
Definition: combotst.c:65
#define MIIM_STRING
Definition: winuser.h:722
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
Definition: chm.c:503
#define LVM_INSERTITEMW
Definition: commctrl.h:2404
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define EDIT_HEIGHT
Definition: help.c:49
#define WS_BORDER
Definition: pedump.c:625
#define HHTB_NUMBITMAPS
Definition: resource.h:50
#define HHTB_CONTRACT
Definition: resource.h:48
static ATOM item
Definition: dde.c:856
static void ResizePopupChild(HHInfo *info)
Definition: help.c:1324
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define NM_DBLCLK
Definition: commctrl.h:131
HWND buttons[5]
Definition: sndrec32.cpp:40
LPWSTR name
Definition: hhctrl.h:72
static HANDLE sem
Definition: sync.c:674
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2132
#define ARRAY_SIZE(a)
Definition: main.h:24
void wintype_stringsA_free(struct wintype_stringsA *stringsA)
Definition: help.c:1800
#define COLOR_BTNSHADOW
Definition: winuser.h:924
LPWSTR local
Definition: hhctrl.h:73
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_LBUTTONUP
Definition: winuser.h:1767
WCHAR * pszUrlJump1
Definition: hhctrl.h:153
#define HHWIN_BUTTON_NOTES
Definition: htmlhelp.h:107
#define IDTB_SYNC
Definition: htmlhelp.h:131
WCHAR * pszIndex
Definition: hhctrl.h:148
HWND hwndSizeBar
Definition: hhctrl.h:201
BYTE lfItalic
Definition: dimm.idl:64
#define TVIF_IMAGE
Definition: commctrl.h:3267
static LRESULT CALLBACK EditChild_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:695
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define IDS_CONTENTS
Definition: resource.h:32
#define IDTB_OPTIONS
Definition: htmlhelp.h:133
#define min(a, b)
Definition: monoChain.cc:55
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define IDS_SHOWTABS
Definition: resource.h:37
unsigned int UINT
Definition: ndis.h:50
#define WM_MOUSEMOVE
Definition: winuser.h:1765
#define NULL
Definition: types.h:112
#define TAB_MARGIN
Definition: help.c:48
BOOL empty
Definition: button.c:170
#define SWP_SHOWWINDOW
Definition: winuser.h:1238
#define SM_CXVSCROLL
Definition: winuser.h:955
struct list window_list
Definition: help.c:51
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define MultiByteToWideChar
Definition: compat.h:110
#define TB_HIDEBUTTON
Definition: commctrl.h:1045
void ReleaseWebBrowser(HHInfo *) DECLSPEC_HIDDEN
Definition: webbrowser.c:720
#define WM_SETFONT
Definition: winuser.h:1640
#define HINST_COMMCTRL
Definition: commctrl.h:1063
#define FW_NORMAL
Definition: wingdi.h:373
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define HHWIN_PARAM_RECT
Definition: htmlhelp.h:88
HICON hIconSm
Definition: winuser.h:3217
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3252
BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl)
Definition: help.c:226
static void HH_RegisterSizeBarClass(HHInfo *pHHInfo)
Definition: help.c:404
#define IDC_ARROW
Definition: winuser.h:682
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
static void HH_RegisterChildWndClass(HHInfo *pHHInfo)
Definition: help.c:812
#define TVSIL_NORMAL
Definition: commctrl.h:3443
Definition: name.c:38
#define TBSTATE_HIDDEN
Definition: commctrl.h:975
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
void ReleaseIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:288
char * pszUrlJump2
Definition: hhctrl.h:168
#define LVM_GETITEMW
Definition: commctrl.h:2390
#define HHWIN_PROP_TRI_PANE
Definition: htmlhelp.h:60
#define LVIF_PARAM
Definition: commctrl.h:2311
#define TBSTATE_ENABLED
Definition: commctrl.h:974
IndexSubItem * items
Definition: hhctrl.h:86
#define TPM_LEFTBUTTON
Definition: winuser.h:2369
uint32_t * LPDWORD
Definition: typedefs.h:59
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:990
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define IDTB_ZOOM
Definition: htmlhelp.h:146
#define HIWORD(l)
Definition: typedefs.h:247
#define IDTB_TOC_NEXT
Definition: htmlhelp.h:147
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
LONG bottom
Definition: windef.h:309
#define SWP_NOMOVE
Definition: winuser.h:1234
CHMInfo * CloseCHM(CHMInfo *chm)
Definition: chm.c:670
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define IDS_HIDETABS
Definition: resource.h:36
#define IDB_HHTOOLBAR
Definition: resource.h:42
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
static LRESULT CALLBACK HelpPopup_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:1353
#define SetWindowLongPtrW
Definition: winuser.h:5336
static HBITMAP
Definition: button.c:44
static char find_html_symbol(const char *entity, int entity_len)
Definition: help.c:1893
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define TVIF_PARAM
Definition: commctrl.h:3268
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
COLORREF WINAPI SetDCPenColor(_In_ HDC hdc, _In_ COLORREF crColor)
Definition: dc.c:941
#define WS_EX_APPWINDOW
Definition: winuser.h:383
LONG lfWeight
Definition: dimm.idl:63
static LRESULT CALLBACK PopupChild_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:1376
BYTE fsState
Definition: commctrl.h:951
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LONG_PTR LRESULT
Definition: windef.h:209
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
HHInfo * find_window(const WCHAR *window)
Definition: help.c:1980
static BOOL AddIndexPopup(HHInfo *info)
Definition: help.c:1423
#define ES_LEFT
Definition: pedump.c:664
#define WS_VISIBLE
Definition: pedump.c:620
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
BYTE lfUnderline
Definition: dimm.idl:65
#define HHWIN_BUTTON_TOC_NEXT
Definition: htmlhelp.h:119
static BOOL CreateViewer(HHInfo *pHHInfo)
Definition: help.c:1742
#define memset(x, y, z)
Definition: compat.h:39
int viewer_initialized
Definition: hhctrl.h:205
int tolower(int c)
Definition: utclib.c:902
#define IDTB_HISTORY
Definition: htmlhelp.h:141
HFONT hFont
Definition: hhctrl.h:202
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define LVM_INSERTCOLUMNA
Definition: commctrl.h:2631
LPWSTR filename
Definition: hhctrl.h:94
static HBITMAP hBitmap
Definition: timezone.c:26
char * pszFile
Definition: hhctrl.h:163
#define HHWIN_BUTTON_BROWSE_BCK
Definition: htmlhelp.h:106
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define HHWIN_BUTTON_FAVORITES
Definition: htmlhelp.h:115
#define LOWORD(l)
Definition: pedump.c:82
struct tagMENUITEMINFOW MENUITEMINFOW
static void HP_GetHTMLRect(HHInfo *info, RECT *rc)
Definition: help.c:1149
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static LRESULT CALLBACK SizeBar_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:381
#define TBSTYLE_FLAT
Definition: commctrl.h:992
char * pszIndex
Definition: hhctrl.h:162
char * pszHome
Definition: hhctrl.h:164
#define WM_NOTIFY
Definition: richedit.h:61
WCHAR * pszFile
Definition: hhctrl.h:149
#define IDS_SEARCH
Definition: resource.h:34
#define IDTB_REFRESH
Definition: htmlhelp.h:128
unsigned int index
Definition: notification.c:65
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)
#define HHWIN_BUTTON_FORWARD
Definition: htmlhelp.h:101
LPWSTR name
Definition: hhctrl.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
void InitContent(HHInfo *info)
Definition: content.c:304
UINT_PTR nID
Definition: commctrl.h:1060
WCHAR * pszCaption
Definition: hhctrl.h:146
Definition: fci.c:126
Definition: hhctrl.h:54
GLuint const GLchar * name
Definition: glext.h:6031