ReactOS 0.4.15-dev-8096-ga0eec98
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 821 of file help.c.

◆ SIZEBAR_WIDTH

#define SIZEBAR_WIDTH   4

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

1189{
1190 HIMAGELIST hImageList;
1192 HWND hWnd;
1193
1194 if(info->tabs[TAB_CONTENTS].id == -1)
1195 return TRUE; /* No "Contents" tab */
1197 | TVS_SHOWSELALWAYS | TVS_HASBUTTONS, 50, 50, 100, 100,
1198 info->WinType.hwndNavigation, NULL, hhctrl_hinstance, NULL);
1199 if(!hWnd) {
1200 ERR("Could not create treeview control\n");
1201 return FALSE;
1202 }
1203
1204 hImageList = ImageList_Create(16, 16, ILC_COLOR32, 0, HHTV_NUMBITMAPS);
1206 ImageList_Add(hImageList, hBitmap, NULL);
1208
1209 info->contents.hImageList = hImageList;
1210 info->tabs[TAB_CONTENTS].hwnd = hWnd;
1213
1214 return TRUE;
1215}
HWND hWnd
Definition: settings.c:17
#define ERR(fmt,...)
Definition: debug.h:113
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static HBITMAP hBitmap
Definition: timezone.c:26
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:448
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
static void ResizeTabChild(HHInfo *info, int tab)
Definition: help.c:486
static const WCHAR szEmpty[]
Definition: help.c:53
#define HHTV_NUMBITMAPS
Definition: resource.h:64
#define IDB_HHTREEVIEW
Definition: resource.h:59
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41
#define TAB_CONTENTS
Definition: hhctrl.h:116
static HBITMAP
Definition: button.c:44
#define WS_CHILD
Definition: pedump.c:617
#define WS_BORDER
Definition: pedump.c:625
#define TVS_LINESATROOT
Definition: commctrl.h:3249
#define TVSIL_NORMAL
Definition: commctrl.h:3443
#define TVS_SHOWSELALWAYS
Definition: commctrl.h:3252
#define ILC_COLOR32
Definition: commctrl.h:358
#define WC_TREEVIEWW
Definition: commctrl.h:3243
#define TVM_SETIMAGELIST
Definition: commctrl.h:3446
#define TVS_HASBUTTONS
Definition: commctrl.h:3247
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
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 SW_SHOW
Definition: winuser.h:775
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2194
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CreateViewer().

◆ AddIndexPopup()

static BOOL AddIndexPopup ( HHInfo info)
static

Definition at line 1410 of file help.c.

1411{
1412 static const WCHAR szPopupChildClass[] = {'H','H',' ','P','o','p','u','p',' ','C','h','i','l','d',0};
1413 static const WCHAR windowCaptionW[] = {'S','e','l','e','c','t',' ','T','o','p','i','c',':',0};
1414 static const WCHAR windowClassW[] = {'H','H',' ','P','o','p','u','p',0};
1415 HWND hwndList, hwndPopup, hwndCallback;
1416 char hidden_column[] = "Column";
1417 WNDCLASSEXW wcex;
1418 LVCOLUMNA lvc;
1419
1420 if(info->tabs[TAB_INDEX].id == -1)
1421 return TRUE; /* No "Index" tab */
1422
1423 wcex.cbSize = sizeof(WNDCLASSEXW);
1424 wcex.style = CS_HREDRAW | CS_VREDRAW;
1426 wcex.cbClsExtra = 0;
1427 wcex.cbWndExtra = sizeof(LONG_PTR);
1431 wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
1432 wcex.lpszMenuName = NULL;
1435 RegisterClassExW(&wcex);
1436
1437 wcex.cbSize = sizeof(WNDCLASSEXW);
1438 wcex.style = 0;
1440 wcex.cbClsExtra = 0;
1441 wcex.cbWndExtra = sizeof(LONG_PTR);
1445 wcex.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1446 wcex.lpszMenuName = NULL;
1447 wcex.lpszClassName = szPopupChildClass;
1449 RegisterClassExW(&wcex);
1450
1453 windowClassW, windowCaptionW, WS_POPUPWINDOW
1456 CW_USEDEFAULT, 300, 200, info->WinType.hwndHelp,
1458 if (!hwndPopup)
1459 return FALSE;
1460
1462 szPopupChildClass, szEmpty, WS_CHILDWINDOW | WS_VISIBLE,
1463 0, 0, 0, 0,
1464 hwndPopup, NULL, hhctrl_hinstance, NULL);
1465 if (!hwndCallback)
1466 return FALSE;
1467
1468 ShowWindow(hwndPopup, SW_HIDE);
1471 | LVS_NOCOLUMNHEADER, 50, 50, 100, 100,
1472 hwndCallback, NULL, hhctrl_hinstance, NULL);
1473 if(!hwndList) {
1474 ERR("Could not create popup ListView control\n");
1475 return FALSE;
1476 }
1477 memset(&lvc, 0, sizeof(lvc));
1478 lvc.mask = LVCF_TEXT;
1479 lvc.pszText = hidden_column;
1480 if(SendMessageW(hwndList, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1481 {
1482 ERR("Could not create popup ListView column\n");
1483 return FALSE;
1484 }
1485
1486 info->popup.hwndCallback = hwndCallback;
1487 info->popup.hwndPopup = hwndPopup;
1488 info->popup.hwndList = hwndList;
1489 SetWindowLongPtrW(hwndPopup, 0, (LONG_PTR)info);
1490 SetWindowLongPtrW(hwndCallback, 0, (LONG_PTR)info);
1491
1493 ShowWindow(hwndList, SW_SHOW);
1494
1495 return TRUE;
1496}
static LRESULT CALLBACK PopupChild_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:1363
static void ResizePopupChild(HHInfo *info)
Definition: help.c:1311
static LRESULT CALLBACK HelpPopup_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:1340
#define TAB_INDEX
Definition: hhctrl.h:117
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CHILDWINDOW
Definition: pedump.c:639
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_POPUPWINDOW
Definition: pedump.c:638
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define LVS_SINGLESEL
Definition: commctrl.h:2266
#define LVM_INSERTCOLUMNA
Definition: commctrl.h:2631
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2284
#define WC_LISTVIEWW
Definition: commctrl.h:2257
#define LVS_REPORT
Definition: commctrl.h:2262
#define LVCF_TEXT
Definition: commctrl.h:2588
#define memset(x, y, z)
Definition: compat.h:39
static const WCHAR windowClassW[]
Definition: actctx.c:701
LPCWSTR lpszClassName
Definition: winuser.h:3226
LPCWSTR lpszMenuName
Definition: winuser.h:3225
HBRUSH hbrBackground
Definition: winuser.h:3224
WNDPROC lpfnWndProc
Definition: winuser.h:3218
UINT cbSize
Definition: winuser.h:3216
int cbWndExtra
Definition: winuser.h:3220
HCURSOR hCursor
Definition: winuser.h:3223
HICON hIconSm
Definition: winuser.h:3227
HINSTANCE hInstance
Definition: winuser.h:3221
UINT style
Definition: winuser.h:3217
int cbClsExtra
Definition: winuser.h:3219
HICON hIcon
Definition: winuser.h:3222
LPSTR pszText
Definition: commctrl.h:2556
#define LONG_PTR
Definition: treelist.c:79
#define CS_VREDRAW
Definition: winuser.h:658
#define SW_HIDE
Definition: winuser.h:768
#define COLOR_MENU
Definition: winuser.h:917
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define CS_HREDRAW
Definition: winuser.h:653
#define IDC_ARROW
Definition: winuser.h:687
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2136
#define IDI_APPLICATION
Definition: winuser.h:704
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define CW_USEDEFAULT
Definition: winuser.h:225
struct _WNDCLASSEXW WNDCLASSEXW
#define SetWindowLongPtrW
Definition: winuser.h:5346
#define WS_EX_LEFT
Definition: winuser.h:391
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2106
#define COLOR_BTNFACE
Definition: winuser.h:928
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by CreateViewer().

◆ AddIndexTab()

static BOOL AddIndexTab ( HHInfo info)
static

Definition at line 1217 of file help.c.

1218{
1219 char hidden_column[] = "Column";
1220 LVCOLUMNA lvc;
1221
1222 if(info->tabs[TAB_INDEX].id == -1)
1223 return TRUE; /* No "Index" tab */
1226 info->WinType.hwndNavigation, NULL, hhctrl_hinstance, NULL);
1227 if(!info->tabs[TAB_INDEX].hwnd) {
1228 ERR("Could not create ListView control\n");
1229 return FALSE;
1230 }
1231 memset(&lvc, 0, sizeof(lvc));
1232 lvc.mask = LVCF_TEXT;
1233 lvc.pszText = hidden_column;
1234 if(SendMessageW(info->tabs[TAB_INDEX].hwnd, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1235 {
1236 ERR("Could not create ListView column\n");
1237 return FALSE;
1238 }
1239
1241 ShowWindow(info->tabs[TAB_INDEX].hwnd, SW_HIDE);
1242
1243 return TRUE;
1244}

Referenced by CreateViewer().

◆ AddSearchTab()

static BOOL AddSearchTab ( HHInfo info)
static

Definition at line 1246 of file help.c.

1247{
1248 HWND hwndList, hwndEdit, hwndContainer;
1249 char hidden_column[] = "Column";
1250 WNDPROC editWndProc;
1251 LVCOLUMNA lvc;
1252
1253 if(info->tabs[TAB_SEARCH].id == -1)
1254 return TRUE; /* No "Search" tab */
1256 WS_CHILD, 0, 0, 0, 0, info->WinType.hwndNavigation,
1258 if(!hwndContainer) {
1259 ERR("Could not create search window container control.\n");
1260 return FALSE;
1261 }
1263 | WS_VISIBLE | ES_LEFT | SS_NOTIFY, 0, 0, 0, 0,
1264 hwndContainer, NULL, hhctrl_hinstance, NULL);
1265 if(!hwndEdit) {
1266 ERR("Could not create search ListView control.\n");
1267 return FALSE;
1268 }
1269 if(SendMessageW(hwndEdit, WM_SETFONT, (WPARAM) info->hFont, (LPARAM) FALSE) == -1)
1270 {
1271 ERR("Could not set font for edit control.\n");
1272 return FALSE;
1273 }
1275 if(!editWndProc) {
1276 ERR("Could not redirect messages for edit control.\n");
1277 return FALSE;
1278 }
1282 | LVS_REPORT | LVS_NOCOLUMNHEADER, 0, 0, 0, 0,
1283 hwndContainer, NULL, hhctrl_hinstance, NULL);
1284 if(!hwndList) {
1285 ERR("Could not create search ListView control.\n");
1286 return FALSE;
1287 }
1288 memset(&lvc, 0, sizeof(lvc));
1289 lvc.mask = LVCF_TEXT;
1290 lvc.pszText = hidden_column;
1291 if(SendMessageW(hwndList, LVM_INSERTCOLUMNA, 0, (LPARAM) &lvc) == -1)
1292 {
1293 ERR("Could not create ListView column\n");
1294 return FALSE;
1295 }
1296
1297 info->search.hwndEdit = hwndEdit;
1298 info->search.hwndList = hwndList;
1299 info->search.hwndContainer = hwndContainer;
1300 info->tabs[TAB_SEARCH].hwnd = hwndContainer;
1301
1302 SetWindowLongPtrW(hwndContainer, 0, (LONG_PTR)info);
1303
1305
1306 return TRUE;
1307}
HWND hwndEdit
Definition: combotst.c:65
static LRESULT CALLBACK EditChild_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:682
static const WCHAR szChildClass[]
Definition: help.c:450
#define TAB_SEARCH
Definition: hhctrl.h:118
#define ES_LEFT
Definition: pedump.c:664
#define WC_EDITW
Definition: commctrl.h:4687
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
#define SS_NOTIFY
Definition: winuser.h:351
#define WM_SETFONT
Definition: winuser.h:1650
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906

Referenced by CreateViewer().

◆ AppendFullPathURL()

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

Definition at line 238 of file help.c.

239{
240 static const WCHAR url_format[] =
241 {'m','k',':','@','M','S','I','T','S','t','o','r','e',':','%','s',':',':','%','s','%','s',0};
242 static const WCHAR slash[] = {'/',0};
243 static const WCHAR empty[] = {0};
244 WCHAR full_path[MAX_PATH];
245
246 TRACE("%s %p %s\n", debugstr_w(file), buf, debugstr_w(index));
247
248 if (!GetFullPathNameW(file, ARRAY_SIZE(full_path), full_path, NULL)) {
249 WARN("GetFullPathName failed: %u\n", GetLastError());
250 return FALSE;
251 }
252
253 wsprintfW(buf, url_format, full_path, (!index || index[0] == '/') ? empty : slash, index);
254 return TRUE;
255}
#define ARRAY_SIZE(A)
Definition: main.h:33
#define WARN(fmt,...)
Definition: debug.h:115
static const WCHAR empty[]
Definition: main.c:47
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
GLuint index
Definition: glext.h:6031
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
Definition: fci.c:127
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by DoSync(), and NavigateToChm().

◆ Child_OnPaint()

static LRESULT Child_OnPaint ( HWND  hWnd)
static

Definition at line 454 of file help.c.

455{
456 PAINTSTRUCT ps;
457 HDC hdc;
458 RECT rc;
459
460 hdc = BeginPaint(hWnd, &ps);
461
462 /* Only paint the Navigation pane, identified by the fact
463 * that it has a child window
464 */
465 if (GetWindow(hWnd, GW_CHILD))
466 {
467 GetClientRect(hWnd, &rc);
468
469 /* set the border color */
472
473 /* Draw the top border */
474 LineTo(hdc, rc.right, 0);
475
477 MoveToEx(hdc, 0, 1, NULL);
478 LineTo(hdc, rc.right, 1);
479 }
480
481 EndPaint(hWnd, &ps);
482
483 return 0;
484}
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
LONG right
Definition: windef.h:308
COLORREF WINAPI SetDCPenColor(_In_ HDC hdc, _In_ COLORREF crColor)
Definition: dc.c:941
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define WHITE_PEN
Definition: wingdi.h:905
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define COLOR_BTNSHADOW
Definition: winuser.h:930
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define GW_CHILD
Definition: winuser.h:763
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)

Referenced by Child_WndProc().

◆ Child_OnSize()

static LRESULT Child_OnSize ( HWND  hwnd)
static

Definition at line 544 of file help.c.

