ReactOS 0.4.15-dev-7108-g1cf6ce6
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 697 of file winhelp.c.

698{
700 BOOL bPrimary, bPopup, bReUsed = FALSE;
701 HICON hIcon;
702 HWND hTextWnd = NULL;
703
704 bPrimary = !lstrcmpiA(wpage->wininfo->name, "main");
705 bPopup = !bPrimary && (wpage->wininfo->win_style & WS_POPUP);
706
707 if (!bPopup)
708 {
709 for (win = Globals.win_list; win; win = win->next)
710 {
711 if (!lstrcmpiA(win->info->name, wpage->wininfo->name))
712 {
713 if (win->page == wpage->page && win->info == wpage->wininfo)
714 {
715 /* see #22979, some hlp files have a macro (run at page opening), which
716 * jumps to the very same page
717 * Exit gracefully in that case
718 */
719 return TRUE;
720 }
722 bReUsed = TRUE;
723 SetWindowTextA(win->hMainWnd, WINHELP_GetCaption(wpage));
724 if (win->info != wpage->wininfo)
725 {
726 POINT pt = {0, 0};
727 SIZE sz = {0, 0};
729
730 if (wpage->wininfo->origin.x != CW_USEDEFAULT &&
731 wpage->wininfo->origin.y != CW_USEDEFAULT)
732 {
733 pt = wpage->wininfo->origin;
734 flags &= ~SWP_NOSIZE;
735 }
736 if (wpage->wininfo->size.cx != CW_USEDEFAULT &&
737 wpage->wininfo->size.cy != CW_USEDEFAULT)
738 {
739 sz = wpage->wininfo->size;
740 flags &= ~SWP_NOMOVE;
741 }
742 SetWindowPos(win->hMainWnd, HWND_TOP, pt.x, pt.y, sz.cx, sz.cy, flags);
743 }
744
745 if (wpage->page && win->page && wpage->page->file != win->page->file)
747 WINHELP_InitFonts(win->hMainWnd);
748
749 win->page = wpage->page;
750 win->info = wpage->wininfo;
751 hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT);
752 WINHELP_SetupText(hTextWnd, win, wpage->relative);
753
754 InvalidateRect(win->hMainWnd, NULL, TRUE);
755 if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE);
756
757 break;
758 }
759 }
760 }
761
762 if (!win)
763 {
764 /* Initialize WINHELP_WINDOW struct */
766 if (!win) return FALSE;
767 win->next = Globals.win_list;
769
770 win->hHandCur = LoadCursorW(0, (LPWSTR)IDC_HAND);
771 win->back.index = 0;
772 win->font_scale = 1;
774 }
775 win->page = wpage->page;
776 win->info = wpage->wininfo;
778
779 if (!bPopup && wpage->page && remember)
780 {
782 }
783
784 if (bPopup)
786 else
788
789 /* Initialize default pushbuttons */
790 if (bPrimary && wpage->page)
791 {
793
795 MACRO_CreateButton("BTN_CONTENTS", buffer, "Contents()");
797 MACRO_CreateButton("BTN_INDEX", buffer, "Finder()");
799 MACRO_CreateButton("BTN_BACK", buffer, "Back()");
800 if (win->back.index <= 1) MACRO_DisableButton("BTN_BACK");
801 }
802
803 if (!bReUsed)
804 {
805 win->hMainWnd = CreateWindowExA((bPopup) ? WS_EX_TOOLWINDOW : 0, MAIN_WIN_CLASS_NAME,
806 WINHELP_GetCaption(wpage),
807 bPrimary ? WS_OVERLAPPEDWINDOW : wpage->wininfo->win_style,
808 wpage->wininfo->origin.x, wpage->wininfo->origin.y,
809 wpage->wininfo->size.cx, wpage->wininfo->size.cy,
810 bPopup ? Globals.active_win->hMainWnd : NULL,
813 if (!bPopup)
814 /* Create button box and text Window */
816 0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_BUTTON, Globals.hInstance, NULL);
817
820 0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_TEXT, Globals.hInstance, NULL);
821 SendMessageW(hTextWnd, EM_SETEVENTMASK, 0,
822 SendMessageW(hTextWnd, EM_GETEVENTMASK, 0, 0) | ENM_MOUSEEVENTS);
823 win->origRicheditWndProc = (WNDPROC)SetWindowLongPtrA(hTextWnd, GWLP_WNDPROC,
825 }
826
827 hIcon = (wpage->page) ? wpage->page->file->hIcon : NULL;
830 SendMessageW(win->hMainWnd, WM_SETICON, ICON_SMALL, (DWORD_PTR)hIcon);
831
832 /* Initialize file specific pushbuttons */
833 if (!(wpage->wininfo->win_style & WS_POPUP) && wpage->page)
834 {
835 HLPFILE_MACRO *macro;
836 for (macro = wpage->page->file->first_macro; macro; macro = macro->next)
838
839 for (macro = wpage->page->first_macro; macro; macro = macro->next)
841 }
842 /* See #17681, in some cases, the newly created window is closed by the macros it contains
843 * (braindead), so deal with this case
844 */
845 for (win = Globals.win_list; win; win = win->next)
846 {
847 if (!lstrcmpiA(win->info->name, wpage->wininfo->name)) break;
848 }
849 if (!win || !WINHELP_ReleaseWindow(win)) return TRUE;
850
851 if (bPopup)
852 {
853 DWORD mask = SendMessageW(hTextWnd, EM_GETEVENTMASK, 0, 0);
854
855 win->font_scale = Globals.active_win->font_scale;
856 WINHELP_SetupText(hTextWnd, win, wpage->relative);
857
858 /* we need the window to be shown for richedit to compute the size */
859 ShowWindow(win->hMainWnd, nCmdShow);
861 SendMessageW(hTextWnd, EM_REQUESTRESIZE, 0, 0);
862 SendMessageW(hTextWnd, EM_SETEVENTMASK, 0, mask);
863 }
864 else
865 {
866 WINHELP_SetupText(hTextWnd, win, wpage->relative);
868 ShowWindow(win->hMainWnd, nCmdShow);
869 }
870
871 return TRUE;
872}
#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:462
#define CTL_ID_TEXT
Definition: winhelp.c:51
WINHELP_WINDOW * WINHELP_GrabWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:512
BOOL WINHELP_ReleaseWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:523
WINHELP_GLOBALS Globals
Definition: winhelp.c:48
static char * WINHELP_GetCaption(WINHELP_WNDPAGE *wpage)
Definition: winhelp.c:585
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:669
void WINHELP_LayoutMainWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:433
void WINHELP_DeleteBackSet(WINHELP_WINDOW *win)
Definition: winhelp.c:480
static void WINHELP_RememberPage(WINHELP_WINDOW *win, WINHELP_WNDPAGE *wpage)
Definition: winhelp.c:591
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:5344
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:4314
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOMOVE
Definition: winuser.h:1243
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:2172
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define SM_CYSMICON
Definition: winuser.h:1012
#define SWP_NOSIZE
Definition: winuser.h:1244
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:2074
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SM_CXSMICON
Definition: winuser.h:1011
#define HWND_TOP
Definition: winuser.h:1206
#define LR_SHARED
Definition: winuser.h:1099
#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:2905
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 1541 of file winhelp.c.

