ReactOS  0.4.12-dev-57-g7050ac4
winhelp.h File Reference
#include <stdarg.h>
#include "hlpfile.h"
#include "windef.h"
#include "winbase.h"
#include "macro.h"
#include "winhelp_res.h"
Include dependency graph for winhelp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagHelpButton
 
struct  WINHELP_WNDPAGE
 
struct  tagPageSet
 
struct  tagWinHelp
 
struct  tagDll
 
struct  WINHELP_GLOBALS
 
struct  winhelp_callbacks
 

Macros

#define MAX_LANGUAGE_NUMBER   255
 
#define MAX_STRING_LEN   255
 
#define INTERNAL_BORDER_WIDTH   5
 
#define POPUP_YDISTANCE   20
 
#define SHADOW_DX   10
 
#define SHADOW_DY   10
 
#define BUTTON_CX   6
 
#define BUTTON_CY   6
 
#define DC_NOMSG   0x00000000
 
#define DC_MINMAX   0x00000001
 
#define DC_INITTERM   0x00000002
 
#define DC_JUMP   0x00000004
 
#define DC_ACTIVATE   0x00000008
 
#define DC_CALLBACKS   0x00000010
 
#define DW_NOTUSED   0
 
#define DW_WHATMSG   1
 
#define DW_MINMAX   2
 
#define DW_SIZE   3
 
#define DW_INIT   4
 
#define DW_TERM   5
 
#define DW_STARTJUMP   6
 
#define DW_ENDJUMP   7
 
#define DW_CHGFILE   8
 
#define DW_ACTIVATE   9
 
#define DW_CALLBACKS   10
 
#define WH_FIRST_BUTTON   500
 

Typedefs

typedef struct tagHelpButton WINHELP_BUTTON
 
typedef struct tagPageSet WINHELP_PAGESET
 
typedef struct tagWinHelp WINHELP_WINDOW
 
typedef LONG(CALLBACKWINHELP_LDLLHandler) (WORD, LONG_PTR, LONG_PTR)
 
typedef struct tagDll WINHELP_DLL
 

Functions

BOOL WINHELP_CreateHelpWindow (WINHELP_WNDPAGE *, int, BOOL)
 
BOOL WINHELP_OpenHelpWindow (HLPFILE_PAGE *(*)(HLPFILE *, LONG, ULONG *), HLPFILE *, LONG, HLPFILE_WINDOWINFO *, int)
 
BOOL WINHELP_GetOpenFileName (LPSTR, int)
 
BOOL WINHELP_CreateIndexWindow (BOOL)
 
void WINHELP_DeleteBackSet (WINHELP_WINDOW *)
 
HLPFILEWINHELP_LookupHelpFile (LPCSTR lpszFile)
 
HLPFILE_WINDOWINFOWINHELP_GetWindowInfo (HLPFILE *hlpfile, LPCSTR name)
 
void WINHELP_LayoutMainWindow (WINHELP_WINDOW *win)
 
WINHELP_WINDOWWINHELP_GrabWindow (WINHELP_WINDOW *)
 
BOOL WINHELP_ReleaseWindow (WINHELP_WINDOW *)
 

Variables

const struct winhelp_callbacks Callbacks
 
WINHELP_GLOBALS Globals
 
const char MAIN_WIN_CLASS_NAME []
 
const char BUTTON_BOX_WIN_CLASS_NAME []
 
const char TEXT_WIN_CLASS_NAME []
 
const char SHADOW_WIN_CLASS_NAME []
 
const char HISTORY_WIN_CLASS_NAME []
 
const char STRING_BUTTON []
 
const char STRING_MENU_Xx []
 
const char STRING_DIALOG_TEST []
 

Macro Definition Documentation

◆ BUTTON_CX

#define BUTTON_CX   6

Definition at line 32 of file winhelp.h.

Referenced by WINHELP_ButtonBoxWndProc().

◆ BUTTON_CY

#define BUTTON_CY   6

Definition at line 33 of file winhelp.h.

Referenced by WINHELP_ButtonBoxWndProc().

◆ DC_ACTIVATE

#define DC_ACTIVATE   0x00000008

Definition at line 104 of file winhelp.h.

◆ DC_CALLBACKS

#define DC_CALLBACKS   0x00000010

Definition at line 105 of file winhelp.h.

Referenced by MACRO_RegisterRoutine().

◆ DC_INITTERM

#define DC_INITTERM   0x00000002

Definition at line 102 of file winhelp.h.

Referenced by MACRO_RegisterRoutine(), and WinMain().

◆ DC_JUMP

#define DC_JUMP   0x00000004

Definition at line 103 of file winhelp.h.

◆ DC_MINMAX

#define DC_MINMAX   0x00000001

Definition at line 101 of file winhelp.h.

◆ DC_NOMSG

#define DC_NOMSG   0x00000000

Definition at line 100 of file winhelp.h.

Referenced by MACRO_RegisterRoutine().

◆ DW_ACTIVATE

#define DW_ACTIVATE   9

Definition at line 116 of file winhelp.h.

◆ DW_CALLBACKS

#define DW_CALLBACKS   10

Definition at line 117 of file winhelp.h.

Referenced by MACRO_RegisterRoutine().

◆ DW_CHGFILE

#define DW_CHGFILE   8

Definition at line 115 of file winhelp.h.

◆ DW_ENDJUMP

#define DW_ENDJUMP   7

Definition at line 114 of file winhelp.h.

◆ DW_INIT

#define DW_INIT   4

Definition at line 111 of file winhelp.h.

Referenced by MACRO_RegisterRoutine().

◆ DW_MINMAX

#define DW_MINMAX   2

Definition at line 109 of file winhelp.h.

◆ DW_NOTUSED

#define DW_NOTUSED   0

Definition at line 107 of file winhelp.h.

◆ DW_SIZE

#define DW_SIZE   3

Definition at line 110 of file winhelp.h.

◆ DW_STARTJUMP

#define DW_STARTJUMP   6

Definition at line 113 of file winhelp.h.

◆ DW_TERM

#define DW_TERM   5

Definition at line 112 of file winhelp.h.

Referenced by WinMain().

◆ DW_WHATMSG

#define DW_WHATMSG   1

Definition at line 108 of file winhelp.h.

Referenced by MACRO_RegisterRoutine().

◆ INTERNAL_BORDER_WIDTH

#define INTERNAL_BORDER_WIDTH   5

Definition at line 28 of file winhelp.h.

◆ MAX_LANGUAGE_NUMBER

#define MAX_LANGUAGE_NUMBER   255

Definition at line 25 of file winhelp.h.

◆ MAX_STRING_LEN

#define MAX_STRING_LEN   255

Definition at line 26 of file winhelp.h.

◆ POPUP_YDISTANCE

#define POPUP_YDISTANCE   20

Definition at line 29 of file winhelp.h.

◆ SHADOW_DX

#define SHADOW_DX   10

Definition at line 30 of file winhelp.h.

◆ SHADOW_DY

#define SHADOW_DY   10

Definition at line 31 of file winhelp.h.

◆ WH_FIRST_BUTTON

#define WH_FIRST_BUTTON   500

Definition at line 190 of file winhelp.h.

Referenced by MACRO_CreateButton().

Typedef Documentation

◆ WINHELP_BUTTON

◆ WINHELP_DLL

◆ WINHELP_LDLLHandler

typedef LONG(CALLBACK * WINHELP_LDLLHandler) (WORD, LONG_PTR, LONG_PTR)

Definition at line 119 of file winhelp.h.

◆ WINHELP_PAGESET

◆ WINHELP_WINDOW

Function Documentation

◆ WINHELP_CreateHelpWindow()

BOOL WINHELP_CreateHelpWindow ( WINHELP_WNDPAGE ,
int  ,
BOOL   
)

Definition at line 698 of file winhelp.c.

Referenced by MACRO_Back(), MACRO_Next(), MACRO_Prev(), WINHELP_HistoryWndProc(), and WINHELP_OpenHelpWindow().