545{
547 RECT rect;
548
549 if(!info || hwnd != info->WinType.hwndNavigation)
550 return 0;
551
553 SetWindowPos(info->hwndTabCtrl, HWND_TOP, 0, 0,
554 rect.right - TAB_RIGHT_PADDING,
556
560 return 0;
561}
#define TAB_TOP_PADDING
Definition: help.c:46
#define TAB_RIGHT_PADDING
Definition: help.c:47
& rect
Definition: startmenu.cpp:1413
Definition: hhctrl.h:185
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define GetWindowLongPtrW
Definition: winuser.h:4829
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOMOVE
Definition: winuser.h:1244
#define HWND_TOP
Definition: winuser.h:1207

Referenced by Child_WndProc().

◆ Child_WndProc()

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

Definition at line 697 of file help.c.

698{
699 switch (message)
700 {
701 case WM_PAINT:
702 return Child_OnPaint(hWnd);
703 case WM_SIZE:
704 return Child_OnSize(hWnd);
705 case WM_NOTIFY: {
707 NMHDR *nmhdr = (NMHDR*)lParam;
708
709 switch(nmhdr->code) {
710 case TCN_SELCHANGE:
711 return OnTabChange(hWnd);
712 case TVN_SELCHANGEDW:
713 return OnTopicChange(info, (void*)((NMTREEVIEWW *)lParam)->itemNew.lParam);
714 case TVN_ITEMEXPANDINGW: {
715 TVITEMW *item = &((NMTREEVIEWW *)lParam)->itemNew;
716 HWND hwndTreeView = info->tabs[TAB_CONTENTS].hwnd;
717
719 if (item->state & TVIS_EXPANDED)
720 {
721 item->iImage = HHTV_FOLDER;
722 item->iSelectedImage = HHTV_FOLDER;
723 }
724 else
725 {
726 item->iImage = HHTV_OPENFOLDER;
727 item->iSelectedImage = HHTV_OPENFOLDER;
728 }
730 return 0;
731 }
732 case NM_DBLCLK:
733 if(!info)
734 return 0;
735 switch(info->current_tab)
736 {
737 case TAB_INDEX:
738 return OnTopicChange(info, (void*)((NMITEMACTIVATE *)lParam)->lParam);
739 case TAB_SEARCH:
740 return OnTopicChange(info, (void*)((NMITEMACTIVATE *)lParam)->lParam);
741 }
742 break;
743 case NM_RETURN:
744 if(!info)
745 return 0;
746 switch(info->current_tab) {
747 case TAB_INDEX: {
748 HWND hwndList = info->tabs[TAB_INDEX].hwnd;
749 LVITEMW lvItem;
750
751 lvItem.iItem = (int) SendMessageW(hwndList, LVM_GETSELECTIONMARK, 0, 0);
752 lvItem.mask = TVIF_PARAM;
753 SendMessageW(hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
754 OnTopicChange(info, (void*) lvItem.lParam);
755 return 0;
756 }
757 case TAB_SEARCH: {
758 if(nmhdr->hwndFrom == info->search.hwndEdit) {
759 char needle[100];
760 DWORD i, len;
761
762 len = GetWindowTextA(info->search.hwndEdit, needle, sizeof(needle));
763 if(!len)
764 {
765 FIXME("Unable to get search text.\n");
766 return 0;
767 }
768 /* Convert the requested text for comparison later against the
769 * lower case version of HTML file contents.
770 */
771 for(i=0;i<len;i++)
772 needle[i] = tolower(needle[i]);
773 InitSearch(info, needle);
774 return 0;
775 }else if(nmhdr->hwndFrom == info->search.hwndList) {
776 HWND hwndList = info->search.hwndList;
777 LVITEMW lvItem;
778
779 lvItem.iItem = (int) SendMessageW(hwndList, LVM_GETSELECTIONMARK, 0, 0);
780 lvItem.mask = TVIF_PARAM;
781 SendMessageW(hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
782 OnTopicChange(info, (void*) lvItem.lParam);
783 return 0;
784 }
785 break;
786 }
787 }
788 break;
789 }
790 break;
791 }
792 default:
794 }
795
796 return 0;
797}
int tolower(int c)
Definition: utclib.c:902
#define FIXME(fmt,...)
Definition: debug.h:114
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static LRESULT Child_OnSize(HWND hwnd)
Definition: help.c:544
static LRESULT OnTopicChange(HHInfo *info, void *user_data)
Definition: help.c:600
static LRESULT Child_OnPaint(HWND hWnd)
Definition: help.c:454
static LRESULT OnTabChange(HWND hwnd)
Definition: help.c:563
#define HHTV_OPENFOLDER
Definition: resource.h:63
#define HHTV_FOLDER
Definition: resource.h:62
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
HWND hwndTreeView
Definition: eventvwr.c:65
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
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
void InitSearch(HHInfo *info, const char *needle) DECLSPEC_HIDDEN
Definition: search.c:222
static ATOM item
Definition: dde.c:856
#define TVM_SETITEMW
Definition: commctrl.h:3493
#define NM_DBLCLK
Definition: commctrl.h:131
#define TVIF_IMAGE
Definition: commctrl.h:3267
#define TVN_SELCHANGEDW
Definition: commctrl.h:3648
#define NM_RETURN
Definition: commctrl.h:132
#define TCN_SELCHANGE
Definition: commctrl.h:4132
#define TVIS_EXPANDED
Definition: commctrl.h:3284
#define LVM_GETSELECTIONMARK
Definition: commctrl.h:2788
#define TVN_ITEMEXPANDINGW
Definition: commctrl.h:3700
#define TVIF_PARAM
Definition: commctrl.h:3268
#define LVM_GETITEMW
Definition: commctrl.h:2390
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3271
#define WM_NOTIFY
Definition: richedit.h:61
Definition: tftpd.h:60
UINT mask
Definition: commctrl.h:2360
LPARAM lParam
Definition: commctrl.h:2368
UINT code
Definition: winuser.h:3159
HWND hwndFrom
Definition: winuser.h:3157
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1330
#define WM_PAINT
Definition: winuser.h:1620
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SIZE
Definition: winuser.h:1611

Referenced by HH_RegisterChildWndClass().

◆ CreateHelpViewer()

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

Definition at line 1831 of file help.c.

1832{
1833 HHInfo *tmp_info;
1834 unsigned int i;
1835
1836 if(!info)
1837 {
1838 info = heap_alloc_zero(sizeof(HHInfo));
1839 list_add_tail(&window_list, &info->entry);
1840 }
1841
1842 /* Set the invalid tab ID (-1) as the default value for all
1843 * of the tabs, this matches a failed TCM_INSERTITEM call.
1844 */
1845 for (i = 0; i < ARRAY_SIZE(info->tabs); i++)
1846 info->tabs[i].id = -1;
1847
1849
1850 info->pCHMInfo = OpenCHM(filename);
1851 if(!info->pCHMInfo) {
1853 return NULL;
1854 }
1855
1856 if (!LoadWinTypeFromCHM(info)) {
1858 return NULL;
1859 }
1860 info->WinType.hwndCaller = caller;
1861
1862 /* If the window is already open then load the file in that existing window */
1863 if ((tmp_info = find_window(info->WinType.pszType)) && tmp_info != info)
1864 {
1866 return CreateHelpViewer(tmp_info, filename, caller);
1867 }
1868
1869 if(!info->viewer_initialized && !CreateViewer(info)) {
1871 return NULL;
1872 }
1873
1874 return info;
1875}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
CHMInfo * OpenCHM(LPCWSTR szFile)
Definition: chm.c:626
BOOL LoadWinTypeFromCHM(HHInfo *info)
Definition: chm.c:344
HHInfo * CreateHelpViewer(HHInfo *info, LPCWSTR filename, HWND caller)
Definition: help.c:1831
struct list window_list
Definition: help.c:51
static BOOL CreateViewer(HHInfo *pHHInfo)
Definition: help.c:1729
void ReleaseHelpViewer(HHInfo *info)
Definition: help.c:1802
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
const char * filename
Definition: ioapi.h:137
static HWND find_window()
Definition: wclickat.c:251

Referenced by CreateHelpViewer(), and HtmlHelpW().

◆ CreateViewer()

static BOOL CreateViewer ( HHInfo pHHInfo)
static

Definition at line 1729 of file help.c.

1730{
1731 HH_CreateFont(pHHInfo);
1732
1733 if (!HH_CreateHelpWindow(pHHInfo))
1734 return FALSE;
1735
1737
1738 if (!HH_AddToolbar(pHHInfo))
1739 return FALSE;
1740
1741 HH_RegisterChildWndClass(pHHInfo);
1742
1743 if (!HH_AddNavigationPane(pHHInfo))
1744 return FALSE;
1745
1746 HH_RegisterSizeBarClass(pHHInfo);
1747
1748 if (!HH_AddSizeBar(pHHInfo))
1749 return FALSE;
1750
1751 if (!HH_AddHTMLPane(pHHInfo))
1752 return FALSE;
1753
1754 if (!AddContentTab(pHHInfo))
1755 return FALSE;
1756
1757 if (!AddIndexTab(pHHInfo))
1758 return FALSE;
1759
1760 if (!AddIndexPopup(pHHInfo))
1761 return FALSE;
1762
1763 if (!AddSearchTab(pHHInfo))
1764 return FALSE;
1765
1766 InitContent(pHHInfo);
1767 InitIndex(pHHInfo);
1768
1769 pHHInfo->viewer_initialized = TRUE;
1770 return TRUE;
1771}
static BOOL HH_CreateHelpWindow(HHInfo *info)
Definition: help.c:1608
static void HH_InitRequiredControls(DWORD dwControls)
Definition: help.c:1719
static BOOL AddIndexTab(HHInfo *info)
Definition: help.c:1217
static void HH_RegisterSizeBarClass(HHInfo *pHHInfo)
Definition: help.c:391
static BOOL AddSearchTab(HHInfo *info)
Definition: help.c:1246
static void HH_RegisterChildWndClass(HHInfo *pHHInfo)
Definition: help.c:799
static void HH_CreateFont(HHInfo *pHHInfo)
Definition: help.c:1707
static BOOL AddIndexPopup(HHInfo *info)
Definition: help.c:1410
static BOOL HH_AddNavigationPane(HHInfo *info)
Definition: help.c:1086
static BOOL AddContentTab(HHInfo *info)
Definition: help.c:1188
static BOOL HH_AddHTMLPane(HHInfo *pHHInfo)
Definition: help.c:1159
static BOOL HH_AddToolbar(HHInfo *pHHInfo)
Definition: help.c:999
static BOOL HH_AddSizeBar(HHInfo *pHHInfo)
Definition: help.c:422
void InitIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:265
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
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 1902 of file help.c.

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

Referenced by parse_index_obj_node_param(), and parse_obj_node_param().

◆ DisplayPopupMenu()

static void DisplayPopupMenu ( HHInfo info)
static

Definition at line 823 of file help.c.

824{
825 HMENU menu, submenu;
829 RECT rect;
830 DWORD index;
831
833
834 if (!menu)
835 return;
836
837 submenu = GetSubMenu(menu, 0);
838
839 /* Update the Show/Hide menu item */
840 item.cbSize = sizeof(MENUITEMINFOW);
842 item.fType = MFT_STRING;
843 item.fState = MF_ENABLED;
844
845 if (info->WinType.fNotExpanded)
846 item.dwTypeData = HH_LoadString(IDS_SHOWTABS);
847 else
848 item.dwTypeData = HH_LoadString(IDS_HIDETABS);
849
851 heap_free(item.dwTypeData);
852
853 /* Find the index toolbar button */
854 button.cbSize = sizeof(TBBUTTONINFOW);
855 button.dwMask = TBIF_COMMAND;
856 index = SendMessageW(info->WinType.hwndToolBar, TB_GETBUTTONINFOW, IDTB_OPTIONS, (LPARAM) &button);
857
858 if (index == -1)
859 return;
860
861 /* Get position */
862 SendMessageW(info->WinType.hwndToolBar, TB_GETITEMRECT, index, (LPARAM) &rect);
863
864 coords.x = rect.left;
865 coords.y = rect.bottom;
866
867 ClientToScreen(info->WinType.hwndToolBar, &coords);
868 TrackPopupMenu(submenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_NOANIMATION, coords.x, coords.y, 0, info->WinType.hwndHelp, NULL);
869}
#define index(s, c)
Definition: various.h:29
static LPWSTR HH_LoadString(DWORD dwID)
Definition: help.c:177
#define IDS_SHOWTABS
Definition: resource.h:37
#define MENU_POPUP
Definition: resource.h:39
#define IDS_HIDETABS
Definition: resource.h:36
GLuint coords
Definition: glext.h:7368
#define IDTB_OPTIONS
Definition: htmlhelp.h:133
#define IDTB_EXPAND
Definition: htmlhelp.h:125
DWORD button
Definition: button.c:166
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define TB_GETBUTTONINFOW
Definition: commctrl.h:1257
#define TB_GETITEMRECT
Definition: commctrl.h:1133
#define TBIF_COMMAND
Definition: commctrl.h:1224
#define MIIM_STRING
Definition: winuser.h:727
#define MIIM_FTYPE
Definition: winuser.h:729
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define TPM_TOPALIGN
Definition: winuser.h:2383
#define MIIM_STATE
Definition: winuser.h:721
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define MF_ENABLED
Definition: winuser.h:128
#define TPM_LEFTALIGN
Definition: winuser.h:2377
#define TPM_LEFTBUTTON
Definition: winuser.h:2379
#define MFT_STRING
Definition: winuser.h:746
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
struct tagMENUITEMINFOW MENUITEMINFOW

Referenced by TB_OnClick().

◆ DoSync()

static void DoSync ( HHInfo info)
static

Definition at line 269 of file help.c.

270{
273 BSTR url;
274
275 hres = IWebBrowser2_get_LocationURL(info->web_browser->web_browser, &url);
276
277 if (FAILED(hres))
278 {
279 WARN("get_LocationURL failed: %08x\n", hres);
280 return;
281 }
282
283 /* If we're not currently viewing a page in the active .chm file, abort */
284 if ((!AppendFullPathURL(info->WinType.pszFile, buf, NULL)) || (lstrlenW(buf) > lstrlenW(url)))
285 {
287 return;
288 }
289
290 if (lstrcmpiW(buf, url) > 0)
291 {
292 static const WCHAR delimW[] = {':',':','/',0};
293 const WCHAR *index;
294
295 index = wcsstr(url, delimW);
296
297 if (index)
298 ActivateContentTopic(info->tabs[TAB_CONTENTS].hwnd, index + 3, info->content); /* skip over ::/ */
299 }
300
302}
OLECHAR * BSTR
Definition: compat.h:2293
#define lstrlenW
Definition: compat.h:750
static BOOL AppendFullPathURL(LPCWSTR file, LPWSTR buf, LPCWSTR index)
Definition: help.c:238
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1418
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define FAILED(hr)
Definition: intsafe.h:51
static const WCHAR url[]
Definition: encode.c:1432
HRESULT hres
Definition: protocol.c:465
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
void ActivateContentTopic(HWND hWnd, LPCWSTR filename, ContentItem *item)
Definition: content.c:330

Referenced by TB_OnClick().

◆ EditChild_WndProc()

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

Definition at line 682 of file help.c.

683{
685
686 if(message == WM_KEYUP && wParam == VK_RETURN)
687 {
688 NMHDR nmhdr;
689
690 nmhdr.hwndFrom = hWnd;
691 nmhdr.code = NM_RETURN;
693 }
694 return editWndProc(hWnd, message, wParam, lParam);
695}
#define WM_KEYUP
Definition: winuser.h:1716
#define VK_RETURN
Definition: winuser.h:2201
HWND WINAPI GetParent(_In_ HWND)

Referenced by AddSearchTab().

◆ ExpandContract()

static void ExpandContract ( HHInfo pHHInfo)
static

Definition at line 1500 of file help.c.

1501{
1502 RECT r, nav;
1503
1504 pHHInfo->WinType.fNotExpanded = !pHHInfo->WinType.fNotExpanded;
1505 GetWindowRect(pHHInfo->WinType.hwndHelp, &r);
1506 NP_GetNavigationRect(pHHInfo, &nav);
1507
1508 /* hide/show both the nav bar and the size bar */
1509 if (pHHInfo->WinType.fNotExpanded)
1510 {
1512 ShowWindow(pHHInfo->hwndSizeBar, SW_HIDE);
1513 r.left = r.left + nav.right;
1514
1517 }
1518 else
1519 {
1521 ShowWindow(pHHInfo->hwndSizeBar, SW_SHOW);
1522 r.left = r.left - nav.right;
1523
1526 }
1527
1528 MoveWindow(pHHInfo->WinType.hwndHelp, r.left, r.top, r.right-r.left, r.bottom-r.top, TRUE);
1529}
static void NP_GetNavigationRect(HHInfo *pHHInfo, RECT *rc)
Definition: help.c:1049
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define IDTB_CONTRACT
Definition: htmlhelp.h:126
#define TB_HIDEBUTTON
Definition: commctrl.h:1045
HH_WINTYPEW WinType
Definition: hhctrl.h:188
HWND hwndSizeBar
Definition: hhctrl.h:201
HWND hwndNavigation
Definition: htmlhelp.h:354
HWND hwndToolBar
Definition: htmlhelp.h:353
BOOL fNotExpanded
Definition: htmlhelp.h:363
#define MAKELPARAM(l, h)
Definition: winuser.h:4008
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)

Referenced by TB_OnClick().

◆ find_html_symbol()

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

Definition at line 1880 of file help.c.

1881{
1883 int min = 0, dir;
1884
1885 while(min <= max)
1886 {
1887 int pos = (min+max)/2;
1888 const char *encoded_symbol = html_encoded_symbols[pos].html_code;
1889 dir = strncmp(encoded_symbol, entity, entity_len);
1890 if(dir == 0 && !encoded_symbol[entity_len]) return html_encoded_symbols[pos].ansi_symbol;
1891 if(dir < 0)
1892 min = pos+1;
1893 else
1894 max = pos-1;
1895 }
1896 return 0;
1897}
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
unsigned int dir
Definition: maze.c:112
static struct html_encoded_symbol html_encoded_symbols[]
Definition: help.c:64
#define min(a, b)
Definition: monoChain.cc:55
Definition: actctx.c:447
#define max(a, b)
Definition: svc.c:63

Referenced by decode_html().

◆ find_window()

HHInfo * find_window ( const WCHAR window)

Definition at line 1967 of file help.c.

1968{
1969 HHInfo *info;
1970
1972 {
1973 if (lstrcmpW(info->WinType.pszType, window) == 0)
1974 return info;
1975 }
1976 return NULL;
1977}
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4242
uint32_t entry
Definition: isohybrid.c:63
static IHTMLWindow2 * window
Definition: events.c:77
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198

◆ Help_OnSize()

static LRESULT Help_OnSize ( HWND  hWnd)
static

Definition at line 1531 of file help.c.

1532{
1533 HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
1534 DWORD dwSize;
1535 RECT rc;
1536
1537 if (!pHHInfo)
1538 return 0;
1539
1540 if (navigation_visible(pHHInfo))
1541 {
1542 NP_GetNavigationRect(pHHInfo, &rc);
1544 rc.right, rc.bottom, SWP_NOMOVE);
1545
1546 SB_GetSizeBarRect(pHHInfo, &rc);
1547 SetWindowPos(pHHInfo->hwndSizeBar, HWND_TOP, rc.left, rc.top,
1548 rc.right, rc.bottom, SWP_SHOWWINDOW);
1549
1550 }
1551
1552 HP_GetHTMLRect(pHHInfo, &rc);
1553 SetWindowPos(pHHInfo->WinType.hwndHTML, HWND_TOP, rc.left, rc.top,
1554 rc.right, rc.bottom, SWP_SHOWWINDOW);
1555
1556 /* Resize browser window taking the frame size into account */
1558 ResizeWebBrowser(pHHInfo, rc.right - dwSize, rc.bottom - dwSize);
1559
1560 return 0;
1561}
static void HP_GetHTMLRect(HHInfo *info, RECT *rc)
Definition: help.c:1136
static void SB_GetSizeBarRect(HHInfo *info, RECT *rc)
Definition: help.c:411
static BOOL navigation_visible(HHInfo *info)
Definition: help.c:168
void ResizeWebBrowser(HHInfo *, DWORD, DWORD) DECLSPEC_HIDDEN
Definition: webbrowser.c:744
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define SM_CXFRAME
Definition: winuser.h:994
#define SWP_SHOWWINDOW
Definition: winuser.h:1248
int WINAPI GetSystemMetrics(_In_ int)

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

1584{
1585 switch (message)
1586 {
1587 case WM_COMMAND:
1588 if (HIWORD(wParam) == BN_CLICKED)
1590 break;
1591 case WM_SIZE:
1592 return Help_OnSize(hWnd);
1593 case WM_CLOSE:
1595 return 0;
1596 case WM_DESTROY:
1597 if(hh_process)
1598 PostQuitMessage(0);
1599 break;
1600
1601 default:
1603 }
1604
1605 return 0;
1606}
static LRESULT Help_OnSize(HWND hWnd)
Definition: help.c:1531
static void TB_OnClick(HWND hWnd, DWORD dwID)
Definition: help.c:871
BOOL hh_process
Definition: hhctrl.c:42
#define LOWORD(l)
Definition: pedump.c:82
#define HIWORD(l)
Definition: typedefs.h:247
#define WM_CLOSE
Definition: winuser.h:1621
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_COMMAND
Definition: winuser.h:1740
#define BN_CLICKED
Definition: winuser.h:1925
#define WM_DESTROY
Definition: winuser.h:1609

Referenced by HH_CreateHelpWindow().

◆ HelpPopup_WndProc()

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

Definition at line 1340 of file help.c.

1341{
1343
1344 switch (message)
1345 {
1346 case WM_SIZE:
1348 return 0;
1349 case WM_DESTROY:
1351 return 0;
1352 case WM_CLOSE:
1354 return 0;
1355
1356 default:
1358 }
1359
1360 return 0;
1361}
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by AddIndexPopup().

◆ HH_AddHTMLPane()

static BOOL HH_AddHTMLPane ( HHInfo pHHInfo)
static

Definition at line 1159 of file help.c.

1160{
1161 HWND hWnd;
1162 HWND hwndParent = pHHInfo->WinType.hwndHelp;
1165 RECT rc;
1166
1167 HP_GetHTMLRect(pHHInfo, &rc);
1168
1169 hWnd = CreateWindowExW(dwExStyles, szChildClass, szEmpty, dwStyles,
1170 rc.left, rc.top, rc.right, rc.bottom,
1172 if (!hWnd)
1173 return FALSE;
1174
1175 if (!InitWebBrowser(pHHInfo, hWnd))
1176 return FALSE;
1177
1178 /* store the pointer to the HH info struct */
1179 SetWindowLongPtrW(hWnd, 0, (LONG_PTR)pHHInfo);
1180
1183
1184 pHHInfo->WinType.hwndHTML = hWnd;
1185 return TRUE;
1186}
static HWND hwndParent
Definition: cryptui.c:300
BOOL InitWebBrowser(HHInfo *, HWND) DECLSPEC_HIDDEN
Definition: webbrowser.c:670
BOOL WINAPI UpdateWindow(_In_ HWND)

Referenced by CreateViewer().

◆ HH_AddNavigationPane()

static BOOL HH_AddNavigationPane ( HHInfo info)
static

Definition at line 1086 of file help.c.

1087{
1088 HWND hWnd, hwndTabCtrl;
1089 HWND hwndParent = info->WinType.hwndHelp;
1090 DWORD dwStyles = WS_CHILDWINDOW;
1092 RECT rc;
1093
1095 dwStyles |= WS_VISIBLE;
1096
1098
1099 hWnd = CreateWindowExW(dwExStyles, szChildClass, szEmpty, dwStyles,
1100 rc.left, rc.top, rc.right, rc.bottom,
1102 if (!hWnd)
1103 return FALSE;
1104
1106
1107 hwndTabCtrl = CreateWindowExW(dwExStyles, WC_TABCONTROLW, szEmpty, dwStyles | WS_VISIBLE,
1108 0, TAB_TOP_PADDING,
1112 if (!hwndTabCtrl)
1113 return FALSE;
1114
1115 if (*info->WinType.pszToc)
1116 info->tabs[TAB_CONTENTS].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_CONTENTS);
1117
1118 if (*info->WinType.pszIndex)
1119 info->tabs[TAB_INDEX].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_INDEX);
1120
1121 if (info->WinType.fsWinProperties & HHWIN_PROP_TAB_SEARCH)
1122 info->tabs[TAB_SEARCH].id = NP_CreateTab(hhctrl_hinstance, hwndTabCtrl, IDS_SEARCH);
1123
1124 if (info->WinType.fsWinProperties & HHWIN_PROP_TAB_FAVORITES)
1126
1127 SendMessageW(hwndTabCtrl, WM_SETFONT, (WPARAM)info->hFont, TRUE);
1128
1129 info->hwndTabCtrl = hwndTabCtrl;
1130 info->WinType.hwndNavigation = hWnd;
1131 return TRUE;
1132}
static DWORD NP_CreateTab(HINSTANCE hInstance, HWND hwndTabCtrl, DWORD index)
Definition: help.c:1071
#define IDS_CONTENTS
Definition: resource.h:32
#define IDS_INDEX
Definition: resource.h:33
#define IDS_FAVORITES
Definition: resource.h:35
#define IDS_SEARCH
Definition: resource.h:34
#define TAB_FAVORITES
Definition: hhctrl.h:119
#define HHWIN_PROP_TAB_FAVORITES
Definition: htmlhelp.h:67
#define HHWIN_PROP_TAB_SEARCH
Definition: htmlhelp.h:65
#define WC_TABCONTROLW
Definition: commctrl.h:3935

Referenced by CreateViewer().

◆ HH_AddSizeBar()

static BOOL HH_AddSizeBar ( HHInfo pHHInfo)
static

Definition at line 422 of file help.c.

423{
424 HWND hWnd;
425 HWND hwndParent = pHHInfo->WinType.hwndHelp;
428 RECT rc;
429
430 if (navigation_visible(pHHInfo))
431 dwStyles |= WS_VISIBLE;
432
433 SB_GetSizeBarRect(pHHInfo, &rc);
434
435 hWnd = CreateWindowExW(dwExStyles, szSizeBarClass, szEmpty, dwStyles,
436 rc.left, rc.top, rc.right, rc.bottom,
438 if (!hWnd)
439 return FALSE;
440
441 /* store the pointer to the HH info struct */
442 SetWindowLongPtrW(hWnd, 0, (LONG_PTR)pHHInfo);
443
444 pHHInfo->hwndSizeBar = hWnd;
445 return TRUE;
446}
static const WCHAR szSizeBarClass[]
Definition: help.c:308
#define WS_OVERLAPPED
Definition: pedump.c:615

Referenced by CreateViewer().

◆ HH_AddToolbar()

static BOOL HH_AddToolbar ( HHInfo pHHInfo)
static

Definition at line 999 of file help.c.

1000{
1001 HWND hToolbar;
1002 HWND hwndParent = pHHInfo->WinType.hwndHelp;
1003 DWORD toolbarFlags;
1005 DWORD dwStyles, dwExStyles;
1006 DWORD dwNumButtons, dwIndex;
1007
1009 toolbarFlags = pHHInfo->WinType.fsToolBarFlags;
1010 else
1011 toolbarFlags = HHWIN_DEF_BUTTONS;
1012
1015
1016 hToolbar = CreateWindowExW(dwExStyles, TOOLBARCLASSNAMEW, NULL, dwStyles,
1017 0, 0, 0, 0, hwndParent, NULL,
1019 if (!hToolbar)
1020 return FALSE;
1021 pHHInfo->WinType.hwndToolBar = hToolbar;
1022
1024 SendMessageW(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
1025 SendMessageW(hToolbar, WM_SETFONT, (WPARAM)pHHInfo->hFont, TRUE);
1026
1027 TB_AddButtonsFromFlags(pHHInfo, buttons, toolbarFlags, &dwNumButtons);
1028
1029 for (dwIndex = 0; dwIndex < dwNumButtons; dwIndex++)
1030 {
1031 LPWSTR szBuf = HH_LoadString(buttons[dwIndex].idCommand);
1032 DWORD dwLen = lstrlenW(szBuf);
1033 szBuf[dwLen + 1] = 0; /* Double-null terminate */
1034
1035 buttons[dwIndex].iString = (DWORD)SendMessageW(hToolbar, TB_ADDSTRINGW, 0, (LPARAM)szBuf);
1036 heap_free(szBuf);
1037 }
1038
1039 SendMessageW(hToolbar, TB_ADDBUTTONSW, dwNumButtons, (LPARAM)buttons);
1040 SendMessageW(hToolbar, TB_AUTOSIZE, 0, 0);
1042 ShowWindow(hToolbar, SW_SHOW);
1043
1044 return TRUE;
1045}
static void TB_AddButtonsFromFlags(HHInfo *pHHInfo, TBBUTTON *pButtons, DWORD dwButtonFlags, LPDWORD pdwNumButtons)
Definition: help.c:935
#define ICON_SIZE
Definition: help.c:821
#define HHWIN_PARAM_TB_FLAGS
Definition: htmlhelp.h:92
#define IDTB_TOC_PREV
Definition: htmlhelp.h:148
#define HHWIN_DEF_BUTTONS
Definition: htmlhelp.h:122
#define HHWIN_PROP_TRI_PANE
Definition: htmlhelp.h:60
#define DWORD
Definition: nt_native.h:44
#define TB_AUTOSIZE
Definition: commctrl.h:1137
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
#define TB_ADDSTRINGW
Definition: commctrl.h:1132
#define CCS_NODIVIDER
Definition: commctrl.h:2248
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define TB_SETBITMAPSIZE
Definition: commctrl.h:1136
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:990
#define TB_ADDBUTTONSW
Definition: commctrl.h:1266
HWND buttons[5]
Definition: sndrec32.cpp:40
HFONT hFont
Definition: hhctrl.h:202
DWORD fsToolBarFlags
Definition: htmlhelp.h:362
DWORD fsWinProperties
Definition: htmlhelp.h:344
#define MAKELONG(a, b)
Definition: typedefs.h:249
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CreateViewer().

◆ HH_CreateFont()

static void HH_CreateFont ( HHInfo pHHInfo)
static

Definition at line 1707 of file help.c.

1708{
1709 LOGFONTW lf;
1710
1712 lf.lfWeight = FW_NORMAL;
1713 lf.lfItalic = FALSE;
1714 lf.lfUnderline = FALSE;
1715
1716 pHHInfo->hFont = CreateFontIndirectW(&lf);
1717}
BYTE lfItalic
Definition: dimm.idl:64
LONG lfWeight
Definition: dimm.idl:63
BYTE lfUnderline
Definition: dimm.idl:65
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
#define FW_NORMAL
Definition: wingdi.h:373
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)

Referenced by CreateViewer().

◆ HH_CreateHelpWindow()

static BOOL HH_CreateHelpWindow ( HHInfo info)
static

Definition at line 1608 of file help.c.

1609{
1610 HWND hWnd;
1611 RECT winPos = info->WinType.rcWindowPos;
1612 WNDCLASSEXW wcex;
1613 DWORD dwStyles, dwExStyles;
1614 DWORD x, y, width = 0, height = 0;
1615 LPCWSTR caption;
1616
1617 static const WCHAR windowClassW[] = {
1618 'H','H',' ', 'P','a','r','e','n','t',0
1619 };
1620
1621 wcex.cbSize = sizeof(WNDCLASSEXW);
1622 wcex.style = CS_HREDRAW | CS_VREDRAW;
1624 wcex.cbClsExtra = 0;
1625 wcex.cbWndExtra = sizeof(LONG_PTR);
1627#ifdef __REACTOS__
1628 wcex.hIcon = LoadIconW(hhctrl_hinstance, MAKEINTRESOURCEW(IDI_HHICON));
1629#else
1631#endif
1633 wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
1634 wcex.lpszMenuName = NULL;
1636#ifdef __REACTOS__
1637 wcex.hIconSm = NULL;
1638#else
1640#endif
1641
1642 RegisterClassExW(&wcex);
1643
1644 /* Read in window parameters if available */
1645 if (info->WinType.fsValidMembers & HHWIN_PARAM_STYLES)
1646 {
1647 dwStyles = info->WinType.dwStyles;
1648 if (!(info->WinType.dwStyles & WS_CHILD))
1649 dwStyles |= WS_OVERLAPPEDWINDOW;
1650 }
1651 else
1652 dwStyles = WS_OVERLAPPEDWINDOW | WS_VISIBLE |
1654
1655 if (info->WinType.fsValidMembers & HHWIN_PARAM_EXSTYLES)
1656 dwExStyles = info->WinType.dwExStyles;
1657 else
1660
1661 if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT)
1662 {
1663 x = winPos.left;
1664 y = winPos.top;
1665 width = winPos.right - x;
1666 height = winPos.bottom - y;
1667 }
1668 if (!width || !height)
1669 {
1674 }
1675
1676 if (!(info->WinType.fsWinProperties & HHWIN_PROP_TRI_PANE) && info->WinType.fNotExpanded)
1677 {
1678 if (!(info->WinType.fsValidMembers & HHWIN_PARAM_NAV_WIDTH) &&
1679 info->WinType.iNavWidth == 0)
1680 {
1681 info->WinType.iNavWidth = WINTYPE_DEFAULT_NAVWIDTH;
1682 }
1683
1684 x += info->WinType.iNavWidth;
1685 width -= info->WinType.iNavWidth;
1686 }
1687
1688
1689 caption = info->WinType.pszCaption;
1690 if (!*caption) caption = info->pCHMInfo->defTitle;
1691
1692 hWnd = CreateWindowExW(dwExStyles, windowClassW, caption, dwStyles, x, y, width, height,
1693 info->WinType.hwndCaller, NULL, hhctrl_hinstance, NULL);
1694 if (!hWnd)
1695 return FALSE;
1696
1699
1700 /* store the pointer to the HH info struct */
1702
1703 info->WinType.hwndHelp = hWnd;
1704 return TRUE;
1705}
#define WINTYPE_DEFAULT_Y
Definition: help.c:41
#define WINTYPE_DEFAULT_NAVWIDTH
Definition: help.c:44
#define WINTYPE_DEFAULT_WIDTH
Definition: help.c:42
#define WINTYPE_DEFAULT_HEIGHT
Definition: help.c:43
#define WINTYPE_DEFAULT_X
Definition: help.c:40
static LRESULT CALLBACK Help_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:1583
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
#define HHWIN_PARAM_EXSTYLES
Definition: htmlhelp.h:87
#define HHWIN_PARAM_NAV_WIDTH
Definition: htmlhelp.h:89
#define HHWIN_PARAM_RECT
Definition: htmlhelp.h:88
#define HHWIN_PARAM_STYLES
Definition: htmlhelp.h:86

Referenced by CreateViewer().

◆ HH_InitRequiredControls()

static void HH_InitRequiredControls ( DWORD  dwControls)
static

Definition at line 1719 of file help.c.

1720{
1722
1723 icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
1724 icex.dwICC = dwControls;
1725 InitCommonControlsEx(&icex);
1726}
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX

Referenced by CreateViewer().

◆ HH_LoadString()

static LPWSTR HH_LoadString ( DWORD  dwID)
static

Definition at line 177 of file help.c.

179{
180 LPWSTR string = NULL;
181 LPCWSTR stringresource;
182 int iSize;
183
184 iSize = LoadStringW(hhctrl_hinstance, dwID, (LPWSTR)&stringresource, 0);
185
186 string = heap_alloc((iSize + 2) * sizeof(WCHAR)); /* some strings (tab text) needs double-null termination */
187 memcpy(string, stringresource, iSize*sizeof(WCHAR));
188 string[iSize] = 0;
189
190 return string;
191}
char string[160]
Definition: util.h:11
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)

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

◆ HH_RegisterChildWndClass()

static void HH_RegisterChildWndClass ( HHInfo pHHInfo)
static

Definition at line 799 of file help.c.

800{
801 WNDCLASSEXW wcex;
802
803 wcex.cbSize = sizeof(WNDCLASSEXW);
804 wcex.style = 0;
806 wcex.cbClsExtra = 0;
807 wcex.cbWndExtra = sizeof(LONG_PTR);
811 wcex.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
812 wcex.lpszMenuName = NULL;
815
816 RegisterClassExW(&wcex);
817}
static LRESULT CALLBACK Child_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:697

Referenced by CreateViewer().

◆ HH_RegisterSizeBarClass()

static void HH_RegisterSizeBarClass ( HHInfo pHHInfo)
static

Definition at line 391 of file help.c.

392{
393 WNDCLASSEXW wcex;
394
395 wcex.cbSize = sizeof(WNDCLASSEXW);
396 wcex.style = 0;
398 wcex.cbClsExtra = 0;
399 wcex.cbWndExtra = sizeof(LONG_PTR);
403 wcex.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
404 wcex.lpszMenuName = NULL;
407
408 RegisterClassExW(&wcex);
409}
static LRESULT CALLBACK SizeBar_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: help.c:368
#define IDC_SIZEWE
Definition: winuser.h:694

Referenced by CreateViewer().

◆ HP_GetHTMLRect()

static void HP_GetHTMLRect ( HHInfo info,
RECT rc 
)
static

Definition at line 1136 of file help.c.

1137{
1138 RECT rectTB, rectWND, rectNP, rectSB;
1139
1140 GetClientRect(info->WinType.hwndHelp, &rectWND);
1141 GetClientRect(info->hwndSizeBar, &rectSB);
1142
1143 rc->left = 0;
1144 rc->top = 0;
1146 {
1147 GetClientRect(info->WinType.hwndNavigation, &rectNP);
1148 rc->left += rectNP.right + rectSB.right;
1149 }
1150 if (info->WinType.fsWinProperties & HHWIN_PROP_TRI_PANE)
1151 {
1152 GetClientRect(info->WinType.hwndToolBar, &rectTB);
1153 rc->top += rectTB.bottom;
1154 }
1155 rc->right = rectWND.right - rc->left;
1156 rc->bottom = rectWND.bottom - rc->top;
1157}

Referenced by Help_OnSize(), and HH_AddHTMLPane().

◆ navigate_url()

static HRESULT navigate_url ( HHInfo info,
LPCWSTR  surl 
)
static

Definition at line 193 of file help.c.

194{
195 VARIANT url;
197
198 TRACE("%s\n", debugstr_w(surl));
199
200 V_VT(&url) = VT_BSTR;
201 V_BSTR(&url) = SysAllocString(surl);
202
203 hres = IWebBrowser2_Navigate2(info->web_browser->web_browser, &url, 0, 0, 0, 0);
204
206
207 if(FAILED(hres))
208 TRACE("Navigation failed: %08x\n", hres);
209
210 return hres;
211}
@ VT_BSTR
Definition: compat.h:2303
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648

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

258{
260
261 TRACE("%p %s %s\n", info, debugstr_w(file), debugstr_w(index));
262
263 if ((!info->web_browser) || !AppendFullPathURL(file, buf, index))
264 return FALSE;
265
266 return SUCCEEDED(navigate_url(info, buf));
267}
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:193
#define SUCCEEDED(hr)
Definition: intsafe.h:50

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

◆ NavigateToUrl()

BOOL NavigateToUrl ( HHInfo info,
LPCWSTR  surl 
)

Definition at line 213 of file help.c.

214{
215 ChmPath chm_path;
216 BOOL ret;
218
219 static const WCHAR url_indicator[] = {':', '/', '/', 0};
220
221 TRACE("%s\n", debugstr_w(surl));
222
223 if (wcsstr(surl, url_indicator)) {
224 hres = navigate_url(info, surl);
225 if(SUCCEEDED(hres))
226 return TRUE;
227 } /* look up in chm if it doesn't look like a full url */
228
229 SetChmPath(&chm_path, info->pCHMInfo->szFile, surl);
230 ret = NavigateToChm(info, chm_path.chm_file, chm_path.chm_index);
231
232 heap_free(chm_path.chm_file);
233 heap_free(chm_path.chm_index);
234
235 return ret;
236}
void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
Definition: chm.c:503
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:257
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: hhctrl.h:54
LPWSTR chm_file
Definition: hhctrl.h:55
LPWSTR chm_index
Definition: hhctrl.h:56
int ret

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}

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

1072{
1073 TCITEMW tie;
1074 LPWSTR tabText = HH_LoadString(index);
1075 DWORD ret;
1076
1077 tie.mask = TCIF_TEXT;
1078 tie.pszText = tabText;
1079
1080 ret = SendMessageW( hwndTabCtrl, TCM_INSERTITEMW, index, (LPARAM)&tie );
1081
1082 heap_free(tabText);
1083 return ret;
1084}
#define TCM_INSERTITEMW
Definition: commctrl.h:4047
#define TCIF_TEXT
Definition: commctrl.h:3971
LPWSTR pszText
Definition: commctrl.h:4023
UINT mask
Definition: commctrl.h:4020

Referenced by HH_AddNavigationPane().

◆ NP_GetNavigationRect()

static void NP_GetNavigationRect ( HHInfo pHHInfo,
RECT rc 
)
static

Definition at line 1049 of file help.c.

1050{
1051 HWND hwndParent = pHHInfo->WinType.hwndHelp;
1052 HWND hwndToolbar = pHHInfo->WinType.hwndToolBar;
1053 RECT rectWND, rectTB;
1054
1055 GetClientRect(hwndParent, &rectWND);
1056 GetClientRect(hwndToolbar, &rectTB);
1057
1058 rc->left = 0;
1059 rc->top = rectTB.bottom;
1060 rc->bottom = rectWND.bottom - rectTB.bottom;
1061
1062 if (!(pHHInfo->WinType.fsValidMembers & HHWIN_PARAM_NAV_WIDTH) &&
1063 pHHInfo->WinType.iNavWidth == 0)
1064 {
1066 }
1067
1068 rc->right = pHHInfo->WinType.iNavWidth;
1069}
DWORD fsValidMembers
Definition: htmlhelp.h:343

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

◆ OnTabChange()

static LRESULT OnTabChange ( HWND  hwnd)
static

Definition at line 563 of file help.c.

564{
566 int tab_id, tab_index, i;
567
568 TRACE("%p\n", hwnd);
569
570 if (!info)
571 return 0;
572
573 if(info->tabs[info->current_tab].hwnd)
574 ShowWindow(info->tabs[info->current_tab].hwnd, SW_HIDE);
575
576 tab_id = (int) SendMessageW(info->hwndTabCtrl, TCM_GETCURSEL, 0, 0);
577 /* convert the ID of the tab to an index in our tab list */
578 tab_index = -1;
579 for (i=0; i<TAB_NUMTABS; i++)
580 {
581 if (info->tabs[i].id == tab_id)
582 {
583 tab_index = i;
584 break;
585 }
586 }
587 if (tab_index == -1)
588 {
589 FIXME("Tab ID %d does not correspond to a valid index in the tab list.\n", tab_id);
590 return 0;
591 }
592 info->current_tab = tab_index;
593
594 if(info->tabs[info->current_tab].hwnd)
595 ShowWindow(info->tabs[info->current_tab].hwnd, SW_SHOW);
596
597 return 0;
598}
#define TAB_NUMTABS
Definition: hhctrl.h:120
#define TCM_GETCURSEL
Definition: commctrl.h:4062

Referenced by Child_WndProc().

◆ OnTopicChange()

static LRESULT OnTopicChange ( HHInfo info,
void user_data 
)
static

Definition at line 600 of file help.c.

601{
602 LPCWSTR chmfile = NULL, name = NULL, local = NULL;
603 ContentItem *citer;
604 SearchItem *siter;
605 IndexItem *iiter;
606
607 if(!user_data || !info)
608 return 0;
609
610 switch (info->current_tab)
611 {
612 case TAB_CONTENTS:
613 citer = (ContentItem *) user_data;
614 name = citer->name;
615 local = citer->local;
616 while(citer) {
617 if(citer->merge.chm_file) {
618 chmfile = citer->merge.chm_file;
619 break;
620 }
621 citer = citer->parent;
622 }
623 break;
624 case TAB_INDEX:
625 iiter = (IndexItem *) user_data;
626 if(iiter->nItems == 0) {
627 FIXME("No entries for this item!\n");
628 return 0;
629 }
630 if(iiter->nItems > 1) {
631 int i = 0;
632 LVITEMW lvi;
633
634 SendMessageW(info->popup.hwndList, LVM_DELETEALLITEMS, 0, 0);
635 for(i=0;i<iiter->nItems;i++) {
636 IndexSubItem *item = &iiter->items[i];
637 WCHAR *name = iiter->keyword;
638
639 if(!item->name)
640 item->name = GetDocumentTitle(info->pCHMInfo, item->local);
641 if(item->name)
642 name = item->name;
643 memset(&lvi, 0, sizeof(lvi));
644 lvi.iItem = i;
646 lvi.cchTextMax = lstrlenW(name)+1;
647 lvi.pszText = name;
648 lvi.lParam = (LPARAM) item;
649 SendMessageW(info->popup.hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi);
650 }
651 ShowWindow(info->popup.hwndPopup, SW_SHOW);
652 return 0;
653 }
654 name = iiter->items[0].name;
655 local = iiter->items[0].local;
656 chmfile = iiter->merge.chm_file;
657 break;
658 case TAB_SEARCH:
659 siter = (SearchItem *) user_data;
660 name = siter->filename;
661 local = siter->filename;
662 chmfile = info->pCHMInfo->szFile;
663 break;
664 default:
665 FIXME("Unhandled operation for this tab!\n");
666 return 0;
667 }
668
669 if(!chmfile)
670 {
671 FIXME("No help file found for this item!\n");
672 return 0;
673 }
674
675 TRACE("name %s loal %s\n", debugstr_w(name), debugstr_w(local));
676
677 NavigateToChm(info, chmfile, local);
678 return 0;
679}
WCHAR * GetDocumentTitle(CHMInfo *info, LPCWSTR document)
Definition: chm.c:572
#define local
Definition: zutil.h:30
#define LVM_DELETEALLITEMS
Definition: commctrl.h:2413
#define LVIF_PARAM
Definition: commctrl.h:2311
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVM_INSERTITEMW
Definition: commctrl.h:2404
struct ContentItem * parent
Definition: hhctrl.h:60
LPWSTR local
Definition: hhctrl.h:67
ChmPath merge
Definition: hhctrl.h:68
LPWSTR name
Definition: hhctrl.h:66
int nItems
Definition: hhctrl.h:83
IndexSubItem * items
Definition: hhctrl.h:86
ChmPath merge
Definition: hhctrl.h:81
LPWSTR keyword
Definition: hhctrl.h:80
LPWSTR local
Definition: hhctrl.h:73
LPWSTR name
Definition: hhctrl.h:72
LPWSTR filename
Definition: hhctrl.h:94
Definition: name.c:39
LPWSTR pszText
Definition: commctrl.h:2365
int cchTextMax
Definition: commctrl.h:2366

Referenced by Child_WndProc().

◆ PopupChild_WndProc()

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

Definition at line 1363 of file help.c.

1364{
1365 switch (message)
1366 {
1367 case WM_NOTIFY: {
1368 NMHDR *nmhdr = (NMHDR*)lParam;
1369 switch(nmhdr->code)
1370 {
1371 case NM_DBLCLK: {
1373 IndexSubItem *iter;
1374
1375 if(info == 0 || lParam == 0)
1376 return 0;
1377 iter = (IndexSubItem*) ((NMITEMACTIVATE *)lParam)->lParam;
1378 if(iter == 0)
1379 return 0;
1380 NavigateToChm(info, info->index->merge.chm_file, iter->local);
1381 ShowWindow(info->popup.hwndPopup, SW_HIDE);
1382 return 0;
1383 }
1384 case NM_RETURN: {
1386 IndexSubItem *iter;
1387 LVITEMW lvItem;
1388
1389 if(info == 0)
1390 return 0;
1391
1392 lvItem.iItem = (int) SendMessageW(info->popup.hwndList, LVM_GETSELECTIONMARK, 0, 0);
1393 lvItem.mask = TVIF_PARAM;
1394 SendMessageW(info->popup.hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem);
1395 iter = (IndexSubItem*) lvItem.lParam;
1396 NavigateToChm(info, info->index->merge.chm_file, iter->local);
1397 ShowWindow(info->popup.hwndPopup, SW_HIDE);
1398 return 0;
1399 }
1400 }
1401 break;
1402 }
1403 default:
1405 }
1406
1407 return 0;
1408}
unsigned int index
Definition: notification.c:65

Referenced by AddIndexPopup().

◆ ReleaseHelpViewer()

void ReleaseHelpViewer ( HHInfo info)

Definition at line 1802 of file help.c.

1803{
1804 TRACE("(%p)\n", info);
1805
1806 if (!info)
1807 return;
1808
1809 list_remove(&info->entry);
1810
1811 wintype_stringsA_free(&info->stringsA);
1812 wintype_stringsW_free(&info->stringsW);
1813
1814 if (info->pCHMInfo)
1815 CloseCHM(info->pCHMInfo);
1816
1821
1822 if(info->contents.hImageList)
1823 ImageList_Destroy(info->contents.hImageList);
1824 if(info->WinType.hwndHelp)
1825 DestroyWindow(info->WinType.hwndHelp);
1826
1827 heap_free(info);
1829}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
CHMInfo * CloseCHM(CHMInfo *chm)
Definition: chm.c:670
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
void wintype_stringsW_free(struct wintype_stringsW *stringsW)
Definition: help.c:1773
void wintype_stringsA_free(struct wintype_stringsA *stringsA)
Definition: help.c:1787
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
void ReleaseWebBrowser(HHInfo *) DECLSPEC_HIDDEN
Definition: webbrowser.c:720
void ReleaseSearch(HHInfo *info) DECLSPEC_HIDDEN
Definition: search.c:235
void ReleaseIndex(HHInfo *) DECLSPEC_HIDDEN
Definition: index.c:288
void ReleaseContent(HHInfo *info)
Definition: content.c:325

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

◆ ResizePopupChild()

static void ResizePopupChild ( HHInfo info)
static

Definition at line 1311 of file help.c.

1312{
1313 int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
1314 int border_width = GetSystemMetrics(SM_CXBORDER);
1315 int edge_width = GetSystemMetrics(SM_CXEDGE);
1316 INT width, height;
1317 RECT rect;
1318
1319 if(!info)
1320 return;
1321
1322 GetClientRect(info->popup.hwndPopup, &rect);
1323 SetWindowPos(info->popup.hwndCallback, HWND_TOP, 0, 0,
1324 rect.right, rect.bottom, SWP_NOMOVE);
1325
1326 rect.left = TAB_MARGIN;
1329 rect.bottom -= TAB_MARGIN;
1330 width = rect.right-rect.left;
1331 height = rect.bottom-rect.top;
1332
1333 SetWindowPos(info->popup.hwndList, NULL, rect.left, rect.top, width, height,
1335
1336 SendMessageW(info->popup.hwndList, LVM_SETCOLUMNWIDTH, 0,
1337 width-scroll_width-2*border_width-2*edge_width);
1338}
#define TAB_MARGIN
Definition: help.c:48
#define LVM_SETCOLUMNWIDTH
Definition: commctrl.h:2646
int32_t INT
Definition: typedefs.h:58
#define SWP_NOACTIVATE
Definition: winuser.h:1242
#define SM_CXEDGE
Definition: winuser.h:1008
#define SM_CXVSCROLL
Definition: winuser.h:961
#define SM_CXBORDER
Definition: winuser.h:964
#define SWP_NOZORDER
Definition: winuser.h:1247

Referenced by AddIndexPopup(), and HelpPopup_WndProc().

◆ ResizeTabChild()

static void ResizeTabChild ( HHInfo info,
int  tab 
)
static

Definition at line 486 of file help.c.

487{
488 HWND hwnd = info->tabs[tab].hwnd;
490 RECT rect, tabrc;
491 DWORD cnt;
492
493 GetClientRect(info->WinType.hwndNavigation, &rect);
494 SendMessageW(info->hwndTabCtrl, TCM_GETITEMRECT, 0, (LPARAM)&tabrc);
495 cnt = SendMessageW(info->hwndTabCtrl, TCM_GETROWCOUNT, 0, 0);
496
497 rect.left = TAB_MARGIN;
498 rect.top = TAB_TOP_PADDING + cnt*(tabrc.bottom-tabrc.top) + TAB_MARGIN;
500 rect.bottom -= TAB_MARGIN;
501 width = rect.right-rect.left;
502 height = rect.bottom-rect.top;
503
504 SetWindowPos(hwnd, NULL, rect.left, rect.top, width, height,
506
507 switch (tab)
508 {
509 case TAB_INDEX: {
510 int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
511 int border_width = GetSystemMetrics(SM_CXBORDER);
512 int edge_width = GetSystemMetrics(SM_CXEDGE);
513
514 /* Resize the tab widget column to perfectly fit the tab window and
515 * leave sufficient space for the scroll widget.
516 */
518 width-scroll_width-2*border_width-2*edge_width);
519
520 break;
521 }
522 case TAB_SEARCH: {
523 int scroll_width = GetSystemMetrics(SM_CXVSCROLL);
524 int border_width = GetSystemMetrics(SM_CXBORDER);
525 int edge_width = GetSystemMetrics(SM_CXEDGE);
526 int top_pos = 0;
527
528 SetWindowPos(info->search.hwndEdit, NULL, 0, top_pos, width,
530 top_pos += EDIT_HEIGHT + TAB_MARGIN;
531 SetWindowPos(info->search.hwndList, NULL, 0, top_pos, width,
533 /* Resize the tab widget column to perfectly fit the tab window and
534 * leave sufficient space for the scroll widget.
535 */
536 SendMessageW(info->search.hwndList, LVM_SETCOLUMNWIDTH, 0,
537 width-scroll_width-2*border_width-2*edge_width);
538
539 break;
540 }
541 }
542}
#define EDIT_HEIGHT
Definition: help.c:49
#define TCM_GETROWCOUNT
Definition: commctrl.h:4093
#define TCM_GETITEMRECT
Definition: commctrl.h:4059

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

◆ SB_GetSizeBarRect()

static void SB_GetSizeBarRect ( HHInfo info,
RECT rc 
)
static

Definition at line 411 of file help.c.

412{
413 RECT rectWND, rectTB, rectNP;
414
415 GetClientRect(info->WinType.hwndHelp, &rectWND);
416 GetClientRect(info->WinType.hwndToolBar, &rectTB);
417 GetClientRect(info->WinType.hwndNavigation, &rectNP);
418
419 SetRect(rc, rectNP.right, rectTB.bottom, SIZEBAR_WIDTH, rectWND.bottom - rectTB.bottom);
420}
#define SIZEBAR_WIDTH
Definition: help.c:306
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by Help_OnSize(), and HH_AddSizeBar().

◆ SB_OnLButtonDown()

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

Definition at line 341 of file help.c.

342{
344}
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 346 of file help.c.

347{
348 HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
349 POINT pt;
350
351 pt.x = (short)LOWORD(lParam);
352 pt.y = (short)HIWORD(lParam);
353
354 /* update the window sizes */
355 pHHInfo->WinType.iNavWidth += pt.x;
357
359}
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define pt(x, y)
Definition: drawing.c:79
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890

Referenced by SizeBar_WndProc().

◆ SB_OnMouseMove()

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

Definition at line 361 of file help.c.

362{
363 /* ignore WM_MOUSEMOVE if not dragging the SizeBar */
364 if (!(wParam & MK_LBUTTON))
365 return;
366}
#define MK_LBUTTON
Definition: winuser.h:2367

Referenced by SizeBar_WndProc().

◆ SB_OnPaint()

static void SB_OnPaint ( HWND  hWnd)
static

Definition at line 313 of file help.c.

314{
315 PAINTSTRUCT ps;
316 HDC hdc;
317 RECT rc;
318
319 hdc = BeginPaint(hWnd, &ps);
320
321 GetClientRect(hWnd, &rc);
322
323 /* dark frame */
324 rc.right += 1;
325 rc.bottom -= 1;
327
328 /* white highlight */
330 MoveToEx(hdc, rc.right, 1, NULL);
331 LineTo(hdc, 1, 1);
332 LineTo(hdc, 1, rc.bottom - 1);
333
334
335 MoveToEx(hdc, 0, rc.bottom, NULL);
336 LineTo(hdc, rc.right, rc.bottom);
337
338 EndPaint(hWnd, &ps);
339}
#define GRAY_BRUSH
Definition: wingdi.h:898
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 368 of file help.c.

369{
370 switch (message)
371 {
372 case WM_LBUTTONDOWN:
374 break;
375 case WM_LBUTTONUP:
377 break;
378 case WM_MOUSEMOVE:
380 break;
381 case WM_PAINT:
383 break;
384 default:
386 }
387
388 return 0;
389}
static void SB_OnLButtonUp(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:346
static void SB_OnLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:341
static void SB_OnMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: help.c:361
static void SB_OnPaint(HWND hWnd)
Definition: help.c:313
#define WM_MOUSEMOVE
Definition: winuser.h:1775
#define WM_LBUTTONDOWN
Definition: winuser.h:1776
#define WM_LBUTTONUP
Definition: winuser.h:1777

Referenced by HH_RegisterSizeBarClass().

◆ TB_AddButton()

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

Definition at line 925 of file help.c.

926{
927 pButtons[dwIndex].iBitmap = dwBitmap;
928 pButtons[dwIndex].idCommand = dwID;
929 pButtons[dwIndex].fsState = TBSTATE_ENABLED;
930 pButtons[dwIndex].fsStyle = BTNS_BUTTON;
931 pButtons[dwIndex].dwData = 0;
932 pButtons[dwIndex].iString = 0;
933}
#define BTNS_BUTTON
Definition: commctrl.h:998
#define TBSTATE_ENABLED
Definition: commctrl.h:974
BYTE fsState
Definition: commctrl.h:951
INT_PTR iString
Definition: commctrl.h:959
int idCommand
Definition: commctrl.h:950
DWORD_PTR dwData
Definition: commctrl.h:958
int iBitmap
Definition: commctrl.h:949
BYTE fsStyle
Definition: commctrl.h:952

Referenced by TB_AddButtonsFromFlags().

◆ TB_AddButtonsFromFlags()

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

Definition at line 935 of file help.c.

936{
937 int nHistBitmaps = 0, nStdBitmaps = 0, nHHBitmaps = 0;
938 HWND hToolbar = pHHInfo->WinType.hwndToolBar;
939 TBADDBITMAP tbAB;
940 DWORD unsupported;
941
942 /* Common bitmaps */
943 tbAB.hInst = HINST_COMMCTRL;
945 nHistBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&tbAB);
947 nStdBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&tbAB);
948 /* hhctrl.ocx bitmaps */
949 tbAB.hInst = hhctrl_hinstance;
950 tbAB.nID = IDB_HHTOOLBAR;
951 nHHBitmaps = SendMessageW(hToolbar, TB_ADDBITMAP, HHTB_NUMBITMAPS, (LPARAM)&tbAB);
952
953 *pdwNumButtons = 0;
954
955 unsupported = dwButtonFlags & (HHWIN_BUTTON_BROWSE_FWD |
960 if (unsupported)
961 FIXME("got asked for unsupported buttons: %06x\n", unsupported);
962
963 if (dwButtonFlags & HHWIN_BUTTON_EXPAND)
964 {
965 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_EXPAND, nHHBitmaps + HHTB_EXPAND);
966 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_CONTRACT, nHHBitmaps + HHTB_CONTRACT);
967
968 if (pHHInfo->WinType.fNotExpanded)
969 pButtons[1].fsState |= TBSTATE_HIDDEN;
970 else
971 pButtons[0].fsState |= TBSTATE_HIDDEN;
972 }
973
974 if (dwButtonFlags & HHWIN_BUTTON_BACK)
975 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_BACK, nHistBitmaps + HIST_BACK);
976
977 if (dwButtonFlags & HHWIN_BUTTON_FORWARD)
978 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_FORWARD, nHistBitmaps + HIST_FORWARD);
979
980 if (dwButtonFlags & HHWIN_BUTTON_STOP)
981 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_STOP, nHHBitmaps + HHTB_STOP);
982
983 if (dwButtonFlags & HHWIN_BUTTON_REFRESH)
984 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_REFRESH, nHHBitmaps + HHTB_REFRESH);
985
986 if (dwButtonFlags & HHWIN_BUTTON_HOME)
987 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_HOME, nHHBitmaps + HHTB_HOME);
988
989 if (dwButtonFlags & HHWIN_BUTTON_SYNC)
990 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_SYNC, nHHBitmaps + HHTB_SYNC);
991
992 if (dwButtonFlags & HHWIN_BUTTON_OPTIONS)
993 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_OPTIONS, nStdBitmaps + STD_PROPERTIES);
994
995 if (dwButtonFlags & HHWIN_BUTTON_PRINT)
996 TB_AddButton(pButtons, (*pdwNumButtons)++, IDTB_PRINT, nStdBitmaps + STD_PRINT);
997}
static void TB_AddButton(TBBUTTON *pButtons, DWORD dwIndex, DWORD dwID, DWORD dwBitmap)
Definition: help.c:925
#define HHTB_CONTRACT
Definition: resource.h:49
#define HHTB_SYNC
Definition: resource.h:47
#define HHTB_NUMBITMAPS
Definition: resource.h:50
#define HHTB_REFRESH
Definition: resource.h:45
#define IDB_HHTOOLBAR
Definition: resource.h:42
#define HHTB_EXPAND
Definition: resource.h:48
#define HHTB_STOP
Definition: resource.h:44
#define HHTB_HOME
Definition: resource.h:46
#define HHWIN_BUTTON_INDEX
Definition: htmlhelp.h:112
#define IDTB_BACK
Definition: htmlhelp.h:129
#define HHWIN_BUTTON_FAVORITES
Definition: htmlhelp.h:115
#define HHWIN_BUTTON_REFRESH
Definition: htmlhelp.h:103
#define HHWIN_BUTTON_JUMP1
Definition: htmlhelp.h:116
#define IDTB_SYNC
Definition: htmlhelp.h:131
#define HHWIN_BUTTON_STOP
Definition: htmlhelp.h:102
#define HHWIN_BUTTON_SEARCH
Definition: htmlhelp.h:113
#define HHWIN_BUTTON_FORWARD
Definition: htmlhelp.h:101
#define IDTB_HOME
Definition: htmlhelp.h:130
#define HHWIN_BUTTON_TOC_NEXT
Definition: htmlhelp.h:119
#define IDTB_PRINT
Definition: htmlhelp.h:132
#define HHWIN_BUTTON_OPTIONS
Definition: htmlhelp.h:110
#define HHWIN_BUTTON_SYNC
Definition: htmlhelp.h:109
#define HHWIN_BUTTON_BROWSE_FWD
Definition: htmlhelp.h:105
#define IDTB_FORWARD
Definition: htmlhelp.h:134
#define HHWIN_BUTTON_PRINT
Definition: htmlhelp.h:111
#define IDTB_STOP
Definition: htmlhelp.h:127
#define HHWIN_BUTTON_TOC_PREV
Definition: htmlhelp.h:120
#define HHWIN_BUTTON_ZOOM
Definition: htmlhelp.h:118
#define HHWIN_BUTTON_HISTORY
Definition: htmlhelp.h:114
#define HHWIN_BUTTON_EXPAND
Definition: htmlhelp.h:99
#define HHWIN_BUTTON_NOTES
Definition: htmlhelp.h:107
#define IDTB_REFRESH
Definition: htmlhelp.h:128
#define HHWIN_BUTTON_HOME
Definition: htmlhelp.h:104
#define HHWIN_BUTTON_BACK
Definition: htmlhelp.h:100
#define HHWIN_BUTTON_CONTENTS
Definition: htmlhelp.h:108
#define HHWIN_BUTTON_JUMP2
Definition: htmlhelp.h:117
#define HHWIN_BUTTON_BROWSE_BCK
Definition: htmlhelp.h:106
#define STD_PRINT
Definition: commctrl.h:1085
#define IDB_HIST_LARGE_COLOR
Definition: commctrl.h:1069
#define HINST_COMMCTRL
Definition: commctrl.h:1063
#define STD_PROPERTIES
Definition: commctrl.h:1081
#define IDB_STD_LARGE_COLOR
Definition: commctrl.h:1065
#define HIST_BACK
Definition: commctrl.h:1100
#define TBSTATE_HIDDEN
Definition: commctrl.h:975
#define HIST_FORWARD
Definition: commctrl.h:1101
#define TB_ADDBITMAP
Definition: commctrl.h:1056
UINT_PTR nID
Definition: commctrl.h:1060
HINSTANCE hInst
Definition: commctrl.h:1059

Referenced by HH_AddToolbar().

◆ TB_OnClick()

static void TB_OnClick ( HWND  hWnd,
DWORD  dwID 
)
static

Definition at line 871 of file help.c.

872{
874
875 switch (dwID)
876 {
877 case IDTB_STOP:
878 DoPageAction(info->web_browser, WB_STOP);
879 break;
880 case IDTB_REFRESH:
881 DoPageAction(info->web_browser, WB_REFRESH);
882 break;
883 case IDTB_BACK:
884 DoPageAction(info->web_browser, WB_GOBACK);
885 break;
886 case IDTB_HOME:
887 NavigateToChm(info, info->pCHMInfo->szFile, info->WinType.pszHome);
888 break;
889 case IDTB_FORWARD:
890 DoPageAction(info->web_browser, WB_GOFORWARD);
891 break;
892 case IDTB_PRINT:
893 DoPageAction(info->web_browser, WB_PRINT);
894 break;
895 case IDTB_EXPAND:
896 case IDTB_CONTRACT:
898 break;
899 case IDTB_SYNC:
900 DoSync(info);
901 break;
902 case IDTB_OPTIONS:
904 break;
905 case IDTB_NOTES:
906 case IDTB_CONTENTS:
907 case IDTB_INDEX:
908 case IDTB_SEARCH:
909 case IDTB_HISTORY:
910 case IDTB_FAVORITES:
911 /* These are officially unimplemented as of the Windows 7 SDK */
912 break;
913 case IDTB_BROWSE_FWD:
914 case IDTB_BROWSE_BACK:
915 case IDTB_JUMP1:
916 case IDTB_JUMP2:
917 case IDTB_CUSTOMIZE:
918 case IDTB_ZOOM:
919 case IDTB_TOC_NEXT:
920 case IDTB_TOC_PREV:
921 break;
922 }
923}
static void DoSync(HHInfo *info)
Definition: help.c:269
static void ExpandContract(HHInfo *pHHInfo)
Definition: help.c:1500
static void DisplayPopupMenu(HHInfo *info)
Definition: help.c:823
#define WB_STOP
Definition: hhctrl.h:51
#define WB_GOFORWARD
Definition: hhctrl.h:47
void DoPageAction(WebBrowserContainer *, DWORD) DECLSPEC_HIDDEN
Definition: webbrowser.c:753
#define WB_GOBACK
Definition: hhctrl.h:46
#define WB_PRINT
Definition: hhctrl.h:52
#define WB_REFRESH
Definition: hhctrl.h:50
#define IDTB_CONTENTS
Definition: htmlhelp.h:138
#define IDTB_FAVORITES
Definition: htmlhelp.h:142
#define IDTB_HISTORY
Definition: htmlhelp.h:141
#define IDTB_SEARCH
Definition: htmlhelp.h:140
#define IDTB_CUSTOMIZE
Definition: htmlhelp.h:145
#define IDTB_JUMP2
Definition: htmlhelp.h:144
#define IDTB_TOC_NEXT
Definition: htmlhelp.h:147
#define IDTB_ZOOM
Definition: htmlhelp.h:146
#define IDTB_INDEX
Definition: htmlhelp.h:139
#define IDTB_BROWSE_BACK
Definition: htmlhelp.h:137
#define IDTB_JUMP1
Definition: htmlhelp.h:143
#define IDTB_NOTES
Definition: htmlhelp.h:135
#define IDTB_BROWSE_FWD
Definition: htmlhelp.h:136

