Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
8db2c26d
Commit
8db2c26d
authored
Aug 01, 2005
by
James Hawkins
Committed by
Alexandre Julliard
Aug 01, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add beginnings of the Help viewer.
parent
2abbb909
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
252 additions
and
7 deletions
+252
-7
Makefile.in
dlls/hhctrl.ocx/Makefile.in
+2
-1
help.c
dlls/hhctrl.ocx/help.c
+250
-0
hhctrl.c
dlls/hhctrl.ocx/hhctrl.c
+0
-6
No files found.
dlls/hhctrl.ocx/Makefile.in
View file @
8db2c26d
...
...
@@ -3,9 +3,10 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
hhctrl.ocx
IMPORTS
=
advapi32
shell32 ole32 user
32 kernel32
IMPORTS
=
advapi32
comctl32 shell32 ole32 user32 gdi
32 kernel32
C_SRCS
=
\
help.c
\
hhctrl.c
\
regsvr.c
...
...
dlls/hhctrl.ocx/help.c
0 → 100644
View file @
8db2c26d
/*
* Help Viewer Implementation
*
* Copyright 2005 James Hawkins
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "htmlhelp.h"
#include "ole2.h"
/* Window type defaults */
#define WINTYPE_DEFAULT_X 280
#define WINTYPE_DEFAULT_Y 100
#define WINTYPE_DEFAULT_WIDTH 740
#define WINTYPE_DEFAULT_HEIGHT 640
typedef
struct
tagHHInfo
{
HH_WINTYPEW
*
pHHWinType
;
HINSTANCE
hInstance
;
LPCWSTR
szCmdLine
;
HFONT
hFont
;
}
HHInfo
;
static
LPWSTR
HH_ANSIToUnicode
(
LPCSTR
ansi
)
{
LPWSTR
unicode
;
int
count
;
count
=
MultiByteToWideChar
(
CP_ACP
,
0
,
ansi
,
-
1
,
NULL
,
0
);
unicode
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
ansi
,
-
1
,
unicode
,
count
);
return
unicode
;
}
/* Toolbar */
static
BOOL
HH_AddToolbar
(
HHInfo
*
pHHInfo
)
{
return
TRUE
;
}
/* Navigation Pane */
static
BOOL
HH_AddNavigationPane
(
HHInfo
*
pHHInfo
)
{
return
TRUE
;
}
/* HTML Pane */
static
BOOL
HH_AddHTMLPane
(
HHInfo
*
pHHInfo
)
{
return
TRUE
;
}
/* Viewer Window */
LRESULT
CALLBACK
Help_WndProc
(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
PAINTSTRUCT
ps
;
HDC
hdc
;
switch
(
message
)
{
case
WM_PAINT
:
hdc
=
BeginPaint
(
hWnd
,
&
ps
);
EndPaint
(
hWnd
,
&
ps
);
break
;
case
WM_DESTROY
:
PostQuitMessage
(
0
);
break
;
default:
return
DefWindowProcW
(
hWnd
,
message
,
wParam
,
lParam
);
}
return
0
;
}
static
BOOL
HH_CreateHelpWindow
(
HHInfo
*
pHHInfo
)
{
HWND
hWnd
;
HINSTANCE
hInstance
=
pHHInfo
->
hInstance
;
WNDCLASSEXW
wcex
;
DWORD
dwStyles
,
dwExStyles
;
DWORD
x
,
y
,
width
,
height
;
static
const
WCHAR
windowClassW
[]
=
{
'H'
,
'H'
,
' '
,
'P'
,
'a'
,
'r'
,
'e'
,
'n'
,
't'
,
0
};
static
const
WCHAR
windowTitleW
[]
=
{
'H'
,
'T'
,
'M'
,
'L'
,
' '
,
'H'
,
'e'
,
'l'
,
'p'
,
0
};
wcex
.
cbSize
=
sizeof
(
WNDCLASSEXW
);
wcex
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
wcex
.
lpfnWndProc
=
(
WNDPROC
)
Help_WndProc
;
wcex
.
cbClsExtra
=
0
;
wcex
.
cbWndExtra
=
0
;
wcex
.
hInstance
=
hInstance
;
wcex
.
hIcon
=
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_APPLICATION
);
wcex
.
hCursor
=
LoadCursorW
(
NULL
,
(
LPCWSTR
)
IDC_ARROW
);
wcex
.
hbrBackground
=
(
HBRUSH
)(
COLOR_BACKGROUND
+
1
);
wcex
.
lpszMenuName
=
NULL
;
wcex
.
lpszClassName
=
windowClassW
;
wcex
.
hIconSm
=
LoadIconW
(
NULL
,
(
LPCWSTR
)
IDI_APPLICATION
);
RegisterClassExW
(
&
wcex
);
dwStyles
=
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
|
WS_CLIPSIBLINGS
|
WS_CLIPCHILDREN
;
dwExStyles
=
WS_EX_LEFT
|
WS_EX_LTRREADING
|
WS_EX_RIGHTSCROLLBAR
|
WS_EX_WINDOWEDGE
|
WS_EX_APPWINDOW
;
/* these will be loaded from the CHM file in the future if they're provided */
x
=
WINTYPE_DEFAULT_X
;
y
=
WINTYPE_DEFAULT_Y
;
width
=
WINTYPE_DEFAULT_WIDTH
;
height
=
WINTYPE_DEFAULT_HEIGHT
;
hWnd
=
CreateWindowExW
(
dwExStyles
,
windowClassW
,
windowTitleW
,
dwStyles
,
x
,
y
,
width
,
height
,
NULL
,
NULL
,
hInstance
,
NULL
);
if
(
!
hWnd
)
return
FALSE
;
ShowWindow
(
hWnd
,
SW_SHOW
);
UpdateWindow
(
hWnd
);
/* store the pointer to the HH info struct */
SetWindowLongPtrW
(
hWnd
,
GWLP_USERDATA
,
(
LONG_PTR
)
pHHInfo
);
pHHInfo
->
pHHWinType
->
hwndHelp
=
hWnd
;
return
TRUE
;
}
static
void
HH_CreateFont
(
HHInfo
*
pHHInfo
)
{
LOGFONTW
lf
;
GetObjectW
(
GetStockObject
(
ANSI_VAR_FONT
),
sizeof
(
LOGFONTW
),
&
lf
);
lf
.
lfWeight
=
FW_NORMAL
;
lf
.
lfItalic
=
FALSE
;
lf
.
lfUnderline
=
FALSE
;
pHHInfo
->
hFont
=
CreateFontIndirectW
(
&
lf
);
}
static
void
HH_InitRequiredControls
(
DWORD
dwControls
)
{
INITCOMMONCONTROLSEX
icex
;
icex
.
dwSize
=
sizeof
(
INITCOMMONCONTROLSEX
);
icex
.
dwICC
=
dwControls
;
InitCommonControlsEx
(
&
icex
);
}
/* Creates the whole package */
static
BOOL
HH_CreateViewer
(
HHInfo
*
pHHInfo
)
{
HH_CreateFont
(
pHHInfo
);
if
(
!
HH_CreateHelpWindow
(
pHHInfo
))
return
FALSE
;
HH_InitRequiredControls
(
ICC_BAR_CLASSES
);
if
(
!
HH_AddToolbar
(
pHHInfo
))
return
FALSE
;
if
(
!
HH_AddNavigationPane
(
pHHInfo
))
return
FALSE
;
if
(
!
HH_AddHTMLPane
(
pHHInfo
))
return
FALSE
;
return
TRUE
;
}
static
HHInfo
*
HH_OpenHH
(
HINSTANCE
hInstance
,
LPCWSTR
szCmdLine
)
{
HHInfo
*
pHHInfo
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
HHInfo
));
pHHInfo
->
pHHWinType
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
HH_WINTYPEW
));
pHHInfo
->
hInstance
=
hInstance
;
pHHInfo
->
szCmdLine
=
szCmdLine
;
return
pHHInfo
;
}
static
void
HH_Close
(
HHInfo
*
pHHInfo
)
{
if
(
!
pHHInfo
)
return
;
HeapFree
(
GetProcessHeap
(),
0
,
pHHInfo
->
pHHWinType
);
}
/* FIXME: Check szCmdLine for bad arguments */
int
WINAPI
doWinMain
(
HINSTANCE
hInstance
,
LPSTR
szCmdLine
)
{
MSG
msg
;
HHInfo
*
pHHInfo
;
if
(
OleInitialize
(
NULL
)
!=
S_OK
)
return
-
1
;
pHHInfo
=
HH_OpenHH
(
hInstance
,
HH_ANSIToUnicode
(
szCmdLine
));
if
(
!
pHHInfo
||
!
HH_CreateViewer
(
pHHInfo
))
{
OleUninitialize
();
return
-
1
;
}
while
(
GetMessageW
(
&
msg
,
0
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
DispatchMessageW
(
&
msg
);
}
HH_Close
(
pHHInfo
);
HeapFree
(
GetProcessHeap
(),
0
,
pHHInfo
);
OleUninitialize
();
return
0
;
}
dlls/hhctrl.ocx/hhctrl.c
View file @
8db2c26d
...
...
@@ -108,9 +108,3 @@ HWND WINAPI HtmlHelpA(HWND caller, LPCSTR filename, UINT command, DWORD data)
HeapFree
(
GetProcessHeap
(),
0
,
wfile
);
return
result
;
}
int
WINAPI
doWinMain
(
HMODULE
hMod
,
LPSTR
cmdline
)
{
FIXME
(
"(0x%x %s) stub!
\n
"
,
(
unsigned
)
hMod
,
debugstr_a
(
cmdline
));
return
-
1
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment