ReactOS  0.4.15-dev-5500-g82cf6c2
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 834 of file help.c.

◆ SIZEBAR_WIDTH

#define SIZEBAR_WIDTH   4

Definition at line 319 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 1201 of file help.c.

1202 {
1203  HIMAGELIST hImageList;
1204  HBITMAP hBitmap;
1205  HWND hWnd;
1206 
1207  if(info->tabs[TAB_CONTENTS].id == -1)
1208  return TRUE; /* No "Contents" tab */
1210  | TVS_SHOWSELALWAYS | TVS_HASBUTTONS, 50, 50, 100, 100,
1211  info->WinType.hwndNavigation, NULL, hhctrl_hinstance, NULL);
1212  if(!hWnd) {
1213  ERR("Could not create treeview control\n");
1214  return FALSE;
1215  }
1216 
1217  hImageList = ImageList_Create(16, 16, ILC_COLOR32, 0, HHTV_NUMBITMAPS);
1219  ImageList_Add(hImageList, hBitmap, NULL);
1221 
1222  info->contents.hImageList = hImageList;
1223  info->tabs[TAB_CONTENTS].hwnd = hWnd;
1226 
1227  return TRUE;
1228 }
#define WC_TREEVIEWW
Definition: commctrl.h:3243
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:448
#define TRUE
Definition: types.h:120
#define TVS_LINESATROOT
Definition: commctrl.h:3249
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:358
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define FALSE
Definition: types.h:117
#define HHTV_NUMBITMAPS
Definition: resource.h:64
#define TVS_HASBUTTONS
Definition: commctrl.h:3247
#define TVM_SETIMAGELIST
Definition: commctrl.h:3446
LONG_PTR LPARAM
Definition: windef.h:208
#define SW_SHOW
Definition: winuser.h:769
static void ResizeTabChild(HHInfo *info, int tab)
Definition: help.c:499
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:110
#define IDB_HHTREEVIEW
Definition: resource.h:59
#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 NULL
Definition: types.h:112
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3252
#define TVSIL_NORMAL
Definition: commctrl.h:3443
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:26

Referenced by CreateViewer().

◆ AddIndexPopup()

static BOOL AddIndexPopup ( HHInfo info)
static

Definition at line 1423 of file help.c.

