ReactOS 0.4.15-dev-7934-g1dc8d80
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.

◆ BUTTON_CY

#define BUTTON_CY   6

Definition at line 33 of file winhelp.h.

◆ 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.

◆ DC_INITTERM

#define DC_INITTERM   0x00000002

Definition at line 102 of file winhelp.h.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ DW_WHATMSG

#define DW_WHATMSG   1

Definition at line 108 of file winhelp.h.

◆ 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.

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 wpage,
int  nCmdShow,
BOOL  remember 
)

Definition at line 701 of file winhelp.c.

702{
704 BOOL bPrimary, bPopup, bReUsed = FALSE;
705 HICON hIcon;
706 HWND hTextWnd = NULL;
707
708 bPrimary = !lstrcmpiA(wpage->wininfo->name, "main");
709 bPopup = !bPrimary && (wpage->wininfo->win_style & WS_POPUP);
710
711 if (!bPopup)
712 {
713 for (win = Globals.win_list; win; win = win->next)
714 {
715 if (!lstrcmpiA(win->info->name, wpage->wininfo->name))
716 {
717 if (win->page == wpage->page && win->info == wpage->wininfo)
718 {
719 /* see #22979, some hlp files have a macro (run at page opening), which
720 * jumps to the very same page
721 * Exit gracefully in that case
722 */
723 return TRUE;
724 }
726 bReUsed = TRUE;
727 SetWindowTextA(win->hMainWnd, WINHELP_GetCaption(wpage));
728 if (win->info != wpage->wininfo)
729 {
730 POINT pt = {0, 0};
731 SIZE sz = {0, 0};
733
734 if (wpage->wininfo->origin.x != CW_USEDEFAULT &&
735 wpage->wininfo->origin.y != CW_USEDEFAULT)
736 {
737 pt = wpage->wininfo->origin;
738 flags &= ~SWP_NOSIZE;
739 }
740 if (wpage->wininfo->size.cx != CW_USEDEFAULT &&
741 wpage->wininfo->size.cy != CW_USEDEFAULT)
742 {
743 sz = wpage->wininfo->size;
744 flags &= ~SWP_NOMOVE;
745 }
746 SetWindowPos(win->hMainWnd, HWND_TOP, pt.x, pt.y, sz.cx, sz.cy, flags);
747 }
748
749 if (wpage->page && win->page && wpage->page->file != win->page->file)
751 WINHELP_InitFonts(win->hMainWnd);
752
753 win->page = wpage->page;
754 win->info = wpage->wininfo;
755 hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT);
756 WINHELP_SetupText(hTextWnd, win, wpage->relative);
757
758 InvalidateRect(win->hMainWnd, NULL, TRUE);
759 if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE);
760
761 break;
762 }
763 }
764 }
765
766 if (!win)
767 {
768 /* Initialize WINHELP_WINDOW struct */
770 if (!win) return FALSE;
771 win->next = Globals.win_list;
773
774 win->hHandCur = LoadCursorW(0, (LPWSTR)IDC_HAND);
775 win->back.index = 0;
776 win->font_scale = 1;
778 }
779 win->page = wpage->page;
780 win->info = wpage->wininfo;
782
783 if (!bPopup && wpage->page && remember)
784 {
786 }
787
788 if (bPopup)
790 else
792
793 /* Initialize default pushbuttons */
794 if (bPrimary && wpage->page)
795 {
797
799 MACRO_CreateButton("BTN_CONTENTS", buffer, "Contents()");
801 MACRO_CreateButton("BTN_INDEX", buffer, "Finder()");
803 MACRO_CreateButton("BTN_BACK", buffer, "Back()");
804 if (win->back.index <= 1) MACRO_DisableButton("BTN_BACK");
805 }
806
807 if (!bReUsed)
808 {
809 win->hMainWnd = CreateWindowExA((bPopup) ? WS_EX_TOOLWINDOW : 0, MAIN_WIN_CLASS_NAME,
810 WINHELP_GetCaption(wpage),
811 bPrimary ? WS_OVERLAPPEDWINDOW : wpage->wininfo->win_style,
812 wpage->wininfo->origin.x, wpage->wininfo->origin.y,
813 wpage->wininfo->size.cx, wpage->wininfo->size.cy,
814 bPopup ? Globals.active_win->hMainWnd : NULL,
817 if (!bPopup)
818 /* Create button box and text Window */
820 0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_BUTTON, Globals.hInstance, NULL);
821
824 0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_TEXT, Globals.hInstance, NULL);
825 SendMessageW(hTextWnd, EM_SETEVENTMASK, 0,
826 SendMessageW(hTextWnd, EM_GETEVENTMASK, 0, 0) | ENM_MOUSEEVENTS);
827 win->origRicheditWndProc = (WNDPROC)SetWindowLongPtrA(hTextWnd, GWLP_WNDPROC,
829 }
830
831 hIcon = (wpage->page) ? wpage->page->file->hIcon : NULL;
834 SendMessageW(win->hMainWnd, WM_SETICON, ICON_SMALL, (DWORD_PTR)hIcon);
835
836 /* Initialize file specific pushbuttons */
837 if (!(wpage->wininfo->win_style & WS_POPUP) && wpage->page)
838 {
839 HLPFILE_MACRO *macro;
840 for (macro = wpage->page->file->first_macro; macro; macro = macro->next)
842
843 for (macro = wpage->page->first_macro; macro; macro = macro->next)
845 }
846 /* See #17681, in some cases, the newly created window is closed by the macros it contains
847 * (braindead), so deal with this case
848 */
849 for (win = Globals.win_list; win; win = win->next)
850 {
851 if (!lstrcmpiA(win->info->name, wpage->wininfo->name)) break;
852 }
853 if (!win || !WINHELP_ReleaseWindow(win)) return TRUE;
854
855 if (bPopup)
856 {
857 DWORD mask = SendMessageW(hTextWnd, EM_GETEVENTMASK, 0, 0);
858
859 win->font_scale = Globals.active_win->font_scale;
860 WINHELP_SetupText(hTextWnd, win, wpage->relative);
861
862 /* we need the window to be shown for richedit to compute the size */
863 ShowWindow(win->hMainWnd, nCmdShow);
865 SendMessageW(hTextWnd, EM_REQUESTRESIZE, 0, 0);
866 SendMessageW(hTextWnd, EM_SETEVENTMASK, 0, mask);
867 }
868 else
869 {
870 WINHELP_SetupText(hTextWnd, win, wpage->relative);
872 ShowWindow(win->hMainWnd, nCmdShow);
873 }
874
875 return TRUE;
876}
#define MAX_STRING_LEN
Definition: precomp.h:36
#define MAIN_MENU
Definition: resources.h:12
const char MAIN_WIN_CLASS_NAME[]
Definition: string.c:23
const char BUTTON_BOX_WIN_CLASS_NAME[]
Definition: string.c:24
static void WINHELP_DeleteButtons(WINHELP_WINDOW *win)
Definition: winhelp.c:466
#define CTL_ID_TEXT
Definition: winhelp.c:51
WINHELP_WINDOW * WINHELP_GrabWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:516
BOOL WINHELP_ReleaseWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:527
WINHELP_GLOBALS Globals
Definition: winhelp.c:48
static char * WINHELP_GetCaption(WINHELP_WNDPAGE *wpage)
Definition: winhelp.c:589
static void WINHELP_SetupText(HWND hTextWnd, WINHELP_WINDOW *win, ULONG relative)
Definition: winhelp.c:103
static LRESULT CALLBACK WINHELP_RicheditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: winhelp.c:673
void WINHELP_LayoutMainWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:437
void WINHELP_DeleteBackSet(WINHELP_WINDOW *win)
Definition: winhelp.c:484
static void WINHELP_RememberPage(WINHELP_WINDOW *win, WINHELP_WNDPAGE *wpage)
Definition: winhelp.c:595
static void WINHELP_InitFonts(HWND hWnd)
Definition: winhelp.c:58
#define CTL_ID_BUTTON
Definition: winhelp.c:50
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define pt(x, y)
Definition: drawing.c:79
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint buffer
Definition: glext.h:5915
GLenum GLint GLuint mask
Definition: glext.h:6028
GLbitfield flags
Definition: glext.h:7161
static real win[4][36]
if(dx< 0)
Definition: linetemp.h:194
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro)
Definition: macro.c:73
void CALLBACK MACRO_DisableButton(LPCSTR id)
Definition: macro.c:116
BOOL MACRO_ExecuteMacro(struct tagWinHelp *, LPCSTR)
static HICON
Definition: imagelist.c:84
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
HICON hIcon
Definition: msconfig.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define ES_READONLY
Definition: pedump.c:675
#define WS_POPUP
Definition: pedump.c:616
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_HSCROLL
Definition: pedump.c:628
#define ES_MULTILINE
Definition: pedump.c:667
#define EM_GETEVENTMASK
Definition: richedit.h:92
#define EM_REQUESTRESIZE
Definition: richedit.h:98
#define EM_SETEVENTMASK
Definition: richedit.h:102
#define RICHEDIT_CLASS20A
Definition: richedit.h:43
#define ENM_REQUESTRESIZE
Definition: richedit.h:477
#define ENM_MOUSEEVENTS
Definition: richedit.h:476
char name[9]
Definition: hlpfile.h:30
HANDLE hInstance
Definition: winhelp.h:133
WINHELP_WINDOW * active_popup
Definition: winhelp.h:136
WINHELP_WINDOW * active_win
Definition: winhelp.h:135
WINHELP_WINDOW * win_list
Definition: winhelp.h:137
ULONG relative
Definition: winhelp.h:64
HLPFILE_WINDOWINFO * wininfo
Definition: winhelp.h:63
HLPFILE_PAGE * page
Definition: winhelp.h:62
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
LPCSTR lpszMacro
Definition: hlpfile.h:64
struct tagHlpFileMacro * next
Definition: hlpfile.h:65
HLPFILE_MACRO * first_macro
Definition: hlpfile.h:71
struct tagHlpFileFile * file
Definition: hlpfile.h:84
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
HWND hMainWnd
Definition: winhelp.h:80
unsigned font_scale
Definition: winhelp.h:95
#define ICON_SMALL
Definition: tnclass.cpp:48
#define GWLP_WNDPROC
Definition: treelist.c:66
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define STID_BACK
Definition: winhelp_res.h:44
#define STID_INDEX
Definition: winhelp_res.h:43
#define IDI_WINHELP
Definition: winhelp_res.h:56
#define STID_CONTENTS
Definition: winhelp_res.h:42
#define SetWindowLongPtrA
Definition: winuser.h:5345
BOOL WINAPI SetWindowTextA(_In_ HWND, _In_opt_ LPCSTR)
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)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define IMAGE_ICON
Definition: winuser.h:212
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4315
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
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2203
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define SM_CYSMICON
Definition: winuser.h:1013
#define SWP_NOSIZE
Definition: winuser.h:1245
int WINAPI LoadStringA(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPSTR lpBuffer, _In_ int cchBufferMax)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2105
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SM_CXSMICON
Definition: winuser.h:1012
#define HWND_TOP
Definition: winuser.h:1207
#define LR_SHARED
Definition: winuser.h:1100
#define CW_USEDEFAULT
Definition: winuser.h:225
#define IDC_HAND
Definition: winuser.h:698
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
char CHAR
Definition: xmlstorage.h:175

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

