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
eea60a66
Commit
eea60a66
authored
Nov 28, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Activate document object.
parent
1b1880b0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
0 deletions
+87
-0
dochost.c
dlls/shdocvw/dochost.c
+77
-0
shdocvw.h
dlls/shdocvw/shdocvw.h
+4
-0
webbrowser.c
dlls/shdocvw/webbrowser.c
+6
-0
No files found.
dlls/shdocvw/dochost.c
View file @
eea60a66
...
...
@@ -18,11 +18,83 @@
#include "wine/debug.h"
#include "shdocvw.h"
#include "hlink.h"
#include "exdispid.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
shdocvw
);
static
ATOM
doc_view_atom
=
0
;
static
void
navigate_complete
(
WebBrowser
*
This
)
{
IDispatch
*
disp
,
*
docdisp
=
NULL
;
DISPPARAMS
dispparams
;
VARIANTARG
params
[
2
];
VARIANT
url
;
HRESULT
hres
;
hres
=
IOleClientSite_QueryInterface
(
This
->
client
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
if
(
FAILED
(
hres
))
return
;
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IDispatch
,
(
void
**
)
&
docdisp
);
if
(
FAILED
(
hres
))
FIXME
(
"Could not get IDispatch interface
\n
"
);
dispparams
.
cArgs
=
2
;
dispparams
.
cNamedArgs
=
0
;
dispparams
.
rgdispidNamedArgs
=
NULL
;
dispparams
.
rgvarg
=
params
;
V_VT
(
params
)
=
(
VT_BYREF
|
VT_VARIANT
);
V_BYREF
(
params
)
=
&
url
;
V_VT
(
params
+
1
)
=
VT_DISPATCH
;
V_DISPATCH
(
params
+
1
)
=
docdisp
;
V_VT
(
&
url
)
=
VT_BSTR
;
V_BSTR
(
&
url
)
=
This
->
url
;
IDispatch_Invoke
(
disp
,
DISPID_NAVIGATECOMPLETE2
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_METHOD
,
&
dispparams
,
NULL
,
NULL
,
NULL
);
IDispatch_Invoke
(
disp
,
DISPID_DOCUMENTCOMPLETE
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_METHOD
,
&
dispparams
,
NULL
,
NULL
,
NULL
);
IDispatch_Release
(
disp
);
if
(
docdisp
)
IDispatch_Release
(
docdisp
);
}
static
LRESULT
navigate2
(
WebBrowser
*
This
)
{
IHlinkTarget
*
hlink
;
HRESULT
hres
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
This
->
document
)
{
WARN
(
"document == NULL
\n
"
);
return
0
;
}
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IHlinkTarget
,
(
void
**
)
&
hlink
);
if
(
FAILED
(
hres
))
{
FIXME
(
"Could not get IHlinkTarget interface
\n
"
);
return
0
;
}
hres
=
IHlinkTarget_Navigate
(
hlink
,
0
,
NULL
);
IHlinkTarget_Release
(
hlink
);
if
(
FAILED
(
hres
))
{
FIXME
(
"Navigate failed
\n
"
);
return
0
;
}
navigate_complete
(
This
);
return
0
;
}
static
LRESULT
WINAPI
doc_view_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
WebBrowser
*
This
;
...
...
@@ -37,6 +109,11 @@ static LRESULT WINAPI doc_view_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
This
=
GetPropW
(
hwnd
,
wszTHIS
);
}
switch
(
msg
)
{
case
WB_WM_NAVIGATE2
:
return
navigate2
(
This
);
}
return
DefWindowProcA
(
hwnd
,
msg
,
wParam
,
lParam
);
}
...
...
dlls/shdocvw/shdocvw.h
View file @
eea60a66
...
...
@@ -91,6 +91,8 @@ typedef struct {
IOleContainer
*
container
;
IOleDocumentView
*
view
;
LPOLESTR
url
;
/* window context */
HWND
iphwnd
;
...
...
@@ -152,6 +154,8 @@ HRESULT WebBrowser_Create(IUnknown*,REFIID,void**);
void
create_doc_view_hwnd
(
WebBrowser
*
This
);
#define WB_WM_NAVIGATE2 (WM_USER+100)
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
/**********************************************************************
...
...
dlls/shdocvw/webbrowser.c
View file @
eea60a66
...
...
@@ -128,6 +128,7 @@ static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
WebBrowser_Events_Destroy
(
This
);
WebBrowser_ClientSite_Destroy
(
This
);
SysFreeString
(
This
->
url
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
SHDOCVW_UnlockModule
();
}
...
...
@@ -551,6 +552,8 @@ static HRESULT WINAPI WebBrowser_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VA
return
hres
;
}
This
->
url
=
SysAllocString
(
V_BSTR
(
URL
));
hres
=
IUnknown_QueryInterface
(
This
->
document
,
&
IID_IOleObject
,
(
void
**
)
&
oleobj
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -558,6 +561,8 @@ static HRESULT WINAPI WebBrowser_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VA
hres
=
IOleObject_SetClientSite
(
oleobj
,
CLIENTSITE
(
This
));
IOleObject_Release
(
oleobj
);
PostMessageW
(
This
->
doc_view_hwnd
,
WB_WM_NAVIGATE2
,
0
,
0
);
return
hres
;
}
...
...
@@ -783,6 +788,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
ret
->
ref
=
0
;
ret
->
document
=
NULL
;
ret
->
url
=
NULL
;
WebBrowser_OleObject_Init
(
ret
);
WebBrowser_ViewObject_Init
(
ret
);
...
...
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