1424 {
1425  static const WCHAR szPopupChildClass[] = {'H','H',' ','P','o','p','u','p',' ','C','h','i','l','d',0};
1426  static const WCHAR windowCaptionW[] = {'S','e','l','e','c','t',' ','T','o','p','i','c',':',0};
1427  static const WCHAR windowClassW[] = {'H','H',' ','P','o','p','u','p',0};
1428  HWND hwndList, hwndPopup, hwndCallback;
1429  char hidden_column[] = "Column";
1430  WNDCLASSEXW wcex;
1431  LVCOLUMNA lvc;
1432 
1433  if(info->tabs[TAB_INDEX].id == -1)
1434  return TRUE; /* No "Index" tab */
1435 
1436  wcex.cbSize = sizeof(WNDCLASSEXW);
1437  wcex.style = CS_HREDRAW | CS_VREDRAW;
1439  wcex.cbClsExtra = 0;
1440  wcex.cbWndExtra = sizeof(LONG_PTR);
1441  wcex.hInstance = hhctrl_hinstance;
1444  wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
1445  wcex.lpszMenuName = NULL;
1446  wcex.lpszClassName = windowClassW;
1448  RegisterClassExW(&wcex);
1449 
1450  wcex.cbSize = sizeof(WNDCLASSEXW);
1451  wcex.style = 0;
1453  wcex.cbClsExtra = 0;
1454  wcex.cbWndExtra = sizeof(LONG_PTR);
1455  wcex.hInstance = hhctrl_hinstance;
1458  wcex.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1459  wcex.lpszMenuName = NULL;
1460  wcex.lpszClassName = szPopupChildClass;
1462  RegisterClassExW(&wcex);
1463 
1466  windowClassW, windowCaptionW, WS_POPUPWINDOW
1469  CW_USEDEFAULT, 300, 200, info->WinType.hwndHelp,
1471  if (!hwndPopup)
1472  return FALSE;
1473 
1475  szPopupChildClass, szEmpty, WS_CHILDWINDOW | WS_VISIBLE,
1476  0, 0, 0, 0,
1477  hwndPopup, NULL, hhctrl_hinstance, NULL);
1478  if (!hwndCallback)
1479  return FALSE;
1480 
1481  ShowWindow(hwndPopup, SW_HIDE);
1484  | LVS_NOCOLUMNHEADER, 50, 50, 100, 100,
1485  hwndCallback, NULL, hhctrl_hinstance, NULL);
1486  if(!hwndList) {
1487  ERR("Could not create popup ListView control\n");
1488  return FALSE;
1489  }
1490  memset(&lvc, 0, sizeof(lvc));
1491  lvc.mask = LVCF_TEXT;
1492  lvc.pszText = hidden_column;
1493  if(SendMessageW(hwndList, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1494  {
1495  ERR("Could not create popup ListView column\n");
1496  return FALSE;
1497  }
1498 
1499  info->popup.hwndCallback = hwndCallback;
1500  info->popup.hwndPopup = hwndPopup;
1501  info->popup.hwndList = hwndList;
1502  SetWindowLongPtrW(hwndPopup, 0, (LONG_PTR)info);
1503  SetWindowLongPtrW(hwndCallback, 0, (LONG_PTR)info);
1504 
1506  ShowWindow(hwndList, SW_SHOW);
1507 
1508  return TRUE;
1509 }
#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
int cbWndExtra
Definition: winuser.h:3210
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2284
#define LVCF_TEXT
Definition: commctrl.h:2588
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
#define LVS_REPORT
Definition: commctrl.h:2262
static const WCHAR windowClassW[]
Definition: actctx.c:633
#define WC_LISTVIEWW
Definition: commctrl.h:2257
#define CS_HREDRAW
Definition: winuser.h:648
HICON hIcon
Definition: winuser.h:3212
#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:2556
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
LPCWSTR lpszMenuName
Definition: winuser.h:3215
#define FALSE
Definition: types.h:117
#define CW_USEDEFAULT
Definition: winuser.h:225
#define COLOR_MENU
Definition: winuser.h:911
LONG_PTR LPARAM
Definition: windef.h:208
int cbClsExtra
Definition: winuser.h:3209
#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:3216
#define CS_VREDRAW
Definition: winuser.h:653
__wchar_t WCHAR
Definition: xmlstorage.h:180
HBRUSH hbrBackground
Definition: winuser.h:3214
UINT cbSize
Definition: winuser.h:3206
#define LVS_SINGLESEL
Definition: commctrl.h:2266
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
HINSTANCE hInstance
Definition: winuser.h:3211
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:922
HCURSOR hCursor
Definition: winuser.h:3213
UINT style
Definition: winuser.h:3207
#define TAB_INDEX
Definition: hhctrl.h:117
WNDPROC lpfnWndProc
Definition: winuser.h:3208
#define ERR(fmt,...)
Definition: debug.h:110
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
#define WS_BORDER
Definition: pedump.c:625
static void ResizePopupChild(HHInfo *info)
Definition: help.c:1324
#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
#define NULL
Definition: types.h:112
HICON hIconSm
Definition: winuser.h:3217
#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:1353
#define SetWindowLongPtrW
Definition: winuser.h:5336
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:1376
#define WS_VISIBLE
Definition: pedump.c:620
#define memset(x, y, z)
Definition: compat.h:39
#define LVM_INSERTCOLUMNA
Definition: commctrl.h:2631

Referenced by CreateViewer().

◆ AddIndexTab()

static BOOL AddIndexTab ( HHInfo info)
static

Definition at line 1230 of file help.c.

1231 {
1232  char hidden_column[] = "Column";
1233  LVCOLUMNA lvc;
1234 
1235  if(info->tabs[TAB_INDEX].id == -1)
1236  return TRUE; /* No "Index" tab */
1239  info->WinType.hwndNavigation, NULL, hhctrl_hinstance, NULL);
1240  if(!info->tabs[TAB_INDEX].hwnd) {
1241  ERR("Could not create ListView control\n");
1242  return FALSE;
1243  }
1244  memset(&lvc, 0, sizeof(lvc));
1245  lvc.mask = LVCF_TEXT;
1246  lvc.pszText = hidden_column;
1247  if(SendMessageW(info->tabs[TAB_INDEX].hwnd, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1248  {
1249  ERR("Could not create ListView column\n");
1250  return FALSE;
1251  }
1252 
1254  ShowWindow(info->tabs[TAB_INDEX].hwnd, SW_HIDE);
1255 
1256  return TRUE;
1257 }
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2284
#define LVCF_TEXT
Definition: commctrl.h:2588
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
#define LVS_REPORT
Definition: commctrl.h:2262
#define WC_LISTVIEWW
Definition: commctrl.h:2257
#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:2556
#define FALSE
Definition: types.h:117
LONG_PTR LPARAM
Definition: windef.h:208
#define LVS_SINGLESEL
Definition: commctrl.h:2266
static void ResizeTabChild(HHInfo *info, int tab)
Definition: help.c:499
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:110
#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)
#define NULL
Definition: types.h:112
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
#define memset(x, y, z)
Definition: compat.h:39
#define LVM_INSERTCOLUMNA
Definition: commctrl.h:2631

Referenced by CreateViewer().

◆ AddSearchTab()

static BOOL AddSearchTab ( HHInfo info)
static

Definition at line 1259 of file help.c.

1260 {
1261  HWND hwndList, hwndEdit, hwndContainer;
1262  char hidden_column[] = "Column";
1263  WNDPROC editWndProc;
1264  LVCOLUMNA lvc;
1265 
1266  if(info->tabs[TAB_SEARCH].id == -1)
1267  return TRUE; /* No "Search" tab */
1269  WS_CHILD, 0, 0, 0, 0, info->WinType.hwndNavigation,
1271  if(!hwndContainer) {
1272  ERR("Could not create search window container control.\n");
1273  return FALSE;
1274  }
1276  | WS_VISIBLE | ES_LEFT | SS_NOTIFY, 0, 0, 0, 0,
1277  hwndContainer, NULL, hhctrl_hinstance, NULL);
1278  if(!hwndEdit) {
1279  ERR("Could not create search ListView control.\n");
1280  return FALSE;
1281  }
1282  if(SendMessageW(hwndEdit, WM_SETFONT, (WPARAM) info->hFont, (LPARAM) FALSE) == -1)
1283  {
1284  ERR("Could not set font for edit control.\n");
1285  return FALSE;
1286  }
1288  if(!editWndProc) {
1289  ERR("Could not redirect messages for edit control.\n");
1290  return FALSE;
1291  }
1295  | LVS_REPORT | LVS_NOCOLUMNHEADER, 0, 0, 0, 0,
1296  hwndContainer, NULL, hhctrl_hinstance, NULL);
1297  if(!hwndList) {
1298  ERR("Could not create search ListView control.\n");
1299  return FALSE;
1300  }
1301  memset(&lvc, 0, sizeof(lvc));
1302  lvc.mask = LVCF_TEXT;
1303  lvc.pszText = hidden_column;
1304  if(SendMessageW(hwndList, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1305  {
1306  ERR("Could not create ListView column\n");
1307  return FALSE;
1308  }
1309 
1310  info->search.hwndEdit = hwndEdit;
1311  info->search.hwndList = hwndList;
1312  info->search.hwndContainer = hwndContainer;
1313  info->tabs[TAB_SEARCH].hwnd = hwndContainer;
1314 
1315  SetWindowLongPtrW(hwndContainer, 0, (LONG_PTR)info);
1316 
1318 
1319  return TRUE;
1320 }
#define WC_EDITW
Definition: commctrl.h:4687
static const WCHAR szChildClass[]
Definition: help.c:463
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2284
#define LVCF_TEXT
Definition: commctrl.h:2588
#define TRUE
Definition: types.h:120
#define LVS_REPORT
Definition: commctrl.h:2262
#define WC_LISTVIEWW
Definition: commctrl.h:2257
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:2556
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
#define FALSE
Definition: types.h:117
#define GWLP_USERDATA
Definition: treelist.c:63
LONG_PTR LPARAM
Definition: windef.h:208
#define SS_NOTIFY
Definition: winuser.h:351
#define LVS_SINGLESEL
Definition: commctrl.h:2266
static void ResizeTabChild(HHInfo *info, int tab)
Definition: help.c:499
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:2896
#define ERR(fmt,...)
Definition: debug.h:110
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:695
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define NULL
Definition: types.h:112
#define WM_SETFONT
Definition: winuser.h:1640
#define SetWindowLongPtrW
Definition: winuser.h:5336
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:2631

Referenced by CreateViewer().

◆ AppendFullPathURL()

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

Definition at line 251 of file help.c.

252 {
253  static const WCHAR url_format[] =
254  {'m','k',':','@','M','S','I','T','S','t','o','r','e',':','%','s',':',':','%','s','%','s',0};
255  static const WCHAR slash[] = {'/',0};
256  static const WCHAR empty[] = {0};
257  WCHAR full_path[MAX_PATH];
258 
259  TRACE("%s %p %s\n", debugstr_w(file), buf, debugstr_w(index));
260 
261  if (!GetFullPathNameW(file, ARRAY_SIZE(full_path), full_path, NULL)) {
262  WARN("GetFullPathName failed: %u\n", GetLastError());
263  return FALSE;
264  }
265 
266  wsprintfW(buf, url_format, full_path, (!index || index[0] == '/') ? empty : slash, index);
267  return TRUE;
268 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define FALSE
Definition: types.h:117
#define debugstr_w
Definition: kernel32.h:32
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:34
#define ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
BOOL empty
Definition: button.c:170
Definition: fci.c:126

Referenced by DoSync(), and NavigateToChm().

◆ Child_OnPaint()

static LRESULT Child_OnPaint ( HWND  hWnd)
static

Definition at line 467 of file help.c.

468 {
469  PAINTSTRUCT ps;
470  HDC hdc;
471  RECT rc;
472 
473  hdc = BeginPaint(hWnd, &ps);
474 
475  /* Only paint the Navigation pane, identified by the fact
476  * that it has a child window
477  */
478  if (GetWindow(hWnd, GW_CHILD))
479  {
480  GetClientRect(hWnd, &rc);
481 
482  /* set the border color */
483  SelectObject(hdc, GetStockObject(DC_PEN));
485 
486  /* Draw the top border */
487  LineTo(hdc, rc.right, 0);
488 
490  MoveToEx(hdc, 0, 1, NULL);
491  LineTo(hdc, rc.right, 1);
492  }
493 
494  EndPaint(hWnd, &ps);
495 
496  return 0;
497 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define GW_CHILD
Definition: winuser.h:758
#define WHITE_PEN
Definition: wingdi.h:905
static HDC
Definition: imagelist.c:92
HWND hWnd
Definition: settings.c:17
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:308
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
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:924
#define NULL
Definition: types.h:112
COLORREF WINAPI SetDCPenColor(_In_ HDC hdc, _In_ COLORREF crColor)
Definition: dc.c:941

Referenced by Child_WndProc().

◆ Child_OnSize()

static LRESULT Child_OnSize ( HWND  hwnd)
static

Definition at line 557 of file help.c.

558 {
560  RECT rect;
561 
562  if(!info || hwnd != info->WinType.hwndNavigation)
563  return 0;
564 
566  SetWindowPos(info->hwndTabCtrl, HWND_TOP, 0, 0,
567  rect.right - TAB_RIGHT_PADDING,
568  rect.bottom - TAB_TOP_PADDING, SWP_NOMOVE);
569 
573  return 0;
574 }
#define TAB_CONTENTS
Definition: hhctrl.h:116
#define HWND_TOP
Definition: winuser.h:1197
#define GetWindowLongPtrW
Definition: winuser.h:4819
& 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:499
#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:1234
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022

Referenced by Child_WndProc().

◆ Child_WndProc()

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

Definition at line 710 of file help.c.

711 {
712  switch (message)
713  {
714  case WM_PAINT:
715  return Child_OnPaint(hWnd);
716  case WM_SIZE:
717  return Child_OnSize(hWnd);
718  case WM_NOTIFY: {
720  NMHDR *nmhdr = (NMHDR*)lParam;
721 
722  switch(nmhdr->code) {
723  case TCN_SELCHANGE:
724  return OnTabChange(hWnd);
725  case TVN_SELCHANGEDW:
726  return OnTopicChange(info, (void*)((NMTREEVIEWW *)lParam)->itemNew.lParam);
727  case TVN_ITEMEXPANDINGW: {
728  TVITEMW *item = &((NMTREEVIEWW *)lParam)->itemNew;
729  HWND hwndTreeView = info->tabs[TAB_CONTENTS].hwnd;
730 
732  if (item->state & TVIS_EXPANDED)
733  {
734  item->iImage = HHTV_FOLDER;
735  item->iSelectedImage = HHTV_FOLDER;
736  }
737  else
738  {
739  item->iImage = HHTV_OPENFOLDER;
740  item->iSelectedImage = HHTV_OPENFOLDER;
741  }
743  return 0;
744  }
745  case NM_DBLCLK:
746  if(!info)
747  return 0;
748  switch(info->current_tab)
749  {
750  case TAB_INDEX:
751  return OnTopicChange(info, (void*)((NMITEMACTIVATE *)lParam)->lParam);
752  case TAB_SEARCH:
753  return OnTopicChange(info, (void*)((NMITEMACTIVATE *)lParam)->lParam);
754  }
755  break;
756  case NM_RETURN:
757  if(!info)
758  return 0;
759  switch(info->current_tab) {
760  case TAB_INDEX: {
761  HWND hwndList = info->tabs[TAB_INDEX].hwnd;
762  LVITEMW lvItem;
763 
764  lvItem.iItem = (int) SendMessageW(hwndList, LVM_GETSELECTIONMARK, 0, 0);
765  lvItem.mask = TVIF_PARAM;
766  SendMessageW(hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
767  OnTopicChange(info, (void*) lvItem.lParam);
768  return 0;
769  }
770  case TAB_SEARCH: {
771  if(nmhdr->hwndFrom == info->search.hwndEdit) {
772  char needle[100];
773  DWORD i, len;
774 
775  len = GetWindowTextA(info->search.hwndEdit, needle, sizeof(needle));
776  if(!len)
777  {
778  FIXME("Unable to get search text.\n");
779  return 0;
780  }
781  /* Convert the requested text for comparison later against the
782  * lower case version of HTML file contents.
783  */
784  for(i=0;i<len;i++)
785  needle[i] = tolower(needle[i]);
786  InitSearch(info, needle);
787  return 0;
788  }else if(nmhdr->hwndFrom == info->search.hwndList) {
789  HWND hwndList = info->search.hwndList;
790  LVITEMW lvItem;
791 
792  lvItem.iItem = (int) SendMessageW(hwndList, LVM_GETSELECTIONMARK, 0, 0);
793  lvItem.mask = TVIF_PARAM;
794  SendMessageW(hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
795  OnTopicChange(info, (void*) lvItem.lParam);
796  return 0;
797  }
798  break;
799  }
800  }
801  break;
802  }
803  break;
804  }
805  default:
807  }
808 
809  return 0;
810 }
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:1330
static LRESULT OnTopicChange(HHInfo *info, void *user_data)
Definition: help.c:613
HWND hWnd
Definition: settings.c:17
#define TAB_CONTENTS
Definition: hhctrl.h:116
#define HHTV_OPENFOLDER
Definition: resource.h:63
#define HHTV_FOLDER
Definition: resource.h:62
#define GetWindowLongPtrW
Definition: winuser.h:4819
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3271
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
UINT code
Definition: winuser.h:3149
#define TVM_SETITEMW
Definition: commctrl.h:3493
static LRESULT Child_OnPaint(HWND hWnd)
Definition: help.c:467
LPARAM lParam
Definition: commctrl.h:2368
#define FIXME(fmt,...)
Definition: debug.h:111
static LRESULT Child_OnSize(HWND hwnd)
Definition: help.c:557
LONG_PTR LPARAM
Definition: windef.h:208
#define TVN_ITEMEXPANDINGW
Definition: commctrl.h:3700
#define TVN_SELCHANGEDW
Definition: commctrl.h:3648
#define TCN_SELCHANGE
Definition: commctrl.h:4132
#define WM_SIZE
Definition: winuser.h:1601
Definition: hhctrl.h:185
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WM_PAINT
Definition: winuser.h:1610
UINT mask
Definition: commctrl.h:2360
HWND hwndTreeView
Definition: eventvwr.c:65
#define LVM_GETSELECTIONMARK
Definition: commctrl.h:2788
GLenum GLsizei len
Definition: glext.h:6722
#define TAB_SEARCH
Definition: hhctrl.h:118
HWND hwndFrom
Definition: winuser.h:3147
#define TAB_INDEX
Definition: hhctrl.h:117
static LRESULT OnTabChange(HWND hwnd)
Definition: help.c:576
#define TVIS_EXPANDED
Definition: commctrl.h:3284
#define NM_RETURN
Definition: commctrl.h:132
static ATOM item
Definition: dde.c:856
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define NM_DBLCLK
Definition: commctrl.h:131
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TVIF_IMAGE
Definition: commctrl.h:3267
#define LVM_GETITEMW
Definition: commctrl.h:2390
#define TVIF_PARAM
Definition: commctrl.h:3268
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 1844 of file help.c.

1845 {
1846  HHInfo *tmp_info;
1847  unsigned int i;
1848 
1849  if(!info)
1850  {
1851  info = heap_alloc_zero(sizeof(HHInfo));
1852  list_add_tail(&window_list, &info->entry);
1853  }
1854 
1855  /* Set the invalid tab ID (-1) as the default value for all
1856  * of the tabs, this matches a failed TCM_INSERTITEM call.
1857  */
1858  for (i = 0; i < ARRAY_SIZE(info->tabs); i++)
1859  info->tabs[i].id = -1;
1860 
1862 
1863  info->pCHMInfo = OpenCHM(filename);
1864  if(!info->pCHMInfo) {
1866  return NULL;
1867  }
1868 
1869  if (!LoadWinTypeFromCHM(info)) {
1871  return NULL;
1872  }
1873  info->WinType.hwndCaller = caller;
1874 
1875  /* If the window is already open then load the file in that existing window */
1876  if ((tmp_info = find_window(info->WinType.pszType)) && tmp_info != info)
1877  {
1879  return CreateHelpViewer(tmp_info, filename, caller);
1880  }
1881 
1882  if(!info->viewer_initialized && !CreateViewer(info)) {
1884  return NULL;
1885  }
1886 
1887  return info;
1888 }
CHMInfo * OpenCHM(LPCWSTR szFile)
Definition: chm.c:626
HHInfo * CreateHelpViewer(HHInfo *info, LPCWSTR filename, HWND caller)
Definition: help.c:1844
BOOL LoadWinTypeFromCHM(HHInfo *info)
Definition: chm.c:344
const char * filename
Definition: ioapi.h:137
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
static struct _test_info info[]
Definition: SetCursorPos.c:19
Definition: hhctrl.h:185
void ReleaseHelpViewer(HHInfo *info)
Definition: help.c:1815
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
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 ARRAY_SIZE(a)
Definition: main.h:24
#define NULL
Definition: types.h:112
struct list window_list
Definition: help.c:51
HHInfo * find_window(const WCHAR *window)
Definition: help.c:1980
static BOOL CreateViewer(HHInfo *pHHInfo)
Definition: help.c:1742

Referenced by CreateHelpViewer(), and HtmlHelpW().

◆ CreateViewer()

static BOOL CreateViewer ( HHInfo pHHInfo)
static

Definition at line 1742 of file help.c.

1743 {
1744  HH_CreateFont(pHHInfo);
1745 
1746  if (!HH_CreateHelpWindow(pHHInfo))
1747  return FALSE;
1748 
1750 
1751  if (!HH_AddToolbar(pHHInfo))
1752  return FALSE;
1753 
1754  HH_RegisterChildWndClass(pHHInfo);
1755 
1756  if (!HH_AddNavigationPane(pHHInfo))
1757  return FALSE;
1758 
1759  HH_RegisterSizeBarClass(pHHInfo);
1760 
1761  if (!HH_AddSizeBar(pHHInfo))
1762  return FALSE;
1763 
1764  if (!HH_AddHTMLPane(pHHInfo))
1765  return FALSE;
1766 
1767  if (!AddContentTab(pHHInfo))
1768  return FALSE;
1769 
1770  if (!AddIndexTab(pHHInfo))
1771  return FALSE;
1772 
1773  if (!AddIndexPopup(pHHInfo))
1774  return FALSE;
1775 
1776  if (!AddSearchTab(pHHInfo))
1777  return FALSE;
1778 
1779  InitContent(pHHInfo);
1780  InitIndex(pHHInfo);
1781 
1782  pHHInfo->viewer_initialized = TRUE;
1783  return TRUE;
1784 }
void InitIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:265
static BOOL HH_AddSizeBar(HHInfo *pHHInfo)
Definition: help.c:435
#define TRUE
Definition: types.h:120
static void HH_InitRequiredControls(DWORD dwControls)
Definition: help.c:1732
static BOOL AddIndexTab(HHInfo *info)
Definition: help.c:1230
#define FALSE
Definition: types.h:117
static BOOL AddSearchTab(HHInfo *info)
Definition: help.c:1259
static void HH_CreateFont(HHInfo *pHHInfo)
Definition: help.c:1720
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
static BOOL HH_AddToolbar(HHInfo *pHHInfo)
Definition: help.c:1012
static BOOL HH_AddNavigationPane(HHInfo *info)
Definition: help.c:1099
static BOOL AddContentTab(HHInfo *info)
Definition: help.c:1201
static BOOL HH_AddHTMLPane(HHInfo *pHHInfo)
Definition: help.c:1172
static BOOL HH_CreateHelpWindow(HHInfo *info)
Definition: help.c:1621
static void HH_RegisterSizeBarClass(HHInfo *pHHInfo)
Definition: help.c:404
static void HH_RegisterChildWndClass(HHInfo *pHHInfo)
Definition: help.c:812
static BOOL AddIndexPopup(HHInfo *info)
Definition: help.c:1423
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 1915 of file help.c.

1916 {
1917  const char *h = html_fragment, *amp, *sem;
1918  char symbol, *tmp;
1919  int len, tmp_len = 0;
1920  WCHAR *unicode_text;
1921 
1922  tmp = heap_alloc(html_fragment_len+1);
1923  while(1)
1924  {
1925  symbol = 0;
1926  amp = strchr(h, '&');
1927  if(!amp) break;
1928  len = amp-h;
1929  /* Copy the characters prior to the HTML encoded character */
1930  memcpy(&tmp[tmp_len], h, len);
1931  tmp_len += len;
1932  amp++; /* skip ampersand */
1933  sem = strchr(amp, ';');
1934  /* Require a semicolon after the ampersand */
1935  if(!sem)
1936  {
1937  h = amp;
1938  tmp[tmp_len++] = '&';
1939  continue;
1940  }
1941  /* Find the symbol either by using the ANSI character number (prefixed by the pound symbol)
1942  * or by searching the HTML entity table */
1943  len = sem-amp;
1944  if(amp[0] == '#')
1945  {
1946  char *endnum = NULL;
1947  int tmp;
1948 
1949  tmp = (char) strtol(amp, &endnum, 10);
1950  if(endnum == sem)
1951  symbol = tmp;
1952  }
1953  else
1954  symbol = find_html_symbol(amp, len);
1955  if(!symbol)
1956  {
1957  FIXME("Failed to translate HTML encoded character '&%.*s;'.\n", len, amp);
1958  h = amp;
1959  tmp[tmp_len++] = '&';
1960  continue;
1961  }
1962  /* Insert the new symbol */
1963  h = sem+1;
1964  tmp[tmp_len++] = symbol;
1965  }
1966  /* Convert any remaining characters */
1967  len = html_fragment_len-(h-html_fragment);
1968  memcpy(&tmp[tmp_len], h, len);
1969  tmp_len += len;
1970  tmp[tmp_len++] = 0; /* NULL-terminate the string */
1971 
1972  len = MultiByteToWideChar(code_page, 0, tmp, tmp_len, NULL, 0);
1973  unicode_text = heap_alloc(len*sizeof(WCHAR));
1974  MultiByteToWideChar(code_page, 0, tmp, tmp_len, unicode_text, len);
1975  heap_free(tmp);
1976  return unicode_text;
1977 }
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:111
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:674
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
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:1893
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 836 of file help.c.

837 {
838  HMENU menu, submenu;
841  POINT coords;
842  RECT rect;
843  DWORD index;
844 
846 
847  if (!menu)
848  return;
849 
850  submenu = GetSubMenu(menu, 0);
851 
852  /* Update the Show/Hide menu item */
853  item.cbSize = sizeof(MENUITEMINFOW);
855  item.fType = MFT_STRING;
856  item.fState = MF_ENABLED;
857 
858  if (info->WinType.fNotExpanded)
859  item.dwTypeData = HH_LoadString(IDS_SHOWTABS);
860  else
861  item.dwTypeData = HH_LoadString(IDS_HIDETABS);
862 
863  SetMenuItemInfoW(submenu, IDTB_EXPAND, FALSE, &item);
864  heap_free(item.dwTypeData);
865 
866  /* Find the index toolbar button */
867  button.cbSize = sizeof(TBBUTTONINFOW);
868  button.dwMask = TBIF_COMMAND;
869  index = SendMessageW(info->WinType.hwndToolBar, TB_GETBUTTONINFOW, IDTB_OPTIONS, (LPARAM) &button);
870 
871  if (index == -1)
872  return;
873 
874  /* Get position */
875  SendMessageW(info->WinType.hwndToolBar, TB_GETITEMRECT, index, (LPARAM) &rect);
876 
877  coords.x = rect.left;
878  coords.y = rect.bottom;
879 
880  ClientToScreen(info->WinType.hwndToolBar, &coords);
881  TrackPopupMenu(submenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_NOANIMATION, coords.x, coords.y, 0, info->WinType.hwndHelp, NULL);
882 }
#define TBIF_COMMAND
Definition: commctrl.h:1224
#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:2367
DWORD button
Definition: button.c:166
#define IDTB_EXPAND
Definition: htmlhelp.h:125
GLuint coords
Definition: glext.h:7368
& rect
Definition: startmenu.cpp:1413
#define TB_GETITEMRECT
Definition: commctrl.h:1133
#define FALSE
Definition: types.h:117
#define MIIM_STATE
Definition: winuser.h:716
#define TPM_TOPALIGN
Definition: winuser.h:2373
#define MENU_POPUP
Definition: resource.h:39
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
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:190
#define TB_GETBUTTONINFOW
Definition: commctrl.h:1257
#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:37
#define NULL
Definition: types.h:112
#define TPM_LEFTBUTTON
Definition: winuser.h:2369
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define IDS_HIDETABS
Definition: resource.h:36
#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 282 of file help.c.

283 {
285  HRESULT hres;
286  BSTR url;
287 
288  hres = IWebBrowser2_get_LocationURL(info->web_browser->web_browser, &url);
289 
290  if (FAILED(hres))
291  {
292  WARN("get_LocationURL failed: %08x\n", hres);
293  return;
294  }
295 
296  /* If we're not currently viewing a page in the active .chm file, abort */
297  if ((!AppendFullPathURL(info->WinType.pszFile, buf, NULL)) || (lstrlenW(buf) > lstrlenW(url)))
298  {
300  return;
301  }
302 
303  if (lstrcmpiW(buf, url) > 0)
304  {
305  static const WCHAR delimW[] = {':',':','/',0};
306  const WCHAR *index;
307 
308  index = wcsstr(url, delimW);
309 
310  if (index)
311  ActivateContentTopic(info->tabs[TAB_CONTENTS].hwnd, index + 3, info->content); /* skip over ::/ */
312  }
313 
315 }
static BOOL AppendFullPathURL(LPCWSTR file, LPWSTR buf, LPCWSTR index)
Definition: help.c:251
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define WARN(fmt,...)
Definition: debug.h:112
#define TAB_CONTENTS
Definition: hhctrl.h:116
OLECHAR * BSTR
Definition: compat.h:2293
#define lstrlenW
Definition: compat.h:750
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1418
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:79
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:271
#define NULL
Definition: types.h:112

Referenced by TB_OnClick().

◆ EditChild_WndProc()

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

Definition at line 695 of file help.c.

696 {
698 
699  if(message == WM_KEYUP && wParam == VK_RETURN)
700  {
701  NMHDR nmhdr;
702 
703  nmhdr.hwndFrom = hWnd;
704  nmhdr.code = NM_RETURN;
706  }
707  return editWndProc(hWnd, message, wParam, lParam);
708 }
Definition: tftpd.h:59
HWND hWnd
Definition: settings.c:17
#define GetWindowLongPtrW
Definition: winuser.h:4819
#define VK_RETURN
Definition: winuser.h:2191
WPARAM wParam
Definition: combotst.c:138
UINT code
Definition: winuser.h:3149
#define GWLP_USERDATA
Definition: treelist.c:63
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_KEYUP
Definition: winuser.h:1706
HWND hwndFrom
Definition: winuser.h:3147
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2896
#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 1513 of file help.c.

1514 {
1515  RECT r, nav;
1516 
1517  pHHInfo->WinType.fNotExpanded = !pHHInfo->WinType.fNotExpanded;
1518  GetWindowRect(pHHInfo->WinType.hwndHelp, &r);
1519  NP_GetNavigationRect(pHHInfo, &nav);
1520 
1521  /* hide/show both the nav bar and the size bar */
1522  if (pHHInfo->WinType.fNotExpanded)
1523  {
1525  ShowWindow(pHHInfo->hwndSizeBar, SW_HIDE);
1526  r.left = r.left + nav.right;
1527 
1530  }
1531  else
1532  {
1534  ShowWindow(pHHInfo->hwndSizeBar, SW_SHOW);
1535  r.left = r.left - nav.right;
1536 
1539  }
1540 
1541  MoveWindow(pHHInfo->WinType.hwndHelp, r.left, r.top, r.right-r.left, r.bottom-r.top, TRUE);
1542 }
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:3998
#define IDTB_EXPAND
Definition: htmlhelp.h:125
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG right
Definition: windef.h:308
#define IDTB_CONTRACT
Definition: htmlhelp.h:126
static void NP_GetNavigationRect(HHInfo *pHHInfo, RECT *rc)
Definition: help.c:1062
#define FALSE
Definition: types.h:117
#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:1045
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 1893 of file help.c.

1894 {
1896  int min = 0, dir;
1897 
1898  while(min <= max)
1899  {
1900  int pos = (min+max)/2;
1901  const char *encoded_symbol = html_encoded_symbols[pos].html_code;
1902  dir = strncmp(encoded_symbol, entity, entity_len);
1903  if(dir == 0 && !encoded_symbol[entity_len]) return html_encoded_symbols[pos].ansi_symbol;
1904  if(dir < 0)
1905  min = pos+1;
1906  else
1907  max = pos-1;
1908  }
1909  return 0;
1910 }
#define max(a, b)
Definition: svc.c:63
static struct html_encoded_symbol html_encoded_symbols[]
Definition: help.c:64
Definition: actctx.c:387
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 1980 of file help.c.

1981 {
1982  HHInfo *info;
1983 
1985  {
1986  if (lstrcmpW(info->WinType.pszType, window) == 0)
1987  return info;
1988  }
1989  return NULL;
1990 }
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static struct _test_info info[]
Definition: SetCursorPos.c:19
Definition: hhctrl.h:185
uint32_t entry
Definition: isohybrid.c:63
static IHTMLWindow2 * window
Definition: events.c:77
#define NULL
Definition: types.h:112
struct list window_list
Definition: help.c:51

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

◆ Help_OnSize()

static LRESULT Help_OnSize ( HWND  hWnd)
static

Definition at line 1544 of file help.c.

1545 {
1546  HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
1547  DWORD dwSize;
1548  RECT rc;
1549 
1550  if (!pHHInfo)
1551  return 0;
1552 
1553  if (navigation_visible(pHHInfo))
1554  {
1555  NP_GetNavigationRect(pHHInfo, &rc);
1556  SetWindowPos(pHHInfo->WinType.hwndNavigation, HWND_TOP, 0, 0,
1557  rc.right, rc.bottom, SWP_NOMOVE);
1558 
1559  SB_GetSizeBarRect(pHHInfo, &rc);
1560  SetWindowPos(pHHInfo->hwndSizeBar, HWND_TOP, rc.left, rc.top,
1561  rc.right, rc.bottom, SWP_SHOWWINDOW);
1562 
1563  }
1564 
1565  HP_GetHTMLRect(pHHInfo, &rc);
1566  SetWindowPos(pHHInfo->WinType.hwndHTML, HWND_TOP, rc.left, rc.top,
1567  rc.right, rc.bottom, SWP_SHOWWINDOW);
1568 
1569  /* Resize browser window taking the frame size into account */
1571  ResizeWebBrowser(pHHInfo, rc.right - dwSize, rc.bottom - dwSize);
1572 
1573  return 0;
1574 }
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:307
#define HWND_TOP
Definition: winuser.h:1197
#define GetWindowLongPtrW
Definition: winuser.h:4819
LONG left
Definition: windef.h:306
static void SB_GetSizeBarRect(HHInfo *info, RECT *rc)
Definition: help.c:424
#define SM_CXFRAME
Definition: winuser.h:988
LONG right
Definition: windef.h:308
static void NP_GetNavigationRect(HHInfo *pHHInfo, RECT *rc)
Definition: help.c:1062
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:1238
LONG bottom
Definition: windef.h:309
#define SWP_NOMOVE
Definition: winuser.h:1234
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:1149
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

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 1596 of file help.c.

1597 {
1598  switch (message)
1599  {
1600  case WM_COMMAND:
1601  if (HIWORD(wParam) == BN_CLICKED)
1603  break;
1604  case WM_SIZE:
1605  return Help_OnSize(hWnd);
1606  case WM_CLOSE:
1608  return 0;
1609  case WM_DESTROY:
1610  if(hh_process)
1611  PostQuitMessage(0);
1612  break;
1613 
1614  default:
1616  }
1617 
1618  return 0;
1619 }
Definition: tftpd.h:59
static LRESULT Help_OnSize(HWND hWnd)
Definition: help.c:1544
HWND hWnd
Definition: settings.c:17
#define GetWindowLongPtrW
Definition: winuser.h:4819
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:1599
static void TB_OnClick(HWND hWnd, DWORD dwID)
Definition: help.c:884
#define WM_SIZE
Definition: winuser.h:1601
Definition: hhctrl.h:185
#define WM_CLOSE
Definition: winuser.h:1611
#define BN_CLICKED
Definition: winuser.h:1915
void ReleaseHelpViewer(HHInfo *info)
Definition: help.c:1815
#define WM_COMMAND
Definition: winuser.h:1730
#define HIWORD(l)
Definition: typedefs.h:247
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 1353 of file help.c.

1354 {
1356 
1357  switch (message)
1358  {
1359  case WM_SIZE:
1361  return 0;
1362  case WM_DESTROY:
1364  return 0;
1365  case WM_CLOSE:
1367  return 0;
1368 
1369  default:
1371  }
1372 
1373  return 0;
1374 }
Definition: tftpd.h:59
#define SW_HIDE
Definition: winuser.h:762
HWND hWnd
Definition: settings.c:17
#define GetWindowLongPtrW
Definition: winuser.h:4819
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:1599
#define WM_SIZE
Definition: winuser.h:1601
Definition: hhctrl.h:185
#define WM_CLOSE
Definition: winuser.h:1611
static void ResizePopupChild(HHInfo *info)
Definition: help.c:1324
LPARAM lParam
Definition: combotst.c:139

Referenced by AddIndexPopup().

◆ HH_AddHTMLPane()

static BOOL HH_AddHTMLPane ( HHInfo pHHInfo)
static

Definition at line 1172 of file help.c.

1173 {
1174  HWND hWnd;
1175  HWND hwndParent = pHHInfo->WinType.hwndHelp;
1178  RECT rc;
1179 
1180  HP_GetHTMLRect(pHHInfo, &rc);
1181 
1182  hWnd = CreateWindowExW(dwExStyles, szChildClass, szEmpty, dwStyles,
1183  rc.left, rc.top, rc.right, rc.bottom,
1185  if (!hWnd)
1186  return FALSE;
1187 
1188  if (!InitWebBrowser(pHHInfo, hWnd))
1189  return FALSE;
1190 
1191  /* store the pointer to the HH info struct */
1192  SetWindowLongPtrW(hWnd, 0, (LONG_PTR)pHHInfo);
1193 
1195  UpdateWindow(hWnd);
1196 
1197  pHHInfo->WinType.hwndHTML = hWnd;
1198  return TRUE;
1199 }
static const WCHAR szChildClass[]
Definition: help.c:463
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define TRUE
Definition: types.h:120
BOOL WINAPI UpdateWindow(_In_ HWND)
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:307
BOOL InitWebBrowser(HHInfo *, HWND) DECLSPEC_HIDDEN
Definition: webbrowser.c:670
LONG left
Definition: windef.h:306
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LONG right
Definition: windef.h:308
static const WCHAR szEmpty[]
Definition: help.c:53
#define FALSE
Definition: types.h:117
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
#define NULL
Definition: types.h:112
LONG bottom
Definition: windef.h:309
#define SetWindowLongPtrW
Definition: winuser.h:5336
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:1149

Referenced by CreateViewer().

◆ HH_AddNavigationPane()

static BOOL HH_AddNavigationPane ( HHInfo info)
static

Definition at line 1099 of file help.c.

1100 {
1101  HWND hWnd, hwndTabCtrl;
1102  HWND hwndParent = info->WinType.hwndHelp;
1103  DWORD dwStyles = WS_CHILDWINDOW;
1105  RECT rc;
1106 
1107  if (navigation_visible(info))
1108  dwStyles |= WS_VISIBLE;
1109 
1110  NP_GetNavigationRect(info, &rc);
1111 
1112  hWnd = CreateWindowExW(dwExStyles, szChildClass, szEmpty, dwStyles,
1113  rc.left, rc.top, rc.right, rc.bottom,
1115  if (!hWnd)
1116  return FALSE;
1117 
1119 
1120  hwndTabCtrl = CreateWindowExW(dwExStyles, WC_TABCONTROLW, szEmpty, dwStyles | WS_VISIBLE,
1121  0, TAB_TOP_PADDING,
1122  rc.right - TAB_RIGHT_PADDING,
1123  rc.bottom - TAB_TOP_PADDING,
1125  if (!hwndTabCtrl)
1126  return FALSE;
1127 
1128  if (*info->WinType.pszToc)
1129  info->tabs[TAB_CONTENTS].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_CONTENTS);
1130 
1131  if (*info->WinType.pszIndex)
1132  info->tabs[TAB_INDEX].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_INDEX);
1133 
1134  if (info->WinType.fsWinProperties & HHWIN_PROP_TAB_SEARCH)
1135  info->tabs[TAB_SEARCH].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_SEARCH);
1136 
1137  if (info->WinType.fsWinProperties & HHWIN_PROP_TAB_FAVORITES)
1138  info->tabs[TAB_FAVORITES].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_FAVORITES);
1139 
1140  SendMessageW(hwndTabCtrl, WM_SETFONT, (WPARAM)info->hFont, TRUE);
1141 
1142  info->hwndTabCtrl = hwndTabCtrl;
1143  info->WinType.hwndNavigation = hWnd;
1144  return TRUE;
1145 }
#define HHWIN_PROP_TAB_FAVORITES
Definition: htmlhelp.h:67
static const WCHAR szChildClass[]
Definition: help.c:463
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define TRUE
Definition: types.h:120
#define TAB_FAVORITES
Definition: hhctrl.h:119
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:307
#define IDS_FAVORITES
Definition: resource.h:35
#define IDS_INDEX
Definition: resource.h:33
#define TAB_CONTENTS
Definition: hhctrl.h:116
UINT_PTR WPARAM
Definition: windef.h:207
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
static const WCHAR szEmpty[]
Definition: help.c:53
static void NP_GetNavigationRect(HHInfo *pHHInfo, RECT *rc)
Definition: help.c:1062
#define FALSE
Definition: types.h:117
static BOOL navigation_visible(HHInfo *info)
Definition: help.c:168
static DWORD NP_CreateTab(HINSTANCE hInstance, HWND hwndTabCtrl, DWORD index)
Definition: help.c:1084
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:3935
#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:32
#define NULL
Definition: types.h:112
#define WM_SETFONT
Definition: winuser.h:1640
LONG bottom
Definition: windef.h:309
#define SetWindowLongPtrW
Definition: winuser.h:5336
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
#define WS_VISIBLE
Definition: pedump.c:620
#define IDS_SEARCH
Definition: resource.h:34

Referenced by CreateViewer().

◆ HH_AddSizeBar()

static BOOL HH_AddSizeBar ( HHInfo pHHInfo)
static

Definition at line 435 of file help.c.

436 {
437  HWND hWnd;
438  HWND hwndParent = pHHInfo->WinType.hwndHelp;
439  DWORD dwStyles = WS_CHILDWINDOW | WS_OVERLAPPED;
441  RECT rc;
442 
443  if (navigation_visible(pHHInfo))
444  dwStyles |= WS_VISIBLE;
445 
446  SB_GetSizeBarRect(pHHInfo, &rc);
447 
448  hWnd = CreateWindowExW(dwExStyles, szSizeBarClass, szEmpty, dwStyles,
449  rc.left, rc.top, rc.right, rc.bottom,
451  if (!hWnd)
452  return FALSE;
453 
454  /* store the pointer to the HH info struct */
455  SetWindowLongPtrW(hWnd, 0, (LONG_PTR)pHHInfo);
456 
457  pHHInfo->hwndSizeBar = hWnd;
458  return TRUE;
459 }
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
static void SB_GetSizeBarRect(HHInfo *info, RECT *rc)
Definition: help.c:424
LONG right
Definition: windef.h:308
static const WCHAR szSizeBarClass[]
Definition: help.c:321
static const WCHAR szEmpty[]
Definition: help.c:53
#define FALSE
Definition: types.h:117
static BOOL navigation_visible(HHInfo *info)
Definition: help.c:168
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
#define NULL
Definition: types.h:112
LONG bottom
Definition: windef.h:309
#define SetWindowLongPtrW
Definition: winuser.h:5336
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 1012 of file help.c.

1013 {
1014  HWND hToolbar;
1015  HWND hwndParent = pHHInfo->WinType.hwndHelp;
1016  DWORD toolbarFlags;
1018  DWORD dwStyles, dwExStyles;
1019  DWORD dwNumButtons, dwIndex;
1020 
1022  toolbarFlags = pHHInfo->WinType.fsToolBarFlags;
1023  else
1024  toolbarFlags = HHWIN_DEF_BUTTONS;
1025 
1028 
1029  hToolbar = CreateWindowExW(dwExStyles, TOOLBARCLASSNAMEW, NULL, dwStyles,
1030  0, 0, 0, 0, hwndParent, NULL,
1032  if (!hToolbar)
1033  return FALSE;
1034  pHHInfo->WinType.hwndToolBar = hToolbar;
1035 
1037  SendMessageW(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
1038  SendMessageW(hToolbar, WM_SETFONT, (WPARAM)pHHInfo->hFont, TRUE);
1039 
1040  TB_AddButtonsFromFlags(pHHInfo, buttons, toolbarFlags, &dwNumButtons);
1041 
1042  for (dwIndex = 0; dwIndex < dwNumButtons; dwIndex++)
1043  {
1044  LPWSTR szBuf = HH_LoadString(buttons[dwIndex].idCommand);
1045  DWORD dwLen = lstrlenW(szBuf);
1046  szBuf[dwLen + 1] = 0; /* Double-null terminate */
1047 
1048  buttons[dwIndex].iString = (DWORD)SendMessageW(hToolbar, TB_ADDSTRINGW, 0, (LPARAM)szBuf);
1049  heap_free(szBuf);
1050  }
1051 
1052  SendMessageW(hToolbar, TB_ADDBUTTONSW, dwNumButtons, (LPARAM)buttons);
1053  SendMessageW(hToolbar, TB_AUTOSIZE, 0, 0);
1055  ShowWindow(hToolbar, SW_SHOW);
1056 
1057  return TRUE;
1058 }
HWND hwndToolBar
Definition: htmlhelp.h:353
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
#define HHWIN_DEF_BUTTONS
Definition: htmlhelp.h:122
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define TRUE
Definition: types.h:120
#define TB_ADDSTRINGW
Definition: commctrl.h:1132
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#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 lstrlenW
Definition: compat.h:750
#define DWORD
Definition: nt_native.h:44
#define CCS_NODIVIDER
Definition: commctrl.h:2248
#define FALSE
Definition: types.h:117
DWORD fsWinProperties
Definition: htmlhelp.h:344
#define TB_AUTOSIZE
Definition: commctrl.h:1137
#define IDTB_TOC_PREV
Definition: htmlhelp.h:148
#define MAKELONG(a, b)
Definition: typedefs.h:249
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:834
unsigned long DWORD
Definition: ntddk_ex.h:95
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
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:1266
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1136
#define HHWIN_PARAM_TB_FLAGS
Definition: htmlhelp.h:92
static LPWSTR HH_LoadString(DWORD dwID)
Definition: help.c:190
static void TB_AddButtonsFromFlags(HHInfo *pHHInfo, TBBUTTON *pButtons, DWORD dwButtonFlags, LPDWORD pdwNumButtons)
Definition: help.c:948
#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 NULL
Definition: types.h:112
#define WM_SETFONT
Definition: winuser.h:1640
#define HHWIN_PROP_TRI_PANE
Definition: htmlhelp.h:60
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:990
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:992
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 1720 of file help.c.

1721 {
1722  LOGFONTW lf;
1723 
1725  lf.lfWeight = FW_NORMAL;
1726  lf.lfItalic = FALSE;
1727  lf.lfUnderline = FALSE;
1728 
1729  pHHInfo->hFont = CreateFontIndirectW(&lf);
1730 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define FALSE
Definition: types.h:117
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
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:373
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 1621 of file help.c.

1622 {
1623  HWND hWnd;
1624  RECT winPos = info->WinType.rcWindowPos;
1625  WNDCLASSEXW wcex;
1626  DWORD dwStyles, dwExStyles;
1627  DWORD x, y, width = 0, height = 0;
1628  LPCWSTR caption;
1629 
1630  static const WCHAR windowClassW[] = {
1631  'H','H',' ', 'P','a','r','e','n','t',0
1632  };
1633 
1634  wcex.cbSize = sizeof(WNDCLASSEXW);
1635  wcex.style = CS_HREDRAW | CS_VREDRAW;
1636  wcex.lpfnWndProc = Help_WndProc;
1637  wcex.cbClsExtra = 0;
1638  wcex.cbWndExtra = sizeof(LONG_PTR);
1639  wcex.hInstance = hhctrl_hinstance;
1640 #ifdef __REACTOS__
1641  wcex.hIcon = LoadIconW(hhctrl_hinstance, MAKEINTRESOURCEW(IDI_HHICON));
1642 #else
1644 #endif
1646  wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
1647  wcex.lpszMenuName = NULL;
1648  wcex.lpszClassName = windowClassW;
1649 #ifdef __REACTOS__
1650  wcex.hIconSm = NULL;
1651 #else
1653 #endif
1654 
1655  RegisterClassExW(&wcex);
1656 
1657  /* Read in window parameters if available */
1658  if (info->WinType.fsValidMembers & HHWIN_PARAM_STYLES)
1659  {
1660  dwStyles = info->WinType.dwStyles;
1661  if (!(info->WinType.dwStyles & WS_CHILD))
1662  dwStyles |= WS_OVERLAPPEDWINDOW;
1663  }
1664  else
1665  dwStyles = WS_OVERLAPPEDWINDOW | WS_VISIBLE |
1667 
1668  if (info->WinType.fsValidMembers & HHWIN_PARAM_EXSTYLES)
1669  dwExStyles = info->WinType.dwExStyles;
1670  else
1671  dwExStyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_APPWINDOW |
1673 
1674  if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT)
1675  {
1676  x = winPos.left;
1677  y = winPos.top;
1678  width = winPos.right - x;
1679  height = winPos.bottom - y;
1680  }
1681  if (!width || !height)
1682  {
1683  x = WINTYPE_DEFAULT_X;
1684  y = WINTYPE_DEFAULT_Y;
1687  }
1688 
1689  if (!(info->WinType.fsWinProperties & HHWIN_PROP_TRI_PANE) && info->WinType.fNotExpanded)
1690  {
1691  if (!(info->WinType.fsValidMembers & HHWIN_PARAM_NAV_WIDTH) &&
1692  info->WinType.iNavWidth == 0)
1693  {
1694  info->WinType.iNavWidth = WINTYPE_DEFAULT_NAVWIDTH;
1695  }
1696 
1697  x += info->WinType.iNavWidth;
1698  width -= info->WinType.iNavWidth;
1699  }
1700 
1701 
1702  caption = info->WinType.pszCaption;
1703  if (!*caption) caption = info->pCHMInfo->defTitle;
1704 
1705  hWnd = CreateWindowExW(dwExStyles, windowClassW, caption, dwStyles, x, y, width, height,
1706  info->WinType.hwndCaller, NULL, hhctrl_hinstance, NULL);
1707  if (!hWnd)
1708  return FALSE;
1709 
1711  UpdateWindow(hWnd);
1712 
1713  /* store the pointer to the HH info struct */
1715 
1716  info->WinType.hwndHelp = hWnd;
1717  return TRUE;
1718 }
#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
int cbWndExtra
Definition: winuser.h:3210
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define TRUE
Definition: types.h:120
#define WINTYPE_DEFAULT_HEIGHT
Definition: help.c:43
static const WCHAR windowClassW[]
Definition: actctx.c:633
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:307
#define CS_HREDRAW
Definition: winuser.h:648
HICON hIcon
Definition: winuser.h:3212
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:306
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:308
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
static LRESULT CALLBACK Help_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:1596
LPCWSTR lpszMenuName
Definition: winuser.h:3215
#define FALSE
Definition: types.h:117
#define HHWIN_PARAM_STYLES
Definition: htmlhelp.h:86
#define COLOR_MENU
Definition: winuser.h:911
int cbClsExtra
Definition: winuser.h:3209
#define SW_SHOW
Definition: winuser.h:769
#define WS_EX_LEFT
Definition: winuser.h:391
LPCWSTR lpszClassName
Definition: winuser.h:3216
#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:3214
UINT cbSize
Definition: winuser.h:3206
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:3211
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:3213
UINT style
Definition: winuser.h:3207
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
WNDPROC lpfnWndProc
Definition: winuser.h:3208
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define NULL
Definition: types.h:112
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define HHWIN_PARAM_RECT
Definition: htmlhelp.h:88
HICON hIconSm
Definition: winuser.h:3217
#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:309
#define SetWindowLongPtrW
Definition: winuser.h:5336
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
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 1732 of file help.c.

1733 {
1734  INITCOMMONCONTROLSEX icex;
1735 
1736  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
1737  icex.dwICC = dwControls;
1738  InitCommonControlsEx(&icex);
1739 }
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 190 of file help.c.

191 {
192  LPWSTR string = NULL;
193  LPCWSTR stringresource;
194  int iSize;
195 
196  iSize = LoadStringW(hhctrl_hinstance, dwID, (LPWSTR)&stringresource, 0);
197 
198  string = heap_alloc((iSize + 2) * sizeof(WCHAR)); /* some strings (tab text) needs double-null termination */
199  memcpy(string, stringresource, iSize*sizeof(WCHAR));
200  string[iSize] = 0;
201 
202  return string;
203 }
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
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
char string[160]
Definition: util.h:11
#define NULL
Definition: types.h:112
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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

◆ HH_RegisterChildWndClass()

static void HH_RegisterChildWndClass ( HHInfo pHHInfo)
static

Definition at line 812 of file help.c.

813 {
814  WNDCLASSEXW wcex;
815 
816  wcex.cbSize = sizeof(WNDCLASSEXW);
817  wcex.style = 0;
818  wcex.lpfnWndProc = Child_WndProc;
819  wcex.cbClsExtra = 0;
820  wcex.cbWndExtra = sizeof(LONG_PTR);
824  wcex.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
825  wcex.lpszMenuName = NULL;
828 
829  RegisterClassExW(&wcex);
830 }
#define LONG_PTR
Definition: treelist.c:79
int cbWndExtra
Definition: winuser.h:3210
static const WCHAR szChildClass[]
Definition: help.c:463
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HICON hIcon
Definition: winuser.h:3212
#define IDI_APPLICATION
Definition: winuser.h:699
struct _WNDCLASSEXW WNDCLASSEXW
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
LPCWSTR lpszMenuName
Definition: winuser.h:3215
int cbClsExtra
Definition: winuser.h:3209
LPCWSTR lpszClassName
Definition: winuser.h:3216
HBRUSH hbrBackground
Definition: winuser.h:3214
UINT cbSize
Definition: winuser.h:3206
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
HINSTANCE hInstance
Definition: winuser.h:3211
static LRESULT CALLBACK Child_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:710
#define COLOR_BTNFACE
Definition: winuser.h:922
HCURSOR hCursor
Definition: winuser.h:3213
UINT style
Definition: winuser.h:3207
WNDPROC lpfnWndProc
Definition: winuser.h:3208
#define NULL
Definition: types.h:112
HICON hIconSm
Definition: winuser.h:3217
#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 404 of file help.c.

405 {
406  WNDCLASSEXW wcex;
407 
408  wcex.cbSize = sizeof(WNDCLASSEXW);
409  wcex.style = 0;
411  wcex.cbClsExtra = 0;
412  wcex.cbWndExtra = sizeof(LONG_PTR);
416  wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
417  wcex.lpszMenuName = NULL;
420 
421  RegisterClassExW(&wcex);
422 }
#define IDC_SIZEWE
Definition: winuser.h:689
#define LONG_PTR
Definition: treelist.c:79
int cbWndExtra
Definition: winuser.h:3210
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HICON hIcon
Definition: winuser.h:3212
#define IDI_APPLICATION
Definition: winuser.h:699
struct _WNDCLASSEXW WNDCLASSEXW
static const WCHAR szSizeBarClass[]
Definition: help.c:321
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
LPCWSTR lpszMenuName
Definition: winuser.h:3215
#define COLOR_MENU
Definition: winuser.h:911
int cbClsExtra
Definition: winuser.h:3209
LPCWSTR lpszClassName
Definition: winuser.h:3216
HBRUSH hbrBackground
Definition: winuser.h:3214
UINT cbSize
Definition: winuser.h:3206
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
HINSTANCE hInstance
Definition: winuser.h:3211
HCURSOR hCursor
Definition: winuser.h:3213
UINT style
Definition: winuser.h:3207
WNDPROC lpfnWndProc
Definition: winuser.h:3208
#define NULL
Definition: types.h:112
HICON hIconSm
Definition: winuser.h:3217
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:381

Referenced by CreateViewer().

◆ HP_GetHTMLRect()

static void HP_GetHTMLRect ( HHInfo info,
RECT rc 
)
static

Definition at line 1149 of file help.c.

1150 {
1151  RECT rectTB, rectWND, rectNP, rectSB;
1152 
1153  GetClientRect(info->WinType.hwndHelp, &rectWND);
1154  GetClientRect(info->hwndSizeBar, &rectSB);
1155 
1156  rc->left = 0;
1157  rc->top = 0;
1158  if (navigation_visible(info))
1159  {
1160  GetClientRect(info->WinType.hwndNavigation, &rectNP);
1161  rc->left += rectNP.right + rectSB.right;
1162  }
1163  if (info->WinType.fsWinProperties & HHWIN_PROP_TRI_PANE)
1164  {
1165  GetClientRect(info->WinType.hwndToolBar, &rectTB);
1166  rc->top += rectTB.bottom;
1167  }
1168  rc->right = rectWND.right - rc->left;
1169  rc->bottom = rectWND.bottom - rc->top;
1170 }
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
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:309

Referenced by Help_OnSize(), and HH_AddHTMLPane().

◆ navigate_url()

static HRESULT navigate_url ( HHInfo info,
LPCWSTR  surl 
)
static

Definition at line 206 of file help.c.

207 {
208  VARIANT url;
209  HRESULT hres;
210 
211  TRACE("%s\n", debugstr_w(surl));
212 
213  V_VT(&url) = VT_BSTR;
214  V_BSTR(&url) = SysAllocString(surl);
215 
216  hres = IWebBrowser2_Navigate2(info->web_browser->web_browser, &url, 0, 0, 0, 0);
217 
218  VariantClear(&url);
219 
220  if(FAILED(hres))
221  TRACE("Navigation failed: %08x\n", hres);
222 
223  return hres;
224 }
#define debugstr_w
Definition: kernel32.h:32
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
static const WCHAR url[]
Definition: encode.c:1432
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#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 270 of file help.c.

271 {
273 
274  TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index));
275 
276  if ((!info->web_browser) || !AppendFullPathURL(file, buf, index))
277  return FALSE;
278 
279  return SUCCEEDED(navigate_url(info, buf));
280 }
static BOOL AppendFullPathURL(LPCWSTR file, LPWSTR buf, LPCWSTR index)
Definition: help.c:251
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:206
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define FALSE
Definition: types.h:117
if SUCCEEDED(hr)
#define debugstr_w
Definition: kernel32.h:32
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1418
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
Definition: fci.c:126

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

◆ NavigateToUrl()

BOOL NavigateToUrl ( HHInfo info,
LPCWSTR  surl 
)

Definition at line 226 of file help.c.

227 {
228  ChmPath chm_path;
229  BOOL ret;
230  HRESULT hres;
231 
232  static const WCHAR url_indicator[] = {':', '/', '/', 0};
233 
234  TRACE("%s\n", debugstr_w(surl));
235 
236  if (wcsstr(surl, url_indicator)) {
237  hres = navigate_url(info, surl);
238  if(SUCCEEDED(hres))
239  return TRUE;
240  } /* look up in chm if it doesn't look like a full url */
241 
242  SetChmPath(&chm_path, info->pCHMInfo->szFile, surl);
243  ret = NavigateToChm(info, chm_path.chm_file, chm_path.chm_index);
244 
245  heap_free(chm_path.chm_file);
246  heap_free(chm_path.chm_index);
247 
248  return ret;
249 }
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:206
#define TRUE
Definition: types.h:120
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:270
LPWSTR chm_index
Definition: hhctrl.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
if SUCCEEDED(hr)
#define debugstr_w
Definition: kernel32.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:79
LPWSTR chm_file
Definition: hhctrl.h:55
int ret
void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
Definition: chm.c:503
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 1084 of file help.c.

1085 {
1086  TCITEMW tie;
1087  LPWSTR tabText = HH_LoadString(index);
1088  DWORD ret;
1089 
1090  tie.mask = TCIF_TEXT;
1091  tie.pszText = tabText;
1092 
1093  ret = SendMessageW( hwndTabCtrl, TCM_INSERTITEMW, index, (LPARAM)&tie );
1094 
1095  heap_free(tabText);
1096  return ret;
1097 }
LPWSTR pszText
Definition: commctrl.h:4023
#define TCIF_TEXT
Definition: commctrl.h:3971
UINT mask
Definition: commctrl.h:4020
#define TCM_INSERTITEMW
Definition: commctrl.h:4047
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:190
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 1062 of file help.c.

1063 {
1064  HWND hwndParent = pHHInfo->WinType.hwndHelp;
1065  HWND hwndToolbar = pHHInfo->WinType.hwndToolBar;
1066  RECT rectWND, rectTB;
1067 
1068  GetClientRect(hwndParent, &rectWND);
1069  GetClientRect(hwndToolbar, &rectTB);
1070 
1071  rc->left = 0;
1072  rc->top = rectTB.bottom;
1073  rc->bottom = rectWND.bottom - rectTB.bottom;
1074 
1075  if (!(pHHInfo->WinType.fsValidMembers & HHWIN_PARAM_NAV_WIDTH) &&
1076  pHHInfo->WinType.iNavWidth == 0)
1077  {
1079  }
1080 
1081  rc->right = pHHInfo->WinType.iNavWidth;
1082 }
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:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
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:309

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

◆ OnTabChange()

static LRESULT OnTabChange ( HWND  hwnd)
static

Definition at line 576 of file help.c.

577 {
579  int tab_id, tab_index, i;
580 
581  TRACE("%p\n", hwnd);
582 
583  if (!info)
584  return 0;
585 
586  if(info->tabs[info->current_tab].hwnd)
587  ShowWindow(info->tabs[info->current_tab].hwnd, SW_HIDE);
588 
589  tab_id = (int) SendMessageW(info->hwndTabCtrl, TCM_GETCURSEL, 0, 0);
590  /* convert the ID of the tab to an index in our tab list */
591  tab_index = -1;
592  for (i=0; i<TAB_NUMTABS; i++)
593  {
594  if (info->tabs[i].id == tab_id)
595  {
596  tab_index = i;
597  break;
598  }
599  }
600  if (tab_index == -1)
601  {
602  FIXME("Tab ID %d does not correspond to a valid index in the tab list.\n", tab_id);
603  return 0;
604  }
605  info->current_tab = tab_index;
606 
607  if(info->tabs[info->current_tab].hwnd)
608  ShowWindow(info->tabs[info->current_tab].hwnd, SW_SHOW);
609 
610  return 0;
611 }
#define TCM_GETCURSEL
Definition: commctrl.h:4062
#define SW_HIDE
Definition: winuser.h:762
#define TAB_NUMTABS
Definition: hhctrl.h:120
#define GetWindowLongPtrW
Definition: winuser.h:4819
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define FIXME(fmt,...)
Definition: debug.h:111
#define SW_SHOW
Definition: winuser.h:769
#define TRACE(s)
Definition: solgame.cpp:4
Definition: hhctrl.h:185
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
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
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 613 of file help.c.

614 {
615  LPCWSTR chmfile = NULL, name = NULL, local = NULL;
616  ContentItem *citer;
617  SearchItem *siter;
618  IndexItem *iiter;
619 
620  if(!user_data || !info)
621  return 0;
622 
623  switch (info->current_tab)
624  {
625  case TAB_CONTENTS:
626  citer = (ContentItem *) user_data;
627  name = citer->name;
628  local = citer->local;
629  while(citer) {
630  if(citer->merge.chm_file) {
631  chmfile = citer->merge.chm_file;
632  break;
633  }
634  citer = citer->parent;
635  }
636  break;
637  case TAB_INDEX:
638  iiter = (IndexItem *) user_data;
639  if(iiter->nItems == 0) {
640  FIXME("No entries for this item!\n");
641  return 0;
642  }
643  if(iiter->nItems > 1) {
644  int i = 0;
645  LVITEMW lvi;
646 
647  SendMessageW(info->popup.hwndList, LVM_DELETEALLITEMS, 0, 0);
648  for(i=0;i<iiter->nItems;i++) {
649  IndexSubItem *item = &iiter->items[i];
650  WCHAR *name = iiter->keyword;
651 
652  if(!item->name)
653  item->name = GetDocumentTitle(info->pCHMInfo, item->local);
654  if(item->name)
655  name = item->name;
656  memset(&lvi, 0, sizeof(lvi));
657  lvi.iItem = i;
658  lvi.mask = LVIF_TEXT|LVIF_PARAM;
659  lvi.cchTextMax = lstrlenW(name)+1;
660  lvi.pszText = name;
661  lvi.lParam = (LPARAM) item;
662  SendMessageW(info->popup.hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi);
663  }
664  ShowWindow(info->popup.hwndPopup, SW_SHOW);
665  return 0;
666  }
667  name = iiter->items[0].name;
668  local = iiter->items[0].local;
669  chmfile = iiter->merge.chm_file;
670  break;
671  case TAB_SEARCH:
672  siter = (SearchItem *) user_data;
673  name = siter->filename;
674  local = siter->filename;
675  chmfile = info->pCHMInfo->szFile;
676  break;
677  default:
678  FIXME("Unhandled operation for this tab!\n");
679  return 0;
680  }
681 
682  if(!chmfile)
683  {
684  FIXME("No help file found for this item!\n");
685  return 0;
686  }
687 
688  TRACE("name %s loal %s\n", debugstr_w(name), debugstr_w(local));
689 
690  NavigateToChm(info, chmfile, local);
691  return 0;
692 }
ChmPath merge
Definition: hhctrl.h:81
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:270
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define lstrlenW
Definition: compat.h:750
int nItems
Definition: hhctrl.h:83
ChmPath merge
Definition: hhctrl.h:68
#define LVIF_TEXT
Definition: commctrl.h:2309
int cchTextMax
Definition: commctrl.h:2366
#define debugstr_w
Definition: kernel32.h:32
LPARAM lParam
Definition: commctrl.h:2368
#define FIXME(fmt,...)
Definition: debug.h:111
LONG_PTR LPARAM
Definition: windef.h:208
#define SW_SHOW
Definition: winuser.h:769
WCHAR * GetDocumentTitle(CHMInfo *info, LPCWSTR document)
Definition: chm.c:572
#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:2365
UINT mask
Definition: commctrl.h:2360
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:2413
#define local
Definition: zutil.h:30
#define LVM_INSERTITEMW
Definition: commctrl.h:2404
static ATOM item
Definition: dde.c:856
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
LPWSTR name
Definition: hhctrl.h:72
LPWSTR local
Definition: hhctrl.h:73
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define NULL
Definition: types.h:112
Definition: name.c:38
#define LVIF_PARAM
Definition: commctrl.h:2311
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 1376 of file help.c.

1377 {
1378  switch (message)
1379  {
1380  case WM_NOTIFY: {
1381  NMHDR *nmhdr = (NMHDR*)lParam;
1382  switch(nmhdr->code)
1383  {
1384  case NM_DBLCLK: {
1386  IndexSubItem *iter;
1387 
1388  if(info == 0 || lParam == 0)
1389  return 0;
1390  iter = (IndexSubItem*) ((NMITEMACTIVATE *)lParam)->lParam;
1391  if(iter == 0)
1392  return 0;
1393  NavigateToChm(info, info->index->merge.chm_file, iter->local);
1394  ShowWindow(info->popup.hwndPopup, SW_HIDE);
1395  return 0;
1396  }
1397  case NM_RETURN: {
1399  IndexSubItem *iter;
1400  LVITEMW lvItem;
1401 
1402  if(info == 0)
1403  return 0;
1404 
1405  lvItem.iItem = (int) SendMessageW(info->popup.hwndList, LVM_GETSELECTIONMARK, 0, 0);
1406  lvItem.mask = TVIF_PARAM;
1407  SendMessageW(info->popup.hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
1408  iter = (IndexSubItem*) lvItem.lParam;
1409  NavigateToChm(info, info->index->merge.chm_file, iter->local);
1410  ShowWindow(info->popup.hwndPopup, SW_HIDE);
1411  return 0;
1412  }
1413  }
1414  break;
1415  }
1416  default:
1418  }
1419 
1420  return 0;
1421 }
Definition: tftpd.h:59
#define SW_HIDE
Definition: winuser.h:762
HWND hWnd
Definition: settings.c:17
#define GetWindowLongPtrW
Definition: winuser.h:4819
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:270
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:3149
LPARAM lParam
Definition: commctrl.h:2368
LONG_PTR LPARAM
Definition: windef.h:208
Definition: hhctrl.h:185
UINT mask
Definition: commctrl.h:2360
#define LVM_GETSELECTIONMARK
Definition: commctrl.h:2788
#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:2390
#define TVIF_PARAM
Definition: commctrl.h:3268
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 1815 of file help.c.

1816 {
1817  TRACE("(%p)\n", info);
1818 
1819  if (!info)
1820  return;
1821 
1822  list_remove(&info->entry);
1823 
1824  wintype_stringsA_free(&info->stringsA);
1825  wintype_stringsW_free(&info->stringsW);
1826 
1827  if (info->pCHMInfo)
1828  CloseCHM(info->pCHMInfo);
1829 
1832  ReleaseIndex(info);
1834 
1835  if(info->contents.hImageList)
1836  ImageList_Destroy(info->contents.hImageList);
1837  if(info->WinType.hwndHelp)
1838  DestroyWindow(info->WinType.hwndHelp);
1839 
1840  heap_free(info);
1841  OleUninitialize();
1842 }
void wintype_stringsW_free(struct wintype_stringsW *stringsW)
Definition: help.c:1786
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:1800
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:670
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
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 1324 of file help.c.

1325 {
1326  int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
1327  int border_width = GetSystemMetrics(SM_CXBORDER);
1328  int edge_width = GetSystemMetrics(SM_CXEDGE);
1329  INT width, height;
1330  RECT rect;
1331 
1332  if(!info)
1333  return;
1334 
1335  GetClientRect(info->popup.hwndPopup, &rect);
1336  SetWindowPos(info->popup.hwndCallback, HWND_TOP, 0, 0,
1337  rect.right, rect.bottom, SWP_NOMOVE);
1338 
1339  rect.left = TAB_MARGIN;
1341  rect.right -= TAB_RIGHT_PADDING + TAB_MARGIN;
1342  rect.bottom -= TAB_MARGIN;
1343  width = rect.right-rect.left;
1344  height = rect.bottom-rect.top;
1345 
1346  SetWindowPos(info->popup.hwndList, NULL, rect.left, rect.top, width, height,
1348 
1349  SendMessageW(info->popup.hwndList, LVM_SETCOLUMNWIDTH, 0,
1350  width-scroll_width-2*border_width-2*edge_width);
1351 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define SM_CXEDGE
Definition: winuser.h:1002
#define HWND_TOP
Definition: winuser.h:1197
#define SWP_NOZORDER
Definition: winuser.h:1237
int32_t INT
Definition: typedefs.h:58
& rect
Definition: startmenu.cpp:1413
#define LVM_SETCOLUMNWIDTH
Definition: commctrl.h:2646
#define TAB_TOP_PADDING
Definition: help.c:46
#define TAB_RIGHT_PADDING
Definition: help.c:47
#define SWP_NOACTIVATE
Definition: winuser.h:1232
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXBORDER
Definition: winuser.h:958
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 NULL
Definition: types.h:112
#define TAB_MARGIN
Definition: help.c:48
#define SM_CXVSCROLL
Definition: winuser.h:955
#define SWP_NOMOVE
Definition: winuser.h:1234
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 499 of file help.c.

500 {
501  HWND hwnd = info->tabs[tab].hwnd;
502  INT width, height;
503  RECT rect, tabrc;
504  DWORD cnt;
505 
506  GetClientRect(info->WinType.hwndNavigation, &rect);
507  SendMessageW(info->hwndTabCtrl, TCM_GETITEMRECT, 0, (LPARAM)&tabrc);
508  cnt = SendMessageW(info->hwndTabCtrl, TCM_GETROWCOUNT, 0, 0);
509 
510  rect.left = TAB_MARGIN;
511  rect.top = TAB_TOP_PADDING + cnt*(tabrc.bottom-tabrc.top) + TAB_MARGIN;
512  rect.right -= TAB_RIGHT_PADDING + TAB_MARGIN;
513  rect.bottom -= TAB_MARGIN;
514  width = rect.right-rect.left;
515  height = rect.bottom-rect.top;
516 
517  SetWindowPos(hwnd, NULL, rect.left, rect.top, width, height,
519 
520  switch (tab)
521  {
522  case TAB_INDEX: {
523  int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
524  int border_width = GetSystemMetrics(SM_CXBORDER);
525  int edge_width = GetSystemMetrics(SM_CXEDGE);
526 
527  /* Resize the tab widget column to perfectly fit the tab window and
528  * leave sufficient space for the scroll widget.
529  */
531  width-scroll_width-2*border_width-2*edge_width);
532 
533  break;
534  }
535  case TAB_SEARCH: {
536  int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
537  int border_width = GetSystemMetrics(SM_CXBORDER);
538  int edge_width = GetSystemMetrics(SM_CXEDGE);
539  int top_pos = 0;
540 
541  SetWindowPos(info->search.hwndEdit, NULL, 0, top_pos, width,
543  top_pos += EDIT_HEIGHT + TAB_MARGIN;
544  SetWindowPos(info->search.hwndList, NULL, 0, top_pos, width,
545  height-top_pos, SWP_NOZORDER | SWP_NOACTIVATE);
546  /* Resize the tab widget column to perfectly fit the tab window and
547  * leave sufficient space for the scroll widget.
548  */
549  SendMessageW(info->search.hwndList, LVM_SETCOLUMNWIDTH, 0,
550  width-scroll_width-2*border_width-2*edge_width);
551 
552  break;
553  }
554  }
555 }
GLint GLint GLsizei width
Definition: gl.h:1546
LONG top
Definition: windef.h:307
#define SM_CXEDGE
Definition: winuser.h:1002
#define SWP_NOZORDER
Definition: winuser.h:1237
int32_t INT
Definition: typedefs.h:58
& rect
Definition: startmenu.cpp:1413
#define TCM_GETROWCOUNT
Definition: commctrl.h:4093
#define LVM_SETCOLUMNWIDTH
Definition: commctrl.h:2646
LONG_PTR LPARAM
Definition: windef.h:208
#define TAB_TOP_PADDING
Definition: help.c:46
#define TCM_GETITEMRECT
Definition: commctrl.h:4059
#define TAB_RIGHT_PADDING
Definition: help.c:47
#define SWP_NOACTIVATE
Definition: winuser.h:1232
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SM_CXBORDER
Definition: winuser.h:958
#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 NULL
Definition: types.h:112
#define TAB_MARGIN
Definition: help.c:48
#define SM_CXVSCROLL
Definition: winuser.h:955
LONG bottom
Definition: windef.h:309
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022

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

◆ SB_GetSizeBarRect()

static void SB_GetSizeBarRect ( HHInfo info,
RECT rc 
)
static

Definition at line 424 of file help.c.

425 {
426  RECT rectWND, rectTB, rectNP;
427 
428  GetClientRect(info->WinType.hwndHelp, &rectWND);
429  GetClientRect(info->WinType.hwndToolBar, &rectTB);
430  GetClientRect(info->WinType.hwndNavigation, &rectNP);
431 
432  SetRect(rc, rectNP.right, rectTB.bottom, SIZEBAR_WIDTH, rectWND.bottom - rectTB.bottom);
433 }
LONG right
Definition: windef.h:308
#define SIZEBAR_WIDTH
Definition: help.c:319
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:309

Referenced by Help_OnSize(), and HH_AddSizeBar().

◆ SB_OnLButtonDown()

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

Definition at line 354 of file help.c.

355 {
356  SetCapture(hWnd);
357 }
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 359 of file help.c.

360 {
361  HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
362  POINT pt;
363 
364  pt.x = (short)LOWORD(lParam);
365  pt.y = (short)HIWORD(lParam);
366 
367  /* update the window sizes */
368  pHHInfo->WinType.iNavWidth += pt.x;
369  Help_OnSize(hWnd);
370 
371  ReleaseCapture();
372 }
static LRESULT Help_OnSize(HWND hWnd)
Definition: help.c:1544
#define pt(x, y)
Definition: drawing.c:79
HWND hWnd
Definition: settings.c:17
#define GetWindowLongPtrW
Definition: winuser.h:4819
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
Definition: hhctrl.h:185
HH_WINTYPEW WinType
Definition: hhctrl.h:188
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define HIWORD(l)
Definition: typedefs.h:247
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 374 of file help.c.

375 {
376  /* ignore WM_MOUSEMOVE if not dragging the SizeBar */
377  if (!(wParam & MK_LBUTTON))
378  return;
379 }
#define MK_LBUTTON
Definition: winuser.h:2357
WPARAM wParam
Definition: combotst.c:138

Referenced by SizeBar_WndProc().

◆ SB_OnPaint()

static void SB_OnPaint ( HWND  hWnd)
static

Definition at line 326 of file help.c.

327 {
328  PAINTSTRUCT ps;
329  HDC hdc;
330  RECT rc;
331 
332  hdc = BeginPaint(hWnd, &ps);
333 
334  GetClientRect(hWnd, &rc);
335 
336  /* dark frame */
337  rc.right += 1;
338  rc.bottom -= 1;
340 
341  /* white highlight */
343  MoveToEx(hdc, rc.right, 1, NULL);
344  LineTo(hdc, 1, 1);
345  LineTo(hdc, 1, rc.bottom - 1);
346 
347 
348  MoveToEx(hdc, 0, rc.bottom, NULL);
349  LineTo(hdc, rc.right, rc.bottom);
350 
351  EndPaint(hWnd, &ps);
352 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WHITE_PEN
Definition: wingdi.h:905
static HDC
Definition: imagelist.c:92
HWND hWnd
Definition: settings.c:17
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
LONG right
Definition: windef.h:308
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define GRAY_BRUSH
Definition: wingdi.h:898
HDC hdc
Definition: main.c:9
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define NULL
Definition: types.h:112
LONG bottom
Definition: windef.h:309
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 381 of file help.c.

382 {
383  switch (message)
384  {
385  case WM_LBUTTONDOWN:
387  break;
388  case WM_LBUTTONUP:
390  break;
391  case WM_MOUSEMOVE:
393  break;
394  case WM_PAINT:
395  SB_OnPaint(hWnd);
396  break;
397  default:
399  }
400 
401  return 0;
402 }
Definition: tftpd.h:59
#define WM_LBUTTONDOWN
Definition: winuser.h:1766
static void SB_OnLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:354
HWND hWnd
Definition: settings.c:17
static void SB_OnPaint(HWND hWnd)
Definition: help.c:326
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_PAINT
Definition: winuser.h:1610
static void SB_OnMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:374
static void SB_OnLButtonUp(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:359
#define WM_LBUTTONUP
Definition: winuser.h:1767
#define WM_MOUSEMOVE
Definition: winuser.h:1765
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 938 of file help.c.

939 {
940  pButtons[dwIndex].iBitmap = dwBitmap;
941  pButtons[dwIndex].idCommand = dwID;
942  pButtons[dwIndex].fsState = TBSTATE_ENABLED;
943  pButtons[dwIndex].fsStyle = BTNS_BUTTON;
944  pButtons[dwIndex].dwData = 0;
945  pButtons[dwIndex].iString = 0;
946 }
BYTE fsStyle
Definition: commctrl.h:952
#define BTNS_BUTTON
Definition: commctrl.h:998
INT_PTR iString
Definition: commctrl.h:959
DWORD_PTR dwData
Definition: commctrl.h:958
int iBitmap
Definition: commctrl.h:949
int idCommand
Definition: commctrl.h:950
#define TBSTATE_ENABLED
Definition: commctrl.h:974
BYTE fsState
Definition: commctrl.h:951

Referenced by TB_AddButtonsFromFlags().

◆ TB_AddButtonsFromFlags()

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

Definition at line 948 of file help.c.

949 {
950  int nHistBitmaps = 0, nStdBitmaps = 0, nHHBitmaps = 0;
951  HWND hToolbar = pHHInfo->WinType.hwndToolBar;
952  TBADDBITMAP tbAB;
953  DWORD unsupported;
954 
955  /* Common bitmaps */
956  tbAB.hInst = HINST_COMMCTRL;
957  tbAB.nID = IDB_HIST_LARGE_COLOR;
958  nHistBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&tbAB);
959  tbAB.nID = IDB_STD_LARGE_COLOR;
960  nStdBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&tbAB);
961  /* hhctrl.ocx bitmaps */
962  tbAB.hInst = hhctrl_hinstance;
963  tbAB.nID = IDB_HHTOOLBAR;
964  nHHBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, HHTB_NUMBITMAPS, (LPARAM)&tbAB);
965 
966  *pdwNumButtons = 0;
967 
968  unsupported = dwButtonFlags & (HHWIN_BUTTON_BROWSE_FWD |
973  if (unsupported)
974  FIXME("got asked for unsupported buttons: %06x\n", unsupported);
975 
976  if (dwButtonFlags & HHWIN_BUTTON_EXPAND)
977  {
978  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_EXPAND, nHHBitmaps + HHTB_EXPAND);
979  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_CONTRACT, nHHBitmaps + HHTB_CONTRACT);
980 
981  if (pHHInfo->WinType.fNotExpanded)
982  pButtons[1].fsState |= TBSTATE_HIDDEN;
983  else
984  pButtons[0].fsState |= TBSTATE_HIDDEN;
985  }
986 
987  if (dwButtonFlags & HHWIN_BUTTON_BACK)
988  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_BACK, nHistBitmaps + HIST_BACK);
989 
990  if (dwButtonFlags & HHWIN_BUTTON_FORWARD)
991  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_FORWARD, nHistBitmaps + HIST_FORWARD);
992 
993  if (dwButtonFlags & HHWIN_BUTTON_STOP)
994  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_STOP, nHHBitmaps + HHTB_STOP);
995 
996  if (dwButtonFlags & HHWIN_BUTTON_REFRESH)
997  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_REFRESH, nHHBitmaps + HHTB_REFRESH);
998 
999  if (dwButtonFlags & HHWIN_BUTTON_HOME)
1000  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_HOME, nHHBitmaps + HHTB_HOME);
1001 
1002  if (dwButtonFlags & HHWIN_BUTTON_SYNC)
1003  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_SYNC, nHHBitmaps + HHTB_SYNC);
1004 
1005  if (dwButtonFlags & HHWIN_BUTTON_OPTIONS)
1006  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_OPTIONS, nStdBitmaps + STD_PROPERTIES);
1007 
1008  if (dwButtonFlags & HHWIN_BUTTON_PRINT)
1009  TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_PRINT, nStdBitmaps + STD_PRINT);
1010 }
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:48
#define IDTB_PRINT
Definition: htmlhelp.h:132
#define IDTB_EXPAND
Definition: htmlhelp.h:125
HINSTANCE hInst
Definition: commctrl.h:1059
#define HHTB_STOP
Definition: resource.h:44
#define HHWIN_BUTTON_STOP
Definition: htmlhelp.h:102
#define IDB_HIST_LARGE_COLOR
Definition: commctrl.h:1069
#define STD_PRINT
Definition: commctrl.h:1085
#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:1100
#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:111
#define IDTB_STOP
Definition: htmlhelp.h:127
#define HHTB_HOME
Definition: resource.h:46
#define HHWIN_BUTTON_ZOOM
Definition: htmlhelp.h:118
#define HIST_FORWARD
Definition: commctrl.h:1101
LONG_PTR LPARAM
Definition: windef.h:208
#define HHTB_REFRESH
Definition: resource.h:45
#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:47
#define TB_ADDBITMAP
Definition: commctrl.h:1056
#define HHWIN_BUTTON_SEARCH
Definition: htmlhelp.h:113
#define STD_PROPERTIES
Definition: commctrl.h:1081
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:1065
static void TB_AddButton(TBBUTTON *pButtons, DWORD dwIndex, DWORD dwID, DWORD dwBitmap)
Definition: help.c:938
#define HHWIN_BUTTON_TOC_PREV
Definition: htmlhelp.h:120
#define HHTB_NUMBITMAPS
Definition: resource.h:50
#define HHTB_CONTRACT
Definition: resource.h:49
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:1063
#define TBSTATE_HIDDEN
Definition: commctrl.h:975
#define IDB_HHTOOLBAR
Definition: resource.h:42
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
BYTE fsState
Definition: commctrl.h:951
#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:1060

