ReactOS  0.4.14-dev-50-g13bb5e2
help.c File Reference
#include "hhctrl.h"
#include "wingdi.h"
#include "commctrl.h"
#include "wininet.h"
#include "wine/debug.h"
#include "resource.h"
Include dependency graph for help.c:

Go to the source code of this file.

Classes

struct  html_encoded_symbol
 

Macros

#define WINTYPE_DEFAULT_X   280
 
#define WINTYPE_DEFAULT_Y   100
 
#define WINTYPE_DEFAULT_WIDTH   740
 
#define WINTYPE_DEFAULT_HEIGHT   640
 
#define WINTYPE_DEFAULT_NAVWIDTH   250
 
#define TAB_TOP_PADDING   8
 
#define TAB_RIGHT_PADDING   4
 
#define TAB_MARGIN   8
 
#define EDIT_HEIGHT   20
 
#define SIZEBAR_WIDTH   4
 
#define ICON_SIZE   20
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (htmlhelp)
 
static LRESULT Help_OnSize (HWND hWnd)
 
static void ExpandContract (HHInfo *pHHInfo)
 
static BOOL navigation_visible (HHInfo *info)
 
static LPWSTR HH_LoadString (DWORD dwID)
 
static HRESULT navigate_url (HHInfo *info, LPCWSTR surl)
 
BOOL NavigateToUrl (HHInfo *info, LPCWSTR surl)
 
static BOOL AppendFullPathURL (LPCWSTR file, LPWSTR buf, LPCWSTR index)
 
BOOL NavigateToChm (HHInfo *info, LPCWSTR file, LPCWSTR index)
 
static void DoSync (HHInfo *info)
 
static void SB_OnPaint (HWND hWnd)
 
static void SB_OnLButtonDown (HWND hWnd, WPARAM wParam, LPARAM lParam)
 
static void SB_OnLButtonUp (HWND hWnd, WPARAM wParam, LPARAM lParam)
 
static void SB_OnMouseMove (HWND hWnd, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK SizeBar_WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void HH_RegisterSizeBarClass (HHInfo *pHHInfo)
 
static void SB_GetSizeBarRect (HHInfo *info, RECT *rc)
 
static BOOL HH_AddSizeBar (HHInfo *pHHInfo)
 
static LRESULT Child_OnPaint (HWND hWnd)
 
static void ResizeTabChild (HHInfo *info, int tab)
 
static LRESULT Child_OnSize (HWND hwnd)
 
static LRESULT OnTabChange (HWND hwnd)
 
static LRESULT OnTopicChange (HHInfo *info, void *user_data)
 
static LRESULT CALLBACK EditChild_WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK Child_WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void HH_RegisterChildWndClass (HHInfo *pHHInfo)
 
static void DisplayPopupMenu (HHInfo *info)
 
static void TB_OnClick (HWND hWnd, DWORD dwID)
 
static void TB_AddButton (TBBUTTON *pButtons, DWORD dwIndex, DWORD dwID, DWORD dwBitmap)
 
static void TB_AddButtonsFromFlags (HHInfo *pHHInfo, TBBUTTON *pButtons, DWORD dwButtonFlags, LPDWORD pdwNumButtons)
 
static BOOL HH_AddToolbar (HHInfo *pHHInfo)
 
static void NP_GetNavigationRect (HHInfo *pHHInfo, RECT *rc)
 
static DWORD NP_CreateTab (HINSTANCE hInstance, HWND hwndTabCtrl, DWORD index)
 
static BOOL HH_AddNavigationPane (HHInfo *info)
 
static void HP_GetHTMLRect (HHInfo *info, RECT *rc)
 
static BOOL HH_AddHTMLPane (HHInfo *pHHInfo)
 
static BOOL AddContentTab (HHInfo *info)
 
static BOOL AddIndexTab (HHInfo *info)
 
static BOOL AddSearchTab (HHInfo *info)
 
static void ResizePopupChild (HHInfo *info)
 
static LRESULT CALLBACK HelpPopup_WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK PopupChild_WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL AddIndexPopup (HHInfo *info)
 
void UpdateHelpWindow (HHInfo *info)
 
static LRESULT CALLBACK Help_WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL HH_CreateHelpWindow (HHInfo *info)
 
static void HH_CreateFont (HHInfo *pHHInfo)
 
static void HH_InitRequiredControls (DWORD dwControls)
 
static BOOL CreateViewer (HHInfo *pHHInfo)
 
void wintype_stringsW_free (struct wintype_stringsW *stringsW)
 
void wintype_stringsA_free (struct wintype_stringsA *stringsA)
 
void ReleaseHelpViewer (HHInfo *info)
 
HHInfoCreateHelpViewer (HHInfo *info, LPCWSTR filename, HWND caller)
 
static char find_html_symbol (const char *entity, int entity_len)
 
WCHARdecode_html (const char *html_fragment, int html_fragment_len, UINT code_page)
 
HHInfofind_window (const WCHAR *window)
 

Variables

struct list window_list = LIST_INIT(window_list)
 
static const WCHAR szEmpty [] = {0}
 
static struct html_encoded_symbol html_encoded_symbols []
 
static const WCHAR szSizeBarClass []
 
static const WCHAR szChildClass []
 

Macro Definition Documentation

◆ EDIT_HEIGHT

#define EDIT_HEIGHT   20

Definition at line 49 of file help.c.

◆ ICON_SIZE

#define ICON_SIZE   20

Definition at line 817 of file help.c.

◆ SIZEBAR_WIDTH

#define SIZEBAR_WIDTH   4

Definition at line 302 of file help.c.

◆ TAB_MARGIN

#define TAB_MARGIN   8

Definition at line 48 of file help.c.

◆ TAB_RIGHT_PADDING

#define TAB_RIGHT_PADDING   4

Definition at line 47 of file help.c.

◆ TAB_TOP_PADDING

#define TAB_TOP_PADDING   8

Definition at line 46 of file help.c.

◆ WINTYPE_DEFAULT_HEIGHT

#define WINTYPE_DEFAULT_HEIGHT   640

Definition at line 43 of file help.c.

◆ WINTYPE_DEFAULT_NAVWIDTH

#define WINTYPE_DEFAULT_NAVWIDTH   250

Definition at line 44 of file help.c.

◆ WINTYPE_DEFAULT_WIDTH

#define WINTYPE_DEFAULT_WIDTH   740

Definition at line 42 of file help.c.

◆ WINTYPE_DEFAULT_X

#define WINTYPE_DEFAULT_X   280

Definition at line 40 of file help.c.

◆ WINTYPE_DEFAULT_Y

#define WINTYPE_DEFAULT_Y   100

Definition at line 41 of file help.c.

Function Documentation

◆ AddContentTab()

static BOOL AddContentTab ( HHInfo info)
static

Definition at line 1184 of file help.c.

1185 {
1186  HIMAGELIST hImageList;
1187  HBITMAP hBitmap;
1188  HWND hWnd;
1189 
1190  if(info->tabs[TAB_CONTENTS].id == -1)
1191  return TRUE; /* No "Contents" tab */
1193  | TVS_SHOWSELALWAYS | TVS_HASBUTTONS, 50, 50, 100, 100,
1194  info->WinType.hwndNavigation, NULL, hhctrl_hinstance, NULL);
1195  if(!hWnd) {
1196  ERR("Could not create treeview control\n");
1197  return FALSE;
1198  }
1199 
1200  hImageList = ImageList_Create(16, 16, ILC_COLOR32, 0, HHTV_NUMBITMAPS);
1202  ImageList_Add(hImageList, hBitmap, NULL);
1204 
1205  info->contents.hImageList = hImageList;
1206  info->tabs[TAB_CONTENTS].hwnd = hWnd;
1209 
1210  return TRUE;
1211 }
#define TRUE
Definition: types.h:120
#define WC_TREEVIEWW
Definition: commctrl.h:3215
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:448
#define TVS_LINESATROOT
Definition: commctrl.h:3221
HWND hWnd
Definition: settings.c:17
#define TAB_CONTENTS
Definition: hhctrl.h:116
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static const WCHAR szEmpty[]
Definition: help.c:53
#define ILC_COLOR32
Definition: commctrl.h:343
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define HHTV_NUMBITMAPS
Definition: resource.h:60
#define TVS_HASBUTTONS
Definition: commctrl.h:3219
#define TVM_SETIMAGELIST
Definition: commctrl.h:3418
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define SW_SHOW
Definition: winuser.h:769
static void ResizeTabChild(HHInfo *info, int tab)
Definition: help.c:482
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)
#define ERR(fmt,...)
Definition: debug.h:109
#define IDB_HHTREEVIEW
Definition: resource.h:55
#define WS_BORDER
Definition: pedump.c:625
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2132
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3224
#define TVSIL_NORMAL
Definition: commctrl.h:3415
static HBITMAP
Definition: button.c:44
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
static HBITMAP hBitmap
Definition: timezone.c:35

Referenced by CreateViewer().

◆ AddIndexPopup()

static BOOL AddIndexPopup ( HHInfo info)
static

Definition at line 1406 of file help.c.

1407 {
1408  static const WCHAR szPopupChildClass[] = {'H','H',' ','P','o','p','u','p',' ','C','h','i','l','d',0};
1409  static const WCHAR windowCaptionW[] = {'S','e','l','e','c','t',' ','T','o','p','i','c',':',0};
1410  static const WCHAR windowClassW[] = {'H','H',' ','P','o','p','u','p',0};
1411  HWND hwndList, hwndPopup, hwndCallback;
1412  char hidden_column[] = "Column";
1413  WNDCLASSEXW wcex;
1414  LVCOLUMNA lvc;
1415 
1416  if(info->tabs[TAB_INDEX].id == -1)
1417  return TRUE; /* No "Index" tab */
1418 
1419  wcex.cbSize = sizeof(WNDCLASSEXW);
1420  wcex.style = CS_HREDRAW | CS_VREDRAW;
1422  wcex.cbClsExtra = 0;
1423  wcex.cbWndExtra = sizeof(LONG_PTR);
1424  wcex.hInstance = hhctrl_hinstance;
1427  wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
1428  wcex.lpszMenuName = NULL;
1429  wcex.lpszClassName = windowClassW;
1431  RegisterClassExW(&wcex);
1432 
1433  wcex.cbSize = sizeof(WNDCLASSEXW);
1434  wcex.style = 0;
1436  wcex.cbClsExtra = 0;
1437  wcex.cbWndExtra = sizeof(LONG_PTR);
1438  wcex.hInstance = hhctrl_hinstance;
1441  wcex.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1442  wcex.lpszMenuName = NULL;
1443  wcex.lpszClassName = szPopupChildClass;
1445  RegisterClassExW(&wcex);
1446 
1449  windowClassW, windowCaptionW, WS_POPUPWINDOW
1452  CW_USEDEFAULT, 300, 200, info->WinType.hwndHelp,
1454  if (!hwndPopup)
1455  return FALSE;
1456 
1458  szPopupChildClass, szEmpty, WS_CHILDWINDOW | WS_VISIBLE,
1459  0, 0, 0, 0,
1460  hwndPopup, NULL, hhctrl_hinstance, NULL);
1461  if (!hwndCallback)
1462  return FALSE;
1463 
1464  ShowWindow(hwndPopup, SW_HIDE);
1467  | LVS_NOCOLUMNHEADER, 50, 50, 100, 100,
1468  hwndCallback, NULL, hhctrl_hinstance, NULL);
1469  if(!hwndList) {
1470  ERR("Could not create popup ListView control\n");
1471  return FALSE;
1472  }
1473  memset(&lvc, 0, sizeof(lvc));
1474  lvc.mask = LVCF_TEXT;
1475  lvc.pszText = hidden_column;
1476  if(SendMessageW(hwndList, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1477  {
1478  ERR("Could not create popup ListView column\n");
1479  return FALSE;
1480  }
1481 
1482  info->popup.hwndCallback = hwndCallback;
1483  info->popup.hwndPopup = hwndPopup;
1484  info->popup.hwndList = hwndList;
1485  SetWindowLongPtrW(hwndPopup, 0, (LONG_PTR)info);
1486  SetWindowLongPtrW(hwndCallback, 0, (LONG_PTR)info);
1487 
1489  ShowWindow(hwndList, SW_SHOW);
1490 
1491  return TRUE;
1492 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_POPUPWINDOW
Definition: pedump.c:638
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define LONG_PTR
Definition: treelist.c:79
#define TRUE
Definition: types.h:120
int cbWndExtra
Definition: winuser.h:3194
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2256
#define LVCF_TEXT
Definition: commctrl.h:2560
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define SW_HIDE
Definition: winuser.h:762
#define LVS_REPORT
Definition: commctrl.h:2234
static const WCHAR windowClassW[]
Definition: actctx.c:596
#define WC_LISTVIEWW
Definition: commctrl.h:2229
#define CS_HREDRAW
Definition: winuser.h:648
HICON hIcon
Definition: winuser.h:3196
#define IDI_APPLICATION
Definition: winuser.h:699
#define WS_CHILD
Definition: pedump.c:617
struct _WNDCLASSEXW WNDCLASSEXW
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WS_CLIPCHILDREN
Definition: pedump.c:619
static const WCHAR szEmpty[]
Definition: help.c:53
LPSTR pszText
Definition: commctrl.h:2528
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
LPCWSTR lpszMenuName
Definition: winuser.h:3199
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
#define COLOR_MENU
Definition: winuser.h:907
LONG_PTR LPARAM
Definition: windef.h:208
int cbClsExtra
Definition: winuser.h:3193
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define SW_SHOW
Definition: winuser.h:769
#define WS_EX_LEFT
Definition: winuser.h:391
LPCWSTR lpszClassName
Definition: winuser.h:3200
#define CS_VREDRAW
Definition: winuser.h:653
__wchar_t WCHAR
Definition: xmlstorage.h:180
HBRUSH hbrBackground
Definition: winuser.h:3198
UINT cbSize
Definition: winuser.h:3190
#define LVS_SINGLESEL
Definition: commctrl.h:2238
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
HINSTANCE hInstance
Definition: winuser.h:3195
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)
#define COLOR_BTNFACE
Definition: winuser.h:918
HCURSOR hCursor
Definition: winuser.h:3197
UINT style
Definition: winuser.h:3191
#define TAB_INDEX
Definition: hhctrl.h:117
WNDPROC lpfnWndProc
Definition: winuser.h:3192
#define ERR(fmt,...)
Definition: debug.h:109
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
#define WS_BORDER
Definition: pedump.c:625
static void ResizePopupChild(HHInfo *info)
Definition: help.c:1307
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HICON hIconSm
Definition: winuser.h:3201
#define IDC_ARROW
Definition: winuser.h:682
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
static LRESULT CALLBACK HelpPopup_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:1336
#define SetWindowLongPtrW
Definition: winuser.h:5247
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
#define WS_EX_APPWINDOW
Definition: winuser.h:383
static LRESULT CALLBACK PopupChild_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:1359
#define WS_VISIBLE
Definition: pedump.c:620
#define memset(x, y, z)
Definition: compat.h:39
#define LVM_INSERTCOLUMNA
Definition: commctrl.h:2603

Referenced by CreateViewer().

◆ AddIndexTab()

static BOOL AddIndexTab ( HHInfo info)
static

Definition at line 1213 of file help.c.

1214 {
1215  char hidden_column[] = "Column";
1216  LVCOLUMNA lvc;
1217 
1218  if(info->tabs[TAB_INDEX].id == -1)
1219  return TRUE; /* No "Index" tab */
1222  info->WinType.hwndNavigation, NULL, hhctrl_hinstance, NULL);
1223  if(!info->tabs[TAB_INDEX].hwnd) {
1224  ERR("Could not create ListView control\n");
1225  return FALSE;
1226  }
1227  memset(&lvc, 0, sizeof(lvc));
1228  lvc.mask = LVCF_TEXT;
1229  lvc.pszText = hidden_column;
1230  if(SendMessageW(info->tabs[TAB_INDEX].hwnd, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1231  {
1232  ERR("Could not create ListView column\n");
1233  return FALSE;
1234  }
1235 
1237  ShowWindow(info->tabs[TAB_INDEX].hwnd, SW_HIDE);
1238 
1239  return TRUE;
1240 }
#define TRUE
Definition: types.h:120
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2256
#define LVCF_TEXT
Definition: commctrl.h:2560
#define SW_HIDE
Definition: winuser.h:762
#define LVS_REPORT
Definition: commctrl.h:2234
#define WC_LISTVIEWW
Definition: commctrl.h:2229
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static const WCHAR szEmpty[]
Definition: help.c:53
LPSTR pszText
Definition: commctrl.h:2528
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define LVS_SINGLESEL
Definition: commctrl.h:2238
static void ResizeTabChild(HHInfo *info, int tab)
Definition: help.c:482
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)
#define TAB_INDEX
Definition: hhctrl.h:117
#define ERR(fmt,...)
Definition: debug.h:109
#define WS_BORDER
Definition: pedump.c:625
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
#define memset(x, y, z)
Definition: compat.h:39
#define LVM_INSERTCOLUMNA
Definition: commctrl.h:2603

Referenced by CreateViewer().

◆ AddSearchTab()

static BOOL AddSearchTab ( HHInfo info)
static

Definition at line 1242 of file help.c.

1243 {
1244  HWND hwndList, hwndEdit, hwndContainer;
1245  char hidden_column[] = "Column";
1246  WNDPROC editWndProc;
1247  LVCOLUMNA lvc;
1248 
1249  if(info->tabs[TAB_SEARCH].id == -1)
1250  return TRUE; /* No "Search" tab */
1252  WS_CHILD, 0, 0, 0, 0, info->WinType.hwndNavigation,
1254  if(!hwndContainer) {
1255  ERR("Could not create search window container control.\n");
1256  return FALSE;
1257  }
1259  | WS_VISIBLE | ES_LEFT | SS_NOTIFY, 0, 0, 0, 0,
1260  hwndContainer, NULL, hhctrl_hinstance, NULL);
1261  if(!hwndEdit) {
1262  ERR("Could not create search ListView control.\n");
1263  return FALSE;
1264  }
1265  if(SendMessageW(hwndEdit, WM_SETFONT, (WPARAM) info->hFont, (LPARAM) FALSE) == -1)
1266  {
1267  ERR("Could not set font for edit control.\n");
1268  return FALSE;
1269  }
1271  if(!editWndProc) {
1272  ERR("Could not redirect messages for edit control.\n");
1273  return FALSE;
1274  }
1278  | LVS_REPORT | LVS_NOCOLUMNHEADER, 0, 0, 0, 0,
1279  hwndContainer, NULL, hhctrl_hinstance, NULL);
1280  if(!hwndList) {
1281  ERR("Could not create search ListView control.\n");
1282  return FALSE;
1283  }
1284  memset(&lvc, 0, sizeof(lvc));
1285  lvc.mask = LVCF_TEXT;
1286  lvc.pszText = hidden_column;
1287  if(SendMessageW(hwndList, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1288  {
1289  ERR("Could not create ListView column\n");
1290  return FALSE;
1291  }
1292 
1293  info->search.hwndEdit = hwndEdit;
1294  info->search.hwndList = hwndList;
1295  info->search.hwndContainer = hwndContainer;
1296  info->tabs[TAB_SEARCH].hwnd = hwndContainer;
1297 
1298  SetWindowLongPtrW(hwndContainer, 0, (LONG_PTR)info);
1299 
1301 
1302  return TRUE;
1303 }
#define TRUE
Definition: types.h:120
#define WC_EDITW
Definition: commctrl.h:4658
static const WCHAR szChildClass[]
Definition: help.c:446
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2256
#define LVCF_TEXT
Definition: commctrl.h:2560
#define LVS_REPORT
Definition: commctrl.h:2234
#define WC_LISTVIEWW
Definition: commctrl.h:2229
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
static const WCHAR szEmpty[]
Definition: help.c:53
LPSTR pszText
Definition: commctrl.h:2528
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define SS_NOTIFY
Definition: winuser.h:351
#define LVS_SINGLESEL
Definition: commctrl.h:2238
static void ResizeTabChild(HHInfo *info, int tab)
Definition: help.c:482
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)
#define TAB_SEARCH
Definition: hhctrl.h:118
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2880
#define ERR(fmt,...)
Definition: debug.h:109
HWND hwndEdit
Definition: combotst.c:65
#define WS_BORDER
Definition: pedump.c:625
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static LRESULT CALLBACK EditChild_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:678
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WM_SETFONT
Definition: winuser.h:1632
#define SetWindowLongPtrW
Definition: winuser.h:5247
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
#define ES_LEFT
Definition: pedump.c:664
#define WS_VISIBLE
Definition: pedump.c:620
#define memset(x, y, z)
Definition: compat.h:39
#define LVM_INSERTCOLUMNA
Definition: commctrl.h:2603