◆ WINHELP_CreateIndexWindow()

BOOL WINHELP_CreateIndexWindow ( BOOL  is_search)

Definition at line 1545 of file winhelp.c.

1546{
1547 HPROPSHEETPAGE psPage[3];
1548 PROPSHEETPAGEA psp;
1549 PROPSHEETHEADERA psHead;
1550 struct index_data id;
1551 char buf[256];
1552
1555 else
1556 return FALSE;
1557
1558 if (id.hlpfile->kwbtree == NULL)
1559 {
1560 WINE_TRACE("No index provided\n");
1561 return FALSE;
1562 }
1563
1565
1566 id.jump = FALSE;
1567 memset(&psp, 0, sizeof(psp));
1568 psp.dwSize = sizeof(psp);
1569 psp.dwFlags = 0;
1571
1573 psp.lParam = (LPARAM)&id;
1575 psPage[0] = CreatePropertySheetPageA(&psp);
1576
1578 psp.lParam = (LPARAM)&id;
1580 psPage[1] = CreatePropertySheetPageA(&psp);
1581
1582 memset(&psHead, 0, sizeof(psHead));
1583 psHead.dwSize = sizeof(psHead);
1584
1587
1588 psHead.pszCaption = buf;
1589 psHead.nPages = 2;
1590 psHead.u2.nStartPage = is_search ? 1 : 0;
1592 psHead.u3.phpage = psPage;
1593 psHead.dwFlags = PSH_NOAPPLYNOW;
1594
1595 PropertySheetA(&psHead);
1596 if (id.jump)
1597 {
1598 WINE_TRACE("got %d as an offset\n", id.offset);
1601 }
1602 return TRUE;
1603}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
BOOL WINHELP_OpenHelpWindow(HLPFILE_PAGE *(*lookup)(HLPFILE *, LONG, ULONG *), HLPFILE *hlpfile, LONG val, HLPFILE_WINDOWINFO *wi, int nCmdShow)
Definition: winhelp.c:882
static INT_PTR CALLBACK WINHELP_SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: winhelp.c:1296
static INT_PTR CALLBACK WINHELP_IndexDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: winhelp.c:1229
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
Definition: propsheet.c:2872
HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA lpPropSheetPage)
Definition: propsheet.c:2999
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint id
Definition: glext.h:5910
GLintptr offset
Definition: glext.h:5920
HLPFILE_PAGE * HLPFILE_PageByOffset(HLPFILE *hlpfile, LONG offset, ULONG *relative)
Definition: hlpfile.c:369
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define PSH_NOAPPLYNOW
Definition: prsht.h:47
#define WINE_TRACE
Definition: debug.h:354
#define memset(x, y, z)
Definition: compat.h:39
char caption[51]
Definition: hlpfile.h:31
DWORD dwFlags
Definition: prsht.h:259
DWORD dwSize
Definition: prsht.h:258
HWND hwndParent
Definition: prsht.h:260
UINT nStartPage
Definition: prsht.h:269
HPROPSHEETPAGE * phpage
Definition: prsht.h:274
LPCSTR pszCaption
Definition: prsht.h:266
DWORD dwFlags
Definition: prsht.h:178
LPCSTR pszTemplate
Definition: prsht.h:181
HINSTANCE hInstance
Definition: prsht.h:179
LPARAM lParam
Definition: prsht.h:190
DLGPROC pfnDlgProc
Definition: prsht.h:189
DWORD dwSize
Definition: prsht.h:177
HLPFILE * hlpfile
Definition: winhelp.c:1220
BOOL jump
Definition: winhelp.c:1221
BYTE * kwbtree
Definition: hlpfile.h:111
HLPFILE_PAGE * page
Definition: winhelp.h:78
HLPFILE_WINDOWINFO * info
Definition: winhelp.h:92
LONG_PTR LPARAM
Definition: windef.h:208
#define STID_PSH_INDEX
Definition: winhelp_res.h:50
#define IDD_SEARCH
Definition: winhelp_res.h:54
#define IDD_INDEX
Definition: winhelp_res.h:52
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define SW_NORMAL
Definition: winuser.h:769