Referenced by HH_AddToolbar().

◆ TB_OnClick()

static void TB_OnClick ( HWND  hWnd,
DWORD  dwID 
)
static

Definition at line 884 of file help.c.

885 {
887 
888  switch (dwID)
889  {
890  case IDTB_STOP:
891  DoPageAction(info->web_browser, WB_STOP);
892  break;
893  case IDTB_REFRESH:
894  DoPageAction(info->web_browser, WB_REFRESH);
895  break;
896  case IDTB_BACK:
897  DoPageAction(info->web_browser, WB_GOBACK);
898  break;
899  case IDTB_HOME:
900  NavigateToChm(info, info->pCHMInfo->szFile, info->WinType.pszHome);
901  break;
902  case IDTB_FORWARD:
903  DoPageAction(info->web_browser, WB_GOFORWARD);
904  break;
905  case IDTB_PRINT:
906  DoPageAction(info->web_browser, WB_PRINT);
907  break;
908  case IDTB_EXPAND:
909  case IDTB_CONTRACT:
911  break;
912  case IDTB_SYNC:
913  DoSync(info);
914  break;
915  case IDTB_OPTIONS:
917  break;
918  case IDTB_NOTES:
919  case IDTB_CONTENTS:
920  case IDTB_INDEX:
921  case IDTB_SEARCH:
922  case IDTB_HISTORY:
923  case IDTB_FAVORITES:
924  /* These are officially unimplemented as of the Windows 7 SDK */
925  break;
926  case IDTB_BROWSE_FWD:
927  case IDTB_BROWSE_BACK:
928  case IDTB_JUMP1:
929  case IDTB_JUMP2:
930  case IDTB_CUSTOMIZE:
931  case IDTB_ZOOM:
932  case IDTB_TOC_NEXT:
933  case IDTB_TOC_PREV:
934  break;
935  }
936 }
#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:4819
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:270
#define IDTB_JUMP1
Definition: htmlhelp.h:143
static void ExpandContract(HHInfo *pHHInfo)
Definition: help.c:1513
#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:836
#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:282
#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 1576 of file help.c.