699 {
701  BOOL bPrimary, bPopup, bReUsed = FALSE;
702  HICON hIcon;
703  HWND hTextWnd = NULL;
704 
705  bPrimary = !lstrcmpiA(wpage->wininfo->name, "main");
706  bPopup = !bPrimary && (wpage->wininfo->win_style & WS_POPUP);
707 
708  if (!bPopup)
709  {
710  for (win = Globals.win_list; win; win = win->next)
711  {
712  if (!lstrcmpiA(win->info->name, wpage->wininfo->name))
713  {
714  if (win->page == wpage->page && win->info == wpage->wininfo)
715  {
716  /* see #22979, some hlp files have a macro (run at page opening), which
717  * jumps to the very same page
718  * Exit gracefully in that case
719  */
720  return TRUE;
721  }
723  bReUsed = TRUE;
725  if (win->info != wpage->wininfo)
726  {
727  POINT pt = {0, 0};
728  SIZE sz = {0, 0};
730 
731  if (wpage->wininfo->origin.x != CW_USEDEFAULT &&
732  wpage->wininfo->origin.y != CW_USEDEFAULT)
733  {
734  pt = wpage->wininfo->origin;
735  flags &= ~SWP_NOSIZE;
736  }
737  if (wpage->wininfo->size.cx != CW_USEDEFAULT &&
738  wpage->wininfo->size.cy != CW_USEDEFAULT)
739  {
740  sz = wpage->wininfo->size;
741  flags &= ~SWP_NOMOVE;
742  }
743  SetWindowPos(win->hMainWnd, HWND_TOP, pt.x, pt.y, sz.cx, sz.cy, flags);
744  }
745 
746  if (wpage->page && win->page && wpage->page->file != win->page->file)
749 
750  win->page = wpage->page;
751  win->info = wpage->wininfo;
752  hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT);
753  WINHELP_SetupText(hTextWnd, win, wpage->relative);
754 
756  if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE);
757 
758  break;
759  }
760  }
761  }
762 
763  if (!win)
764  {
765  /* Initialize WINHELP_WINDOW struct */
767  if (!win) return FALSE;
768  win->next = Globals.win_list;
769  Globals.win_list = win;
770 
771  win->hHandCur = LoadCursorW(0, (LPWSTR)IDC_HAND);
772  win->back.index = 0;
773  win->font_scale = 1;
774  WINHELP_GrabWindow(win);
775  }
776  win->page = wpage->page;
777  win->info = wpage->wininfo;
778  WINHELP_GrabWindow(win);
779 
780  if (!bPopup && wpage->page && remember)
781  {
782  WINHELP_RememberPage(win, wpage);
783  }
784 
785  if (bPopup)
787  else
789 
790  /* Initialize default pushbuttons */
791  if (bPrimary && wpage->page)
792  {
794 
795  LoadStringA(Globals.hInstance, STID_CONTENTS, buffer, sizeof(buffer));
796  MACRO_CreateButton("BTN_CONTENTS", buffer, "Contents()");
797  LoadStringA(Globals.hInstance, STID_INDEX, buffer, sizeof(buffer));
798  MACRO_CreateButton("BTN_INDEX", buffer, "Finder()");
799  LoadStringA(Globals.hInstance, STID_BACK, buffer, sizeof(buffer));
800  MACRO_CreateButton("BTN_BACK", buffer, "Back()");
801  if (win->back.index <= 1) MACRO_DisableButton("BTN_BACK");
802  }
803 
804  if (!bReUsed)
805  {
807  WINHELP_GetCaption(wpage),
808  bPrimary ? WS_OVERLAPPEDWINDOW : wpage->wininfo->win_style,
809  wpage->wininfo->origin.x, wpage->wininfo->origin.y,
810  wpage->wininfo->size.cx, wpage->wininfo->size.cy,
811  bPopup ? Globals.active_win->hMainWnd : NULL,
813  Globals.hInstance, win);
814  if (!bPopup)
815  /* Create button box and text Window */
817  0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_BUTTON, Globals.hInstance, NULL);
818 
819  hTextWnd = CreateWindowA(RICHEDIT_CLASS20A, NULL,
821  0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_TEXT, Globals.hInstance, NULL);
822  SendMessageW(hTextWnd, EM_SETEVENTMASK, 0,
823  SendMessageW(hTextWnd, EM_GETEVENTMASK, 0, 0) | ENM_MOUSEEVENTS);
826  }
827 
828  hIcon = (wpage->page) ? wpage->page->file->hIcon : NULL;
831  SendMessageW(win->hMainWnd, WM_SETICON, ICON_SMALL, (DWORD_PTR)hIcon);
832 
833  /* Initialize file specific pushbuttons */
834  if (!(wpage->wininfo->win_style & WS_POPUP) && wpage->page)
835  {
836  HLPFILE_MACRO *macro;
837  for (macro = wpage->page->file->first_macro; macro; macro = macro->next)
838  MACRO_ExecuteMacro(win, macro->lpszMacro);
839 
840  for (macro = wpage->page->first_macro; macro; macro = macro->next)
841  MACRO_ExecuteMacro(win, macro->lpszMacro);
842  }
843  /* See #17681, in some cases, the newly created window is closed by the macros it contains
844  * (braindead), so deal with this case
845  */
846  for (win = Globals.win_list; win; win = win->next)
847  {
848  if (!lstrcmpiA(win->info->name, wpage->wininfo->name)) break;
849  }
850  if (!win || !WINHELP_ReleaseWindow(win)) return TRUE;
851 
852  if (bPopup)
853  {
854  DWORD mask = SendMessageW(hTextWnd, EM_GETEVENTMASK, 0, 0);
855 
857  WINHELP_SetupText(hTextWnd, win, wpage->relative);
858 
859  /* we need the window to be shown for richedit to compute the size */
860  ShowWindow(win->hMainWnd, nCmdShow);
861  SendMessageW(hTextWnd, EM_SETEVENTMASK, 0, mask | ENM_REQUESTRESIZE);
862  SendMessageW(hTextWnd, EM_REQUESTRESIZE, 0, 0);
863  SendMessageW(hTextWnd, EM_SETEVENTMASK, 0, mask);
864  }
865  else
866  {
867  WINHELP_SetupText(hTextWnd, win, wpage->relative);
869  ShowWindow(win->hMainWnd, nCmdShow);
870  }
871 
872  return TRUE;
873 }
LPCSTR lpszMacro
Definition: hlpfile.h:64
static void WINHELP_RememberPage(WINHELP_WINDOW *win, WINHELP_WNDPAGE *wpage)
Definition: winhelp.c:592
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
#define CTL_ID_TEXT
Definition: winhelp.c:51
long y
Definition: polytest.cpp:48
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
long x
Definition: polytest.cpp:48
#define EM_GETEVENTMASK
Definition: richedit.h:92
#define pt(x, y)
Definition: drawing.c:79
#define ENM_MOUSEEVENTS
Definition: richedit.h:476
struct tagHlpFileFile * file
Definition: hlpfile.h:84
char CHAR
Definition: xmlstorage.h:175
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
#define ES_MULTILINE
Definition: pedump.c:667
#define MAIN_MENU
Definition: resources.h:12
HANDLE hInstance
Definition: winhelp.h:133
static void WINHELP_InitFonts(HWND hWnd)
Definition: winhelp.c:58
void WINHELP_DeleteBackSet(WINHELP_WINDOW *win)
Definition: winhelp.c:481
#define HWND_TOP
Definition: winuser.h:1193
GLuint buffer
Definition: glext.h:5915
#define SM_CYSMICON
Definition: winuser.h:1003
#define MAX_STRING_LEN
Definition: precomp.h:36
#define ES_READONLY
Definition: pedump.c:675
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
WINHELP_WINDOW * active_popup
Definition: winhelp.h:136
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define ICON_SMALL
Definition: tnclass.cpp:48
#define STID_INDEX
Definition: winhelp_res.h:43
GLenum GLint GLuint mask
Definition: glext.h:6028
BOOL WINHELP_ReleaseWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:524
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
struct tagHlpFileMacro * next
Definition: hlpfile.h:65
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4184
#define CW_USEDEFAULT
Definition: winuser.h:225
WINHELP_WINDOW * win_list
Definition: winhelp.h:137
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:324
void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro)
Definition: macro.c:73
WINHELP_WINDOW * WINHELP_GrabWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:513
unsigned index
Definition: winhelp.h:71
#define IDI_WINHELP
Definition: winhelp_res.h:56
#define EM_SETEVENTMASK
Definition: richedit.h:102
const char MAIN_WIN_CLASS_NAME[]
Definition: string.c:23
char name[9]
Definition: hlpfile.h:30
#define STID_CONTENTS
Definition: winhelp_res.h:42
#define IDC_HAND
Definition: winuser.h:693
unsigned int BOOL
Definition: ntddk_ex.h:94
void WINHELP_LayoutMainWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:434
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
if(!(yy_init))
Definition: macro.lex.yy.c:717
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
static char * WINHELP_GetCaption(WINHELP_WNDPAGE *wpage)
Definition: winhelp.c:586
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define WS_HSCROLL
Definition: pedump.c:628
GLbitfield flags
Definition: glext.h:7161
#define SM_CXSMICON
Definition: winuser.h:1002
#define CTL_ID_BUTTON
Definition: winhelp.c:50
static LRESULT CALLBACK WINHELP_RicheditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: winhelp.c:670
#define SetWindowLongPtrA
Definition: winuser.h:5214
BOOL MACRO_ExecuteMacro(struct tagWinHelp *, LPCSTR)
uint32_t DWORD_PTR
Definition: typedefs.h:63
WNDPROC origRicheditWndProc
Definition: winhelp.h:83
#define EM_REQUESTRESIZE
Definition: richedit.h:98
#define GWLP_WNDPROC
Definition: treelist.c:66
void CALLBACK MACRO_DisableButton(LPCSTR id)
Definition: macro.c:116
#define SWP_NOSIZE
Definition: winuser.h:1230
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
HWND hHistoryWnd
Definition: winhelp.h:81
HCURSOR hHandCur
Definition: winhelp.h:88
static real win[4][36]
HWND hMainWnd
Definition: winhelp.h:80
HICON hIcon
Definition: msconfig.c:44
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define RICHEDIT_CLASS20A
Definition: richedit.h:43
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define STID_BACK
Definition: winhelp_res.h:44
#define ENM_REQUESTRESIZE
Definition: richedit.h:477
#define WS_POPUP
Definition: pedump.c:616
#define WS_VSCROLL
Definition: pedump.c:627
WINHELP_WINDOW * active_win
Definition: winhelp.h:135
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR 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)
WINHELP_PAGESET back
Definition: winhelp.h:94
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define SWP_NOMOVE
Definition: winuser.h:1229
HLPFILE_WINDOWINFO * info
Definition: winhelp.h:92
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static void WINHELP_DeleteButtons(WINHELP_WINDOW *win)
Definition: winhelp.c:463
HLPFILE_PAGE * page
Definition: winhelp.h:78
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const char BUTTON_BOX_WIN_CLASS_NAME[]
Definition: string.c:24
#define WS_VISIBLE
Definition: pedump.c:620
WINHELP_GLOBALS Globals
Definition: winhelp.c:48
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LONG cy
Definition: windef.h:325
static void WINHELP_SetupText(HWND hTextWnd, WINHELP_WINDOW *win, ULONG relative)
Definition: winhelp.c:104
unsigned font_scale
Definition: winhelp.h:95
struct tagWinHelp * next
Definition: winhelp.h:97