Referenced by CreateViewer().

◆ AppendFullPathURL()

static BOOL AppendFullPathURL ( LPCWSTR  file,
LPWSTR  buf,
LPCWSTR  index 
)
static

Definition at line 234 of file help.c.

235 {
236  static const WCHAR url_format[] =
237  {'m','k',':','@','M','S','I','T','S','t','o','r','e',':','%','s',':',':','%','s','%','s',0};
238  static const WCHAR slash[] = {'/',0};
239  static const WCHAR empty[] = {0};
240  WCHAR full_path[MAX_PATH];
241 
242  TRACE("%s %p %s\n", debugstr_w(file), buf, debugstr_w(index));
243 
244  if (!GetFullPathNameW(file, ARRAY_SIZE(full_path), full_path, NULL)) {
245  WARN("GetFullPathName failed: %u\n", GetLastError());
246  return FALSE;
247  }
248 
249  wsprintfW(buf, url_format, full_path, (!index || index[0] == '/') ? empty : slash, index);
250  return TRUE;
251 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define TRUE
Definition: types.h:120
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static const WCHAR empty[]
Definition: main.c:49
#define WARN(fmt,...)
Definition: debug.h:111
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define ARRAY_SIZE(a)
Definition: main.h:24
Definition: fci.c:126

Referenced by DoSync(), and NavigateToChm().

◆ Child_OnPaint()

static LRESULT Child_OnPaint ( HWND  hWnd)
static

Definition at line 450 of file help.c.

451 {
452  PAINTSTRUCT ps;
453  HDC hdc;
454  RECT rc;
455 
456  hdc = BeginPaint(hWnd, &ps);
457 
458  /* Only paint the Navigation pane, identified by the fact
459  * that it has a child window
460  */
461  if (GetWindow(hWnd, GW_CHILD))
462  {
463  GetClientRect(hWnd, &rc);
464 
465  /* set the border color */
466  SelectObject(hdc, GetStockObject(DC_PEN));
468 
469  /* Draw the top border */
470  LineTo(hdc, rc.right, 0);
471 
473  MoveToEx(hdc, 0, 1, NULL);
474  LineTo(hdc, rc.right, 1);
475  }
476 
477  EndPaint(hWnd, &ps);
478 
479  return 0;
480 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define GW_CHILD
Definition: winuser.h:758
#define WHITE_PEN
Definition: wingdi.h:904
static HDC
Definition: imagelist.c:92
HWND hWnd
Definition: settings.c:17
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:293
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
HDC hdc
Definition: main.c:9
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define COLOR_BTNSHADOW
Definition: winuser.h:920
COLORREF WINAPI SetDCPenColor(_In_ HDC hdc, _In_ COLORREF crColor)
Definition: dc.c:917

Referenced by Child_WndProc().

◆ Child_OnSize()

static LRESULT Child_OnSize ( HWND  hwnd)
static

Definition at line 540 of file help.c.

541 {
543  RECT rect;
544 
545  if(!info || hwnd != info->WinType.hwndNavigation)
546  return 0;
547 
549  SetWindowPos(info->hwndTabCtrl, HWND_TOP, 0, 0,
550  rect.right - TAB_RIGHT_PADDING,
551  rect.bottom - TAB_TOP_PADDING, SWP_NOMOVE);
552 
556  return 0;
557 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TAB_CONTENTS
Definition: hhctrl.h:116
#define HWND_TOP
Definition: winuser.h:1193
#define GetWindowLongPtrW
Definition: winuser.h:4730
& rect
Definition: startmenu.cpp:1413
#define TAB_TOP_PADDING
Definition: help.c:46
#define TAB_RIGHT_PADDING
Definition: help.c:47
Definition: hhctrl.h:185
static void ResizeTabChild(HHInfo *info, int tab)
Definition: help.c:482
#define TAB_SEARCH
Definition: hhctrl.h:118
#define TAB_INDEX
Definition: hhctrl.h:117
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

Referenced by Child_WndProc().

◆ Child_WndProc()

static LRESULT CALLBACK Child_WndProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 693 of file help.c.

694 {
695  switch (message)
696  {
697  case WM_PAINT:
698  return Child_OnPaint(hWnd);
699  case WM_SIZE:
700  return Child_OnSize(hWnd);
701  case WM_NOTIFY: {
703  NMHDR *nmhdr = (NMHDR*)lParam;
704 
705  switch(nmhdr->code) {
706  case TCN_SELCHANGE:
707  return OnTabChange(hWnd);
708  case TVN_SELCHANGEDW:
709  return OnTopicChange(info, (void*)((NMTREEVIEWW *)lParam)->itemNew.lParam);
710  case TVN_ITEMEXPANDINGW: {
711  TVITEMW *item = &((NMTREEVIEWW *)lParam)->itemNew;
712  HWND hwndTreeView = info->tabs[TAB_CONTENTS].hwnd;
713 
715  if (item->state & TVIS_EXPANDED)
716  {
717  item->iImage = HHTV_FOLDER;
718  item->iSelectedImage = HHTV_FOLDER;
719  }
720  else
721  {
722  item->iImage = HHTV_OPENFOLDER;
723  item->iSelectedImage = HHTV_OPENFOLDER;
724  }
726  return 0;
727  }
728  case NM_DBLCLK:
729  if(!info)
730  return 0;
731  switch(info->current_tab)
732  {
733  case TAB_INDEX:
734  return OnTopicChange(info, (void*)((NMITEMACTIVATE *)lParam)->lParam);
735  case TAB_SEARCH:
736  return OnTopicChange(info, (void*)((NMITEMACTIVATE *)lParam)->lParam);
737  }
738  break;
739  case NM_RETURN:
740  if(!info)
741  return 0;
742  switch(info->current_tab) {
743  case TAB_INDEX: {
744  HWND hwndList = info->tabs[TAB_INDEX].hwnd;
745  LVITEMW lvItem;
746 
747  lvItem.iItem = (int) SendMessageW(hwndList, LVM_GETSELECTIONMARK, 0, 0);
748  lvItem.mask = TVIF_PARAM;
749  SendMessageW(hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
750  OnTopicChange(info, (void*) lvItem.lParam);
751  return 0;
752  }
753  case TAB_SEARCH: {
754  if(nmhdr->hwndFrom == info->search.hwndEdit) {
755  char needle[100];
756  DWORD i, len;
757 
758  len = GetWindowTextA(info->search.hwndEdit, needle, sizeof(needle));
759  if(!len)
760  {
761  FIXME("Unable to get search text.\n");
762  return 0;
763  }
764  /* Convert the requested text for comparison later against the
765  * lower case version of HTML file contents.
766  */
767  for(i=0;i<len;i++)
768  needle[i] = tolower(needle[i]);
769  InitSearch(info, needle);
770  return 0;
771  }else if(nmhdr->hwndFrom == info->search.hwndList) {
772  HWND hwndList = info->search.hwndList;
773  LVITEMW lvItem;
774 
775  lvItem.iItem = (int) SendMessageW(hwndList, LVM_GETSELECTIONMARK, 0, 0);
776  lvItem.mask = TVIF_PARAM;
777  SendMessageW(hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
778  OnTopicChange(info, (void*) lvItem.lParam);
779  return 0;
780  }
781  break;
782  }
783  }
784  break;
785  }
786  break;
787  }
788  default:
790  }
791 
792  return 0;
793 }
void InitSearch(HHInfo *info, const char *needle) DECLSPEC_HIDDEN
Definition: search.c:222
Definition: tftpd.h:59
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1326
static LRESULT OnTopicChange(HHInfo *info, void *user_data)
Definition: help.c:596
HWND hWnd
Definition: settings.c:17
#define TAB_CONTENTS
Definition: hhctrl.h:116
#define HHTV_OPENFOLDER
Definition: resource.h:59
#define HHTV_FOLDER
Definition: resource.h:58
#define GetWindowLongPtrW
Definition: winuser.h:4730
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3243
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
UINT code
Definition: winuser.h:3133
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 TVM_SETITEMW
Definition: commctrl.h:3465
static LRESULT Child_OnPaint(HWND hWnd)
Definition: help.c:450
LPARAM lParam
Definition: commctrl.h:2340
#define FIXME(fmt,...)
Definition: debug.h:110
static LRESULT Child_OnSize(HWND hwnd)
Definition: help.c:540
LONG_PTR LPARAM
Definition: windef.h:208
#define TVN_ITEMEXPANDINGW
Definition: commctrl.h:3672
#define TVN_SELCHANGEDW
Definition: commctrl.h:3620
#define TCN_SELCHANGE
Definition: commctrl.h:4104
#define WM_SIZE
Definition: winuser.h:1593
Definition: hhctrl.h:185
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WM_PAINT
Definition: winuser.h:1602
UINT mask
Definition: commctrl.h:2332
HWND hwndTreeView
Definition: eventvwr.c:82
#define LVM_GETSELECTIONMARK
Definition: commctrl.h:2760
GLenum GLsizei len
Definition: glext.h:6722
#define TAB_SEARCH
Definition: hhctrl.h:118
HWND hwndFrom
Definition: winuser.h:3131
#define TAB_INDEX
Definition: hhctrl.h:117
static LRESULT OnTabChange(HWND hwnd)
Definition: help.c:559
#define TVIS_EXPANDED
Definition: commctrl.h:3256
#define NM_RETURN
Definition: commctrl.h:132
static ATOM item
Definition: dde.c:856
#define NM_DBLCLK
Definition: commctrl.h:131
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TVIF_IMAGE
Definition: commctrl.h:3239
#define LVM_GETITEMW
Definition: commctrl.h:2362
#define TVIF_PARAM
Definition: commctrl.h:3240
int tolower(int c)
Definition: utclib.c:902
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by HH_RegisterChildWndClass().

◆ CreateHelpViewer()

HHInfo* CreateHelpViewer ( HHInfo info,
LPCWSTR  filename,
HWND  caller 
)

Definition at line 1819 of file help.c.

1820 {
1821  HHInfo *tmp_info;
1822  unsigned int i;
1823 
1824  if(!info)
1825  {
1826  info = heap_alloc_zero(sizeof(HHInfo));
1827  list_add_tail(&window_list, &info->entry);
1828  }
1829 
1830  /* Set the invalid tab ID (-1) as the default value for all
1831  * of the tabs, this matches a failed TCM_INSERTITEM call.
1832  */
1833  for (i = 0; i < ARRAY_SIZE(info->tabs); i++)
1834  info->tabs[i].id = -1;
1835 
1837 
1838  info->pCHMInfo = OpenCHM(filename);
1839  if(!info->pCHMInfo) {
1841  return NULL;
1842  }
1843 
1844  if (!LoadWinTypeFromCHM(info)) {
1846  return NULL;
1847  }
1848  info->WinType.hwndCaller = caller;
1849 
1850  /* If the window is already open then load the file in that existing window */
1851  if ((tmp_info = find_window(info->WinType.pszType)) && tmp_info != info)
1852  {
1854  return CreateHelpViewer(tmp_info, filename, caller);
1855  }
1856 
1857  if(!info->viewer_initialized && !CreateViewer(info)) {
1859  return NULL;
1860  }
1861 
1862  return info;
1863 }
CHMInfo * OpenCHM(LPCWSTR szFile)
Definition: chm.c:619
HHInfo * CreateHelpViewer(HHInfo *info, LPCWSTR filename, HWND caller)
Definition: help.c:1819
BOOL LoadWinTypeFromCHM(HHInfo *info)
Definition: chm.c:341
const char * filename
Definition: ioapi.h:135
struct _test_info info[]
Definition: SetCursorPos.c:19
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
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
smooth NULL
Definition: ftsmooth.c:416
Definition: hhctrl.h:185
void ReleaseHelpViewer(HHInfo *info)
Definition: help.c:1790
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:172
#define ARRAY_SIZE(a)
Definition: main.h:24
struct list window_list
Definition: help.c:51
HHInfo * find_window(const WCHAR *window)
Definition: help.c:1955
static BOOL CreateViewer(HHInfo *pHHInfo)
Definition: help.c:1717

Referenced by CreateHelpViewer(), and HtmlHelpW().

◆ CreateViewer()

static BOOL CreateViewer ( HHInfo pHHInfo)
static

Definition at line 1717 of file help.c.

1718 {
1719  HH_CreateFont(pHHInfo);
1720 
1721  if (!HH_CreateHelpWindow(pHHInfo))
1722  return FALSE;
1723 
1725 
1726  if (!HH_AddToolbar(pHHInfo))
1727  return FALSE;
1728 
1729  HH_RegisterChildWndClass(pHHInfo);
1730 
1731  if (!HH_AddNavigationPane(pHHInfo))
1732  return FALSE;
1733 
1734  HH_RegisterSizeBarClass(pHHInfo);
1735 
1736  if (!HH_AddSizeBar(pHHInfo))
1737  return FALSE;
1738 
1739  if (!HH_AddHTMLPane(pHHInfo))
1740  return FALSE;
1741 
1742  if (!AddContentTab(pHHInfo))
1743  return FALSE;
1744 
1745  if (!AddIndexTab(pHHInfo))
1746  return FALSE;
1747 
1748  if (!AddIndexPopup(pHHInfo))
1749  return FALSE;
1750 
1751  if (!AddSearchTab(pHHInfo))
1752  return FALSE;
1753 
1754  InitContent(pHHInfo);
1755  InitIndex(pHHInfo);
1756 
1757  pHHInfo->viewer_initialized = TRUE;
1758  return TRUE;
1759 }
void InitIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:265
static BOOL HH_AddSizeBar(HHInfo *pHHInfo)
Definition: help.c:418
#define TRUE
Definition: types.h:120
static void HH_InitRequiredControls(DWORD dwControls)
Definition: help.c:1707
static BOOL AddIndexTab(HHInfo *info)
Definition: help.c:1213
static BOOL AddSearchTab(HHInfo *info)
Definition: help.c:1242
static void HH_CreateFont(HHInfo *pHHInfo)
Definition: help.c:1695
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
static BOOL HH_AddToolbar(HHInfo *pHHInfo)
Definition: help.c:995
static BOOL HH_AddNavigationPane(HHInfo *info)
Definition: help.c:1082
static BOOL AddContentTab(HHInfo *info)
Definition: help.c:1184
static BOOL HH_AddHTMLPane(HHInfo *pHHInfo)
Definition: help.c:1155
static BOOL HH_CreateHelpWindow(HHInfo *info)
Definition: help.c:1604
static void HH_RegisterSizeBarClass(HHInfo *pHHInfo)
Definition: help.c:387
static void HH_RegisterChildWndClass(HHInfo *pHHInfo)
Definition: help.c:795
static BOOL AddIndexPopup(HHInfo *info)
Definition: help.c:1406
int viewer_initialized
Definition: hhctrl.h:205
void InitContent(HHInfo *info)
Definition: content.c:304

Referenced by CreateHelpViewer().

◆ decode_html()

WCHAR* decode_html ( const char html_fragment,
int  html_fragment_len,
UINT  code_page 
)

Definition at line 1890 of file help.c.

1891 {
1892  const char *h = html_fragment, *amp, *sem;
1893  char symbol, *tmp;
1894  int len, tmp_len = 0;
1895  WCHAR *unicode_text;
1896 
1897  tmp = heap_alloc(html_fragment_len+1);
1898  while(1)
1899  {
1900  symbol = 0;
1901  amp = strchr(h, '&');
1902  if(!amp) break;
1903  len = amp-h;
1904  /* Copy the characters prior to the HTML encoded character */
1905  memcpy(&tmp[tmp_len], h, len);
1906  tmp_len += len;
1907  amp++; /* skip ampersand */
1908  sem = strchr(amp, ';');
1909  /* Require a semicolon after the ampersand */
1910  if(!sem)
1911  {
1912  h = amp;
1913  tmp[tmp_len++] = '&';
1914  continue;
1915  }
1916  /* Find the symbol either by using the ANSI character number (prefixed by the pound symbol)
1917  * or by searching the HTML entity table */
1918  len = sem-amp;
1919  if(amp[0] == '#')
1920  {
1921  char *endnum = NULL;
1922  int tmp;
1923 
1924  tmp = (char) strtol(amp, &endnum, 10);
1925  if(endnum == sem)
1926  symbol = tmp;
1927  }
1928  else
1929  symbol = find_html_symbol(amp, len);
1930  if(!symbol)
1931  {
1932  FIXME("Failed to translate HTML encoded character '&%.*s;'.\n", len, amp);
1933  h = amp;
1934  tmp[tmp_len++] = '&';
1935  continue;
1936  }
1937  /* Insert the new symbol */
1938  h = sem+1;
1939  tmp[tmp_len++] = symbol;
1940  }
1941  /* Convert any remaining characters */
1942  len = html_fragment_len-(h-html_fragment);
1943  memcpy(&tmp[tmp_len], h, len);
1944  tmp_len += len;
1945  tmp[tmp_len++] = 0; /* NULL-terminate the string */
1946 
1947  len = MultiByteToWideChar(code_page, 0, tmp, tmp_len, NULL, 0);
1948  unicode_text = heap_alloc(len*sizeof(WCHAR));
1949  MultiByteToWideChar(code_page, 0, tmp, tmp_len, unicode_text, len);
1950  heap_free(tmp);
1951  return unicode_text;
1952 }
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
unsigned char
Definition: typeof.h:29
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
static HANDLE sem
Definition: sync.c:677
#define MultiByteToWideChar
Definition: compat.h:100
char * strchr(const char *String, int ch)
Definition: utclib.c:501
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
static char find_html_symbol(const char *entity, int entity_len)
Definition: help.c:1868
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by parse_index_obj_node_param(), and parse_obj_node_param().

◆ DisplayPopupMenu()

static void DisplayPopupMenu ( HHInfo info)
static

Definition at line 819 of file help.c.

820 {
821  HMENU menu, submenu;
822  TBBUTTONINFOW button;
824  POINT coords;
825  RECT rect;
826  DWORD index;
827 
829 
830  if (!menu)
831  return;
832 
833  submenu = GetSubMenu(menu, 0);
834 
835  /* Update the Show/Hide menu item */
836  item.cbSize = sizeof(MENUITEMINFOW);
838  item.fType = MFT_STRING;
839  item.fState = MF_ENABLED;
840 
841  if (info->WinType.fNotExpanded)
842  item.dwTypeData = HH_LoadString(IDS_SHOWTABS);
843  else
844  item.dwTypeData = HH_LoadString(IDS_HIDETABS);
845 
846  SetMenuItemInfoW(submenu, IDTB_EXPAND, FALSE, &item);
847  heap_free(item.dwTypeData);
848 
849  /* Find the index toolbar button */
850  button.cbSize = sizeof(TBBUTTONINFOW);
851  button.dwMask = TBIF_COMMAND;
852  index = SendMessageW(info->WinType.hwndToolBar, TB_GETBUTTONINFOW, IDTB_OPTIONS, (LPARAM) &button);
853 
854  if (index == -1)
855  return;
856 
857  /* Get position */
858  SendMessageW(info->WinType.hwndToolBar, TB_GETITEMRECT, index, (LPARAM) &rect);
859 
860  coords.x = rect.left;
861  coords.y = rect.bottom;
862 
863  ClientToScreen(info->WinType.hwndToolBar, &coords);
864  TrackPopupMenu(submenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_NOANIMATION, coords.x, coords.y, 0, info->WinType.hwndHelp, NULL);
865 }
#define TBIF_COMMAND
Definition: commctrl.h:1196
#define MFT_STRING
Definition: winuser.h:741
#define MIIM_FTYPE
Definition: winuser.h:724
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define TPM_LEFTALIGN
Definition: winuser.h:2352
DWORD dwMask
Definition: commctrl.h:1215
#define IDTB_EXPAND
Definition: htmlhelp.h:125
GLuint coords
Definition: glext.h:7368
& rect
Definition: startmenu.cpp:1413
#define TB_GETITEMRECT
Definition: commctrl.h:1105
#define MIIM_STATE
Definition: winuser.h:716
#define TPM_TOPALIGN
Definition: winuser.h:2358
#define MENU_POPUP
Definition: resource.h:35
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
#define MF_ENABLED
Definition: winuser.h:128
unsigned long DWORD
Definition: ntddk_ex.h:95
#define index(s, c)
Definition: various.h:29
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
static LPWSTR HH_LoadString(DWORD dwID)
Definition: help.c:174
#define TB_GETBUTTONINFOW
Definition: commctrl.h:1229
#define MIIM_STRING
Definition: winuser.h:722
static ATOM item
Definition: dde.c:856
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDTB_OPTIONS
Definition: htmlhelp.h:133
#define IDS_SHOWTABS
Definition: resource.h:33
#define TPM_LEFTBUTTON
Definition: winuser.h:2354
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define IDS_HIDETABS
Definition: resource.h:32
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
struct tagMENUITEMINFOW MENUITEMINFOW
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by TB_OnClick().

◆ DoSync()

static void DoSync ( HHInfo info)
static

Definition at line 265 of file help.c.

266 {
268  HRESULT hres;
269  BSTR url;
270 
271  hres = IWebBrowser2_get_LocationURL(info->web_browser->web_browser, &url);
272 
273  if (FAILED(hres))
274  {
275  WARN("get_LocationURL failed: %08x\n", hres);
276  return;
277  }
278 
279  /* If we're not currently viewing a page in the active .chm file, abort */
280  if ((!AppendFullPathURL(info->WinType.pszFile, buf, NULL)) || (lstrlenW(buf) > lstrlenW(url)))
281  {
283  return;
284  }
285 
286  if (lstrcmpiW(buf, url) > 0)
287  {
288  static const WCHAR delimW[] = {':',':','/',0};
289  const WCHAR *index;
290 
291  index = strstrW(url, delimW);
292 
293  if (index)
294  ActivateContentTopic(info->tabs[TAB_CONTENTS].hwnd, index + 3, info->content); /* skip over ::/ */
295  }
296 
298 }
static BOOL AppendFullPathURL(LPCWSTR file, LPWSTR buf, LPCWSTR index)
Definition: help.c:234
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define WARN(fmt,...)
Definition: debug.h:111
#define TAB_CONTENTS
Definition: hhctrl.h:116
OLECHAR * BSTR
Definition: compat.h:1934
#define lstrlenW
Definition: compat.h:407
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
#define strstrW(d, s)
Definition: unicode.h:32
smooth NULL
Definition: ftsmooth.c:416
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1380
GLuint index
Definition: glext.h:6031
void ActivateContentTopic(HWND hWnd, LPCWSTR filename, ContentItem *item)
Definition: content.c:330
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
#define index(s, c)
Definition: various.h:29
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274

Referenced by TB_OnClick().

◆ EditChild_WndProc()

static LRESULT CALLBACK EditChild_WndProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 678 of file help.c.

679 {
681 
682  if(message == WM_KEYUP && wParam == VK_RETURN)
683  {
684  NMHDR nmhdr;
685 
686  nmhdr.hwndFrom = hWnd;
687  nmhdr.code = NM_RETURN;
689  }
690  return editWndProc(hWnd, message, wParam, lParam);
691 }
Definition: tftpd.h:59
HWND hWnd
Definition: settings.c:17
#define GetWindowLongPtrW
Definition: winuser.h:4730
#define VK_RETURN
Definition: winuser.h:2176
WPARAM wParam
Definition: combotst.c:138
UINT code
Definition: winuser.h:3133
#define GWLP_USERDATA
Definition: treelist.c:63
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_KEYUP
Definition: winuser.h:1698
HWND hwndFrom
Definition: winuser.h:3131
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2880
#define NM_RETURN
Definition: commctrl.h:132
HWND WINAPI GetParent(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by AddSearchTab().

◆ ExpandContract()

static void ExpandContract ( HHInfo pHHInfo)
static

Definition at line 1496 of file help.c.

1497 {
1498  RECT r, nav;
1499 
1500  pHHInfo->WinType.fNotExpanded = !pHHInfo->WinType.fNotExpanded;
1501  GetWindowRect(pHHInfo->WinType.hwndHelp, &r);
1502  NP_GetNavigationRect(pHHInfo, &nav);
1503 
1504  /* hide/show both the nav bar and the size bar */
1505  if (pHHInfo->WinType.fNotExpanded)
1506  {
1508  ShowWindow(pHHInfo->hwndSizeBar, SW_HIDE);
1509  r.left = r.left + nav.right;
1510 
1513  }
1514  else
1515  {
1517  ShowWindow(pHHInfo->hwndSizeBar, SW_SHOW);
1518  r.left = r.left - nav.right;
1519 
1522  }
1523 
1524  MoveWindow(pHHInfo->WinType.hwndHelp, r.left, r.top, r.right-r.left, r.bottom-r.top, TRUE);
1525 }
HWND hwndToolBar
Definition: htmlhelp.h:353
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
#define IDTB_EXPAND
Definition: htmlhelp.h:125
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG right
Definition: windef.h:293
#define IDTB_CONTRACT
Definition: htmlhelp.h:126
static void NP_GetNavigationRect(HHInfo *pHHInfo, RECT *rc)
Definition: help.c:1045
#define SW_SHOW
Definition: winuser.h:769
HWND hwndNavigation
Definition: htmlhelp.h:354
HH_WINTYPEW WinType
Definition: hhctrl.h:188
BOOL fNotExpanded
Definition: htmlhelp.h:363
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hwndSizeBar
Definition: hhctrl.h:201
#define TB_HIDEBUTTON
Definition: commctrl.h:1017
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by TB_OnClick().

◆ find_html_symbol()

static char find_html_symbol ( const char entity,
int  entity_len 
)
static

Definition at line 1868 of file help.c.

1869 {
1871  int min = 0, dir;
1872 
1873  while(min <= max)
1874  {
1875  int pos = (min+max)/2;
1876  const char *encoded_symbol = html_encoded_symbols[pos].html_code;
1877  dir = strncmp(encoded_symbol, entity, entity_len);
1878  if(dir == 0 && !encoded_symbol[entity_len]) return html_encoded_symbols[pos].ansi_symbol;
1879  if(dir < 0)
1880  min = pos+1;
1881  else
1882  max = pos-1;
1883  }
1884  return 0;
1885 }
#define max(a, b)
Definition: svc.c:63
static struct html_encoded_symbol html_encoded_symbols[]
Definition: help.c:64
Definition: actctx.c:371
unsigned int dir
Definition: maze.c:112
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define ARRAY_SIZE(a)
Definition: main.h:24
#define min(a, b)
Definition: monoChain.cc:55

Referenced by decode_html().

◆ find_window()

HHInfo* find_window ( const WCHAR window)

Definition at line 1955 of file help.c.

1956 {
1957  HHInfo *info;
1958 
1960  {
1961  if (strcmpW(info->WinType.pszType, window) == 0)
1962  return info;
1963  }
1964  return NULL;
1965 }
struct _test_info info[]
Definition: SetCursorPos.c:19
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
Definition: hhctrl.h:185
uint32_t entry
Definition: isohybrid.c:63
static IHTMLWindow2 * window
Definition: events.c:77
struct list window_list
Definition: help.c:51
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229

Referenced by CreateHelpViewer(), HtmlHelpA(), and HtmlHelpW().

◆ Help_OnSize()

static LRESULT Help_OnSize ( HWND  hWnd)
static

Definition at line 1527 of file help.c.

1528 {
1529  HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
1530  DWORD dwSize;
1531  RECT rc;
1532 
1533  if (!pHHInfo)
1534  return 0;
1535 
1536  if (navigation_visible(pHHInfo))
1537  {
1538  NP_GetNavigationRect(pHHInfo, &rc);
1539  SetWindowPos(pHHInfo->WinType.hwndNavigation, HWND_TOP, 0, 0,
1540  rc.right, rc.bottom, SWP_NOMOVE);
1541 
1542  SB_GetSizeBarRect(pHHInfo, &rc);
1543  SetWindowPos(pHHInfo->hwndSizeBar, HWND_TOP, rc.left, rc.top,
1544  rc.right, rc.bottom, SWP_SHOWWINDOW);
1545 
1546  }
1547 
1548  HP_GetHTMLRect(pHHInfo, &rc);
1549  SetWindowPos(pHHInfo->WinType.hwndHTML, HWND_TOP, rc.left, rc.top,
1550  rc.right, rc.bottom, SWP_SHOWWINDOW);
1551 
1552  /* Resize browser window taking the frame size into account */
1554  ResizeWebBrowser(pHHInfo, rc.right - dwSize, rc.bottom - dwSize);
1555 
1556  return 0;
1557 }
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:292
#define HWND_TOP
Definition: winuser.h:1193
#define GetWindowLongPtrW
Definition: winuser.h:4730
LONG left
Definition: windef.h:291
static void SB_GetSizeBarRect(HHInfo *info, RECT *rc)
Definition: help.c:407
#define SM_CXFRAME
Definition: winuser.h:984
LONG right
Definition: windef.h:293
static void NP_GetNavigationRect(HHInfo *pHHInfo, RECT *rc)
Definition: help.c:1045
static BOOL navigation_visible(HHInfo *info)
Definition: help.c:168
void ResizeWebBrowser(HHInfo *, DWORD, DWORD) DECLSPEC_HIDDEN
Definition: webbrowser.c:744
Definition: hhctrl.h:185
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND hwndNavigation
Definition: htmlhelp.h:354
HH_WINTYPEW WinType
Definition: hhctrl.h:188
HWND hwndSizeBar
Definition: hhctrl.h:201
#define SWP_SHOWWINDOW
Definition: winuser.h:1233
LONG bottom
Definition: windef.h:294
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
static void HP_GetHTMLRect(HHInfo *info, RECT *rc)
Definition: help.c:1132
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by Help_WndProc(), and SB_OnLButtonUp().

◆ Help_WndProc()

static LRESULT CALLBACK Help_WndProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1579 of file help.c.

1580 {
1581  switch (message)
1582  {
1583  case WM_COMMAND:
1584  if (HIWORD(wParam) == BN_CLICKED)
1586  break;
1587  case WM_SIZE:
1588  return Help_OnSize(hWnd);
1589  case WM_CLOSE:
1591  return 0;
1592  case WM_DESTROY:
1593  if(hh_process)
1594  PostQuitMessage(0);
1595  break;
1596 
1597  default:
1599  }
1600 
1601  return 0;
1602 }
Definition: tftpd.h:59
static LRESULT Help_OnSize(HWND hWnd)
Definition: help.c:1527
HWND hWnd
Definition: settings.c:17
#define GetWindowLongPtrW
Definition: winuser.h:4730
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL hh_process
Definition: hhctrl.c:42
#define WM_DESTROY
Definition: winuser.h:1591
static void TB_OnClick(HWND hWnd, DWORD dwID)
Definition: help.c:867
#define WM_SIZE
Definition: winuser.h:1593
Definition: hhctrl.h:185
#define WM_CLOSE
Definition: winuser.h:1603
#define BN_CLICKED
Definition: winuser.h:1907
void ReleaseHelpViewer(HHInfo *info)
Definition: help.c:1790
#define WM_COMMAND
Definition: winuser.h:1722
#define HIWORD(l)
Definition: typedefs.h:246
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

Referenced by HH_CreateHelpWindow().

◆ HelpPopup_WndProc()

static LRESULT CALLBACK HelpPopup_WndProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1336 of file help.c.

1337 {
1339 
1340  switch (message)
1341  {
1342  case WM_SIZE:
1344  return 0;
1345  case WM_DESTROY:
1347  return 0;
1348  case WM_CLOSE:
1350  return 0;
1351 
1352  default:
1354  }
1355 
1356  return 0;
1357 }
Definition: tftpd.h:59
#define SW_HIDE
Definition: winuser.h:762
HWND hWnd
Definition: settings.c:17
#define GetWindowLongPtrW
Definition: winuser.h:4730
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_DESTROY
Definition: winuser.h:1591
#define WM_SIZE
Definition: winuser.h:1593
Definition: hhctrl.h:185
#define WM_CLOSE
Definition: winuser.h:1603
static void ResizePopupChild(HHInfo *info)
Definition: help.c:1307
LPARAM lParam
Definition: combotst.c:139

Referenced by AddIndexPopup().

◆ HH_AddHTMLPane()

static BOOL HH_AddHTMLPane ( HHInfo pHHInfo)
static

Definition at line 1155 of file help.c.

1156 {
1157  HWND hWnd;
1158  HWND hwndParent = pHHInfo->WinType.hwndHelp;
1161  RECT rc;
1162 
1163  HP_GetHTMLRect(pHHInfo, &rc);
1164 
1165  hWnd = CreateWindowExW(dwExStyles, szChildClass, szEmpty, dwStyles,
1166  rc.left, rc.top, rc.right, rc.bottom,
1168  if (!hWnd)
1169  return FALSE;
1170 
1171  if (!InitWebBrowser(pHHInfo, hWnd))
1172  return FALSE;
1173 
1174  /* store the pointer to the HH info struct */
1175  SetWindowLongPtrW(hWnd, 0, (LONG_PTR)pHHInfo);
1176 
1178  UpdateWindow(hWnd);
1179 
1180  pHHInfo->WinType.hwndHTML = hWnd;
1181  return TRUE;
1182 }
#define TRUE
Definition: types.h:120
static const WCHAR szChildClass[]
Definition: help.c:446
#define WS_EX_LTRREADING
Definition: winuser.h:393
BOOL WINAPI UpdateWindow(_In_ HWND)
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:292
BOOL InitWebBrowser(HHInfo *, HWND) DECLSPEC_HIDDEN
Definition: webbrowser.c:670
LONG left
Definition: windef.h:291
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LONG right
Definition: windef.h:293
static const WCHAR szEmpty[]
Definition: help.c:53
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define SW_SHOW
Definition: winuser.h:769
#define WS_EX_LEFT
Definition: winuser.h:391
unsigned long DWORD
Definition: ntddk_ex.h:95
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)
HH_WINTYPEW WinType
Definition: hhctrl.h:188
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
LONG bottom
Definition: windef.h:294
#define SetWindowLongPtrW
Definition: winuser.h:5247
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
#define WS_VISIBLE
Definition: pedump.c:620
static void HP_GetHTMLRect(HHInfo *info, RECT *rc)
Definition: help.c:1132

Referenced by CreateViewer().

◆ HH_AddNavigationPane()

static BOOL HH_AddNavigationPane ( HHInfo info)
static

Definition at line 1082 of file help.c.

1083 {
1084  HWND hWnd, hwndTabCtrl;
1085  HWND hwndParent = info->WinType.hwndHelp;
1086  DWORD dwStyles = WS_CHILDWINDOW;
1088  RECT rc;
1089 
1090  if (navigation_visible(info))
1091  dwStyles |= WS_VISIBLE;
1092 
1093  NP_GetNavigationRect(info, &rc);
1094 
1095  hWnd = CreateWindowExW(dwExStyles, szChildClass, szEmpty, dwStyles,
1096  rc.left, rc.top, rc.right, rc.bottom,
1098  if (!hWnd)
1099  return FALSE;
1100 
1102 
1103  hwndTabCtrl = CreateWindowExW(dwExStyles, WC_TABCONTROLW, szEmpty, dwStyles | WS_VISIBLE,
1104  0, TAB_TOP_PADDING,
1105  rc.right - TAB_RIGHT_PADDING,
1106  rc.bottom - TAB_TOP_PADDING,
1108  if (!hwndTabCtrl)
1109  return FALSE;
1110 
1111  if (*info->WinType.pszToc)
1112  info->tabs[TAB_CONTENTS].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_CONTENTS);
1113 
1114  if (*info->WinType.pszIndex)
1115  info->tabs[TAB_INDEX].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_INDEX);
1116 
1117  if (info->WinType.fsWinProperties & HHWIN_PROP_TAB_SEARCH)
1118  info->tabs[TAB_SEARCH].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_SEARCH);
1119 
1120  if (info->WinType.fsWinProperties & HHWIN_PROP_TAB_FAVORITES)
1121  info->tabs[TAB_FAVORITES].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_FAVORITES);
1122 
1123  SendMessageW(hwndTabCtrl, WM_SETFONT, (WPARAM)info->hFont, TRUE);
1124 
1125  info->hwndTabCtrl = hwndTabCtrl;
1126  info->WinType.hwndNavigation = hWnd;
1127  return TRUE;
1128 }
#define HHWIN_PROP_TAB_FAVORITES
Definition: htmlhelp.h:67
#define TRUE
Definition: types.h:120
static const WCHAR szChildClass[]
Definition: help.c:446
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define TAB_FAVORITES
Definition: hhctrl.h:119
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:292
#define IDS_FAVORITES
Definition: resource.h:31
#define IDS_INDEX
Definition: resource.h:29
#define TAB_CONTENTS
Definition: hhctrl.h:116
UINT_PTR WPARAM
Definition: windef.h:207
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
static const WCHAR szEmpty[]
Definition: help.c:53
static void NP_GetNavigationRect(HHInfo *pHHInfo, RECT *rc)
Definition: help.c:1045
static BOOL navigation_visible(HHInfo *info)
Definition: help.c:168
smooth NULL
Definition: ftsmooth.c:416
static DWORD NP_CreateTab(HINSTANCE hInstance, HWND hwndTabCtrl, DWORD index)
Definition: help.c:1067
static HWND hwndParent
Definition: cryptui.c:300
#define TAB_TOP_PADDING
Definition: help.c:46
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define WS_EX_LEFT
Definition: winuser.h:391
#define TAB_RIGHT_PADDING
Definition: help.c:47
unsigned long DWORD
Definition: ntddk_ex.h:95
#define HHWIN_PROP_TAB_SEARCH
Definition: htmlhelp.h:65
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)
#define WC_TABCONTROLW
Definition: commctrl.h:3907
#define TAB_SEARCH
Definition: hhctrl.h:118
#define TAB_INDEX
Definition: hhctrl.h:117
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define IDS_CONTENTS
Definition: resource.h:28
#define WM_SETFONT
Definition: winuser.h:1632
LONG bottom
Definition: windef.h:294
#define SetWindowLongPtrW
Definition: winuser.h:5247
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
#define WS_VISIBLE
Definition: pedump.c:620
#define IDS_SEARCH
Definition: resource.h:30

Referenced by CreateViewer().

◆ HH_AddSizeBar()

static BOOL HH_AddSizeBar ( HHInfo pHHInfo)
static

Definition at line 418 of file help.c.

419 {
420  HWND hWnd;
421  HWND hwndParent = pHHInfo->WinType.hwndHelp;
422  DWORD dwStyles = WS_CHILDWINDOW | WS_OVERLAPPED;
424  RECT rc;
425 
426  if (navigation_visible(pHHInfo))
427  dwStyles |= WS_VISIBLE;
428 
429  SB_GetSizeBarRect(pHHInfo, &rc);
430 
431  hWnd = CreateWindowExW(dwExStyles, szSizeBarClass, szEmpty, dwStyles,
432  rc.left, rc.top, rc.right, rc.bottom,
434  if (!hWnd)
435  return FALSE;
436 
437  /* store the pointer to the HH info struct */
438  SetWindowLongPtrW(hWnd, 0, (LONG_PTR)pHHInfo);
439 
440  pHHInfo->hwndSizeBar = hWnd;
441  return TRUE;
442 }
#define TRUE
Definition: types.h:120
#define WS_EX_LTRREADING
Definition: winuser.h:393
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
static void SB_GetSizeBarRect(HHInfo *info, RECT *rc)
Definition: help.c:407
LONG right
Definition: windef.h:293
static const WCHAR szSizeBarClass[]
Definition: help.c:304
static const WCHAR szEmpty[]
Definition: help.c:53
static BOOL navigation_visible(HHInfo *info)
Definition: help.c:168
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define WS_EX_LEFT
Definition: winuser.h:391
#define WS_OVERLAPPED
Definition: pedump.c:615
unsigned long DWORD
Definition: ntddk_ex.h:95
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)
HH_WINTYPEW WinType
Definition: hhctrl.h:188
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
HWND hwndSizeBar
Definition: hhctrl.h:201
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
LONG bottom
Definition: windef.h:294
#define SetWindowLongPtrW
Definition: winuser.h:5247
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by CreateViewer().

◆ HH_AddToolbar()

static BOOL HH_AddToolbar ( HHInfo pHHInfo)
static

Definition at line 995 of file help.c.

996 {
997  HWND hToolbar;
998  HWND hwndParent = pHHInfo->WinType.hwndHelp;
999  DWORD toolbarFlags;
1001  DWORD dwStyles, dwExStyles;
1002  DWORD dwNumButtons, dwIndex;
1003 
1005  toolbarFlags = pHHInfo->WinType.fsToolBarFlags;
1006  else
1007  toolbarFlags = HHWIN_DEF_BUTTONS;
1008 
1011 
1012  hToolbar = CreateWindowExW(dwExStyles, TOOLBARCLASSNAMEW, NULL, dwStyles,
1013  0, 0, 0, 0, hwndParent, NULL,
1015  if (!hToolbar)
1016  return FALSE;
1017  pHHInfo->WinType.hwndToolBar = hToolbar;
1018 
1020  SendMessageW(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
1021  SendMessageW(hToolbar, WM_SETFONT, (WPARAM)pHHInfo->hFont, TRUE);
1022 
1023  TB_AddButtonsFromFlags(pHHInfo, buttons, toolbarFlags, &dwNumButtons);
1024 
1025  for (dwIndex = 0; dwIndex < dwNumButtons; dwIndex++)
1026  {
1027  LPWSTR szBuf = HH_LoadString(buttons[dwIndex].idCommand);
1028  DWORD dwLen = strlenW(szBuf);
1029  szBuf[dwLen + 1] = 0; /* Double-null terminate */
1030 
1031  buttons[dwIndex].iString = (DWORD)SendMessageW(hToolbar, TB_ADDSTRINGW, 0, (LPARAM)szBuf);
1032  heap_free(szBuf);
1033  }
1034 
1035  SendMessageW(hToolbar, TB_ADDBUTTONSW, dwNumButtons, (LPARAM)buttons);
1036  SendMessageW(hToolbar, TB_AUTOSIZE, 0, 0);
1038  ShowWindow(hToolbar, SW_SHOW);
1039 
1040  return TRUE;
1041 }
HWND hwndToolBar
Definition: htmlhelp.h:353
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1106
#define TRUE
Definition: types.h:120
#define HHWIN_DEF_BUTTONS
Definition: htmlhelp.h:122
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define TB_ADDSTRINGW
Definition: commctrl.h:1104
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:915
#define IDTB_EXPAND
Definition: htmlhelp.h:125
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
DWORD fsToolBarFlags
Definition: htmlhelp.h:362
#define DWORD
Definition: nt_native.h:44
#define CCS_NODIVIDER
Definition: commctrl.h:2220
DWORD fsWinProperties
Definition: htmlhelp.h:344
#define TB_AUTOSIZE
Definition: commctrl.h:1109
#define IDTB_TOC_PREV
Definition: htmlhelp.h:148
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
LONG_PTR LPARAM
Definition: windef.h:208
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define SW_SHOW
Definition: winuser.h:769
#define WS_EX_LEFT
Definition: winuser.h:391
#define ICON_SIZE
Definition: help.c:817
unsigned long DWORD
Definition: ntddk_ex.h:95
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:961
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)
HH_WINTYPEW WinType
Definition: hhctrl.h:188
#define TB_ADDBUTTONSW
Definition: commctrl.h:1238
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1108
#define HHWIN_PARAM_TB_FLAGS
Definition: htmlhelp.h:92
static LPWSTR HH_LoadString(DWORD dwID)
Definition: help.c:174
static void TB_AddButtonsFromFlags(HHInfo *pHHInfo, TBBUTTON *pButtons, DWORD dwButtonFlags, LPDWORD pdwNumButtons)
Definition: help.c:931
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
HWND buttons[5]
Definition: sndrec32.cpp:40
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SETFONT
Definition: winuser.h:1632
#define HHWIN_PROP_TRI_PANE
Definition: htmlhelp.h:60
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:962
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HFONT hFont
Definition: hhctrl.h:202
#define TBSTYLE_FLAT
Definition: commctrl.h:964
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by CreateViewer().

◆ HH_CreateFont()

static void HH_CreateFont ( HHInfo pHHInfo)
static

Definition at line 1695 of file help.c.

1696 {
1697  LOGFONTW lf;
1698 
1700  lf.lfWeight = FW_NORMAL;
1701  lf.lfItalic = FALSE;
1702  lf.lfUnderline = FALSE;
1703 
1704  pHHInfo->hFont = CreateFontIndirectW(&lf);
1705 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
#define DEFAULT_GUI_FONT
Definition: wingdi.h:908
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BYTE lfItalic
Definition: dimm.idl:64
#define FW_NORMAL
Definition: wingdi.h:372
LONG lfWeight
Definition: dimm.idl:63
BYTE lfUnderline
Definition: dimm.idl:65
HFONT hFont
Definition: hhctrl.h:202

Referenced by CreateViewer().

◆ HH_CreateHelpWindow()

static BOOL HH_CreateHelpWindow ( HHInfo info)
static

Definition at line 1604 of file help.c.

1605 {
1606  HWND hWnd;
1607  RECT winPos = info->WinType.rcWindowPos;
1608  WNDCLASSEXW wcex;
1609  DWORD dwStyles, dwExStyles;
1610  DWORD x, y, width = 0, height = 0;
1611  LPCWSTR caption;
1612 
1613  static const WCHAR windowClassW[] = {
1614  'H','H',' ', 'P','a','r','e','n','t',0
1615  };
1616 
1617  wcex.cbSize = sizeof(WNDCLASSEXW);
1618  wcex.style = CS_HREDRAW | CS_VREDRAW;
1619  wcex.lpfnWndProc = Help_WndProc;
1620  wcex.cbClsExtra = 0;
1621  wcex.cbWndExtra = sizeof(LONG_PTR);
1622  wcex.hInstance = hhctrl_hinstance;
1625  wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
1626  wcex.lpszMenuName = NULL;
1627  wcex.lpszClassName = windowClassW;
1629 
1630  RegisterClassExW(&wcex);
1631 
1632  /* Read in window parameters if available */
1633  if (info->WinType.fsValidMembers & HHWIN_PARAM_STYLES)
1634  {
1635  dwStyles = info->WinType.dwStyles;
1636  if (!(info->WinType.dwStyles & WS_CHILD))
1637  dwStyles |= WS_OVERLAPPEDWINDOW;
1638  }
1639  else
1640  dwStyles = WS_OVERLAPPEDWINDOW | WS_VISIBLE |
1642 
1643  if (info->WinType.fsValidMembers & HHWIN_PARAM_EXSTYLES)
1644  dwExStyles = info->WinType.dwExStyles;
1645  else
1646  dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_APPWINDOW |
1648 
1649  if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT)
1650  {
1651  x = winPos.left;
1652  y = winPos.top;
1653  width = winPos.right - x;
1654  height = winPos.bottom - y;
1655  }
1656  if (!width || !height)
1657  {
1658  x = WINTYPE_DEFAULT_X;
1659  y = WINTYPE_DEFAULT_Y;
1662  }
1663 
1664  if (!(info->WinType.fsWinProperties & HHWIN_PROP_TRI_PANE) && info->WinType.fNotExpanded)
1665  {
1666  if (!(info->WinType.fsValidMembers & HHWIN_PARAM_NAV_WIDTH) &&
1667  info->WinType.iNavWidth == 0)
1668  {
1669  info->WinType.iNavWidth = WINTYPE_DEFAULT_NAVWIDTH;
1670  }
1671 
1672  x += info->WinType.iNavWidth;
1673  width -= info->WinType.iNavWidth;
1674  }
1675 
1676 
1677  caption = info->WinType.pszCaption;
1678  if (!*caption) caption = info->pCHMInfo->defTitle;
1679 
1680  hWnd = CreateWindowExW(dwExStyles, windowClassW, caption, dwStyles, x, y, width, height,
1681  info->WinType.hwndCaller, NULL, hhctrl_hinstance, NULL);
1682  if (!hWnd)
1683  return FALSE;
1684 
1686  UpdateWindow(hWnd);
1687 
1688  /* store the pointer to the HH info struct */
1690 
1691  info->WinType.hwndHelp = hWnd;
1692  return TRUE;
1693 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WINTYPE_DEFAULT_NAVWIDTH
Definition: help.c:44
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define WINTYPE_DEFAULT_WIDTH
Definition: help.c:42
GLint GLint GLsizei width
Definition: gl.h:1546
#define LONG_PTR
Definition: treelist.c:79
#define TRUE
Definition: types.h:120
int cbWndExtra
Definition: winuser.h:3194
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define WINTYPE_DEFAULT_HEIGHT
Definition: help.c:43
static const WCHAR windowClassW[]
Definition: actctx.c:596
BOOL WINAPI UpdateWindow(_In_ HWND)
HWND hWnd
Definition: settings.c:17
#define HHWIN_PARAM_NAV_WIDTH
Definition: htmlhelp.h:89
LONG top
Definition: windef.h:292
#define CS_HREDRAW
Definition: winuser.h:648
HICON hIcon
Definition: winuser.h:3196
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define IDI_APPLICATION
Definition: winuser.h:699
#define WS_CHILD
Definition: pedump.c:617
struct _WNDCLASSEXW WNDCLASSEXW
LONG left
Definition: windef.h:291
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WINTYPE_DEFAULT_Y
Definition: help.c:41
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LONG right
Definition: windef.h:293
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
static LRESULT CALLBACK Help_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:1579
LPCWSTR lpszMenuName
Definition: winuser.h:3199
#define HHWIN_PARAM_STYLES
Definition: htmlhelp.h:86
smooth NULL
Definition: ftsmooth.c:416
#define COLOR_MENU
Definition: winuser.h:907
int cbClsExtra
Definition: winuser.h:3193
#define SW_SHOW
Definition: winuser.h:769
#define WS_EX_LEFT
Definition: winuser.h:391
LPCWSTR lpszClassName
Definition: winuser.h:3200
#define WINTYPE_DEFAULT_X
Definition: help.c:40
#define CS_VREDRAW
Definition: winuser.h:653
__wchar_t WCHAR
Definition: xmlstorage.h:180
HBRUSH hbrBackground
Definition: winuser.h:3198
UINT cbSize
Definition: winuser.h:3190
unsigned long DWORD
Definition: ntddk_ex.h:95
#define HHWIN_PARAM_EXSTYLES
Definition: htmlhelp.h:87
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
HINSTANCE hInstance
Definition: winuser.h:3195
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)
HCURSOR hCursor
Definition: winuser.h:3197
UINT style
Definition: winuser.h:3191
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
WNDPROC lpfnWndProc
Definition: winuser.h:3192
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define HHWIN_PARAM_RECT
Definition: htmlhelp.h:88
HICON hIconSm
Definition: winuser.h:3201
#define IDC_ARROW
Definition: winuser.h:682
#define HHWIN_PROP_TRI_PANE
Definition: htmlhelp.h:60
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
LONG bottom
Definition: windef.h:294
#define SetWindowLongPtrW
Definition: winuser.h:5247
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by CreateViewer().

◆ HH_InitRequiredControls()

static void HH_InitRequiredControls ( DWORD  dwControls)
static

Definition at line 1707 of file help.c.

1708 {
1709  INITCOMMONCONTROLSEX icex;
1710 
1711  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
1712  icex.dwICC = dwControls;
1713  InitCommonControlsEx(&icex);
1714 }
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893

Referenced by CreateViewer().

◆ HH_LoadString()

static LPWSTR HH_LoadString ( DWORD  dwID)
static

Definition at line 174 of file help.c.

175 {
176  LPWSTR string = NULL;
177  LPCWSTR stringresource;
178  int iSize;
179 
180  iSize = LoadStringW(hhctrl_hinstance, dwID, (LPWSTR)&stringresource, 0);
181 
182  string = heap_alloc((iSize + 2) * sizeof(WCHAR)); /* some strings (tab text) needs double-null termination */
183  memcpy(string, stringresource, iSize*sizeof(WCHAR));
184  string[iSize] = 0;
185 
186  return string;
187 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
char string[160]
Definition: util.h:11
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DisplayPopupMenu(), HH_AddToolbar(), and NP_CreateTab().

◆ HH_RegisterChildWndClass()

static void HH_RegisterChildWndClass ( HHInfo pHHInfo)
static

Definition at line 795 of file help.c.

796 {
797  WNDCLASSEXW wcex;
798 
799  wcex.cbSize = sizeof(WNDCLASSEXW);
800  wcex.style = 0;
801  wcex.lpfnWndProc = Child_WndProc;
802  wcex.cbClsExtra = 0;
803  wcex.cbWndExtra = sizeof(LONG_PTR);
807  wcex.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
808  wcex.lpszMenuName = NULL;
811 
812  RegisterClassExW(&wcex);
813 }
#define LONG_PTR
Definition: treelist.c:79
int cbWndExtra
Definition: winuser.h:3194
static const WCHAR szChildClass[]
Definition: help.c:446
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HICON hIcon
Definition: winuser.h:3196
#define IDI_APPLICATION
Definition: winuser.h:699
struct _WNDCLASSEXW WNDCLASSEXW
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
LPCWSTR lpszMenuName
Definition: winuser.h:3199
smooth NULL
Definition: ftsmooth.c:416
int cbClsExtra
Definition: winuser.h:3193
LPCWSTR lpszClassName
Definition: winuser.h:3200
HBRUSH hbrBackground
Definition: winuser.h:3198
UINT cbSize
Definition: winuser.h:3190
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
HINSTANCE hInstance
Definition: winuser.h:3195
static LRESULT CALLBACK Child_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:693
#define COLOR_BTNFACE
Definition: winuser.h:918
HCURSOR hCursor
Definition: winuser.h:3197
UINT style
Definition: winuser.h:3191
WNDPROC lpfnWndProc
Definition: winuser.h:3192
HICON hIconSm
Definition: winuser.h:3201
#define IDC_ARROW
Definition: winuser.h:682
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41

Referenced by CreateViewer().

◆ HH_RegisterSizeBarClass()

static void HH_RegisterSizeBarClass ( HHInfo pHHInfo)
static

Definition at line 387 of file help.c.

388 {
389  WNDCLASSEXW wcex;
390 
391  wcex.cbSize = sizeof(WNDCLASSEXW);
392  wcex.style = 0;
394  wcex.cbClsExtra = 0;
395  wcex.cbWndExtra = sizeof(LONG_PTR);
399  wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
400  wcex.lpszMenuName = NULL;
403 
404  RegisterClassExW(&wcex);
405 }
#define IDC_SIZEWE
Definition: winuser.h:689
#define LONG_PTR
Definition: treelist.c:79
int cbWndExtra
Definition: winuser.h:3194
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HICON hIcon
Definition: winuser.h:3196
#define IDI_APPLICATION
Definition: winuser.h:699
struct _WNDCLASSEXW WNDCLASSEXW
static const WCHAR szSizeBarClass[]
Definition: help.c:304
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
LPCWSTR lpszMenuName
Definition: winuser.h:3199
smooth NULL
Definition: ftsmooth.c:416
#define COLOR_MENU
Definition: winuser.h:907
int cbClsExtra
Definition: winuser.h:3193
LPCWSTR lpszClassName
Definition: winuser.h:3200
HBRUSH hbrBackground
Definition: winuser.h:3198
UINT cbSize
Definition: winuser.h:3190
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
HINSTANCE hInstance
Definition: winuser.h:3195
HCURSOR hCursor
Definition: winuser.h:3197
UINT style
Definition: winuser.h:3191
WNDPROC lpfnWndProc
Definition: winuser.h:3192
HICON hIconSm
Definition: winuser.h:3201
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
static LRESULT CALLBACK SizeBar_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:364

Referenced by CreateViewer().

◆ HP_GetHTMLRect()

static void HP_GetHTMLRect ( HHInfo info,
RECT rc 
)
static

Definition at line 1132 of file help.c.

1133 {
1134  RECT rectTB, rectWND, rectNP, rectSB;
1135 
1136  GetClientRect(info->WinType.hwndHelp, &rectWND);
1137  GetClientRect(info->hwndSizeBar, &rectSB);
1138 
1139  rc->left = 0;
1140  rc->top = 0;
1141  if (navigation_visible(info))
1142  {
1143  GetClientRect(info->WinType.hwndNavigation, &rectNP);
1144  rc->left += rectNP.right + rectSB.right;
1145  }
1146  if (info->WinType.fsWinProperties & HHWIN_PROP_TRI_PANE)
1147  {
1148  GetClientRect(info->WinType.hwndToolBar, &rectTB);
1149  rc->top += rectTB.bottom;
1150  }
1151  rc->right = rectWND.right - rc->left;
1152  rc->bottom = rectWND.bottom - rc->top;
1153 }
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
static BOOL navigation_visible(HHInfo *info)
Definition: help.c:168
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define HHWIN_PROP_TRI_PANE
Definition: htmlhelp.h:60
LONG bottom
Definition: windef.h:294

Referenced by Help_OnSize(), and HH_AddHTMLPane().

◆ navigate_url()

static HRESULT navigate_url ( HHInfo info,
LPCWSTR  surl 
)
static

Definition at line 189 of file help.c.

190 {
191  VARIANT url;
192  HRESULT hres;
193 
194  TRACE("%s\n", debugstr_w(surl));
195 
196  V_VT(&url) = VT_BSTR;
197  V_BSTR(&url) = SysAllocString(surl);
198 
199  hres = IWebBrowser2_Navigate2(info->web_browser->web_browser, &url, 0, 0, 0, 0);
200 
201  VariantClear(&url);
202 
203  if(FAILED(hres))
204  TRACE("Navigation failed: %08x\n", hres);
205 
206  return hres;
207 }
#define debugstr_w
Definition: kernel32.h:32
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226

Referenced by HTMLDocument_put_URL(), HTMLFrameBase_put_src(), HTMLLocation_put_hash(), HTMLLocation_put_href(), HTMLLocation_replace(), HTMLWindow2_navigate(), InternetExplorer_Navigate(), InternetExplorer_Navigate2(), navigate_href(), NavigateToChm(), NavigateToUrl(), WebBrowser_Navigate(), and WebBrowser_Navigate2().

◆ NavigateToChm()

BOOL NavigateToChm ( HHInfo info,
LPCWSTR  file,
LPCWSTR  index 
)

Definition at line 253 of file help.c.

254 {
256 
257  TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index));
258 
259  if ((!info->web_browser) || !AppendFullPathURL(file, buf, index))
260  return FALSE;
261 
262  return SUCCEEDED(navigate_url(info, buf));
263 }
static BOOL AppendFullPathURL(LPCWSTR file, LPWSTR buf, LPCWSTR index)
Definition: help.c:234
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:189
#define debugstr_w
Definition: kernel32.h:32
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1380
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: fci.c:126

Referenced by HtmlHelpW(), NavigateToUrl(), OnTopicChange(), PopupChild_WndProc(), and TB_OnClick().

◆ NavigateToUrl()

BOOL NavigateToUrl ( HHInfo info,
LPCWSTR  surl 
)

Definition at line 209 of file help.c.

210 {
211  ChmPath chm_path;
212  BOOL ret;
213  HRESULT hres;
214 
215  static const WCHAR url_indicator[] = {':', '/', '/', 0};
216 
217  TRACE("%s\n", debugstr_w(surl));
218 
219  if (strstrW(surl, url_indicator)) {
220  hres = navigate_url(info, surl);
221  if(SUCCEEDED(hres))
222  return TRUE;
223  } /* look up in chm if it doesn't look like a full url */
224 
225  SetChmPath(&chm_path, info->pCHMInfo->szFile, surl);
226  ret = NavigateToChm(info, chm_path.chm_file, chm_path.chm_index);
227 
228  heap_free(chm_path.chm_file);
229  heap_free(chm_path.chm_index);
230 
231  return ret;
232 }
#define TRUE
Definition: types.h:120
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:189
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:253
LPWSTR chm_index
Definition: hhctrl.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define strstrW(d, s)
Definition: unicode.h:32
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
LPWSTR chm_file
Definition: hhctrl.h:55
int ret
void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
Definition: chm.c:496
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
Definition: hhctrl.h:54

Referenced by HtmlHelpW().

◆ navigation_visible()

static BOOL navigation_visible ( HHInfo info)
inlinestatic

Definition at line 168 of file help.c.

169 {
170  return ((info->WinType.fsWinProperties & HHWIN_PROP_TRI_PANE) && !info->WinType.fNotExpanded);
171 }
#define HHWIN_PROP_TRI_PANE
Definition: htmlhelp.h:60

Referenced by Help_OnSize(), HH_AddNavigationPane(), HH_AddSizeBar(), and HP_GetHTMLRect().

◆ NP_CreateTab()

static DWORD NP_CreateTab ( HINSTANCE  hInstance,
HWND  hwndTabCtrl,
DWORD  index 
)
static

Definition at line 1067 of file help.c.

1068 {
1069  TCITEMW tie;
1070  LPWSTR tabText = HH_LoadString(index);
1071  DWORD ret;
1072 
1073  tie.mask = TCIF_TEXT;
1074  tie.pszText = tabText;
1075 
1076  ret = SendMessageW( hwndTabCtrl, TCM_INSERTITEMW, index, (LPARAM)&tie );
1077 
1078  heap_free(tabText);
1079  return ret;
1080 }
LPWSTR pszText
Definition: commctrl.h:3995
#define TCIF_TEXT
Definition: commctrl.h:3943
UINT mask
Definition: commctrl.h:3992
#define TCM_INSERTITEMW
Definition: commctrl.h:4019
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static LPWSTR HH_LoadString(DWORD dwID)
Definition: help.c:174
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by HH_AddNavigationPane().

◆ NP_GetNavigationRect()

static void NP_GetNavigationRect ( HHInfo pHHInfo,
RECT rc 
)
static

Definition at line 1045 of file help.c.

1046 {
1047  HWND hwndParent = pHHInfo->WinType.hwndHelp;
1048  HWND hwndToolbar = pHHInfo->WinType.hwndToolBar;
1049  RECT rectWND, rectTB;
1050 
1051  GetClientRect(hwndParent, &rectWND);
1052  GetClientRect(hwndToolbar, &rectTB);
1053 
1054  rc->left = 0;
1055  rc->top = rectTB.bottom;
1056  rc->bottom = rectWND.bottom - rectTB.bottom;
1057 
1058  if (!(pHHInfo->WinType.fsValidMembers & HHWIN_PARAM_NAV_WIDTH) &&
1059  pHHInfo->WinType.iNavWidth == 0)
1060  {
1062  }
1063 
1064  rc->right = pHHInfo->WinType.iNavWidth;
1065 }
HWND hwndToolBar
Definition: htmlhelp.h:353
DWORD fsValidMembers
Definition: htmlhelp.h:343
#define WINTYPE_DEFAULT_NAVWIDTH
Definition: help.c:44
#define HHWIN_PARAM_NAV_WIDTH
Definition: htmlhelp.h:89
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
static HWND hwndParent
Definition: cryptui.c:300
HH_WINTYPEW WinType
Definition: hhctrl.h:188
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LONG bottom
Definition: windef.h:294

Referenced by ExpandContract(), Help_OnSize(), and HH_AddNavigationPane().

◆ OnTabChange()

static LRESULT OnTabChange ( HWND  hwnd)
static

Definition at line 559 of file help.c.

560 {
562  int tab_id, tab_index, i;
563 
564  TRACE("%p\n", hwnd);
565 
566  if (!info)
567  return 0;
568 
569  if(info->tabs[info->current_tab].hwnd)
570  ShowWindow(info->tabs[info->current_tab].hwnd, SW_HIDE);
571 
572  tab_id = (int) SendMessageW(info->hwndTabCtrl, TCM_GETCURSEL, 0, 0);
573  /* convert the ID of the tab to an index in our tab list */
574  tab_index = -1;
575  for (i=0; i<TAB_NUMTABS; i++)
576  {
577  if (info->tabs[i].id == tab_id)
578  {
579  tab_index = i;
580  break;
581  }
582  }
583  if (tab_index == -1)
584  {
585  FIXME("Tab ID %d does not correspond to a valid index in the tab list.\n", tab_id);
586  return 0;
587  }
588  info->current_tab = tab_index;
589 
590  if(info->tabs[info->current_tab].hwnd)
591  ShowWindow(info->tabs[info->current_tab].hwnd, SW_SHOW);
592 
593  return 0;
594 }
#define TCM_GETCURSEL
Definition: commctrl.h:4034
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define SW_HIDE
Definition: winuser.h:762
#define TAB_NUMTABS
Definition: hhctrl.h:120
#define GetWindowLongPtrW
Definition: winuser.h:4730
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
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 FIXME(fmt,...)
Definition: debug.h:110
#define SW_SHOW
Definition: winuser.h:769
#define TRACE(s)
Definition: solgame.cpp:4
Definition: hhctrl.h:185
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by Child_WndProc().

◆ OnTopicChange()

static LRESULT OnTopicChange ( HHInfo info,
void user_data 
)
static

Definition at line 596 of file help.c.

597 {
598  LPCWSTR chmfile = NULL, name = NULL, local = NULL;
599  ContentItem *citer;
600  SearchItem *siter;
601  IndexItem *iiter;
602 
603  if(!user_data || !info)
604  return 0;
605 
606  switch (info->current_tab)
607  {
608  case TAB_CONTENTS:
609  citer = (ContentItem *) user_data;
610  name = citer->name;
611  local = citer->local;
612  while(citer) {
613  if(citer->merge.chm_file) {
614  chmfile = citer->merge.chm_file;
615  break;
616  }
617  citer = citer->parent;
618  }
619  break;
620  case TAB_INDEX:
621  iiter = (IndexItem *) user_data;
622  if(iiter->nItems == 0) {
623  FIXME("No entries for this item!\n");
624  return 0;
625  }
626  if(iiter->nItems > 1) {
627  int i = 0;
628  LVITEMW lvi;
629 
630  SendMessageW(info->popup.hwndList, LVM_DELETEALLITEMS, 0, 0);
631  for(i=0;i<iiter->nItems;i++) {
632  IndexSubItem *item = &iiter->items[i];
633  WCHAR *name = iiter->keyword;
634 
635  if(!item->name)
636  item->name = GetDocumentTitle(info->pCHMInfo, item->local);
637  if(item->name)
638  name = item->name;
639  memset(&lvi, 0, sizeof(lvi));
640  lvi.iItem = i;
641  lvi.mask = LVIF_TEXT|LVIF_PARAM;
642  lvi.cchTextMax = strlenW(name)+1;
643  lvi.pszText = name;
644  lvi.lParam = (LPARAM) item;
645  SendMessageW(info->popup.hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi);
646  }
647  ShowWindow(info->popup.hwndPopup, SW_SHOW);
648  return 0;
649  }
650  name = iiter->items[0].name;
651  local = iiter->items[0].local;
652  chmfile = iiter->merge.chm_file;
653  break;
654  case TAB_SEARCH:
655  siter = (SearchItem *) user_data;
656  name = siter->filename;
657  local = siter->filename;
658  chmfile = info->pCHMInfo->szFile;
659  break;
660  default:
661  FIXME("Unhandled operation for this tab!\n");
662  return 0;
663  }
664 
665  if(!chmfile)
666  {
667  FIXME("No help file found for this item!\n");
668  return 0;
669  }
670 
671  TRACE("name %s loal %s\n", debugstr_w(name), debugstr_w(local));
672 
673  NavigateToChm(info, chmfile, local);
674  return 0;
675 }
ChmPath merge
Definition: hhctrl.h:81
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
struct ContentItem * parent
Definition: hhctrl.h:60
#define TAB_CONTENTS
Definition: hhctrl.h:116
LPWSTR local
Definition: hhctrl.h:67
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:253
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int nItems
Definition: hhctrl.h:83
ChmPath merge
Definition: hhctrl.h:68
#define LVIF_TEXT
Definition: commctrl.h:2281
int cchTextMax
Definition: commctrl.h:2338
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 debugstr_w
Definition: kernel32.h:32
LPARAM lParam
Definition: commctrl.h:2340
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define SW_SHOW
Definition: winuser.h:769
WCHAR * GetDocumentTitle(CHMInfo *info, LPCWSTR document)
Definition: chm.c:565
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LPWSTR chm_file
Definition: hhctrl.h:55
LPWSTR pszText
Definition: commctrl.h:2337
UINT mask
Definition: commctrl.h:2332
LPWSTR keyword
Definition: hhctrl.h:80
#define TAB_SEARCH
Definition: hhctrl.h:118
#define TAB_INDEX
Definition: hhctrl.h:117
#define LVM_DELETEALLITEMS
Definition: commctrl.h:2385
#define local
Definition: zutil.h:30
#define LVM_INSERTITEMW
Definition: commctrl.h:2376
static ATOM item
Definition: dde.c:856
LPWSTR name
Definition: hhctrl.h:72
LPWSTR local
Definition: hhctrl.h:73
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Definition: name.c:36
#define LVIF_PARAM
Definition: commctrl.h:2283
IndexSubItem * items
Definition: hhctrl.h:86
#define memset(x, y, z)
Definition: compat.h:39
LPWSTR filename
Definition: hhctrl.h:94
LPWSTR name
Definition: hhctrl.h:66
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by Child_WndProc().

◆ PopupChild_WndProc()

static LRESULT CALLBACK PopupChild_WndProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1359 of file help.c.

1360 {
1361  switch (message)
1362  {
1363  case WM_NOTIFY: {
1364  NMHDR *nmhdr = (NMHDR*)lParam;
1365  switch(nmhdr->code)
1366  {
1367  case NM_DBLCLK: {
1369  IndexSubItem *iter;
1370 
1371  if(info == 0 || lParam == 0)
1372  return 0;
1373  iter = (IndexSubItem*) ((NMITEMACTIVATE *)lParam)->lParam;
1374  if(iter == 0)
1375  return 0;
1376  NavigateToChm(info, info->index->merge.chm_file, iter->local);
1377  ShowWindow(info->popup.hwndPopup, SW_HIDE);
1378  return 0;
1379  }
1380  case NM_RETURN: {
1382  IndexSubItem *iter;
1383  LVITEMW lvItem;
1384 
1385  if(info == 0)
1386  return 0;
1387 
1388  lvItem.iItem = (int) SendMessageW(info->popup.hwndList, LVM_GETSELECTIONMARK, 0, 0);
1389  lvItem.mask = TVIF_PARAM;
1390  SendMessageW(info->popup.hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
1391  iter = (IndexSubItem*) lvItem.lParam;
1392  NavigateToChm(info, info->index->merge.chm_file, iter->local);
1393  ShowWindow(info->popup.hwndPopup, SW_HIDE);
1394  return 0;
1395  }
1396  }
1397  break;
1398  }
1399  default:
1401  }
1402 
1403  return 0;
1404 }
Definition: tftpd.h:59
#define SW_HIDE
Definition: winuser.h:762
HWND hWnd
Definition: settings.c:17
#define GetWindowLongPtrW
Definition: winuser.h:4730
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:253
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
UINT code
Definition: winuser.h:3133
LPARAM lParam
Definition: commctrl.h:2340
LONG_PTR LPARAM
Definition: windef.h:208
Definition: hhctrl.h:185
UINT mask
Definition: commctrl.h:2332
#define LVM_GETSELECTIONMARK
Definition: commctrl.h:2760
#define NM_RETURN
Definition: commctrl.h:132
#define NM_DBLCLK
Definition: commctrl.h:131
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LPWSTR local
Definition: hhctrl.h:73
#define LVM_GETITEMW
Definition: commctrl.h:2362
#define TVIF_PARAM
Definition: commctrl.h:3240
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
unsigned int index
Definition: notification.c:65
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by AddIndexPopup().

◆ ReleaseHelpViewer()

void ReleaseHelpViewer ( HHInfo info)

Definition at line 1790 of file help.c.

1791 {
1792  TRACE("(%p)\n", info);
1793 
1794  if (!info)
1795  return;
1796 
1797  list_remove(&info->entry);
1798 
1799  wintype_stringsA_free(&info->stringsA);
1800  wintype_stringsW_free(&info->stringsW);
1801 
1802  if (info->pCHMInfo)
1803  CloseCHM(info->pCHMInfo);
1804 
1807  ReleaseIndex(info);
1809 
1810  if(info->contents.hImageList)
1811  ImageList_Destroy(info->contents.hImageList);
1812  if(info->WinType.hwndHelp)
1813  DestroyWindow(info->WinType.hwndHelp);
1814 
1815  heap_free(info);
1816  OleUninitialize();
1817 }
void wintype_stringsW_free(struct wintype_stringsW *stringsW)
Definition: help.c:1761
void ReleaseContent(HHInfo *info)
Definition: content.c:325
void ReleaseSearch(HHInfo *info) DECLSPEC_HIDDEN
Definition: search.c:235
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
void wintype_stringsA_free(struct wintype_stringsA *stringsA)
Definition: help.c:1775
void ReleaseWebBrowser(HHInfo *) DECLSPEC_HIDDEN
Definition: webbrowser.c:720
void ReleaseIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:288
CHMInfo * CloseCHM(CHMInfo *chm)
Definition: chm.c:663
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:233
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by CreateHelpViewer(), Help_WndProc(), and HtmlHelpW().

◆ ResizePopupChild()

static void ResizePopupChild ( HHInfo info)
static

Definition at line 1307 of file help.c.

1308 {
1309  int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
1310  int border_width = GetSystemMetrics(SM_CXBORDER);
1311  int edge_width = GetSystemMetrics(SM_CXEDGE);
1312  INT width, height;
1313  RECT rect;
1314 
1315  if(!info)
1316  return;
1317 
1318  GetClientRect(info->popup.hwndPopup, &rect);
1319  SetWindowPos(info->popup.hwndCallback, HWND_TOP, 0, 0,
1320  rect.right, rect.bottom, SWP_NOMOVE);
1321 
1322  rect.left = TAB_MARGIN;
1324  rect.right -= TAB_RIGHT_PADDING + TAB_MARGIN;
1325  rect.bottom -= TAB_MARGIN;
1326  width = rect.right-rect.left;
1327  height = rect.bottom-rect.top;
1328 
1329  SetWindowPos(info->popup.hwndList, NULL, rect.left, rect.top, width, height,
1331 
1332  SendMessageW(info->popup.hwndList, LVM_SETCOLUMNWIDTH, 0,
1333  width-scroll_width-2*border_width-2*edge_width);
1334 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define SM_CXEDGE
Definition: winuser.h:998
#define HWND_TOP
Definition: winuser.h:1193
#define SWP_NOZORDER
Definition: winuser.h:1232
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
#define LVM_SETCOLUMNWIDTH
Definition: commctrl.h:2618
smooth NULL
Definition: ftsmooth.c:416
#define TAB_TOP_PADDING
Definition: help.c:46
#define TAB_RIGHT_PADDING
Definition: help.c:47
#define SWP_NOACTIVATE
Definition: winuser.h:1227
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXBORDER
Definition: winuser.h:954
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TAB_MARGIN
Definition: help.c:48
#define SM_CXVSCROLL
Definition: winuser.h:951
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

Referenced by AddIndexPopup(), and HelpPopup_WndProc().

◆ ResizeTabChild()

static void ResizeTabChild ( HHInfo info,
int  tab 
)
static

Definition at line 482 of file help.c.

483 {
484  HWND hwnd = info->tabs[tab].hwnd;
485  INT width, height;
486  RECT rect, tabrc;
487  DWORD cnt;
488 
489  GetClientRect(info->WinType.hwndNavigation, &rect);
490  SendMessageW(info->hwndTabCtrl, TCM_GETITEMRECT, 0, (LPARAM)&tabrc);
491  cnt = SendMessageW(info->hwndTabCtrl, TCM_GETROWCOUNT, 0, 0);
492 
493  rect.left = TAB_MARGIN;
494  rect.top = TAB_TOP_PADDING + cnt*(tabrc.bottom-tabrc.top) + TAB_MARGIN;
495  rect.right -= TAB_RIGHT_PADDING + TAB_MARGIN;
496  rect.bottom -= TAB_MARGIN;
497  width = rect.right-rect.left;
498  height = rect.bottom-rect.top;
499 
500  SetWindowPos(hwnd, NULL, rect.left, rect.top, width, height,
502 
503  switch (tab)
504  {
505  case TAB_INDEX: {
506  int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
507  int border_width = GetSystemMetrics(SM_CXBORDER);
508  int edge_width = GetSystemMetrics(SM_CXEDGE);
509 
510  /* Resize the tab widget column to perfectly fit the tab window and
511  * leave sufficient space for the scroll widget.
512  */
514  width-scroll_width-2*border_width-2*edge_width);
515 
516  break;
517  }
518  case TAB_SEARCH: {
519  int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
520  int border_width = GetSystemMetrics(SM_CXBORDER);
521  int edge_width = GetSystemMetrics(SM_CXEDGE);
522  int top_pos = 0;
523 
524  SetWindowPos(info->search.hwndEdit, NULL, 0, top_pos, width,
526  top_pos += EDIT_HEIGHT + TAB_MARGIN;
527  SetWindowPos(info->search.hwndList, NULL, 0, top_pos, width,
528  height-top_pos, SWP_NOZORDER | SWP_NOACTIVATE);
529  /* Resize the tab widget column to perfectly fit the tab window and
530  * leave sufficient space for the scroll widget.
531  */
532  SendMessageW(info->search.hwndList, LVM_SETCOLUMNWIDTH, 0,
533  width-scroll_width-2*border_width-2*edge_width);
534 
535  break;
536  }
537  }
538 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
GLint GLint GLsizei width
Definition: gl.h:1546
LONG top
Definition: windef.h:292
#define SM_CXEDGE
Definition: winuser.h:998
#define SWP_NOZORDER
Definition: winuser.h:1232
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
#define TCM_GETROWCOUNT
Definition: commctrl.h:4065
#define LVM_SETCOLUMNWIDTH
Definition: commctrl.h:2618
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define TAB_TOP_PADDING
Definition: help.c:46
#define TCM_GETITEMRECT
Definition: commctrl.h:4031
#define TAB_RIGHT_PADDING
Definition: help.c:47
#define SWP_NOACTIVATE
Definition: winuser.h:1227
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SM_CXBORDER
Definition: winuser.h:954
#define TAB_SEARCH
Definition: hhctrl.h:118
#define TAB_INDEX
Definition: hhctrl.h:117
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define EDIT_HEIGHT
Definition: help.c:49
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TAB_MARGIN
Definition: help.c:48
#define SM_CXVSCROLL
Definition: winuser.h:951
LONG bottom
Definition: windef.h:294
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

Referenced by AddContentTab(), AddIndexTab(), AddSearchTab(), and Child_OnSize().

◆ SB_GetSizeBarRect()

static void SB_GetSizeBarRect ( HHInfo info,
RECT rc 
)
static

Definition at line 407 of file help.c.

408 {
409  RECT rectWND, rectTB, rectNP;
410 
411  GetClientRect(info->WinType.hwndHelp, &rectWND);
412  GetClientRect(info->WinType.hwndToolBar, &rectTB);
413  GetClientRect(info->WinType.hwndNavigation, &rectNP);
414 
415  SetRect(rc, rectNP.right, rectTB.bottom, SIZEBAR_WIDTH, rectWND.bottom - rectTB.bottom);
416 }
LONG right
Definition: windef.h:293
#define SIZEBAR_WIDTH
Definition: help.c:302
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
LONG bottom
Definition: windef.h:294

Referenced by Help_OnSize(), and HH_AddSizeBar().

◆ SB_OnLButtonDown()

static void SB_OnLButtonDown ( HWND  hWnd,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 337 of file help.c.

338 {
339  SetCapture(hWnd);
340 }
HWND hWnd
Definition: settings.c:17
HWND WINAPI SetCapture(_In_ HWND hWnd)

Referenced by SizeBar_WndProc().

◆ SB_OnLButtonUp()

static void SB_OnLButtonUp ( HWND  hWnd,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 342 of file help.c.

343 {
344  HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
345  POINT pt;
346 
347  pt.x = (short)LOWORD(lParam);
348  pt.y = (short)HIWORD(lParam);
349 
350  /* update the window sizes */
351  pHHInfo->WinType.iNavWidth += pt.x;
352  Help_OnSize(hWnd);
353 
354  ReleaseCapture();
355 }
static LRESULT Help_OnSize(HWND hWnd)
Definition: help.c:1527
#define pt(x, y)
Definition: drawing.c:79
HWND hWnd
Definition: settings.c:17
#define GetWindowLongPtrW
Definition: winuser.h:4730
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:93
Definition: hhctrl.h:185
HH_WINTYPEW WinType
Definition: hhctrl.h:188
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2888
#define HIWORD(l)
Definition: typedefs.h:246
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by SizeBar_WndProc().

◆ SB_OnMouseMove()

static void SB_OnMouseMove ( HWND  hWnd,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 357 of file help.c.

358 {
359  /* ignore WM_MOUSEMOVE if not dragging the SizeBar */
360  if (!(wParam & MK_LBUTTON))
361  return;
362 }
#define MK_LBUTTON
Definition: winuser.h:2342
WPARAM wParam
Definition: combotst.c:138

Referenced by SizeBar_WndProc().

◆ SB_OnPaint()

static void SB_OnPaint ( HWND  hWnd)
static

Definition at line 309 of file help.c.

310 {
311  PAINTSTRUCT ps;
312  HDC hdc;
313  RECT rc;
314 
315  hdc = BeginPaint(hWnd, &ps);
316 
317  GetClientRect(hWnd, &rc);
318 
319  /* dark frame */
320  rc.right += 1;
321  rc.bottom -= 1;
323 
324  /* white highlight */
326  MoveToEx(hdc, rc.right, 1, NULL);
327  LineTo(hdc, 1, 1);
328  LineTo(hdc, 1, rc.bottom - 1);
329 
330 
331  MoveToEx(hdc, 0, rc.bottom, NULL);
332  LineTo(hdc, rc.right, rc.bottom);
333 
334  EndPaint(hWnd, &ps);
335 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WHITE_PEN
Definition: wingdi.h:904
static HDC
Definition: imagelist.c:92
HWND hWnd
Definition: settings.c:17
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:293
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
smooth NULL
Definition: ftsmooth.c:416
#define GRAY_BRUSH
Definition: wingdi.h:897
HDC hdc
Definition: main.c:9
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LONG bottom
Definition: windef.h:294
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)

Referenced by SizeBar_WndProc().

◆ SizeBar_WndProc()

static LRESULT CALLBACK SizeBar_WndProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 364 of file help.c.

365 {
366  switch (message)
367  {
368  case WM_LBUTTONDOWN:
370  break;
371  case WM_LBUTTONUP:
373  break;
374  case WM_MOUSEMOVE:
376  break;
377  case WM_PAINT:
378  SB_OnPaint(hWnd);
379  break;
380  default:
382  }
383 
384  return 0;
385 }
Definition: tftpd.h:59
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
static void SB_OnLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:337
HWND hWnd
Definition: settings.c:17
static void SB_OnPaint(HWND hWnd)
Definition: help.c:309
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_PAINT
Definition: winuser.h:1602
static void SB_OnMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:357
static void SB_OnLButtonUp(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:342
#define WM_LBUTTONUP
Definition: winuser.h:1759
#define WM_MOUSEMOVE
Definition: winuser.h:1757
LPARAM lParam
Definition: combotst.c:139

Referenced by HH_RegisterSizeBarClass().

◆ TB_AddButton()

static void TB_AddButton ( TBBUTTON pButtons,
DWORD  dwIndex,
DWORD  dwID,
DWORD  dwBitmap 
)
static

Definition at line 921 of file help.c.

922 {
923  pButtons[dwIndex].iBitmap = dwBitmap;
924  pButtons[dwIndex].idCommand = dwID;
925  pButtons[dwIndex].fsState = TBSTATE_ENABLED;
926  pButtons[dwIndex].fsStyle = BTNS_BUTTON;
927  pButtons[dwIndex].dwData = 0;
928  pButtons[dwIndex].iString = 0;
929 }
BYTE fsStyle
Definition: commctrl.h:924
#define BTNS_BUTTON
Definition: commctrl.h:970
INT_PTR iString
Definition: commctrl.h:931
DWORD_PTR dwData
Definition: commctrl.h:930
int iBitmap
Definition: commctrl.h:921
int idCommand
Definition: commctrl.h:922
#define TBSTATE_ENABLED
Definition: commctrl.h:946
BYTE fsState
Definition: commctrl.h:923

Referenced by TB_AddButtonsFromFlags().

◆ TB_AddButtonsFromFlags()

static void TB_AddButtonsFromFlags ( HHInfo pHHInfo,
TBBUTTON pButtons,
DWORD  dwButtonFlags,
LPDWORD  pdwNumButtons 
)
static

Definition at line 931 of file help.c.

932 {
933  int nHistBitmaps = 0, nStdBitmaps = 0, nHHBitmaps = 0;
934  HWND hToolbar = pHHInfo->WinType.hwndToolBar;
935  TBADDBITMAP tbAB;
936  DWORD unsupported;
937 
938  /* Common bitmaps */
939  tbAB.hInst = HINST_COMMCTRL;
940  tbAB.nID = IDB_HIST_LARGE_COLOR;
941  nHistBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&tbAB);
942  tbAB.nID = IDB_STD_LARGE_COLOR;
943  nStdBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&tbAB);
944  /* hhctrl.ocx bitmaps */
945  tbAB.hInst = hhctrl_hinstance;
946  tbAB.nID = IDB_HHTOOLBAR;
947  nHHBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, HHTB_NUMBITMAPS, (LPARAM)&tbAB);
948 
949  *pdwNumButtons = 0;
950 
951  unsupported = dwButtonFlags & (HHWIN_BUTTON_BROWSE_FWD |
956  if (unsupported)
957  FIXME("got asked for unsupported buttons: %06x\n", unsupported);
958 
959  if (dwButtonFlags & HHWIN_BUTTON_EXPAND)
960  {
961  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_EXPAND, nHHBitmaps + HHTB_EXPAND);
962  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_CONTRACT, nHHBitmaps + HHTB_CONTRACT);
963 
964  if (pHHInfo->WinType.fNotExpanded)
965  pButtons[1].fsState |= TBSTATE_HIDDEN;
966  else
967  pButtons[0].fsState |= TBSTATE_HIDDEN;
968  }
969 
970  if (dwButtonFlags & HHWIN_BUTTON_BACK)
971  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_BACK, nHistBitmaps + HIST_BACK);
972 
973  if (dwButtonFlags & HHWIN_BUTTON_FORWARD)
974  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_FORWARD, nHistBitmaps + HIST_FORWARD);
975 
976  if (dwButtonFlags & HHWIN_BUTTON_STOP)
977  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_STOP, nHHBitmaps + HHTB_STOP);
978 
979  if (dwButtonFlags & HHWIN_BUTTON_REFRESH)
980  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_REFRESH, nHHBitmaps + HHTB_REFRESH);
981 
982  if (dwButtonFlags & HHWIN_BUTTON_HOME)
983  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_HOME, nHHBitmaps + HHTB_HOME);
984 
985  if (dwButtonFlags & HHWIN_BUTTON_SYNC)
986  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_SYNC, nHHBitmaps + HHTB_SYNC);
987 
988  if (dwButtonFlags & HHWIN_BUTTON_OPTIONS)
989  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_OPTIONS, nStdBitmaps + STD_PROPERTIES);
990 
991  if (dwButtonFlags & HHWIN_BUTTON_PRINT)
992  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_PRINT, nStdBitmaps + STD_PRINT);
993 }
HWND hwndToolBar
Definition: htmlhelp.h:353
#define HHWIN_BUTTON_REFRESH
Definition: htmlhelp.h:103
#define HHWIN_BUTTON_SYNC
Definition: htmlhelp.h:109
#define HHWIN_BUTTON_BACK
Definition: htmlhelp.h:100
#define HHWIN_BUTTON_EXPAND
Definition: htmlhelp.h:99
#define HHWIN_BUTTON_JUMP1
Definition: htmlhelp.h:116
#define HHTB_EXPAND
Definition: resource.h:45
#define IDTB_PRINT
Definition: htmlhelp.h:132
#define IDTB_EXPAND
Definition: htmlhelp.h:125
HINSTANCE hInst
Definition: commctrl.h:1031
#define HHTB_STOP
Definition: resource.h:40
#define HHWIN_BUTTON_STOP
Definition: htmlhelp.h:102
#define IDB_HIST_LARGE_COLOR
Definition: commctrl.h:1041
#define STD_PRINT
Definition: commctrl.h:1057
#define HHWIN_BUTTON_OPTIONS
Definition: htmlhelp.h:110
#define IDTB_FORWARD
Definition: htmlhelp.h:134
#define IDTB_HOME
Definition: htmlhelp.h:130
#define IDTB_CONTRACT
Definition: htmlhelp.h:126
#define HIST_BACK
Definition: commctrl.h:1072
#define HHWIN_BUTTON_HOME
Definition: htmlhelp.h:104
#define IDTB_BACK
Definition: htmlhelp.h:129
#define HHWIN_BUTTON_BROWSE_FWD
Definition: htmlhelp.h:105
#define FIXME(fmt,...)
Definition: debug.h:110
#define IDTB_STOP
Definition: htmlhelp.h:127
#define HHTB_HOME
Definition: resource.h:42
#define HHWIN_BUTTON_ZOOM
Definition: htmlhelp.h:118
#define HIST_FORWARD
Definition: commctrl.h:1073
LONG_PTR LPARAM
Definition: windef.h:208
#define HHTB_REFRESH
Definition: resource.h:41
#define HHWIN_BUTTON_INDEX
Definition: htmlhelp.h:112
#define HHWIN_BUTTON_PRINT
Definition: htmlhelp.h:111
unsigned long DWORD
Definition: ntddk_ex.h:95
#define HHWIN_BUTTON_CONTENTS
Definition: htmlhelp.h:108
#define HHTB_SYNC
Definition: resource.h:43
#define TB_ADDBITMAP
Definition: commctrl.h:1028
#define HHWIN_BUTTON_SEARCH
Definition: htmlhelp.h:113
#define STD_PROPERTIES
Definition: commctrl.h:1053
HH_WINTYPEW WinType
Definition: hhctrl.h:188
BOOL fNotExpanded
Definition: htmlhelp.h:363
#define HHWIN_BUTTON_HISTORY
Definition: htmlhelp.h:114
#define HHWIN_BUTTON_JUMP2
Definition: htmlhelp.h:117
#define IDB_STD_LARGE_COLOR
Definition: commctrl.h:1037
static void TB_AddButton(TBBUTTON *pButtons, DWORD dwIndex, DWORD dwID, DWORD dwBitmap)
Definition: help.c:921
#define HHWIN_BUTTON_TOC_PREV
Definition: htmlhelp.h:120
#define HHTB_NUMBITMAPS
Definition: resource.h:46
#define HHTB_CONTRACT
Definition: resource.h:44
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HHWIN_BUTTON_NOTES
Definition: htmlhelp.h:107
#define IDTB_SYNC
Definition: htmlhelp.h:131
#define IDTB_OPTIONS
Definition: htmlhelp.h:133
#define HINST_COMMCTRL
Definition: commctrl.h:1035
#define TBSTATE_HIDDEN
Definition: commctrl.h:947
#define IDB_HHTOOLBAR
Definition: resource.h:38
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
BYTE fsState
Definition: commctrl.h:923
#define HHWIN_BUTTON_TOC_NEXT
Definition: htmlhelp.h:119
#define HHWIN_BUTTON_BROWSE_BCK
Definition: htmlhelp.h:106
#define HHWIN_BUTTON_FAVORITES
Definition: htmlhelp.h:115
#define IDTB_REFRESH
Definition: htmlhelp.h:128
#define HHWIN_BUTTON_FORWARD
Definition: htmlhelp.h:101
UINT_PTR nID
Definition: commctrl.h:1032