1577 {
1578  if (!info->WinType.hwndHelp)
1579  return;
1580 
1581  WARN("Only the size of the window is currently updated.\n");
1582  if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT)
1583  {
1584  RECT *rect = &info->WinType.rcWindowPos;
1585  INT x, y, width, height;
1586 
1587  x = rect->left;
1588  y = rect->top;
1589  width = rect->right - x;
1590  height = rect->bottom - y;
1591  SetWindowPos(info->WinType.hwndHelp, NULL, rect->left, rect->top, width, height,
1593  }
1594 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define WARN(fmt,...)
Definition: debug.h:112
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define SWP_NOZORDER
Definition: winuser.h:1237
int32_t INT
Definition: typedefs.h:58
& rect
Definition: startmenu.cpp:1413
#define SWP_NOACTIVATE
Definition: winuser.h:1232
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define NULL
Definition: types.h:112
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 1800 of file help.c.

1801 {
1802  heap_free(stringsA->pszType);
1803  heap_free(stringsA->pszCaption);
1804  heap_free(stringsA->pszToc);
1805  heap_free(stringsA->pszIndex);
1806  heap_free(stringsA->pszFile);
1807  heap_free(stringsA->pszHome);
1808  heap_free(stringsA->pszJump1);
1809  heap_free(stringsA->pszJump2);
1810  heap_free(stringsA->pszUrlJump1);
1811  heap_free(stringsA->pszUrlJump2);
1812  heap_free(stringsA->pszCustomTabs);
1813 }
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 1786 of file help.c.

1787 {
1788  heap_free(stringsW->pszType);
17