ReactOS  0.4.13-dev-645-g69454b4
hhctrl.c File Reference
#include "wine/debug.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "htmlhelp.h"
#include "ole2.h"
#include "rpcproxy.h"
#include "hhctrl.h"
Include dependency graph for hhctrl.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define INIT_GUID
 
#define X(x)   case x: return #x
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (htmlhelp)
 
BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
 
static const charcommand_to_string (UINT command)
 
static BOOL resolve_filename (const WCHAR *filename, WCHAR *fullname, DWORD buflen, WCHAR **index, WCHAR **window)
 
HWND WINAPI HtmlHelpW (HWND caller, LPCWSTR filename, UINT command, DWORD_PTR data)
 
static void wintypeAtoW (const HH_WINTYPEA *data, HH_WINTYPEW *wdata, struct wintype_stringsW *stringsW)
 
static void wintypeWtoA (const HH_WINTYPEW *wdata, HH_WINTYPEA *data, struct wintype_stringsA *stringsA)
 
HWND WINAPI HtmlHelpA (HWND caller, LPCSTR filename, UINT command, DWORD_PTR data)
 
int WINAPI doWinMain (HINSTANCE hInstance, LPSTR szCmdLine)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

HINSTANCE hhctrl_hinstance
 
BOOL hh_process = FALSE
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 26 of file hhctrl.c.

◆ INIT_GUID

#define INIT_GUID

Definition at line 36 of file hhctrl.c.

◆ X

#define X (   x)    case x: return #x

Function Documentation

◆ command_to_string()

static const char* command_to_string ( UINT  command)
static

Definition at line 59 of file hhctrl.c.

60 {
61 #define X(x) case x: return #x
62  switch (command)
63  {
65  X( HH_DISPLAY_TOC );
68  X( HH_SET_WIN_TYPE );
69  X( HH_GET_WIN_TYPE );
73  X( HH_SYNC );
74  X( HH_RESERVED1 );
75  X( HH_RESERVED2 );
76  X( HH_RESERVED3 );
79  X( HH_HELP_CONTEXT );
82  X( HH_CLOSE_ALL );
83  X( HH_ALINK_LOOKUP );
90  X( HH_INITIALIZE );
91  X( HH_UNINITIALIZE );
95  default: return "???";
96  }
97 #undef X
98 }
#define HH_ALINK_LOOKUP
Definition: htmlhelp.h:42
#define HH_SET_WIN_TYPE
Definition: htmlhelp.h:27
#define HH_TP_HELP_CONTEXTMENU
Definition: htmlhelp.h:39
#define HH_GET_WIN_HANDLE
Definition: htmlhelp.h:29
#define HH_SAFE_DISPLAY_TOPIC
Definition: htmlhelp.h:51
#define HH_PRETRANSLATEMESSAGE
Definition: htmlhelp.h:52
#define HH_KEYWORD_LOOKUP
Definition: htmlhelp.h:36
#define X(x)
#define HH_DISPLAY_TOC
Definition: htmlhelp.h:24
#define HH_HELP_CONTEXT
Definition: htmlhelp.h:38
#define HH_GET_LAST_ERROR
Definition: htmlhelp.h:43
#define HH_DISPLAY_SEARCH
Definition: htmlhelp.h:26
#define HH_INITIALIZE
Definition: htmlhelp.h:49
#define HH_DISPLAY_INDEX
Definition: htmlhelp.h:25
#define HH_ENUM_CATEGORY
Definition: htmlhelp.h:44
#define HH_UNINITIALIZE
Definition: htmlhelp.h:50
#define HH_TP_HELP_WM_HELP
Definition: htmlhelp.h:40
#define HH_GET_WIN_TYPE
Definition: htmlhelp.h:28
#define HH_DISPLAY_TOPIC
Definition: htmlhelp.h:22
#define HH_RESERVED2
Definition: htmlhelp.h:34
#define HH_RESERVED1
Definition: htmlhelp.h:33
#define HH_CLOSE_ALL
Definition: htmlhelp.h:41
#define HH_SET_INCLUSIVE_FILTER
Definition: htmlhelp.h:47
#define HH_SET_INFO_TYPE
Definition: htmlhelp.h:31
#define HH_ENUM_CATEGORY_IT
Definition: htmlhelp.h:45
#define HH_SYNC
Definition: htmlhelp.h:32
#define HH_RESET_IT_FILTER
Definition: htmlhelp.h:46
#define HH_RESERVED3
Definition: htmlhelp.h:35
#define HH_DISPLAY_TEXT_POPUP
Definition: htmlhelp.h:37
#define HH_ENUM_INFO_TYPE
Definition: htmlhelp.h:30
#define HH_SET_GLOBAL_PROPERTY
Definition: htmlhelp.h:53
#define HH_SET_EXCLUSIVE_FILTER
Definition: htmlhelp.h:48