Referenced by HH_AddToolbar().

◆ TB_OnClick()

static void TB_OnClick ( HWND  hWnd,
DWORD  dwID 
)
static

Definition at line 867 of file help.c.

868 {
870 
871  switch (dwID)
872  {
873  case IDTB_STOP:
874  DoPageAction(info->web_browser, WB_STOP);
875  break;
876  case IDTB_REFRESH:
877  DoPageAction(info->web_browser, WB_REFRESH);
878  break;
879  case IDTB_BACK:
880  DoPageAction(info->web_browser, WB_GOBACK);
881  break;
882  case IDTB_HOME:
883  NavigateToChm(info, info->pCHMInfo->szFile, info->WinType.pszHome);
884  break;
885  case IDTB_FORWARD:
886  DoPageAction(info->web_browser, WB_GOFORWARD);
887  break;
888  case IDTB_PRINT:
889  DoPageAction(info->web_browser, WB_PRINT);
890  break;
891  case IDTB_EXPAND:
892  case IDTB_CONTRACT:
894  break;
895  case IDTB_SYNC:
896  DoSync(info);
897  break;
898  case IDTB_OPTIONS:
900  break;
901  case IDTB_NOTES:
902  case IDTB_CONTENTS:
903  case IDTB_INDEX:
904  case IDTB_SEARCH:
905  case IDTB_HISTORY:
906  case IDTB_FAVORITES:
907  /* These are officially unimplemented as of the Windows 7 SDK */
908  break;
909  case IDTB_BROWSE_FWD:
910  case IDTB_BROWSE_BACK:
911  case IDTB_JUMP1:
912  case IDTB_JUMP2:
913  case IDTB_CUSTOMIZE:
914  case IDTB_ZOOM:
915  case IDTB_TOC_NEXT:
916  case IDTB_TOC_PREV:
917  break;
918  }
919 }
#define IDTB_FAVORITES
Definition: htmlhelp.h:142
#define WB_PRINT
Definition: hhctrl.h:52
#define WB_STOP
Definition: hhctrl.h:51
#define IDTB_CUSTOMIZE
Definition: htmlhelp.h:145
void DoPageAction(WebBrowserContainer *, DWORD) DECLSPEC_HIDDEN
Definition: webbrowser.c:753
#define WB_GOBACK
Definition: hhctrl.h:46
#define IDTB_PRINT
Definition: htmlhelp.h:132
HWND hWnd
Definition: settings.c:17
#define IDTB_EXPAND
Definition: htmlhelp.h:125
#define GetWindowLongPtrW
Definition: winuser.h:4730
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:253
#define IDTB_JUMP1
Definition: htmlhelp.h:143
static void ExpandContract(HHInfo *pHHInfo)
Definition: help.c:1496
#define IDTB_JUMP2
Definition: htmlhelp.h:144
#define IDTB_FORWARD
Definition: htmlhelp.h:134
#define IDTB_HOME
Definition: htmlhelp.h:130
#define IDTB_CONTRACT
Definition: htmlhelp.h:126
static void DisplayPopupMenu(HHInfo *info)
Definition: help.c:819
#define IDTB_CONTENTS
Definition: htmlhelp.h:138
#define IDTB_NOTES
Definition: htmlhelp.h:135
#define IDTB_BACK
Definition: htmlhelp.h:129
#define IDTB_STOP
Definition: htmlhelp.h:127
#define IDTB_TOC_PREV
Definition: htmlhelp.h:148
#define WB_REFRESH
Definition: hhctrl.h:50
static void DoSync(HHInfo *info)
Definition: help.c:265
#define WB_GOFORWARD
Definition: hhctrl.h:47
#define IDTB_BROWSE_FWD
Definition: htmlhelp.h:136
Definition: hhctrl.h:185
#define IDTB_INDEX
Definition: htmlhelp.h:139
#define IDTB_BROWSE_BACK
Definition: htmlhelp.h:137
#define IDTB_SEARCH
Definition: htmlhelp.h:140
#define IDTB_SYNC
Definition: htmlhelp.h:131
#define IDTB_OPTIONS
Definition: htmlhelp.h:133
#define IDTB_ZOOM
Definition: htmlhelp.h:146
#define IDTB_TOC_NEXT
Definition: htmlhelp.h:147
#define IDTB_HISTORY
Definition: htmlhelp.h:141
#define IDTB_REFRESH
Definition: htmlhelp.h:128