◆ WINHELP_CreateIndexWindow()

BOOL WINHELP_CreateIndexWindow ( BOOL  )

Definition at line 1542 of file winhelp.c.

Referenced by MACRO_Finder(), and MACRO_Search().

1543 {
1544  HPROPSHEETPAGE psPage[3];
1545  PROPSHEETPAGEA psp;
1546  PROPSHEETHEADERA psHead;
1547  struct index_data id;
1548  char buf[256];
1549 
1552  else
1553  return FALSE;
1554 
1555  if (id.hlpfile->kwbtree == NULL)
1556  {
1557  WINE_TRACE("No index provided\n");
1558  return FALSE;
1559  }
1560 
1562 
1563  id.jump = FALSE;
1564  memset(&psp, 0, sizeof(psp));
1565  psp.dwSize = sizeof(psp);
1566  psp.dwFlags = 0;
1567  psp.hInstance = Globals.hInstance;
1568 
1570  psp.lParam = (LPARAM)&id;
1572  psPage[0] = CreatePropertySheetPageA(&psp);
1573 
1575  psp.lParam = (LPARAM)&id;
1577  psPage[1] = CreatePropertySheetPageA(&psp);
1578 
1579  memset(&psHead, 0, sizeof(psHead));
1580  psHead.dwSize = sizeof(psHead);
1581 
1582  LoadStringA(Globals.hInstance, STID_PSH_INDEX, buf, sizeof(buf));
1584 
1585  psHead.pszCaption = buf;
1586  psHead.nPages = 2;
1587  psHead.u2.nStartPage = is_search ? 1 : 0;
1589  psHead.u3.phpage = psPage;
1590  psHead.dwFlags = PSH_NOAPPLYNOW;
1591 
1592  PropertySheetA(&psHead);
1593  if (id.jump)
1594  {
1595  WINE_TRACE("got %d as an offset\n", id.offset);
1598  }
1599  return TRUE;
1600 }
#define SW_NORMAL
Definition: winuser.h:763
#define TRUE
Definition: types.h:120
#define PSH_NOAPPLYNOW
Definition: prsht.h:47
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
DWORD dwSize
Definition: prsht.h:177
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
struct tagHlpFileFile * file
Definition: hlpfile.h:84
#define IDD_SEARCH
Definition: winhelp_res.h:54
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
LPCSTR pszCaption
Definition: prsht.h:248
GLintptr offset
Definition: glext.h:5920
HANDLE hInstance
Definition: winhelp.h:133
char caption[51]
Definition: hlpfile.h:31
#define WINE_TRACE
Definition: debug.h:353
LPCSTR pszTemplate
Definition: prsht.h:181
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
UINT nStartPage
Definition: prsht.h:251
static INT_PTR CALLBACK WINHELP_SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: winhelp.c:1293
HLPFILE_PAGE * HLPFILE_PageByOffset(HLPFILE *hlpfile, LONG offset, ULONG *relative)
Definition: hlpfile.c:369
HWND hwndParent
Definition: prsht.h:242
#define STID_PSH_INDEX
Definition: winhelp_res.h:50
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
HINSTANCE hInstance
Definition: prsht.h:179
smooth NULL
Definition: ftsmooth.c:416
BOOL WINHELP_OpenHelpWindow(HLPFILE_PAGE *(*lookup)(HLPFILE *, LONG, ULONG *), HLPFILE *hlpfile, LONG val, HLPFILE_WINDOWINFO *wi, int nCmdShow)
Definition: winhelp.c:879
HPROPSHEETPAGE * phpage
Definition: prsht.h:256
INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
Definition: propsheet.c:2855
DWORD dwSize
Definition: prsht.h:240
LPARAM lParam
Definition: prsht.h:190
DWORD dwFlags
Definition: prsht.h:241
BOOL jump
Definition: winhelp.c:1218
DWORD dwFlags
Definition: prsht.h:178
HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA lpPropSheetPage)
Definition: propsheet.c:2982
HWND hMainWnd
Definition: winhelp.h:80
#define IDD_INDEX
Definition: winhelp_res.h:52
WINHELP_WINDOW * active_win
Definition: winhelp.h:135
BYTE * kwbtree
Definition: hlpfile.h:111
static INT_PTR CALLBACK WINHELP_IndexDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: winhelp.c:1226
HLPFILE * hlpfile
Definition: winhelp.c:1217
GLenum GLuint id
Definition: glext.h:5579
HLPFILE_WINDOWINFO * info
Definition: winhelp.h:92
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
HLPFILE_PAGE * page
Definition: winhelp.h:78
#define memset(x, y, z)
Definition: compat.h:39
WINHELP_GLOBALS Globals
Definition: winhelp.c:48
DLGPROC pfnDlgProc
Definition: prsht.h:189
#define LPARAM
Definition: msvc.h:38

