Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
864bfd8e
Commit
864bfd8e
authored
May 23, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
May 23, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shdocvw: Move inplace activating code to the separated function.
parent
86163e7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
48 deletions
+58
-48
oleobject.c
dlls/shdocvw/oleobject.c
+58
-48
No files found.
dlls/shdocvw/oleobject.c
View file @
864bfd8e
...
...
@@ -99,6 +99,59 @@ static void create_shell_embedding_hwnd(WebBrowser *This)
NULL
,
shdocvw_hinstance
,
This
);
}
static
HRESULT
activate_inplace
(
WebBrowser
*
This
,
IOleClientSite
*
active_site
,
HWND
parent_hwnd
)
{
HRESULT
hres
;
if
(
!
active_site
)
return
E_INVALIDARG
;
if
(
This
->
inplace
)
{
IOleInPlaceSite_Release
(
This
->
inplace
);
This
->
inplace
=
NULL
;
}
hres
=
IOleClientSite_QueryInterface
(
active_site
,
&
IID_IOleInPlaceSite
,
(
void
**
)
&
This
->
inplace
);
if
(
FAILED
(
hres
))
{
WARN
(
"Could not get IOleInPlaceSite
\n
"
);
return
hres
;
}
hres
=
IOleInPlaceSite_CanInPlaceActivate
(
This
->
inplace
);
if
(
hres
!=
S_OK
)
{
WARN
(
"CanInPlaceActivate returned: %08lx
\n
"
,
hres
);
IOleInPlaceSite_Release
(
This
->
inplace
);
return
E_FAIL
;
}
hres
=
IOleInPlaceSite_GetWindow
(
This
->
inplace
,
&
This
->
iphwnd
);
if
(
FAILED
(
hres
))
This
->
iphwnd
=
parent_hwnd
;
IOleInPlaceSite_OnInPlaceActivate
(
This
->
inplace
);
IOleInPlaceSite_GetWindowContext
(
This
->
inplace
,
&
This
->
frame
,
&
This
->
uiwindow
,
&
This
->
pos_rect
,
&
This
->
clip_rect
,
&
This
->
frameinfo
);
SetWindowPos
(
This
->
shell_embedding_hwnd
,
NULL
,
This
->
pos_rect
.
left
,
This
->
pos_rect
.
top
,
This
->
pos_rect
.
right
-
This
->
pos_rect
.
left
,
This
->
pos_rect
.
bottom
-
This
->
pos_rect
.
top
,
SWP_NOZORDER
|
SWP_SHOWWINDOW
);
if
(
This
->
client
)
{
IOleClientSite_ShowObject
(
This
->
client
);
IOleClientSite_GetContainer
(
This
->
client
,
&
This
->
container
);
}
if
(
This
->
frame
)
IOleInPlaceFrame_GetWindow
(
This
->
frame
,
&
This
->
frame_hwnd
);
return
S_OK
;
}
/**********************************************************************
* Implement the IOleObject interface for the WebBrowser control
*/
...
...
@@ -247,59 +300,16 @@ static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tag
switch
(
iVerb
)
{
case
OLEIVERB_SHOW
:
case
OLEIVERB_INPLACEACTIVATE
:
TRACE
(
"OLEIVERB_INPLACEACTIVATE
\n
"
);
return
activate_inplace
(
This
,
pActiveSite
,
hwndParent
);
if
(
!
pActiveSite
)
return
E_INVALIDARG
;
if
(
This
->
inplace
)
{
IOleInPlaceSite_Release
(
This
->
inplace
);
This
->
inplace
=
NULL
;
}
hres
=
IOleClientSite_QueryInterface
(
pActiveSite
,
&
IID_IOleInPlaceSite
,
(
void
**
)
&
This
->
inplace
);
if
(
FAILED
(
hres
))
{
WARN
(
"Could not get IOleInPlaceSite
\n
"
);
return
hres
;
}
hres
=
IOleInPlaceSite_CanInPlaceActivate
(
This
->
inplace
);
if
(
hres
!=
S_OK
)
{
WARN
(
"CanInPlaceActivate returned: %08lx
\n
"
,
hres
);
IOleInPlaceSite_Release
(
This
->
inplace
);
return
E_FAIL
;
}
case
OLEIVERB_SHOW
:
TRACE
(
"OLEIVERB_SHOW
\n
"
);
hres
=
IOleInPlaceSite_GetWindow
(
This
->
inplace
,
&
This
->
iphwnd
);
hres
=
activate_inplace
(
This
,
pActiveSite
,
hwndParent
);
if
(
FAILED
(
hres
))
This
->
iphwnd
=
hwndParent
;
IOleInPlaceSite_OnInPlaceActivate
(
This
->
inplace
);
IOleInPlaceSite_GetWindowContext
(
This
->
inplace
,
&
This
->
frame
,
&
This
->
uiwindow
,
&
This
->
pos_rect
,
&
This
->
clip_rect
,
&
This
->
frameinfo
);
SetWindowPos
(
This
->
shell_embedding_hwnd
,
NULL
,
This
->
pos_rect
.
left
,
This
->
pos_rect
.
top
,
This
->
pos_rect
.
right
-
This
->
pos_rect
.
left
,
This
->
pos_rect
.
bottom
-
This
->
pos_rect
.
top
,
SWP_NOZORDER
|
SWP_SHOWWINDOW
);
if
(
This
->
client
)
{
IOleClientSite_ShowObject
(
This
->
client
);
IOleClientSite_GetContainer
(
This
->
client
,
&
This
->
container
);
}
if
(
This
->
frame
)
IOleInPlaceFrame_GetWindow
(
This
->
frame
,
&
This
->
frame_hwnd
);
if
(
iVerb
==
OLEIVERB_INPLACEACTIVATE
)
return
S_OK
;
TRACE
(
"OLEIVERB_SHOW
\n
"
);
return
hres
;
IOleInPlaceSite_OnUIActivate
(
This
->
inplace
);
...
...
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