Referenced by MACRO_Finder(), and MACRO_Search().

◆ WINHELP_DeleteBackSet()

void WINHELP_DeleteBackSet ( WINHELP_WINDOW win)

Definition at line 484 of file winhelp.c.

485{
486 unsigned int i;
487
488 for (i = 0; i < win->back.index; i++)
489 {
490 HLPFILE_FreeHlpFile(win->back.set[i].page->file);
491 win->back.set[i].page = NULL;
492 }
493 win->back.index = 0;
494}
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 HLPFILE_FreeHlpFile(HLPFILE *hlpfile)
Definition: hlpfile.c:2297

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

◆ WINHELP_GetOpenFileName()

BOOL WINHELP_GetOpenFileName ( LPSTR  lpszFile,
int  len 
)

Definition at line 145 of file winhelp.c.

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

Referenced by MACRO_FileOpen(), and WINHELP_LookupHelpFile().

◆ WINHELP_GetWindowInfo()

HLPFILE_WINDOWINFO * WINHELP_GetWindowInfo ( HLPFILE hlpfile,
LPCSTR  name 
)

Definition at line 253 of file winhelp.c.

254{
255 static HLPFILE_WINDOWINFO mwi;
256 unsigned int i;
257
258 if (!name || !name[0])
260
261 if (hlpfile)
262 for (i = 0; i < hlpfile->numWindows; i++)
263 if (!lstrcmpiA(hlpfile->windows[i].name, name))
264 return &hlpfile->windows[i];
265
266 if (strcmp(name, "main") != 0)
267 {
268 WINE_FIXME("Couldn't find window info for %s\n", debugstr_a(name));
269 assert(0);
270 return NULL;
271 }
272 if (!mwi.name[0])
273 {
274 strcpy(mwi.type, "primary");
275 strcpy(mwi.name, "main");
276 if (hlpfile && hlpfile->lpszTitle[0])
277#ifdef __REACTOS__
278 snprintf(mwi.caption, sizeof(mwi.caption), "%s", hlpfile->lpszTitle);
279#else
280 {
281 char tmp[128];
282 LoadStringA(Globals.hInstance, STID_WINE_HELP, tmp, sizeof(tmp));
283 snprintf(mwi.caption, sizeof(mwi.caption), "%s %s - %s",
284 hlpfile->lpszTitle, tmp, hlpfile->lpszPath);
285 }
286#endif
287 else
289 mwi.origin.x = mwi.origin.y = mwi.size.cx = mwi.size.cy = CW_USEDEFAULT;
290 mwi.style = SW_SHOW;
292 mwi.sr_color = mwi.nsr_color = 0xFFFFFF;
293 }
294 return &mwi;
295}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define assert(x)
Definition: debug.h:53
#define debugstr_a
Definition: kernel32.h:31
#define WINE_FIXME
Definition: debug.h:366
char type[10]
Definition: hlpfile.h:29
COLORREF nsr_color
Definition: hlpfile.h:37
COLORREF sr_color
Definition: hlpfile.h:36
Definition: name.c:39
LPSTR lpszTitle
Definition: hlpfile.h:105
HLPFILE_WINDOWINFO * windows
Definition: hlpfile.h:147
unsigned numWindows
Definition: hlpfile.h:146
LPSTR lpszPath
Definition: hlpfile.h:104
#define STID_WINE_HELP
Definition: winhelp_res.h:36
#define snprintf
Definition: wintirpc.h:48
#define SW_SHOW
Definition: winuser.h:775

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