◆ WINHELP_DeleteBackSet()

void WINHELP_DeleteBackSet ( WINHELP_WINDOW )

Definition at line 481 of file winhelp.c.

Referenced by MACRO_BackFlush(), WINHELP_CreateHelpWindow(), and WINHELP_DeleteWindow().

482 {
483  unsigned int i;
484 
485  for (i = 0; i < win->back.index; i++)
486  {
487  HLPFILE_FreeHlpFile(win->back.set[i].page->file);
488  win->back.set[i].page = NULL;
489  }
490  win->back.index = 0;
491 }
void HLPFILE_FreeHlpFile(HLPFILE *hlpfile)
Definition: hlpfile.c:2297
GLenum GLclampf GLint i
Definition: glfuncs.h:14
smooth NULL
Definition: ftsmooth.c:416
static real win[4][36]

◆ WINHELP_GetOpenFileName()

BOOL WINHELP_GetOpenFileName ( LPSTR  ,
int   
)

Definition at line 146 of file winhelp.c.

Referenced by MACRO_FileOpen(), and WINHELP_LookupHelpFile().

147 {
148  OPENFILENAMEA openfilename;
149  CHAR szDir[MAX_PATH];
150  CHAR szzFilter[2 * MAX_STRING_LEN + 100];
151  LPSTR p = szzFilter;
152 
153  WINE_TRACE("()\n");
154 
156  p += strlen(p) + 1;
157  strcpy(p, "*.hlp");
158  p += strlen(p) + 1;
160  p += strlen(p) + 1;
161  strcpy(p, "*.*");
162  p += strlen(p) + 1;
163  *p = '\0';
164 
165  GetCurrentDirectoryA(sizeof(szDir), szDir);
166 
167  lpszFile[0]='\0';
168 
169  openfilename.lStructSize = sizeof(openfilename);
170  openfilename.hwndOwner = (Globals.active_win ? Globals.active_win->hMainWnd : 0);
171  openfilename.hInstance = Globals.hInstance;
172  openfilename.lpstrFilter = szzFilter;
173  openfilename.lpstrCustomFilter = 0;
174  openfilename.nMaxCustFilter = 0;
175  openfilename.nFilterIndex = 1;
176  openfilename.lpstrFile = lpszFile;
177  openfilename.nMaxFile = len;
178  openfilename.lpstrFileTitle = 0;
179  openfilename.nMaxFileTitle = 0;
180  openfilename.lpstrInitialDir = szDir;
181  openfilename.lpstrTitle = 0;
183  openfilename.nFileOffset = 0;
184  openfilename.nFileExtension = 0;
185  openfilename.lpstrDefExt = 0;
186  openfilename.lCustData = 0;
187  openfilename.lpfnHook = 0;
188  openfilename.lpTemplateName = 0;
189 
190  return GetOpenFileNameA(&openfilename);
191 }
WORD nFileExtension
Definition: commdlg.h:344
LPSTR lpstrFileTitle
Definition: commdlg.h:338
LPARAM lCustData
Definition: commdlg.h:346
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
HWND hwndOwner
Definition: commdlg.h:330
LPSTR lpstrCustomFilter
Definition: commdlg.h:333
char CHAR
Definition: xmlstorage.h:175
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
HANDLE hInstance
Definition: winhelp.h:133
#define WINE_TRACE
Definition: debug.h:353
LPCSTR lpstrDefExt
Definition: commdlg.h:345
#define MAX_STRING_LEN
Definition: precomp.h:36
LPCSTR lpTemplateName
Definition: commdlg.h:348
char * LPSTR
Definition: xmlstorage.h:182
DWORD nMaxFile
Definition: commdlg.h:337
#define STID_ALL_FILES
Definition: winhelp_res.h:45
LPOFNHOOKPROC lpfnHook
Definition: commdlg.h:347
HINSTANCE hInstance
Definition: commdlg.h:331
LPCSTR lpstrInitialDir
Definition: commdlg.h:340
#define MAX_PATH
Definition: compat.h:26
DWORD lStructSize
Definition: commdlg.h:329
DWORD nMaxCustFilter
Definition: commdlg.h:334
#define OFN_READONLY
Definition: commdlg.h:118
GLenum GLsizei len
Definition: glext.h:6722
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define STID_HELP_FILES_HLP
Definition: winhelp_res.h:46
HWND hMainWnd
Definition: winhelp.h:80
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2145
BOOL WINAPI GetOpenFileNameA(OPENFILENAMEA *ofn)
Definition: filedlg.c:4186
LPCSTR lpstrFilter
Definition: commdlg.h:332
WINHELP_WINDOW * active_win
Definition: winhelp.h:135
LPCSTR lpstrTitle
Definition: commdlg.h:341
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
DWORD nFilterIndex
Definition: commdlg.h:335
GLfloat GLfloat p
Definition: glext.h:8902
#define OFN_ENABLESIZING
Definition: commdlg.h:101
WINHELP_GLOBALS Globals
Definition: winhelp.c:48
DWORD nMaxFileTitle
Definition: commdlg.h:339
WORD nFileOffset
Definition: commdlg.h:343
DWORD Flags
Definition: commdlg.h:342