Referenced by Help_WndProc().

◆ UpdateHelpWindow()

void UpdateHelpWindow ( HHInfo info)

Definition at line 1559 of file help.c.

1560 {
1561  if (!info->WinType.hwndHelp)
1562  return;
1563 
1564  WARN("Only the size of the window is currently updated.\n");
1565  if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT)
1566  {
1567  RECT *rect = &info->WinType.rcWindowPos;
1568  INT x, y, width, height;
1569 
1570  x = rect->left;
1571  y = rect->top;
1572  width = rect->right - x;
1573  height = rect->bottom - y;
1574  SetWindowPos(info->WinType.hwndHelp, NULL, rect->left, rect->top, width, height,
1576  }
1577 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define WARN(fmt,...)
Definition: debug.h:111
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define SWP_NOZORDER
Definition: winuser.h:1232
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
smooth NULL
Definition: ftsmooth.c:416
#define SWP_NOACTIVATE
Definition: winuser.h:1227
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define HHWIN_PARAM_RECT
Definition: htmlhelp.h:88
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

Referenced by HtmlHelpW().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( htmlhelp  )

◆ wintype_stringsA_free()

void wintype_stringsA_free ( struct wintype_stringsA stringsA)

Definition at line 1775 of file help.c.

1776 {
1777  heap_free(stringsA->pszType);
1778  heap_free(stringsA->pszCaption);
1779  heap_free(stringsA->pszToc);
1780  heap_free(stringsA->pszIndex);
1781  heap_free(stringsA->pszFile);
1782  heap_free(stringsA->pszHome);
1783  heap_free(stringsA->pszJump1);
1784  heap_free(stringsA->pszJump2);
1785  heap_free(stringsA->pszUrlJump1);
1786  heap_free(stringsA->pszUrlJump2);
1787  heap_free(stringsA->pszCustomTabs);
1788 }
char * pszToc
Definition: hhctrl.h:161
char * pszUrlJump1
Definition: hhctrl.h:167
char * pszCaption
Definition: hhctrl.h:160
char * pszJump1
Definition: hhctrl.h:165
char * pszCustomTabs
Definition: hhctrl.h:169
char * pszJump2
Definition: hhctrl.h:166
char * pszType
Definition: hhctrl.h:159
char * pszUrlJump2
Definition: hhctrl.h:168
char * pszFile
Definition: hhctrl.h:163
char * pszIndex
Definition: hhctrl.h:162
char * pszHome
Definition: hhctrl.h:164
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by HtmlHelpA(), and ReleaseHelpViewer().

◆ wintype_stringsW_free()

void wintype_stringsW_free ( struct wintype_stringsW stringsW)

Definition at line 1761 of file help.c.

1762 {
1763  heap_free(stringsW->pszType);
1764  heap_free(stringsW->pszCaption);
1765  heap_free(stringsW->pszToc);
1766  heap_free(stringsW->pszIndex);
1767  heap_free(stringsW->pszFile);
1768  heap_free(stringsW->pszHome);
1769  heap_free(stringsW->pszJump1);
1770  heap_free(stringsW->pszJump2);
1771  heap_free(stringsW->pszUrlJump1);
1772  heap_free(stringsW->pszUrlJump2);
1773 }
WCHAR * pszJump1
Definition: hhctrl.h:151
WCHAR * pszType
Definition: hhctrl.h:145
WCHAR * pszJump2
Definition: hhctrl.h:152
WCHAR * pszToc
Definition: hhctrl.h:147
WCHAR * pszUrlJump2
Definition: hhctrl.h:154
WCHAR * pszHome
Definition: hhctrl.h:150
WCHAR * pszUrlJump1
Definition: hhctrl.h:153
WCHAR * pszIndex
Definition: hhctrl.h:148
WCHAR * pszFile
Definition: hhctrl.h:149
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
WCHAR * pszCaption
Definition: hhctrl.h:146

Referenced by HtmlHelpA(), and ReleaseHelpViewer().

Variable Documentation

◆ html_encoded_symbols

struct html_encoded_symbol html_encoded_symbols[]
static

Definition at line <