Referenced by HtmlHelpA(), and HtmlHelpW().

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 578 of file hhctrl.c.

579 {
580  FIXME("(%s %s %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
582 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstance,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 45 of file hhctrl.c.

46 {
47  TRACE("(%p,%d,%p)\n", hInstance, fdwReason, lpvReserved);
48 
49  switch (fdwReason)
50  {
51  case DLL_PROCESS_ATTACH:
54  break;
55  }
56  return TRUE;
57 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static IN DWORD IN LPVOID lpvReserved
HINSTANCE hInstance
Definition: charmap.c:20
#define TRACE(s)
Definition: solgame.cpp:4
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 587 of file hhctrl.c.

588 {
590 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 595 of file hhctrl.c.

596 {
598 }
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110
HINSTANCE hhctrl_hinstance
Definition: hhctrl.c:41

◆ doWinMain()

int WINAPI doWinMain ( HINSTANCE  hInstance,
LPSTR  szCmdLine 
)

Definition at line 492 of file hhctrl.c.

493 {
494  MSG msg;
495  int len, buflen, mapid = -1;
496  WCHAR *filename;
497  char *endq = NULL;
498  HWND hwnd;
499 
500  hh_process = TRUE;
501 
502  /* Parse command line option of the HTML Help command.
503  *
504  * Note: The only currently handled action is "mapid",
505  * which corresponds to opening a specific page.
506  */
507  while(*szCmdLine == '-')
508  {
509  LPSTR space, ptr;
510 
511  ptr = szCmdLine + 1;
512  space = strchr(ptr, ' ');
513  if(!strncmp(ptr, "mapid", space-ptr))
514  {
515  char idtxt[10];
516 
517  ptr += strlen("mapid")+1;
518  space = strchr(ptr, ' ');
519  /* command line ends without number */
520  if (!space)
521  return 0;
522  memcpy(idtxt, ptr, space-ptr);
523  idtxt[space-ptr] = '\0';
524  mapid = atoi(idtxt);
525  szCmdLine = space+1;
526  }
527  else
528  {
529  FIXME("Unhandled HTML Help command line parameter! (%.*s)\n", (int)(space-szCmdLine), szCmdLine);
530  return 0;
531  }
532  }
533 
534  /* FIXME: Check szCmdLine for bad arguments */
535  if (*szCmdLine == '\"')
536  endq = strchr(++szCmdLine, '\"');
537 
538  if (endq)
539  len = endq - szCmdLine;
540  else
541  len = strlen(szCmdLine);
542 
543  /* no filename given */
544  if (!len)
545  return 0;
546 
547  buflen = MultiByteToWideChar(CP_ACP, 0, szCmdLine, len, NULL, 0) + 1;
548  filename = heap_alloc(buflen * sizeof(WCHAR));
549  MultiByteToWideChar(CP_ACP, 0, szCmdLine, len, filename, buflen);
550  filename[buflen-1] = 0;
551 
552  /* Open a specific help topic */
553  if(mapid != -1)
555  else
557 
559 
560  if (!hwnd)
561  {
562  ERR("Failed to open HTML Help file '%s'.\n", szCmdLine);
563  return 0;
564  }
565 
566  while (GetMessageW(&msg, 0, 0, 0))
567  {
570  }
571 
572  return 0;
573 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CP_ACP
Definition: compat.h:99
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define HH_HELP_CONTEXT
Definition: htmlhelp.h:38
char * LPSTR
Definition: xmlstorage.h:182
const char * filename
Definition: ioapi.h:135
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR data)
Definition: hhctrl.c:149
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:622
BOOL hh_process
Definition: hhctrl.c:42
#define HH_DISPLAY_TOPIC
Definition: htmlhelp.h:22
__wchar_t WCHAR
Definition: xmlstorage.h:180
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define ERR(fmt,...)
Definition: debug.h:109
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define MultiByteToWideChar
Definition: compat.h:100
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define msg(x)
Definition: auth_time.c:54
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by WinMain().

◆ HtmlHelpA()

HWND WINAPI HtmlHelpA ( HWND  caller,
LPCSTR  filename,
UINT  command,
DWORD_PTR  data 
)

Definition at line 413 of file hhctrl.c.

414 {
415  WCHAR *wfile = strdupAtoW( filename );
416  HWND result = 0;
417 
418  if (data)
419  {
420  switch(command)
421  {
422  case HH_ALINK_LOOKUP:
423  case HH_DISPLAY_SEARCH:
425  case HH_GET_LAST_ERROR:
426  case HH_KEYWORD_LOOKUP:
427  case HH_SYNC:
428  FIXME("structures not handled yet\n");
429  break;
430 
431  case HH_SET_WIN_TYPE:
432  {
433  struct wintype_stringsW stringsW;
434  HH_WINTYPEW wdata;
435 
436  wintypeAtoW((HH_WINTYPEA *)data, &wdata, &stringsW);
437  result = HtmlHelpW( caller, wfile, command, (DWORD_PTR)&wdata );
438  wintype_stringsW_free(&stringsW);
439  goto done;
440  }
441  case HH_GET_WIN_TYPE:
442  {
443  HH_WINTYPEW wdata;
444  HHInfo *info;
445 
446  result = HtmlHelpW( caller, wfile, command, (DWORD_PTR)&wdata );
447  if (!wdata.pszType) break;
448  info = find_window(wdata.pszType);
449  if (!info) break;
450  wintype_stringsA_free(&info->stringsA);
451  wintypeWtoA(&wdata, (HH_WINTYPEA *)data, &info->stringsA);
452  goto done;
453  }
454 
455  case HH_DISPLAY_INDEX:
456  case HH_DISPLAY_TOPIC:
457  case HH_DISPLAY_TOC:
458  case HH_GET_WIN_HANDLE:
460  {
461  WCHAR *wdata = strdupAtoW( (const char *)data );
462  result = HtmlHelpW( caller, wfile, command, (DWORD_PTR)wdata );
463  heap_free(wdata);
464  goto done;
465  }
466 
467  case HH_CLOSE_ALL:
468  case HH_HELP_CONTEXT:
469  case HH_INITIALIZE:
472  case HH_TP_HELP_WM_HELP:
473  case HH_UNINITIALIZE:
474  /* either scalar or pointer to scalar - do nothing */
475  break;
476 
477  default:
478  FIXME("Unknown command: %s (%d)\n", command_to_string(command), command);
479  break;
480  }
481  }
482 
483  result = HtmlHelpW( caller, wfile, command, data );
484 done:
485  heap_free(wfile);
486  return result;
487 }
#define HH_ALINK_LOOKUP
Definition: htmlhelp.h:42
void wintype_stringsW_free(struct wintype_stringsW *stringsW)
Definition: help.c:1761
#define HH_SET_WIN_TYPE
Definition: htmlhelp.h:27
#define HH_TP_HELP_CONTEXTMENU
Definition: htmlhelp.h:39
#define HH_GET_WIN_HANDLE
Definition: htmlhelp.h:29
#define HH_SAFE_DISPLAY_TOPIC
Definition: htmlhelp.h:51
LPCWSTR pszType
Definition: htmlhelp.h:342
#define HH_PRETRANSLATEMESSAGE
Definition: htmlhelp.h:52
#define HH_KEYWORD_LOOKUP
Definition: htmlhelp.h:36
#define HH_DISPLAY_TOC
Definition: htmlhelp.h:24
#define HH_HELP_CONTEXT
Definition: htmlhelp.h:38
#define HH_GET_LAST_ERROR
Definition: htmlhelp.h:43
const char * filename
Definition: ioapi.h:135
#define HH_DISPLAY_SEARCH
Definition: htmlhelp.h:26
struct _test_info info[]
Definition: SetCursorPos.c:19
#define HH_INITIALIZE
Definition: htmlhelp.h:49
#define HH_DISPLAY_INDEX
Definition: htmlhelp.h:25
#define FIXME(fmt,...)
Definition: debug.h:110
HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR data)
Definition: hhctrl.c:149
#define HH_UNINITIALIZE
Definition: htmlhelp.h:50
#define HH_TP_HELP_WM_HELP
Definition: htmlhelp.h:40
#define HH_GET_WIN_TYPE
Definition: htmlhelp.h:28
#define HH_DISPLAY_TOPIC
Definition: htmlhelp.h:22
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const char * command_to_string(UINT command)
Definition: hhctrl.c:59
Definition: hhctrl.h:185
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static void wintypeAtoW(const HH_WINTYPEA *data, HH_WINTYPEW *wdata, struct wintype_stringsW *stringsW)
Definition: hhctrl.c:376
static void wintypeWtoA(const HH_WINTYPEW *wdata, HH_WINTYPEA *data, struct wintype_stringsA *stringsA)
Definition: hhctrl.c:393
#define HH_CLOSE_ALL
Definition: htmlhelp.h:41
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define HH_SYNC
Definition: htmlhelp.h:32
void wintype_stringsA_free(struct wintype_stringsA *stringsA)
Definition: help.c:1775
#define HH_DISPLAY_TEXT_POPUP
Definition: htmlhelp.h:37
HHInfo * find_window(const WCHAR *window)
Definition: help.c:1955
GLuint64EXT * result
Definition: glext.h:11304
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by HtmlHelp_Start().

◆ HtmlHelpW()

HWND WINAPI HtmlHelpW ( HWND  caller,
LPCWSTR  filename,
UINT  command,
DWORD_PTR  data 
)

Definition at line 149 of file hhctrl.c.

150 {
151  WCHAR fullname[MAX_PATH];
152 
153  TRACE("(%p, %s, command=%s, data=%lx)\n",
154  caller, debugstr_w( filename ),
156 
157  switch (command)
158  {
159  case HH_DISPLAY_TOPIC:
160  case HH_DISPLAY_TOC:
161  case HH_DISPLAY_INDEX:
162  case HH_DISPLAY_SEARCH:{
163  BOOL res;
164  NMHDR nmhdr;
165  HHInfo *info = NULL;
166  WCHAR *window = NULL;
167  const WCHAR *index = NULL;
168  WCHAR *default_index = NULL;
169  int tab_index = TAB_CONTENTS;
170 
171  if (!filename)
172  return NULL;
173 
174  if (!resolve_filename(filename, fullname, MAX_PATH, &default_index, &window))
175  {
176  WARN("can't find %s\n", debugstr_w(filename));
177  return 0;
178  }
179  index = default_index;
180 
181  if (window)
183 
184  info = CreateHelpViewer(info, fullname, caller);
185  if(!info)
186  {
187  heap_free(default_index);
188  heap_free(window);
189  return NULL;
190  }
191 
192  if(!index)
193  index = info->WinType.pszFile;
194  if(!info->WinType.pszType)
195  info->WinType.pszType = info->stringsW.pszType = window;
196  else
197  heap_free(window);
198 
199  /* called to load a specified topic */
200  switch(command)
201  {
202  case HH_DISPLAY_TOPIC:
203  case HH_DISPLAY_TOC:
204  if (data)
205  {
206  static const WCHAR delimW[] = {':',':',0};
207  const WCHAR *i = (const WCHAR *)data;
208 
209  index = strstrW(i, delimW);
210  if(index)
211  {
212  if(memcmp(info->pCHMInfo->szFile, i, index-i))
213  FIXME("Opening a CHM file in the context of another is not supported.\n");
214  index += strlenW(delimW);
215  }
216  else
217  index = i;
218  }
219  break;
220  }
221 
222  res = NavigateToChm(info, info->pCHMInfo->szFile, index);
223  heap_free(default_index);
224 
225  if(!res)
226  {
228  return NULL;
229  }
230 
231  switch(command)
232  {
233  case HH_DISPLAY_TOPIC:
234  case HH_DISPLAY_TOC:
235  tab_index = TAB_CONTENTS;
236  break;
237  case HH_DISPLAY_INDEX:
238  tab_index = TAB_INDEX;
239  if (data)
240  FIXME("Should select keyword '%s'.\n", debugstr_w((WCHAR *)data));
241  break;
242  case HH_DISPLAY_SEARCH:
243  tab_index = TAB_SEARCH;
244  if (data)
245  FIXME("Should display search specified by HH_FTS_QUERY structure.\n");
246  break;
247  }
248  /* open the requested tab */
249  memset(&nmhdr, 0, sizeof(nmhdr));
250  nmhdr.code = TCN_SELCHANGE;
251  SendMessageW(info->hwndTabCtrl, TCM_SETCURSEL, (WPARAM)info->tabs[tab_index].id, 0);
252  SendMessageW(info->WinType.hwndNavigation, WM_NOTIFY, 0, (LPARAM)&nmhdr);
253 
254  return info->WinType.hwndHelp;
255  }
256  case HH_HELP_CONTEXT: {
257  WCHAR *window = NULL;
258  HHInfo *info = NULL;
259  LPWSTR url;
260 
261  if (!filename)
262  return NULL;
263 
264  if (!resolve_filename(filename, fullname, MAX_PATH, NULL, &window))
265  {
266  WARN("can't find %s\n", debugstr_w(filename));
267  return 0;
268  }
269 
270  if (window)
272 
273  info = CreateHelpViewer(info, fullname, caller);
274  if(!info)
275  {
276  heap_free(window);
277  return NULL;
278  }
279 
280  if(!info->WinType.pszType)
281  info->WinType.pszType = info->stringsW.pszType = window;
282  else
283  heap_free(window);
284 
285  url = FindContextAlias(info->pCHMInfo, data);
286  if(!url)
287  {
288  if(!data) /* there may legitimately be no context alias for id 0 */
289  return info->WinType.hwndHelp;
291  return NULL;
292  }
293 
295  heap_free(url);
296  return info->WinType.hwndHelp;
297  }
298  case HH_PRETRANSLATEMESSAGE: {
299  static BOOL warned = FALSE;
300 
301  if (!warned)
302  {
303  FIXME("HH_PRETRANSLATEMESSAGE unimplemented\n");
304  warned = TRUE;
305  }
306  return 0;
307  }
308  case HH_CLOSE_ALL: {
309  HHInfo *info, *next;
310 
312  {
313  TRACE("Destroying window %s.\n", debugstr_w(info->WinType.pszType));
315  }
316  return 0;
317  }
318  case HH_SET_WIN_TYPE: {
319  HH_WINTYPEW *wintype = (HH_WINTYPEW *)data;
320  WCHAR *window = NULL;
321  HHInfo *info = NULL;
322 
323  if (!filename && wintype->pszType)
324  window = strdupW(wintype->pszType);
325  else if (!filename || !resolve_filename(filename, fullname, MAX_PATH, NULL, &window) || !window)
326  {
327  WARN("can't find window name: %s\n", debugstr_w(filename));
328  return 0;
329  }
331  if (!info)
332  {
333  info = heap_alloc_zero(sizeof(HHInfo));
334  info->WinType.pszType = info->stringsW.pszType = window;
335  list_add_tail(&window_list, &info->entry);
336  }
337  else
338  heap_free(window);
339 
340  TRACE("Changing WINTYPE, fsValidMembers=0x%x\n", wintype->fsValidMembers);
341 
342  MergeChmProperties(wintype, info, TRUE);
344  return 0;
345  }
346  case HH_GET_WIN_TYPE: {
347  HH_WINTYPEW *wintype = (HH_WINTYPEW *)data;
348  WCHAR *window = NULL;
349  HHInfo *info = NULL;
350 
351  if (!filename || !resolve_filename(filename, fullname, MAX_PATH, NULL, &window) || !window)
352  {
353  WARN("can't find window name: %s\n", debugstr_w(filename));
354  return 0;
355  }
357  if (!info)
358  {
359  WARN("Could not find window named %s.\n", debugstr_w(window));
360  heap_free(window);
361  return (HWND)~0;
362  }
363 
364  TRACE("Retrieving WINTYPE for %s.\n", debugstr_w(window));
365  *wintype = info->WinType;
366  heap_free(window);
367  return 0;
368  }
369  default:
370  FIXME("HH case %s not handled.\n", command_to_string( command ));
371  }
372 
373  return 0;
374 }
DWORD fsValidMembers
Definition: htmlhelp.h:343
#define HH_SET_WIN_TYPE
Definition: htmlhelp.h:27
#define TRUE
Definition: types.h:120
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
LPCWSTR pszType
Definition: htmlhelp.h:342
#define HH_PRETRANSLATEMESSAGE
Definition: htmlhelp.h:52
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
LPWSTR FindContextAlias(CHMInfo *chm, DWORD index)
Definition: chm.c:172
#define HH_DISPLAY_TOC
Definition: htmlhelp.h:24
#define WARN(fmt,...)
Definition: debug.h:111
HHInfo * CreateHelpViewer(HHInfo *info, LPCWSTR filename, HWND caller)
Definition: help.c:1819
#define TAB_CONTENTS
Definition: hhctrl.h:116
#define TCM_SETCURSEL
Definition: commctrl.h:4037
#define HH_HELP_CONTEXT
Definition: htmlhelp.h:38
UINT_PTR WPARAM
Definition: windef.h:207
BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
Definition: help.c:253
static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD buflen, WCHAR **index, WCHAR **window)
Definition: hhctrl.c:100
const char * filename
Definition: ioapi.h:135
#define HH_DISPLAY_SEARCH
Definition: htmlhelp.h:26
struct _test_info info[]
Definition: SetCursorPos.c:19
UINT code
Definition: winuser.h:3112
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void UpdateHelpWindow(HHInfo *info)
Definition: help.c:1559
unsigned int BOOL
Definition: ntddk_ex.h:94
#define HH_DISPLAY_INDEX
Definition: htmlhelp.h:25
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define strstrW(d, s)
Definition: unicode.h:32
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLuint index
Definition: glext.h:6031
#define HH_GET_WIN_TYPE
Definition: htmlhelp.h:28
#define HH_DISPLAY_TOPIC
Definition: htmlhelp.h:22
#define TCN_SELCHANGE
Definition: commctrl.h:4104
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
void MergeChmProperties(HH_WINTYPEW *src, HHInfo *info, BOOL override)
Definition: chm.c:253
static const WCHAR url[]
Definition: encode.c:1432
static const char * command_to_string(UINT command)
Definition: hhctrl.c:59
Definition: hhctrl.h:185
#define MAX_PATH
Definition: compat.h:26
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void ReleaseHelpViewer(HHInfo *info)
Definition: help.c:1790
#define HH_CLOSE_ALL
Definition: htmlhelp.h:41
uint32_t entry
Definition: isohybrid.c:63
#define TAB_SEARCH
Definition: hhctrl.h:118
static IHTMLWindow2 * window
Definition: events.c:77
#define TAB_INDEX
Definition: hhctrl.h:117
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
struct list window_list
Definition: help.c:51
BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl)
Definition: help.c:209
GLuint res
Definition: glext.h:9613
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HHInfo * find_window(const WCHAR *window)
Definition: help.c:1955
#define memset(x, y, z)
Definition: compat.h:39
#define WM_NOTIFY
Definition: richedit.h:61
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by doWinMain(), HtmlHelp_Start(), HtmlHelpA(), and OnCommand().

◆ resolve_filename()

static BOOL resolve_filename ( const WCHAR filename,
WCHAR fullname,
DWORD  buflen,
WCHAR **  index,
WCHAR **  window 
)
static

Definition at line 100 of file hhctrl.c.

101 {
102  const WCHAR *extra;
103  WCHAR chm_file[MAX_PATH];
104 
105  static const WCHAR helpW[] = {'\\','h','e','l','p','\\',0};
106  static const WCHAR delimW[] = {':',':',0};
107  static const WCHAR delim2W[] = {'>',0};
108 
110 
111  /* the format is "helpFile[::/index][>window]" */
112  if (index) *index = NULL;
113  if (window) *window = NULL;
114 
115  extra = strstrW(filename, delim2W);
116  if (extra)
117  {
118  memcpy(chm_file, filename, (extra-filename)*sizeof(WCHAR));
119  chm_file[extra-filename] = 0;
120  filename = chm_file;
121  if (window)
122  *window = strdupW(extra+1);
123  }
124 
125  extra = strstrW(filename, delimW);
126  if (extra)
127  {
128  if (filename != chm_file)
129  memcpy(chm_file, filename, (extra-filename)*sizeof(WCHAR));
130  chm_file[extra-filename] = 0;
131  filename = chm_file;
132  if (index)
133  *index = strdupW(extra+2);
134  }
135 
136  GetFullPathNameW(filename, buflen, fullname, NULL);
138  {
139  GetWindowsDirectoryW(fullname, buflen);
140  strcatW(fullname, helpW);
141  strcatW(fullname, filename);
142  }
143  return (GetFileAttributesW(fullname) != INVALID_FILE_ATTRIBUTES);
144 }
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
const char * filename
Definition: ioapi.h:135
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
#define strstrW(d, s)
Definition: unicode.h:32
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
Definition: id3.c:18
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static IHTMLWindow2 * window
Definition: events.c:77
static const WCHAR helpW[]
Definition: htmlevent.c:70
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
LPCWSTR skip_schema(LPCWSTR url)
Definition: chm.c:480

Referenced by HtmlHelpW().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( htmlhelp  )

◆ wintypeAtoW()

static void wintypeAtoW ( const HH_WINTYPEA data,
HH_WINTYPEW wdata,
struct wintype_stringsW stringsW 
)
static

Definition at line 376 of file hhctrl.c.

377 {
378  memcpy(wdata, data, sizeof(*data));
379  /* convert all of the ANSI strings to Unicode */
380  wdata->pszType = stringsW->pszType = strdupAtoW(data->pszType);
381  wdata->pszCaption = stringsW->pszCaption = strdupAtoW(data->pszCaption);
382  wdata->pszToc = stringsW->pszToc = strdupAtoW(data->pszToc);
383  wdata->pszIndex = stringsW->pszIndex = strdupAtoW(data->pszIndex);
384  wdata->pszFile = stringsW->pszFile = strdupAtoW(data->pszFile);
385  wdata->pszHome = stringsW->pszHome = strdupAtoW(data->pszHome);
386  wdata->pszJump1 = stringsW->pszJump1 = strdupAtoW(data->pszJump1);
387  wdata->pszJump2 = stringsW->pszJump2 = strdupAtoW(data->pszJump2);
388  wdata->pszUrlJump1 = stringsW->pszUrlJump1 = strdupAtoW(data->pszUrlJump1);
389  wdata->pszUrlJump2 = stringsW->pszUrlJump2 = strdupAtoW(data->pszUrlJump2);
390  wdata->pszCustomTabs = stringsW->pszCustomTabs = strdupAtoW(data->pszCustomTabs);
391 }
WCHAR * pszCustomTabs
Definition: hhctrl.h:155
LPCWSTR pszIndex
Definition: htmlhelp.h:359
WCHAR * pszJump1
Definition: hhctrl.h:151
LPCWSTR pszType
Definition: htmlhelp.h:342
WCHAR * pszType
Definition: hhctrl.h:145
WCHAR * pszJump2
Definition: hhctrl.h:152
LPCWSTR pszCaption
Definition: htmlhelp.h:345
WCHAR * pszToc
Definition: hhctrl.h:147
LPCWSTR pszToc
Definition: htmlhelp.h:358
WCHAR * pszUrlJump2
Definition: hhctrl.h:154
LPCWSTR pszJump2
Definition: htmlhelp.h:370
LPCWSTR pszHome
Definition: htmlhelp.h:361
WCHAR * pszHome
Definition: hhctrl.h:150
LPCWSTR pszUrlJump1
Definition: htmlhelp.h:371
LPCWSTR pszCustomTabs
Definition: htmlhelp.h:375
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
LPCWSTR pszFile
Definition: htmlhelp.h:360
LPCWSTR pszUrlJump2
Definition: htmlhelp.h:372
WCHAR * pszUrlJump1
Definition: hhctrl.h:153
WCHAR * pszIndex
Definition: hhctrl.h:148
LPCWSTR pszJump1
Definition: htmlhelp.h:369
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
WCHAR * pszFile
Definition: hhctrl.h:149
WCHAR * pszCaption
Definition: hhctrl.h:146

Referenced by HtmlHelpA().

◆ wintypeWtoA()

static void wintypeWtoA ( const HH_WINTYPEW wdata,
HH_WINTYPEA data,
struct wintype_stringsA stringsA 
)
static

Definition at line 393 of file hhctrl.c.

394 {
395  memcpy(data, wdata, sizeof(*wdata));
396  /* convert all of the Unicode strings to ANSI */
397  data->pszType = stringsA->pszType = strdupWtoA(wdata->pszType);
398  data->pszCaption = stringsA->pszCaption = strdupWtoA(wdata->pszCaption);
399  data->pszToc = stringsA->pszToc = strdupWtoA(wdata->pszToc);
400  data->pszIndex = stringsA->pszFile = strdupWtoA(wdata->pszIndex);
401  data->pszFile = stringsA->pszFile = strdupWtoA(wdata->pszFile);
402  data->pszHome = stringsA->pszHome = strdupWtoA(wdata->pszHome);
403  data->pszJump1 = stringsA->pszJump1 = strdupWtoA(wdata->pszJump1);
404  data->pszJump2 = stringsA->pszJump2 = strdupWtoA(wdata->pszJump2);
405  data->pszUrlJump1 = stringsA->pszUrlJump1 = strdupWtoA(wdata->pszUrlJump1);
406  data->pszUrlJump2 = stringsA->pszUrlJump2 = strdupWtoA(wdata->pszUrlJump2);
407  data->pszCustomTabs = stringsA->pszCustomTabs = strdupWtoA(wdata->pszCustomTabs);
408 }
char * pszToc
Definition: hhctrl.h:161
LPCWSTR pszIndex
Definition: htmlhelp.h:359
LPCWSTR pszType
Definition: htmlhelp.h:342
char * pszUrlJump1
Definition: hhctrl.h:167
static LPSTR strdupWtoA(LPCWSTR str)
Definition: hhctrl.h:296
LPCWSTR pszCaption
Definition: htmlhelp.h:345
char * pszCaption
Definition: hhctrl.h:160
char * pszJump1
Definition: hhctrl.h:165
char * pszCustomTabs
Definition: hhctrl.h:169
LPCWSTR pszToc
Definition: htmlhelp.h:358
LPCWSTR pszJump2
Definition: htmlhelp.h:370
LPCWSTR pszHome
Definition: htmlhelp.h:361
char * pszJump2
Definition: hhctrl.h:166
LPCWSTR pszUrlJump1
Definition: htmlhelp.h:371
LPCWSTR pszCustomTabs
Definition: htmlhelp.h:375
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
char * pszType
Definition: hhctrl.h:159
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
LPCWSTR pszFile
Definition: htmlhelp.h:360
LPCWSTR pszUrlJump2
Definition: htmlhelp.h:372
LPCWSTR pszJump1
Definition: htmlhelp.h:369
char * pszUrlJump2
Definition: hhctrl.h:168
char * pszFile
Definition: hhctrl.h:163
char * pszHome
Definition: hhctrl.h:164

Referenced by HtmlHelpA().

Variable Documentation

◆ hh_process

BOOL hh_process = FALSE

Definition at line 42 of file hhctrl.c.

Referenced by doWinMain(), and Help_WndProc().

◆ hhctrl_hinstance