◆ WINHELP_GetWindowInfo()

HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo ( HLPFILE hlpfile,
LPCSTR  name 
)

Definition at line 254 of file winhelp.c.

Referenced by MACRO_JumpContents(), MACRO_JumpContext(), MACRO_JumpHash(), and WinMain().

255 {
256  static HLPFILE_WINDOWINFO mwi;
257  unsigned int i;
258 
259  if (!name || !name[0])
261 
262  if (hlpfile)
263  for (i = 0; i < hlpfile->numWindows; i++)
264  if (!lstrcmpiA(hlpfile->windows[i].name, name))
265  return &hlpfile->windows[i];
266 
267  if (strcmp(name, "main") != 0)
268  {
269  WINE_FIXME("Couldn't find window info for %s\n", debugstr_a(name));
270  assert(0);
271  return NULL;
272  }
273  if (!mwi.name[0])
274  {
275  strcpy(mwi.type, "primary");
276  strcpy(mwi.name, "main");
277  if (hlpfile && hlpfile->lpszTitle[0])
278  {
279  char tmp[128];
280  LoadStringA(Globals.hInstance, STID_WINE_HELP, tmp, sizeof(tmp));
281  snprintf(mwi.caption, sizeof(mwi.caption), "%s %s - %s",
282  hlpfile->lpszTitle, tmp, hlpfile->lpszPath);
283  }
284  else
286  mwi.origin.x = mwi.origin.y = mwi.size.cx = mwi.size.cy = CW_USEDEFAULT;
287  mwi.style = SW_SHOW;
289  mwi.sr_color = mwi.nsr_color = 0xFFFFFF;
290  }
291  return &mwi;
292 }
long y
Definition: polytest.cpp:48
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
long x
Definition: polytest.cpp:48
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
HANDLE hInstance
Definition: winhelp.h:133
char caption[51]
Definition: hlpfile.h:31
#define snprintf
Definition: wintirpc.h:48
#define assert(x)
Definition: debug.h:53
unsigned numWindows
Definition: hlpfile.h:146
GLenum GLclampf GLint i
Definition: glfuncs.h:14
LPSTR lpszPath
Definition: hlpfile.h:104
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:324
#define SW_SHOW
Definition: winuser.h:769
char name[9]
Definition: hlpfile.h:30
COLORREF sr_color
Definition: hlpfile.h:36
COLORREF nsr_color
Definition: hlpfile.h:37
#define debugstr_a
Definition: kernel32.h:31
LPSTR lpszTitle
Definition: hlpfile.h:105
HLPFILE_WINDOWINFO * windows
Definition: hlpfile.h:147
WINHELP_WINDOW * active_win
Definition: winhelp.h:135
Definition: name.c:36
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
HLPFILE_WINDOWINFO * info
Definition: winhelp.h:92
WINHELP_GLOBALS Globals
Definition: winhelp.c:48
LONG cy
Definition: windef.h:325
#define STID_WINE_HELP
Definition: winhelp_res.h:36
char type[10]
Definition: hlpfile.h:29
#define WINE_FIXME
Definition: debug.h:365

◆ WINHELP_GrabWindow()

WINHELP_WINDOW* WINHELP_GrabWindow ( WINHELP_WINDOW )

Definition at line 513 of file winhelp.c.

Referenced by MACRO_ExecuteMacro(), and WINHELP_CreateHelpWindow().

514 {
515  WINE_TRACE("Grab %p#%d++\n", win, win->ref_count);
516  win->ref_count++;
517  return win;
518 }
#define WINE_TRACE
Definition: debug.h:353
static real win[4][36]

◆ WINHELP_LayoutMainWindow()

void WINHELP_LayoutMainWindow ( WINHELP_WINDOW win)

Definition at line 434 of file winhelp.c.

Referenced by MACRO_ChangeButtonBinding(), MACRO_CreateButton(), WINHELP_CreateHelpWindow(), and WINHELP_MainWndProc().

435 {
436  RECT rect, button_box_rect;
437  INT text_top = 0;
438  HWND hButtonBoxWnd = GetDlgItem(win->hMainWnd, CTL_ID_BUTTON);
439  HWND hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT);
440 
441  GetClientRect(win->hMainWnd, &rect);
442 
443  /* Update button box and text Window */
444  SetWindowPos(hButtonBoxWnd, HWND_TOP,
445  rect.left, rect.top,
446  rect.right - rect.left,
447  rect.bottom - rect.top, 0);
448 
449  if (GetWindowRect(hButtonBoxWnd, &button_box_rect))
450  text_top = rect.top + button_box_rect.bottom - button_box_rect.top;
451 
452  SetWindowPos(hTextWnd, HWND_TOP,
453  rect.left, text_top,
454  rect.right - rect.left,
455  rect.bottom - text_top, 0);
456 
457 }
#define CTL_ID_TEXT
Definition: winhelp.c:51
LONG top
Definition: windef.h:297
#define HWND_TOP
Definition: winuser.h:1193
LONG left
Definition: windef.h:296
LONG right
Definition: windef.h:298
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define CTL_ID_BUTTON
Definition: winhelp.c:50
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND hMainWnd
Definition: winhelp.h:80
LONG bottom
Definition: windef.h:299
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)

◆ WINHELP_LookupHelpFile()

HLPFILE* WINHELP_LookupHelpFile ( LPCSTR  lpszFile)

Definition at line 212 of file winhelp.c.

Referenced by MACRO_JumpContents(), MACRO_JumpContext(), MACRO_JumpHash(), WINHELP_HandleTextMouse(), and WinMain().