Referenced by Help_WndProc().

◆ UpdateHelpWindow()

void UpdateHelpWindow ( HHInfo info)

Definition at line 1563 of file help.c.

1564{
1565 if (!info->WinType.hwndHelp)
1566 return;
1567
1568 WARN("Only the size of the window is currently updated.\n");
1569 if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT)
1570 {
1571 RECT *rect = &info->WinType.rcWindowPos;
1572 INT x, y, width, height;
1573
1574 x = rect->left;
1575 y = rect->top;
1576 width = rect->right - x;
1577 height = rect->bottom - y;
1578 SetWindowPos(info->WinType.hwndHelp, NULL, rect->left, rect->top, width, height,
1580 }
1581}

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

1788{
1789 heap_free(stringsA->pszType);
1790 heap_free(stringsA->pszCaption);
1791 heap_free(stringsA->pszToc);
1792 heap_free(stringsA->pszIndex);
1793 heap_free(stringsA->pszFile);
1794 heap_free(stringsA->pszHome);
1795 heap_free(stringsA->pszJump1);
1796 heap_free(stringsA->pszJump2);
1797 heap_free(stringsA->pszUrlJump1);
1798 heap_free(stringsA->pszUrlJump2);
1799 heap_free(stringsA->pszCustomTabs);
1800}
char * pszToc
Definition: hhctrl.h:161
char * pszCustomTabs
Definition: hhctrl.h:169
char * pszHome
Definition: hhctrl.h:164
char * pszType
Definition: hhctrl.h:159
char * pszUrlJump2
Definition: hhctrl.h:168
char * pszIndex
Definition: hhctrl.h:162
char * pszJump1
Definition: hhctrl.h:165
char * pszUrlJump1
Definition: hhctrl.h:167
char * pszJump2
Definition: hhctrl.h:166
char * pszCaption
Definition: hhctrl.h:160
char * pszFile
Definition: hhctrl.h:163