◆ WINHELP_GrabWindow()

WINHELP_WINDOW * WINHELP_GrabWindow ( WINHELP_WINDOW win)

Definition at line 516 of file winhelp.c.

517{
518 WINE_TRACE("Grab %p#%d++\n", win, win->ref_count);
519 win->ref_count++;
520 return win;
521}

Referenced by WINHELP_CreateHelpWindow().

◆ WINHELP_LayoutMainWindow()

void WINHELP_LayoutMainWindow ( WINHELP_WINDOW win)

Definition at line 437 of file winhelp.c.

438{
439 RECT rect, button_box_rect;
440 INT text_top = 0;
441 HWND hButtonBoxWnd = GetDlgItem(win->hMainWnd, CTL_ID_BUTTON);
442 HWND hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT);
443
444 GetClientRect(win->hMainWnd, &rect);
445
446 /* Update button box and text Window */
447 SetWindowPos(hButtonBoxWnd, HWND_TOP,
448 rect.left, rect.top,
449 rect.right - rect.left,
450 rect.bottom - rect.top, 0);
451
452 if (GetWindowRect(hButtonBoxWnd, &button_box_rect))
453 text_top = rect.top + button_box_rect.bottom - button_box_rect.top;
454
455 SetWindowPos(hTextWnd, HWND_TOP,
456 rect.left, text_top,
457 rect.right - rect.left,
458 rect.bottom - text_top, 0);
459
460}
& rect
Definition: startmenu.cpp:1413
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
int32_t INT
Definition: typedefs.h:58
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

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