213 {
214  HLPFILE* hlpfile;
215  char szFullName[MAX_PATH];
216  char szAddPath[MAX_PATH];
217  char *p;
218 
219  /*
220  * NOTE: This is needed by popup windows only.
221  * In other cases it's not needed but does not hurt though.
222  */
224  {
225  strcpy(szAddPath, Globals.active_win->page->file->lpszPath);
226  p = strrchr(szAddPath, '\\');
227  if (p) *p = 0;
228  }
229 
230  /*
231  * FIXME: Should we swap conditions?
232  */
233  if (!SearchPathA(NULL, lpszFile, ".hlp", MAX_PATH, szFullName, NULL) &&
234  !SearchPathA(szAddPath, lpszFile, ".hlp", MAX_PATH, szFullName, NULL))
235  {
238  return NULL;
239  if (!WINHELP_GetOpenFileName(szFullName, MAX_PATH))
240  return NULL;
241  }
242  hlpfile = HLPFILE_ReadHlpFile(szFullName);
243  if (!hlpfile)
246  return hlpfile;
247 }
static INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type)
Definition: winhelp.c:197
#define IDYES
Definition: winuser.h:829
struct tagHlpFileFile * file
Definition: hlpfile.h:84
#define STID_HLPFILE_ERROR_s
Definition: winhelp_res.h:41
#define MB_ICONSTOP
Definition: winuser.h:797
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define STID_WHERROR
Definition: winhelp_res.h:37
#define MB_YESNO
Definition: winuser.h:811
DWORD WINAPI SearchPathA(IN LPCSTR lpPath OPTIONAL, IN LPCSTR lpFileName, IN LPCSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart OPTIONAL)
Definition: path.c:1122
HLPFILE * HLPFILE_ReadHlpFile(LPCSTR lpszPath)
Definition: hlpfile.c:2759
smooth NULL
Definition: ftsmooth.c:416
#define MB_ICONQUESTION
Definition: winuser.h:783
#define MAX_PATH
Definition: compat.h:26
#define STID_FILE_NOT_FOUND_s
Definition: winhelp_res.h:48
BOOL WINHELP_GetOpenFileName(LPSTR lpszFile, int len)
Definition: winhelp.c:146
#define MB_OK
Definition: winuser.h:784
WINHELP_WINDOW * active_win
Definition: winhelp.h:135
HLPFILE * hlpfile
Definition: winhelp.c:1217
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
HLPFILE_PAGE * page
Definition: winhelp.h:78
GLfloat GLfloat p
Definition: glext.h:8902
WINHELP_GLOBALS Globals
Definition: winhelp.c:48

◆ WINHELP_OpenHelpWindow()

BOOL WINHELP_OpenHelpWindow ( HLPFILE_PAGE *)(HLPFILE *, LONG, ULONG *,
HLPFILE ,
LONG  ,
HLPFILE_WINDOWINFO ,
int   
)

◆ WINHELP_ReleaseWindow()

BOOL WINHELP_ReleaseWindow ( WINHELP_WINDOW )

Definition at line 524 of file winhelp.c.

Referenced by MACRO_CloseSecondarys(), MACRO_CloseWindow(), MACRO_ExecuteMacro(), MACRO_Exit(), WINHELP_CheckPopup(), WINHELP_CreateHelpWindow(), and WINHELP_MainWndProc().

525 {
526  WINE_TRACE("Release %p#%d--\n", win, win->ref_count);
527 
528  if (!--win->ref_count)
529  {
530  DestroyWindow(win->hMainWnd);
531  return FALSE;
532  }
533  return TRUE;
534 }
#define TRUE
Definition: types.h:120
#define WINE_TRACE
Definition: debug.h:353
BOOL WINAPI DestroyWindow(_In_ HWND)
static real win[4][36]

Variable Documentation

◆ BUTTON_BOX_WIN_CLASS_NAME

const char BUTTON_BOX_WIN_CLASS_NAME[]

Definition at line 24 of file string.c.

Referenced by WINHELP_CreateHelpWindow(), and WINHELP_RegisterWinClasses().

◆ Callbacks

◆ Globals

WINHELP_GLOBALS Globals

Definition at line 13 of file clipbrd.c.

◆ HISTORY_WIN_CLASS_NAME

const char HISTORY_WIN_CLASS_NAME[]

Definition at line 25 of file string.c.

Referenced by MACRO_History(), and WINHELP_RegisterWinClasses().

◆ MAIN_WIN_CLASS_NAME

const char MAIN_WIN_CLASS_NAME[]

Definition at line 23 of file string.c.

Referenced by WINHELP_CreateHelpWindow(), and WINHELP_RegisterWinClasses().

◆ SHADOW_WIN_CLASS_NAME

const char SHADOW_WIN_CLASS_NAME[]

◆ STRING_BUTTON

const char STRING_BUTTON[]

Definition at line 26 of file string.c.

Referenced by WINHELP_ButtonBoxWndProc().

◆ STRING_DIALOG_TEST

const char STRING_DIALOG_TEST[]

Definition at line 29 of file string.c.

◆ STRING_MENU_Xx

const char STRING_MENU_Xx[]

◆ TEXT_WIN_CLASS_NAME

const char TEXT_WIN_CLASS_NAME[]