1542{
1543 HPROPSHEETPAGE psPage[3];
1544 PROPSHEETPAGEA psp;
1545 PROPSHEETHEADERA psHead;
1546 struct index_data id;
1547 char buf[256];
1548
1551 else
1552 return FALSE;
1553
1554 if (id.hlpfile->kwbtree == NULL)
1555 {
1556 WINE_TRACE("No index provided\n");
1557 return FALSE;
1558 }
1559
1561
1562 id.jump = FALSE;
1563 memset(&psp, 0, sizeof(psp));
1564 psp.dwSize = sizeof(psp);
1565 psp.dwFlags = 0;
1567
1569 psp.lParam = (LPARAM)&id;
1571 psPage[0] = CreatePropertySheetPageA(&psp);
1572
1574 psp.lParam = (LPARAM)&id;
1576 psPage[1] = CreatePropertySheetPageA(&psp);
1577
1578 memset(&psHead, 0, sizeof(psHead));
1579 psHead.dwSize = sizeof(psHead);
1580
1583
1584 psHead.pszCaption = buf;
1585 psHead.nPages = 2;
1586 psHead.u2.nStartPage = is_search ? 1 : 0;
1588 psHead.u3.phpage = psPage;
1589 psHead.dwFlags = PSH_NOAPPLYNOW;
1590
1591 PropertySheetA(&psHead);
1592 if (id.jump)
1593 {
1594 WINE_TRACE("got %d as an offset\n", id.offset);
1597 }
1598 return TRUE;
1599}
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:878
static INT_PTR CALLBACK WINHELP_SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: winhelp.c:1292
static INT_PTR CALLBACK WINHELP_IndexDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: winhelp.c:1225
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
Definition: propsheet.c:2864
HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA lpPropSheetPage)
Definition: propsheet.c:2991
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:1216
BOOL jump
Definition: winhelp.c:1217
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:768