◆ WINHELP_LookupHelpFile()

HLPFILE * WINHELP_LookupHelpFile ( LPCSTR  lpszFile)

Definition at line 211 of file winhelp.c.

212{
213 HLPFILE* hlpfile;
214 char szFullName[MAX_PATH];
215 char szAddPath[MAX_PATH];
216 char *p;
217
218 /*
219 * NOTE: This is needed by popup windows only.
220 * In other cases it's not needed but does not hurt though.
221 */
223 {
224 strcpy(szAddPath, Globals.active_win->page->file->lpszPath);
225 p = strrchr(szAddPath, '\\');
226 if (p) *p = 0;
227 }
228
229 /*
230 * FIXME: Should we swap conditions?
231 */
232 if (!SearchPathA(NULL, lpszFile, ".hlp", MAX_PATH, szFullName, NULL) &&
233 !SearchPathA(szAddPath, lpszFile, ".hlp", MAX_PATH, szFullName, NULL))
234 {
237 return NULL;
238 if (!WINHELP_GetOpenFileName(szFullName, MAX_PATH))
239 return NULL;
240 }
241 hlpfile = HLPFILE_ReadHlpFile(szFullName);
242 if (!hlpfile)
245 return hlpfile;
246}
static INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type)
Definition: winhelp.c:196
BOOL WINHELP_GetOpenFileName(LPSTR lpszFile, int len)
Definition: winhelp.c:145
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:1123
HLPFILE * HLPFILE_ReadHlpFile(LPCSTR lpszPath)
Definition: hlpfile.c:2759
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define STID_HLPFILE_ERROR_s
Definition: winhelp_res.h:41
#define STID_WHERROR
Definition: winhelp_res.h:37
#define STID_FILE_NOT_FOUND_s
Definition: winhelp_res.h:48
#define MB_YESNO
Definition: winuser.h:817
#define MB_OK
Definition: winuser.h:790
#define MB_ICONQUESTION
Definition: winuser.h:789
#define MB_ICONSTOP
Definition: winuser.h:803
#define IDYES
Definition: winuser.h:835

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

◆ WINHELP_OpenHelpWindow()

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

◆ WINHELP_ReleaseWindow()

BOOL WINHELP_ReleaseWindow ( WINHELP_WINDOW win)

Definition at line 527 of file winhelp.c.

528{
529 WINE_TRACE("Release %p#%d--\n", win, win->ref_count);
530
531 if (!--win->ref_count)
532 {
533 DestroyWindow(win->hMainWnd);
534 return FALSE;
535 }
536 return TRUE;
537}
BOOL WINAPI DestroyWindow(_In_ HWND)

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

Variable Documentation

◆ BUTTON_BOX_WIN_CLASS_NAME

const char BUTTON_BOX_WIN_CLASS_NAME[]
extern

Definition at line 24 of file string.c.

Referenced by WINHELP_CreateHelpWindow(), and WINHELP_RegisterWinClasses().

◆ Callbacks

◆ Globals

WINHELP_GLOBALS Globals
extern

Definition at line 13 of file clipbrd.c.

◆ HISTORY_WIN_CLASS_NAME

const char HISTORY_WIN_CLASS_NAME[]
extern

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[]
extern

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[]
extern

◆ STRING_BUTTON

const char STRING_BUTTON[]
extern

Definition at line 26 of file string.c.

Referenced by WINHELP_ButtonBoxWndProc().

◆ STRING_DIALOG_TEST

const char STRING_DIALOG_TEST[]
extern

Definition at line 29 of file string.c.

◆ STRING_MENU_Xx

const char STRING_MENU_Xx[]
extern

◆ TEXT_WIN_CLASS_NAME

const char TEXT_WIN_CLASS_NAME[]
extern