Referenced by HtmlHelpA(), and ReleaseHelpViewer().

◆ wintype_stringsW_free()

void wintype_stringsW_free ( struct wintype_stringsW stringsW)

Definition at line 1773 of file help.c.

1774{
1775 heap_free(stringsW->pszType);
1776 heap_free(stringsW->pszCaption);
1777 heap_free(stringsW->pszToc);
1778 heap_free(stringsW->pszIndex);
1779 heap_free(stringsW->pszFile);
1780 heap_free(stringsW->pszHome);
1781 heap_free(stringsW->pszJump1);
1782 heap_free(stringsW->pszJump2);
1783 heap_free(stringsW->pszUrlJump1);
1784 heap_free(stringsW->pszUrlJump2);
1785}
WCHAR * pszUrlJump1
Definition: hhctrl.h:153
WCHAR * pszUrlJump2
Definition: hhctrl.h:154
WCHAR * pszJump1
Definition: hhctrl.h:151
WCHAR * pszHome
Definition: hhctrl.h:150
WCHAR * pszToc
Definition: hhctrl.h:147
WCHAR * pszCaption
Definition: hhctrl.h:146
WCHAR * pszFile
Definition: hhctrl.h:149
WCHAR * pszJump2
Definition: hhctrl.h:152
WCHAR * pszType
Definition: hhctrl.h:145
WCHAR * pszIndex
Definition: hhctrl.h:148

Referenced by HtmlHelpA(), and ReleaseHelpViewer().

Variable Documentation

◆ html_encoded_symbols

struct html_encoded_symbol html_encoded_symbols[]
static

Definition at line 64 of file help.c.

Referenced by find_html_symbol().

◆ szChildClass

const WCHAR szChildClass[]
static
Initial value:
= {
'H','H',' ','C','h','i','l','d',0
}

Definition at line 450 of file help.c.

Referenced by AddSearchTab(), HH_AddHTMLPane(), HH_AddNavigationPane(), and HH_RegisterChildWndClass().

◆ szEmpty

const WCHAR szEmpty[] = {0}
static

◆ szSizeBarClass

const WCHAR szSizeBarClass[]
static
Initial value:
= {
'H','H',' ','S','i','z','e','B','a','r',0
}

Definition at line 308 of file help.c.

Referenced by HH_AddSizeBar(), and HH_RegisterSizeBarClass().

◆ window_list

struct list window_list = LIST_INIT(window_list)

Definition at line 51 of file help.c.

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