Referenced by MACRO_Finder(), and MACRO_Search().

◆ WINHELP_DeleteBackSet()

void WINHELP_DeleteBackSet ( WINHELP_WINDOW win)

Definition at line 480 of file winhelp.c.

481{
482 unsigned int i;
483
484 for (i = 0; i < win->back.index; i++)
485 {
486 HLPFILE_FreeHlpFile(win->back.set[i].page->file);
487 win->back.set[i].page = NULL;
488 }
489 win->back.index = 0;
490}
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 {
278 char tmp[128];
279 LoadStringA(Globals.hInstance, STID_WINE_HELP, tmp, sizeof(tmp));
280 snprintf(mwi.caption, sizeof(mwi.caption), "%s %s - %s",
281 hlpfile->lpszTitle, tmp, hlpfile->lpszPath);
282 }
283 else
285 mwi.origin.x = mwi.origin.y = mwi.size.cx = mwi.size.cy = CW_USEDEFAULT;
286 mwi.style = SW_SHOW;
288 mwi.sr_color = mwi.nsr_color = 0xFFFFFF;
289 }
290 return &mwi;
291}
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:774

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

◆ WINHELP_GrabWindow()

WINHELP_WINDOW * WINHELP_GrabWindow ( WINHELP_WINDOW win)

Definition at line 512 of file winhelp.c.

513{
514 WINE_TRACE("Grab %p#%d++\n", win, win->ref_count);
515 win->ref_count++;
516 return win;
517}

Referenced by WINHELP_CreateHelpWindow().

◆ WINHELP_LayoutMainWindow()

void WINHELP_LayoutMainWindow ( WINHELP_WINDOW win)

Definition at line 433 of file winhelp.c.

434{
435 RECT rect, button_box_rect;
436 INT text_top = 0;
437 HWND hButtonBoxWnd = GetDlgItem(win->hMainWnd, CTL_ID_BUTTON);
438 HWND hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT);
439
440 GetClientRect(win->hMainWnd, &rect);
441
442 /* Update button box and text Window */
443 SetWindowPos(hButtonBoxWnd, HWND_TOP,
444 rect.left, rect.top,
445 rect.right - rect.left,
446 rect.bottom - rect.top, 0);
447
448 if (GetWindowRect(hButtonBoxWnd, &button_box_rect))
449 text_top = rect.top + button_box_rect.bottom - button_box_rect.top;
450
451 SetWindowPos(hTextWnd, HWND_TOP,
452 rect.left, text_top,
453 rect.right - rect.left,
454 rect.bottom - text_top, 0);
455
456}
& 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:816
#define MB_OK
Definition: winuser.h:789
#define MB_ICONQUESTION
Definition: winuser.h:788
#define MB_ICONSTOP
Definition: winuser.h:802
#define IDYES
Definition: winuser.h:834

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 523 of file winhelp.c.

524{
525 WINE_TRACE("Release %p#%d--\n", win, win->ref_count);
526
527 if (!--win->ref_count)
528 {
529 DestroyWindow(win->hMainWnd);
530 return FALSE;
531 }
532 return TRUE;
533}
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