Mercurial > dwindows
annotate win/browser.c @ 2793:24977a1ec6fc
iOS: Rewrite dw_window_redraw() so it actually works.
The existing code essentially did nothing, it just set the redraw and shown
state without actually doing anything. This new code works and Interface
Builder now displays correctly without needing to rotate the tablet.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 14 Jul 2022 06:22:19 +0000 |
parents | 2e804b4db81e |
children |
rev | line source |
---|---|
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1 /* Browser.c |
615
f253a7559a59
Allow context menu to be shown.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
584
diff
changeset
|
2 |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
3 This is a Win32 C application (ie, no MFC, WTL, nor even any C++ -- just plain C) that demonstrates |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
4 how to embed a browser "control" (actually, an OLE object) in your own window (in order to display a |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
5 web page, or an HTML file on disk). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
6 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
7 The example opens a main window with a child window into which we embed the browser object. We also |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
8 put "Back", "Forward", and "Stop" buttons in the main window to control the browser navigation. We |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
9 size the child window containing the browser so that there is room at the top of the main window for |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
10 the buttons. We also disable the pop-up context menu. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
11 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
12 This is very loosely based upon a C++ example written by Chris Becke. I used that to learn the minimum |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
13 of what I needed to know about hosting the browser object. Then I wrote this example from the ground up |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
14 in C. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
15 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
16 This requires IE 5.0 (or better) -- due to the IDocHostUIHandler interface, or a browser that supports |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
17 the same level of OLE in-place activation. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
18 */ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
19 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
20 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
21 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
22 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
23 |
1960
22e3e829be13
Win: Switch to using winsock 2.x, this will remove support for ancient versions of Windows like 95 and NT 3.5 and older...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1857
diff
changeset
|
24 #include <winsock2.h> |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
25 #include <windows.h> |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
26 #include <exdisp.h> // Defines of stuff like IWebBrowser2. This is an include file with Visual C 6 and above |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
27 #include <exdispid.h> |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
28 #include <mshtml.h> // Defines of stuff like IHTMLDocument2. This is an include file with Visual C 6 and above |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
29 #include <mshtmhst.h> // Defines of stuff like IDocHostUIHandler. This is an include file with Visual C 6 and above |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
30 #include <crtdbg.h> // for _ASSERT() |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
31 #include <initguid.h> |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
32 #include "dw.h" |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
33 |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
34 /* Import the character conversion functions from dw.c */ |
2625
2e804b4db81e
Win: Standardize internal function name style...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2058
diff
changeset
|
35 LPWSTR _dw_UTF8toWide(const char *utf8string, void *outbuf); |
2e804b4db81e
Win: Standardize internal function name style...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2058
diff
changeset
|
36 char *_dw_WideToUTF8(LPCWSTR widestring, void *outbuf); |
2e804b4db81e
Win: Standardize internal function name style...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2058
diff
changeset
|
37 #define UTF8toWide(a) _dw_UTF8toWide(a, a ? _alloca(MultiByteToWideChar(CP_UTF8, 0, a, -1, NULL, 0) * sizeof(WCHAR)) : NULL) |
2e804b4db81e
Win: Standardize internal function name style...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2058
diff
changeset
|
38 #define WideToUTF8(a) _dw_WideToUTF8(a, a ? _alloca(WideCharToMultiByte(CP_UTF8, 0, a, -1, NULL, 0, NULL, NULL)) : NULL) |
2e804b4db81e
Win: Standardize internal function name style...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2058
diff
changeset
|
39 LRESULT CALLBACK _dw_wndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2); |
2e804b4db81e
Win: Standardize internal function name style...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2058
diff
changeset
|
40 BOOL CALLBACK _dw_free_window_memory(HWND handle, LPARAM lParam); |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
41 |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
42 // This is used by DisplayHTMLStr(). It can be global because we never change it. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
43 static const SAFEARRAYBOUND ArrayBound = {1, 0}; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
44 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
45 // Our IStorage functions that the browser may call |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
46 HRESULT STDMETHODCALLTYPE Storage_QueryInterface(IStorage FAR* This, REFIID riid, LPVOID FAR* ppvObj); |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
47 ULONG STDMETHODCALLTYPE Storage_AddRef(IStorage FAR* This); |
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
48 ULONG STDMETHODCALLTYPE Storage_Release(IStorage FAR* This); |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
49 HRESULT STDMETHODCALLTYPE Storage_CreateStream(IStorage FAR* This, const WCHAR *pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream **ppstm); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
50 HRESULT STDMETHODCALLTYPE Storage_OpenStream(IStorage FAR* This, const WCHAR * pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream **ppstm); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
51 HRESULT STDMETHODCALLTYPE Storage_CreateStorage(IStorage FAR* This, const WCHAR *pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStorage **ppstg); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
52 HRESULT STDMETHODCALLTYPE Storage_OpenStorage(IStorage FAR* This, const WCHAR * pwcsName, IStorage * pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstg); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
53 HRESULT STDMETHODCALLTYPE Storage_CopyTo(IStorage FAR* This, DWORD ciidExclude, IID const *rgiidExclude, SNB snbExclude,IStorage *pstgDest); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
54 HRESULT STDMETHODCALLTYPE Storage_MoveElementTo(IStorage FAR* This, const OLECHAR *pwcsName,IStorage * pstgDest, const OLECHAR *pwcsNewName, DWORD grfFlags); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
55 HRESULT STDMETHODCALLTYPE Storage_Commit(IStorage FAR* This, DWORD grfCommitFlags); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
56 HRESULT STDMETHODCALLTYPE Storage_Revert(IStorage FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
57 HRESULT STDMETHODCALLTYPE Storage_EnumElements(IStorage FAR* This, DWORD reserved1, void * reserved2, DWORD reserved3, IEnumSTATSTG ** ppenum); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
58 HRESULT STDMETHODCALLTYPE Storage_DestroyElement(IStorage FAR* This, const OLECHAR *pwcsName); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
59 HRESULT STDMETHODCALLTYPE Storage_RenameElement(IStorage FAR* This, const WCHAR *pwcsOldName, const WCHAR *pwcsNewName); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
60 HRESULT STDMETHODCALLTYPE Storage_SetElementTimes(IStorage FAR* This, const WCHAR *pwcsName, FILETIME const *pctime, FILETIME const *patime, FILETIME const *pmtime); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
61 HRESULT STDMETHODCALLTYPE Storage_SetClass(IStorage FAR* This, REFCLSID clsid); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
62 HRESULT STDMETHODCALLTYPE Storage_SetStateBits(IStorage FAR* This, DWORD grfStateBits, DWORD grfMask); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
63 HRESULT STDMETHODCALLTYPE Storage_Stat(IStorage FAR* This, STATSTG * pstatstg, DWORD grfStatFlag); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
64 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
65 // Our IStorage VTable. This is the array of pointers to the above functions in our C |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
66 // program that someone may call in order to store some data to disk. We must define a |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
67 // particular set of functions that comprise the IStorage set of functions (see above), |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
68 // and then stuff pointers to those functions in their respective 'slots' in this table. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
69 // We want the browser to use this VTable with our IStorage structure (object). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
70 IStorageVtbl MyIStorageTable = {Storage_QueryInterface, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
71 Storage_AddRef, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
72 Storage_Release, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
73 Storage_CreateStream, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
74 Storage_OpenStream, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
75 Storage_CreateStorage, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
76 Storage_OpenStorage, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
77 Storage_CopyTo, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
78 Storage_MoveElementTo, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
79 Storage_Commit, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
80 Storage_Revert, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
81 Storage_EnumElements, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
82 Storage_DestroyElement, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
83 Storage_RenameElement, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
84 Storage_SetElementTimes, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
85 Storage_SetClass, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
86 Storage_SetStateBits, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
87 Storage_Stat}; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
88 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
89 // Our IStorage structure. NOTE: All it contains is a pointer to our IStorageVtbl, so we can easily initialize it |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
90 // here instead of doing that programmably. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
91 IStorage MyIStorage = { &MyIStorageTable }; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
92 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
93 // Our IOleInPlaceFrame functions that the browser may call |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
94 HRESULT STDMETHODCALLTYPE Frame_QueryInterface(IOleInPlaceFrame FAR* This, REFIID riid, LPVOID FAR* ppvObj); |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
95 ULONG STDMETHODCALLTYPE Frame_AddRef(IOleInPlaceFrame FAR* This); |
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
96 ULONG STDMETHODCALLTYPE Frame_Release(IOleInPlaceFrame FAR* This); |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
97 HRESULT STDMETHODCALLTYPE Frame_GetWindow(IOleInPlaceFrame FAR* This, HWND FAR* lphwnd); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
98 HRESULT STDMETHODCALLTYPE Frame_ContextSensitiveHelp(IOleInPlaceFrame FAR* This, BOOL fEnterMode); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
99 HRESULT STDMETHODCALLTYPE Frame_GetBorder(IOleInPlaceFrame FAR* This, LPRECT lprectBorder); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
100 HRESULT STDMETHODCALLTYPE Frame_RequestBorderSpace(IOleInPlaceFrame FAR* This, LPCBORDERWIDTHS pborderwidths); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
101 HRESULT STDMETHODCALLTYPE Frame_SetBorderSpace(IOleInPlaceFrame FAR* This, LPCBORDERWIDTHS pborderwidths); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
102 HRESULT STDMETHODCALLTYPE Frame_SetActiveObject(IOleInPlaceFrame FAR* This, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
103 HRESULT STDMETHODCALLTYPE Frame_InsertMenus(IOleInPlaceFrame FAR* This, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
104 HRESULT STDMETHODCALLTYPE Frame_SetMenu(IOleInPlaceFrame FAR* This, HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
105 HRESULT STDMETHODCALLTYPE Frame_RemoveMenus(IOleInPlaceFrame FAR* This, HMENU hmenuShared); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
106 HRESULT STDMETHODCALLTYPE Frame_SetStatusText(IOleInPlaceFrame FAR* This, LPCOLESTR pszStatusText); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
107 HRESULT STDMETHODCALLTYPE Frame_EnableModeless(IOleInPlaceFrame FAR* This, BOOL fEnable); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
108 HRESULT STDMETHODCALLTYPE Frame_TranslateAccelerator(IOleInPlaceFrame FAR* This, LPMSG lpmsg, WORD wID); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
109 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
110 // Our IOleInPlaceFrame VTable. This is the array of pointers to the above functions in our C |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
111 // program that the browser may call in order to interact with our frame window that contains |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
112 // the browser object. We must define a particular set of functions that comprise the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
113 // IOleInPlaceFrame set of functions (see above), and then stuff pointers to those functions |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
114 // in their respective 'slots' in this table. We want the browser to use this VTable with our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
115 // IOleInPlaceFrame structure. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
116 IOleInPlaceFrameVtbl MyIOleInPlaceFrameTable = {Frame_QueryInterface, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
117 Frame_AddRef, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
118 Frame_Release, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
119 Frame_GetWindow, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
120 Frame_ContextSensitiveHelp, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
121 Frame_GetBorder, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
122 Frame_RequestBorderSpace, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
123 Frame_SetBorderSpace, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
124 Frame_SetActiveObject, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
125 Frame_InsertMenus, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
126 Frame_SetMenu, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
127 Frame_RemoveMenus, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
128 Frame_SetStatusText, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
129 Frame_EnableModeless, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
130 Frame_TranslateAccelerator}; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
131 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
132 // We need to return an IOleInPlaceFrame struct to the browser object. And one of our IOleInPlaceFrame |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
133 // functions (Frame_GetWindow) is going to need to access our window handle. So let's create our own |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
134 // struct that starts off with an IOleInPlaceFrame struct (and that's important -- the IOleInPlaceFrame |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
135 // struct *must* be first), and then has an extra data field where we can store our own window's HWND. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
136 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
137 // And because we may want to create multiple windows, each hosting its own browser object (to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
138 // display its own web page), then we need to create a IOleInPlaceFrame struct for each window. So, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
139 // we're not going to declare our IOleInPlaceFrame struct globally. We'll allocate it later using |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
140 // GlobalAlloc, and then stuff the appropriate HWND in it then, and also stuff a pointer to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
141 // MyIOleInPlaceFrameTable in it. But let's just define it here. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
142 typedef struct { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
143 IOleInPlaceFrame frame; // The IOleInPlaceFrame must be first! |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
144 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
145 /////////////////////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
146 // Here you add any extra variables that you need |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
147 // to access in your IOleInPlaceFrame functions. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
148 // You don't want those functions to access global |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
149 // variables, because then you couldn't use more |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
150 // than one browser object. (ie, You couldn't have |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
151 // multiple windows, each with its own embedded |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
152 // browser object to display a different web page). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
153 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
154 // So here is where I added my extra HWND that my |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
155 // IOleInPlaceFrame function Frame_GetWindow() needs |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
156 // to access. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
157 /////////////////////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
158 HWND window; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
159 } _IOleInPlaceFrameEx; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
160 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
161 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
162 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
163 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
164 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
165 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
166 // Our IOleClientSite functions that the browser may call |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
167 HRESULT STDMETHODCALLTYPE Site_QueryInterface(IOleClientSite FAR* This, REFIID riid, void ** ppvObject); |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
168 ULONG STDMETHODCALLTYPE Site_AddRef(IOleClientSite FAR* This); |
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
169 ULONG STDMETHODCALLTYPE Site_Release(IOleClientSite FAR* This); |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
170 HRESULT STDMETHODCALLTYPE Site_SaveObject(IOleClientSite FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
171 HRESULT STDMETHODCALLTYPE Site_GetMoniker(IOleClientSite FAR* This, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker ** ppmk); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
172 HRESULT STDMETHODCALLTYPE Site_GetContainer(IOleClientSite FAR* This, LPOLECONTAINER FAR* ppContainer); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
173 HRESULT STDMETHODCALLTYPE Site_ShowObject(IOleClientSite FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
174 HRESULT STDMETHODCALLTYPE Site_OnShowWindow(IOleClientSite FAR* This, BOOL fShow); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
175 HRESULT STDMETHODCALLTYPE Site_RequestNewObjectLayout(IOleClientSite FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
176 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
177 // Our IOleClientSite VTable. This is the array of pointers to the above functions in our C |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
178 // program that the browser may call in order to interact with our frame window that contains |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
179 // the browser object. We must define a particular set of functions that comprise the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
180 // IOleClientSite set of functions (see above), and then stuff pointers to those functions |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
181 // in their respective 'slots' in this table. We want the browser to use this VTable with our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
182 // IOleClientSite structure. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
183 IOleClientSiteVtbl MyIOleClientSiteTable = {Site_QueryInterface, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
184 Site_AddRef, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
185 Site_Release, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
186 Site_SaveObject, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
187 Site_GetMoniker, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
188 Site_GetContainer, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
189 Site_ShowObject, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
190 Site_OnShowWindow, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
191 Site_RequestNewObjectLayout}; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
192 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
193 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
194 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
195 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
196 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
197 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
198 // Our IDocHostUIHandler functions that the browser may call |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
199 HRESULT STDMETHODCALLTYPE UI_QueryInterface(IDocHostUIHandler FAR* This, REFIID riid, void ** ppvObject); |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
200 ULONG STDMETHODCALLTYPE UI_AddRef(IDocHostUIHandler FAR* This); |
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
201 ULONG STDMETHODCALLTYPE UI_Release(IDocHostUIHandler FAR* This); |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
202 HRESULT STDMETHODCALLTYPE UI_ShowContextMenu(IDocHostUIHandler FAR* This, DWORD dwID, POINT __RPC_FAR *ppt, IUnknown __RPC_FAR *pcmdtReserved, IDispatch __RPC_FAR *pdispReserved); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
203 HRESULT STDMETHODCALLTYPE UI_GetHostInfo(IDocHostUIHandler FAR* This, DOCHOSTUIINFO __RPC_FAR *pInfo); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
204 HRESULT STDMETHODCALLTYPE UI_ShowUI(IDocHostUIHandler FAR* This, DWORD dwID, IOleInPlaceActiveObject __RPC_FAR *pActiveObject, IOleCommandTarget __RPC_FAR *pCommandTarget, IOleInPlaceFrame __RPC_FAR *pFrame, IOleInPlaceUIWindow __RPC_FAR *pDoc); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
205 HRESULT STDMETHODCALLTYPE UI_HideUI(IDocHostUIHandler FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
206 HRESULT STDMETHODCALLTYPE UI_UpdateUI(IDocHostUIHandler FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
207 HRESULT STDMETHODCALLTYPE UI_EnableModeless(IDocHostUIHandler FAR* This, BOOL fEnable); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
208 HRESULT STDMETHODCALLTYPE UI_OnDocWindowActivate(IDocHostUIHandler FAR* This, BOOL fActivate); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
209 HRESULT STDMETHODCALLTYPE UI_OnFrameWindowActivate(IDocHostUIHandler FAR* This, BOOL fActivate); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
210 HRESULT STDMETHODCALLTYPE UI_ResizeBorder(IDocHostUIHandler FAR* This, LPCRECT prcBorder, IOleInPlaceUIWindow __RPC_FAR *pUIWindow, BOOL fRameWindow); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
211 HRESULT STDMETHODCALLTYPE UI_TranslateAccelerator(IDocHostUIHandler FAR* This, LPMSG lpMsg, const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
212 HRESULT STDMETHODCALLTYPE UI_GetOptionKeyPath(IDocHostUIHandler FAR* This, LPOLESTR __RPC_FAR *pchKey, DWORD dw); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
213 HRESULT STDMETHODCALLTYPE UI_GetDropTarget(IDocHostUIHandler FAR* This, IDropTarget __RPC_FAR *pDropTarget, IDropTarget __RPC_FAR *__RPC_FAR *ppDropTarget); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
214 HRESULT STDMETHODCALLTYPE UI_GetExternal(IDocHostUIHandler FAR* This, IDispatch __RPC_FAR *__RPC_FAR *ppDispatch); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
215 HRESULT STDMETHODCALLTYPE UI_TranslateUrl(IDocHostUIHandler FAR* This, DWORD dwTranslate, OLECHAR __RPC_FAR *pchURLIn, OLECHAR __RPC_FAR *__RPC_FAR *ppchURLOut); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
216 HRESULT STDMETHODCALLTYPE UI_FilterDataObject(IDocHostUIHandler FAR* This, IDataObject __RPC_FAR *pDO, IDataObject __RPC_FAR *__RPC_FAR *ppDORet); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
217 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
218 // Our IDocHostUIHandler VTable. This is the array of pointers to the above functions in our C |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
219 // program that the browser may call in order to replace/set certain user interface considerations |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
220 // (such as whether to display a pop-up context menu when the user right-clicks on the embedded |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
221 // browser object). We must define a particular set of functions that comprise the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
222 // IDocHostUIHandler set of functions (see above), and then stuff pointers to those functions |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
223 // in their respective 'slots' in this table. We want the browser to use this VTable with our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
224 // IDocHostUIHandler structure. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
225 IDocHostUIHandlerVtbl MyIDocHostUIHandlerTable = {UI_QueryInterface, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
226 UI_AddRef, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
227 UI_Release, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
228 UI_ShowContextMenu, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
229 UI_GetHostInfo, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
230 UI_ShowUI, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
231 UI_HideUI, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
232 UI_UpdateUI, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
233 UI_EnableModeless, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
234 UI_OnDocWindowActivate, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
235 UI_OnFrameWindowActivate, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
236 UI_ResizeBorder, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
237 UI_TranslateAccelerator, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
238 UI_GetOptionKeyPath, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
239 UI_GetDropTarget, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
240 UI_GetExternal, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
241 UI_TranslateUrl, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
242 UI_FilterDataObject}; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
243 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
244 // We'll allocate our IDocHostUIHandler object dynamically with GlobalAlloc() for reasons outlined later. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
245 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
246 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
247 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
248 // Our IOleInPlaceSite functions that the browser may call |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
249 HRESULT STDMETHODCALLTYPE InPlace_QueryInterface(IOleInPlaceSite FAR* This, REFIID riid, void ** ppvObject); |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
250 ULONG STDMETHODCALLTYPE InPlace_AddRef(IOleInPlaceSite FAR* This); |
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
251 ULONG STDMETHODCALLTYPE InPlace_Release(IOleInPlaceSite FAR* This); |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
252 HRESULT STDMETHODCALLTYPE InPlace_GetWindow(IOleInPlaceSite FAR* This, HWND FAR* lphwnd); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
253 HRESULT STDMETHODCALLTYPE InPlace_ContextSensitiveHelp(IOleInPlaceSite FAR* This, BOOL fEnterMode); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
254 HRESULT STDMETHODCALLTYPE InPlace_CanInPlaceActivate(IOleInPlaceSite FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
255 HRESULT STDMETHODCALLTYPE InPlace_OnInPlaceActivate(IOleInPlaceSite FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
256 HRESULT STDMETHODCALLTYPE InPlace_OnUIActivate(IOleInPlaceSite FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
257 HRESULT STDMETHODCALLTYPE InPlace_GetWindowContext(IOleInPlaceSite FAR* This, LPOLEINPLACEFRAME FAR* lplpFrame,LPOLEINPLACEUIWINDOW FAR* lplpDoc,LPRECT lprcPosRect,LPRECT lprcClipRect,LPOLEINPLACEFRAMEINFO lpFrameInfo); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
258 HRESULT STDMETHODCALLTYPE InPlace_Scroll(IOleInPlaceSite FAR* This, SIZE scrollExtent); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
259 HRESULT STDMETHODCALLTYPE InPlace_OnUIDeactivate(IOleInPlaceSite FAR* This, BOOL fUndoable); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
260 HRESULT STDMETHODCALLTYPE InPlace_OnInPlaceDeactivate(IOleInPlaceSite FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
261 HRESULT STDMETHODCALLTYPE InPlace_DiscardUndoState(IOleInPlaceSite FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
262 HRESULT STDMETHODCALLTYPE InPlace_DeactivateAndUndo(IOleInPlaceSite FAR* This); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
263 HRESULT STDMETHODCALLTYPE InPlace_OnPosRectChange(IOleInPlaceSite FAR* This, LPCRECT lprcPosRect); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
264 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
265 // Our IOleInPlaceSite VTable. This is the array of pointers to the above functions in our C |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
266 // program that the browser may call in order to interact with our frame window that contains |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
267 // the browser object. We must define a particular set of functions that comprise the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
268 // IOleInPlaceSite set of functions (see above), and then stuff pointers to those functions |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
269 // in their respective 'slots' in this table. We want the browser to use this VTable with our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
270 // IOleInPlaceSite structure. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
271 IOleInPlaceSiteVtbl MyIOleInPlaceSiteTable = {InPlace_QueryInterface, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
272 InPlace_AddRef, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
273 InPlace_Release, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
274 InPlace_GetWindow, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
275 InPlace_ContextSensitiveHelp, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
276 InPlace_CanInPlaceActivate, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
277 InPlace_OnInPlaceActivate, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
278 InPlace_OnUIActivate, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
279 InPlace_GetWindowContext, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
280 InPlace_Scroll, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
281 InPlace_OnUIDeactivate, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
282 InPlace_OnInPlaceDeactivate, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
283 InPlace_DiscardUndoState, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
284 InPlace_DeactivateAndUndo, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
285 InPlace_OnPosRectChange}; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
286 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
287 // We need to pass our IOleClientSite structure to OleCreate (which in turn gives it to the browser). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
288 // But the browser is also going to ask our IOleClientSite's QueryInterface() to return a pointer to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
289 // our IOleInPlaceSite and/or IDocHostUIHandler structs. So we'll need to have those pointers handy. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
290 // Plus, some of our IOleClientSite and IOleInPlaceSite functions will need to have the HWND to our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
291 // window, and also a pointer to our IOleInPlaceFrame struct. So let's create a single struct that |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
292 // has the IOleClientSite, IOleInPlaceSite, IDocHostUIHandler, and IOleInPlaceFrame structs all inside |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
293 // it (so we can easily get a pointer to any one from any of those structs' functions). As long as the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
294 // IOleClientSite struct is the very first thing in this custom struct, it's all ok. We can still pass |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
295 // it to OleCreate() and pretend that it's an ordinary IOleClientSite. We'll call this new struct a |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
296 // _IOleClientSiteEx. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
297 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
298 // And because we may want to create multiple windows, each hosting its own browser object (to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
299 // display its own web page), then we need to create a unique _IOleClientSiteEx struct for |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
300 // each window. So, we're not going to declare this struct globally. We'll allocate it later |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
301 // using GlobalAlloc, and then initialize the structs within it. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
302 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
303 typedef struct { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
304 IOleInPlaceSite inplace; // My IOleInPlaceSite object. Must be first with in _IOleInPlaceSiteEx. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
305 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
306 /////////////////////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
307 // Here you add any extra variables that you need |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
308 // to access in your IOleInPlaceSite functions. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
309 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
310 // So here is where I added my IOleInPlaceFrame |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
311 // struct. If you need extra variables, add them |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
312 // at the end. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
313 /////////////////////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
314 _IOleInPlaceFrameEx frame; // My IOleInPlaceFrame object. Must be first within my _IOleInPlaceFrameEx |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
315 } _IOleInPlaceSiteEx; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
316 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
317 typedef struct { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
318 IDocHostUIHandler ui; // My IDocHostUIHandler object. Must be first. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
319 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
320 /////////////////////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
321 // Here you add any extra variables that you need |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
322 // to access in your IDocHostUIHandler functions. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
323 /////////////////////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
324 } _IDocHostUIHandlerEx; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
325 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
326 typedef struct { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
327 IOleClientSite client; // My IOleClientSite object. Must be first. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
328 _IOleInPlaceSiteEx inplace; // My IOleInPlaceSite object. A convenient place to put it. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
329 _IDocHostUIHandlerEx ui; // My IDocHostUIHandler object. Must be first within my _IDocHostUIHandlerEx. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
330 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
331 /////////////////////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
332 // Here you add any extra variables that you need |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
333 // to access in your IOleClientSite functions. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
334 /////////////////////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
335 } _IOleClientSiteEx; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
336 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
337 // This is a simple C example. There are lots more things you can control about the browser object, but |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
338 // we don't do it in this example. _Many_ of the functions we provide below for the browser to call, will |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
339 // never actually be called by the browser in our example. Why? Because we don't do certain things |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
340 // with the browser that would require it to call those functions (even though we need to provide |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
341 // at least some stub for all of the functions). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
342 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
343 // So, for these "dummy functions" that we don't expect the browser to call, we'll just stick in some |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
344 // assembly code that causes a debugger breakpoint and tells the browser object that we don't support |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
345 // the functionality. That way, if you try to do more things with the browser object, and it starts |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
346 // calling these "dummy functions", you'll know which ones you should add more meaningful code to. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
347 #define NOTIMPLEMENTED _ASSERT(0); return(E_NOTIMPL) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
348 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
349 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
350 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
351 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
352 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
353 //////////////////////////////////// My IDocHostUIHandler functions ////////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
354 // The browser object asks us for the pointer to our IDocHostUIHandler object by calling our IOleClientSite's |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
355 // QueryInterface (ie, Site_QueryInterface) and specifying a REFIID of IID_IDocHostUIHandler. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
356 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
357 // NOTE: You need at least IE 4.0. Previous versions do not ask for, nor utilize, our IDocHostUIHandler functions. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
358 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
359 HRESULT STDMETHODCALLTYPE UI_QueryInterface(IDocHostUIHandler FAR* This, REFIID riid, LPVOID FAR* ppvObj) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
360 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
361 // The browser assumes that our IDocHostUIHandler object is associated with our IOleClientSite |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
362 // object. So it is possible that the browser may call our IDocHostUIHandler's QueryInterface() |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
363 // to ask us to return a pointer to our IOleClientSite, in the same way that the browser calls |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
364 // our IOleClientSite's QueryInterface() to ask for a pointer to our IDocHostUIHandler. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
365 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
366 // Rather than duplicate much of the code in IOleClientSite's QueryInterface, let's just get |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
367 // a pointer to our _IOleClientSiteEx object, substitute it as the 'This' arg, and call our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
368 // our IOleClientSite's QueryInterface. Note that since our _IDocHostUIHandlerEx is embedded right |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
369 // inside our _IOleClientSiteEx, and comes immediately after the _IOleInPlaceSiteEx, we can employ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
370 // the following trickery to get the pointer to our _IOleClientSiteEx. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
371 return(Site_QueryInterface((IOleClientSite *)((char *)This - sizeof(IOleClientSite) - sizeof(_IOleInPlaceSiteEx)), riid, ppvObj)); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
372 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
373 |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
374 ULONG STDMETHODCALLTYPE UI_AddRef(IDocHostUIHandler FAR* This) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
375 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
376 return(1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
377 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
378 |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
379 ULONG STDMETHODCALLTYPE UI_Release(IDocHostUIHandler FAR* This) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
380 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
381 return(1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
382 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
383 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
384 // Called when the browser object is about to display its context menu. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
385 HRESULT STDMETHODCALLTYPE UI_ShowContextMenu(IDocHostUIHandler FAR* This, DWORD dwID, POINT __RPC_FAR *ppt, IUnknown __RPC_FAR *pcmdtReserved, IDispatch __RPC_FAR *pdispReserved) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
386 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
387 // If desired, we can pop up your own custom context menu here. Of course, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
388 // we would need some way to get our window handle, so what we'd probably |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
389 // do is like what we did with our IOleInPlaceFrame object. We'd define and create |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
390 // our own IDocHostUIHandlerEx object with an embedded IDocHostUIHandler at the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
391 // start of it. Then we'd add an extra HWND field to store our window handle. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
392 // It could look like this: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
393 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
394 // typedef struct _IDocHostUIHandlerEx { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
395 // IDocHostUIHandler ui; // The IDocHostUIHandler must be first! |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
396 // HWND window; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
397 // } IDocHostUIHandlerEx; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
398 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
399 // Of course, we'd need a unique IDocHostUIHandlerEx object for each window, so |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
400 // EmbedBrowserObject() would have to allocate one of those too. And that's |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
401 // what we'd pass to our browser object (and it would in turn pass it to us |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
402 // here, instead of 'This' being a IDocHostUIHandler *). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
403 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
404 // We will return S_OK to tell the browser not to display its default context menu, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
405 // or return S_FALSE to let the browser show its default context menu. For this |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
406 // example, we wish to disable the browser's default context menu. |
615
f253a7559a59
Allow context menu to be shown.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
584
diff
changeset
|
407 // return(S_OK); |
f253a7559a59
Allow context menu to be shown.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
584
diff
changeset
|
408 return(S_FALSE); |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
409 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
410 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
411 // Called at initialization of the browser object UI. We can set various features of the browser object here. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
412 HRESULT STDMETHODCALLTYPE UI_GetHostInfo(IDocHostUIHandler FAR* This, DOCHOSTUIINFO __RPC_FAR *pInfo) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
413 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
414 pInfo->cbSize = sizeof(DOCHOSTUIINFO); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
415 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
416 // Set some flags. We don't want any 3D border. You can do other things like hide |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
417 // the scroll bar (DOCHOSTUIFLAG_SCROLL_NO), display picture display (DOCHOSTUIFLAG_NOPICS), |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
418 // disable any script running when the page is loaded (DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE), |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
419 // open a site in a new browser window when the user clicks on some link (DOCHOSTUIFLAG_OPENNEWWIN), |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
420 // and lots of other things. See the MSDN docs on the DOCHOSTUIINFO struct passed to us. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
421 pInfo->dwFlags = DOCHOSTUIFLAG_NO3DBORDER; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
422 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
423 // Set what happens when the user double-clicks on the object. Here we use the default. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
424 pInfo->dwDoubleClick = DOCHOSTUIDBLCLK_DEFAULT; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
425 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
426 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
427 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
428 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
429 // Called when the browser object shows its UI. This allows us to replace its menus and toolbars by creating our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
430 // own and displaying them here. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
431 HRESULT STDMETHODCALLTYPE UI_ShowUI(IDocHostUIHandler FAR* This, DWORD dwID, IOleInPlaceActiveObject __RPC_FAR *pActiveObject, IOleCommandTarget __RPC_FAR *pCommandTarget, IOleInPlaceFrame __RPC_FAR *pFrame, IOleInPlaceUIWindow __RPC_FAR *pDoc) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
432 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
433 // We've already got our own UI in place so just return S_OK to tell the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
434 // not to display its menus/toolbars. Otherwise we'd return S_FALSE to let it do |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
435 // that. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
436 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
437 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
438 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
439 // Called when browser object hides its UI. This allows us to hide any menus/toolbars we created in ShowUI. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
440 HRESULT STDMETHODCALLTYPE UI_HideUI(IDocHostUIHandler FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
441 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
442 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
443 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
444 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
445 // Called when the browser object wants to notify us that the command state has changed. We should update any |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
446 // controls we have that are dependent upon our embedded object, such as "Back", "Forward", "Stop", or "Home" |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
447 // buttons. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
448 HRESULT STDMETHODCALLTYPE UI_UpdateUI(IDocHostUIHandler FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
449 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
450 // We update our UI in our window message loop so we don't do anything here. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
451 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
452 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
453 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
454 // Called from the browser object's IOleInPlaceActiveObject object's EnableModeless() function. Also |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
455 // called when the browser displays a modal dialog box. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
456 HRESULT STDMETHODCALLTYPE UI_EnableModeless(IDocHostUIHandler FAR* This, BOOL fEnable) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
457 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
458 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
459 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
460 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
461 // Called from the browser object's IOleInPlaceActiveObject object's OnDocWindowActivate() function. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
462 // This informs off of when the object is getting/losing the focus. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
463 HRESULT STDMETHODCALLTYPE UI_OnDocWindowActivate(IDocHostUIHandler FAR* This, BOOL fActivate) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
464 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
465 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
466 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
467 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
468 // Called from the browser object's IOleInPlaceActiveObject object's OnFrameWindowActivate() function. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
469 HRESULT STDMETHODCALLTYPE UI_OnFrameWindowActivate(IDocHostUIHandler FAR* This, BOOL fActivate) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
470 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
471 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
472 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
473 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
474 // Called from the browser object's IOleInPlaceActiveObject object's ResizeBorder() function. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
475 HRESULT STDMETHODCALLTYPE UI_ResizeBorder(IDocHostUIHandler FAR* This, LPCRECT prcBorder, IOleInPlaceUIWindow __RPC_FAR *pUIWindow, BOOL fRameWindow) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
476 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
477 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
478 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
479 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
480 // Called from the browser object's TranslateAccelerator routines to translate key strokes to commands. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
481 HRESULT STDMETHODCALLTYPE UI_TranslateAccelerator(IDocHostUIHandler FAR* This, LPMSG lpMsg, const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
482 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
483 // We don't intercept any keystrokes, so we do nothing here. But for example, if we wanted to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
484 // override the TAB key, perhaps do something with it ourselves, and then tell the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
485 // not to do anything with this keystroke, we'd do: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
486 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
487 // if (pMsg && pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
488 // { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
489 // // Here we do something as a result of a TAB key press. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
490 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
491 // // Tell the browser not to do anything with it. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
492 // return(S_FALSE); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
493 // } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
494 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
495 // // Otherwise, let the browser do something with this message. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
496 // return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
497 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
498 // For our example, we want to make sure that the user can invoke some key to popup the context |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
499 // menu, so we'll tell it to ignore all messages. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
500 return(S_FALSE); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
501 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
502 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
503 // Called by the browser object to find where the host wishes the browser to get its options in the registry. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
504 // We can use this to prevent the browser from using its default settings in the registry, by telling it to use |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
505 // some other registry key we've setup with the options we want. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
506 HRESULT STDMETHODCALLTYPE UI_GetOptionKeyPath(IDocHostUIHandler FAR* This, LPOLESTR __RPC_FAR *pchKey, DWORD dw) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
507 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
508 // Let the browser use its default registry settings. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
509 return(S_FALSE); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
510 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
511 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
512 // Called by the browser object when it is used as a drop target. We can supply our own IDropTarget object, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
513 // IDropTarget functions, and IDropTarget VTable if we want to determine what happens when someone drags and |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
514 // drops some object on our embedded browser object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
515 HRESULT STDMETHODCALLTYPE UI_GetDropTarget(IDocHostUIHandler FAR* This, IDropTarget __RPC_FAR *pDropTarget, IDropTarget __RPC_FAR *__RPC_FAR *ppDropTarget) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
516 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
517 // Return our IDropTarget object associated with this IDocHostUIHandler object. I don't |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
518 // know why we don't do this via UI_QueryInterface(), but we don't. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
519 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
520 // NOTE: If we want/need an IDropTarget interface, then we would have had to setup our own |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
521 // IDropTarget functions, IDropTarget VTable, and create an IDropTarget object. We'd want to put |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
522 // a pointer to the IDropTarget object in our own custom IDocHostUIHandlerEx object (like how |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
523 // we may add an HWND field for the use of UI_ShowContextMenu). So when we created our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
524 // IDocHostUIHandlerEx object, maybe we'd add a 'idrop' field to the end of it, and |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
525 // store a pointer to our IDropTarget object there. Then we could return this pointer as so: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
526 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
527 // *pDropTarget = ((IDocHostUIHandlerEx FAR *)This)->idrop; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
528 // return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
529 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
530 // But for our purposes, we don't need an IDropTarget object, so we'll tell whomever is calling |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
531 // us that we don't have one. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
532 return(S_FALSE); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
533 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
534 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
535 // Called by the browser when it wants a pointer to our IDispatch object. This object allows us to expose |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
536 // our own automation interface (ie, our own COM objects) to other entities that are running within the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
537 // context of the browser so they can call our functions if they want. An example could be a javascript |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
538 // running in the URL we display could call our IDispatch functions. We'd write them so that any args passed |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
539 // to them would use the generic datatypes like a BSTR for utmost flexibility. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
540 HRESULT STDMETHODCALLTYPE UI_GetExternal(IDocHostUIHandler FAR* This, IDispatch __RPC_FAR *__RPC_FAR *ppDispatch) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
541 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
542 // Return our IDispatch object associated with this IDocHostUIHandler object. I don't |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
543 // know why we don't do this via UI_QueryInterface(), but we don't. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
544 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
545 // NOTE: If we want/need an IDispatch interface, then we would have had to setup our own |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
546 // IDispatch functions, IDispatch VTable, and create an IDispatch object. We'd want to put |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
547 // a pointer to the IDispatch object in our custom _IDocHostUIHandlerEx object (like how |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
548 // we may add an HWND field for the use of UI_ShowContextMenu). So when we defined our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
549 // _IDocHostUIHandlerEx object, maybe we'd add a 'idispatch' field to the end of it, and |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
550 // store a pointer to our IDispatch object there. Then we could return this pointer as so: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
551 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
552 // *ppDispatch = ((_IDocHostUIHandlerEx FAR *)This)->idispatch; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
553 // return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
554 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
555 // But for our purposes, we don't need an IDispatch object, so we'll tell whomever is calling |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
556 // us that we don't have one. Note: We must set ppDispatch to 0 if we don't return our own |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
557 // IDispatch object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
558 *ppDispatch = 0; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
559 return(S_FALSE); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
560 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
561 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
562 // Called by the browser object to give us an opportunity to modify the URL to be loaded. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
563 HRESULT STDMETHODCALLTYPE UI_TranslateUrl(IDocHostUIHandler FAR* This, DWORD dwTranslate, OLECHAR __RPC_FAR *pchURLIn, OLECHAR __RPC_FAR *__RPC_FAR *ppchURLOut) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
564 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
565 // We don't need to modify the URL. Note: We need to set ppchURLOut to 0 if we don't |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
566 // return an OLECHAR (buffer) containing a modified version of pchURLIn. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
567 *ppchURLOut = 0; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
568 return(S_FALSE); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
569 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
570 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
571 // Called by the browser when it does cut/paste to the clipboard. This allows us to block certain clipboard |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
572 // formats or support additional clipboard formats. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
573 HRESULT STDMETHODCALLTYPE UI_FilterDataObject(IDocHostUIHandler FAR* This, IDataObject __RPC_FAR *pDO, IDataObject __RPC_FAR *__RPC_FAR *ppDORet) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
574 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
575 // Return our IDataObject object associated with this IDocHostUIHandler object. I don't |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
576 // know why we don't do this via UI_QueryInterface(), but we don't. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
577 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
578 // NOTE: If we want/need an IDataObject interface, then we would have had to setup our own |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
579 // IDataObject functions, IDataObject VTable, and create an IDataObject object. We'd want to put |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
580 // a pointer to the IDataObject object in our custom _IDocHostUIHandlerEx object (like how |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
581 // we may add an HWND field for the use of UI_ShowContextMenu). So when we defined our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
582 // _IDocHostUIHandlerEx object, maybe we'd add a 'idata' field to the end of it, and |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
583 // store a pointer to our IDataObject object there. Then we could return this pointer as so: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
584 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
585 // *ppDORet = ((_IDocHostUIHandlerEx FAR *)This)->idata; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
586 // return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
587 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
588 // But for our purposes, we don't need an IDataObject object, so we'll tell whomever is calling |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
589 // us that we don't have one. Note: We must set ppDORet to 0 if we don't return our own |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
590 // IDataObject object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
591 *ppDORet = 0; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
592 return(S_FALSE); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
593 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
594 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
595 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
596 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
597 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
598 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
599 ////////////////////////////////////// My IStorage functions ///////////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
600 // NOTE: The browser object doesn't use the IStorage functions, so most of these are us just returning |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
601 // E_NOTIMPL so that anyone who *does* call these functions knows nothing is being done here. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
602 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
603 // We give the browser object a pointer to our IStorage object when we call OleCreate(). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
604 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
605 HRESULT STDMETHODCALLTYPE Storage_QueryInterface(IStorage FAR* This, REFIID riid, LPVOID FAR* ppvObj) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
606 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
607 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
608 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
609 |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
610 ULONG STDMETHODCALLTYPE Storage_AddRef(IStorage FAR* This) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
611 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
612 return(1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
613 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
614 |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
615 ULONG STDMETHODCALLTYPE Storage_Release(IStorage FAR* This) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
616 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
617 return(1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
618 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
619 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
620 HRESULT STDMETHODCALLTYPE Storage_CreateStream(IStorage FAR* This, const WCHAR *pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream **ppstm) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
621 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
622 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
623 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
624 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
625 HRESULT STDMETHODCALLTYPE Storage_OpenStream(IStorage FAR* This, const WCHAR * pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream **ppstm) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
626 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
627 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
628 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
629 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
630 HRESULT STDMETHODCALLTYPE Storage_CreateStorage(IStorage FAR* This, const WCHAR *pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStorage **ppstg) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
631 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
632 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
633 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
634 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
635 HRESULT STDMETHODCALLTYPE Storage_OpenStorage(IStorage FAR* This, const WCHAR * pwcsName, IStorage * pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstg) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
636 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
637 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
638 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
639 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
640 HRESULT STDMETHODCALLTYPE Storage_CopyTo(IStorage FAR* This, DWORD ciidExclude, IID const *rgiidExclude, SNB snbExclude,IStorage *pstgDest) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
641 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
642 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
643 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
644 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
645 HRESULT STDMETHODCALLTYPE Storage_MoveElementTo(IStorage FAR* This, const OLECHAR *pwcsName,IStorage * pstgDest, const OLECHAR *pwcsNewName, DWORD grfFlags) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
646 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
647 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
648 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
649 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
650 HRESULT STDMETHODCALLTYPE Storage_Commit(IStorage FAR* This, DWORD grfCommitFlags) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
651 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
652 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
653 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
654 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
655 HRESULT STDMETHODCALLTYPE Storage_Revert(IStorage FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
656 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
657 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
658 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
659 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
660 HRESULT STDMETHODCALLTYPE Storage_EnumElements(IStorage FAR* This, DWORD reserved1, void * reserved2, DWORD reserved3, IEnumSTATSTG ** ppenum) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
661 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
662 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
663 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
664 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
665 HRESULT STDMETHODCALLTYPE Storage_DestroyElement(IStorage FAR* This, const OLECHAR *pwcsName) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
666 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
667 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
668 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
669 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
670 HRESULT STDMETHODCALLTYPE Storage_RenameElement(IStorage FAR* This, const WCHAR *pwcsOldName, const WCHAR *pwcsNewName) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
671 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
672 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
673 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
674 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
675 HRESULT STDMETHODCALLTYPE Storage_SetElementTimes(IStorage FAR* This, const WCHAR *pwcsName, FILETIME const *pctime, FILETIME const *patime, FILETIME const *pmtime) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
676 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
677 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
678 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
679 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
680 HRESULT STDMETHODCALLTYPE Storage_SetClass(IStorage FAR* This, REFCLSID clsid) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
681 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
682 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
683 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
684 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
685 HRESULT STDMETHODCALLTYPE Storage_SetStateBits(IStorage FAR* This, DWORD grfStateBits, DWORD grfMask) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
686 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
687 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
688 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
689 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
690 HRESULT STDMETHODCALLTYPE Storage_Stat(IStorage FAR* This, STATSTG * pstatstg, DWORD grfStatFlag) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
691 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
692 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
693 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
694 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
695 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
696 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
697 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
698 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
699 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
700 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
701 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
702 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
703 ////////////////////////////////////// My IOleClientSite functions ///////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
704 // We give the browser object a pointer to our IOleClientSite object when we call OleCreate() or DoVerb(). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
705 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
706 /************************* Site_QueryInterface() ************************* |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
707 * The browser object calls this when it wants a pointer to one of our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
708 * IOleClientSite, IDocHostUIHandler, or IOleInPlaceSite structures. They |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
709 * are all accessible via the _IOleClientSiteEx struct we allocated in |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
710 * EmbedBrowserObject() and passed to DoVerb() and OleCreate(). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
711 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
712 * This = A pointer to whatever _IOleClientSiteEx struct we passed to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
713 * OleCreate() or DoVerb(). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
714 * riid = A GUID struct that the browser passes us to clue us as to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
715 * which type of struct (object) it would like a pointer |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
716 * returned for. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
717 * ppvObject = Where the browser wants us to return a pointer to the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
718 * appropriate struct. (ie, It passes us a handle to fill in). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
719 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
720 * RETURNS: S_OK if we return the struct, or E_NOINTERFACE if we don't have |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
721 * the requested struct. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
722 */ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
723 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
724 HRESULT STDMETHODCALLTYPE Site_QueryInterface(IOleClientSite FAR* This, REFIID riid, void ** ppvObject) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
725 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
726 // It just so happens that the first arg passed to us is our _IOleClientSiteEx struct we allocated |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
727 // and passed to DoVerb() and OleCreate(). Nevermind that 'This' is declared is an IOleClientSite *. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
728 // Remember that in EmbedBrowserObject(), we allocated our own _IOleClientSiteEx struct, and lied |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
729 // to OleCreate() and DoVerb() -- passing our _IOleClientSiteEx struct and saying it was an |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
730 // IOleClientSite struct. It's ok. An _IOleClientSiteEx starts with an embedded IOleClientSite, so |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
731 // the browser didn't mind. So that's what the browser object is passing us now. The browser doesn't |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
732 // know that it's really an _IOleClientSiteEx struct. But we do. So we can recast it and use it as |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
733 // so here. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
734 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
735 // If the browser is asking us to match IID_IOleClientSite, then it wants us to return a pointer to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
736 // our IOleClientSite struct. Then the browser will use the VTable in that struct to call our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
737 // IOleClientSite functions. It will also pass this same pointer to all of our IOleClientSite |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
738 // functions. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
739 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
740 // Actually, we're going to lie to the browser again. We're going to return our own _IOleClientSiteEx |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
741 // struct, and tell the browser that it's a IOleClientSite struct. It's ok. The first thing in our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
742 // _IOleClientSiteEx is an embedded IOleClientSite, so the browser doesn't mind. We want the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
743 // to continue passing our _IOleClientSiteEx pointer wherever it would normally pass a IOleClientSite |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
744 // pointer. |
615
f253a7559a59
Allow context menu to be shown.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
584
diff
changeset
|
745 // |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
746 // The IUnknown interface uses the same VTable as the first object in our _IOleClientSiteEx |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
747 // struct (which happens to be an IOleClientSite). So if the browser is asking us to match |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
748 // IID_IUnknown, then we'll also return a pointer to our _IOleClientSiteEx. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
749 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
750 if (!memcmp(riid, &IID_IUnknown, sizeof(GUID)) || !memcmp(riid, &IID_IOleClientSite, sizeof(GUID))) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
751 *ppvObject = &((_IOleClientSiteEx *)This)->client; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
752 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
753 // If the browser is asking us to match IID_IOleInPlaceSite, then it wants us to return a pointer to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
754 // our IOleInPlaceSite struct. Then the browser will use the VTable in that struct to call our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
755 // IOleInPlaceSite functions. It will also pass this same pointer to all of our IOleInPlaceSite |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
756 // functions (except for Site_QueryInterface, Site_AddRef, and Site_Release. Those will always get |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
757 // the pointer to our _IOleClientSiteEx. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
758 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
759 // Actually, we're going to lie to the browser. We're going to return our own _IOleInPlaceSiteEx |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
760 // struct, and tell the browser that it's a IOleInPlaceSite struct. It's ok. The first thing in |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
761 // our _IOleInPlaceSiteEx is an embedded IOleInPlaceSite, so the browser doesn't mind. We want the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
762 // browser to continue passing our _IOleInPlaceSiteEx pointer wherever it would normally pass a |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
763 // IOleInPlaceSite pointer. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
764 else if (!memcmp(riid, &IID_IOleInPlaceSite, sizeof(GUID))) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
765 *ppvObject = &((_IOleClientSiteEx *)This)->inplace; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
766 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
767 // If the browser is asking us to match IID_IDocHostUIHandler, then it wants us to return a pointer to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
768 // our IDocHostUIHandler struct. Then the browser will use the VTable in that struct to call our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
769 // IDocHostUIHandler functions. It will also pass this same pointer to all of our IDocHostUIHandler |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
770 // functions (except for Site_QueryInterface, Site_AddRef, and Site_Release. Those will always get |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
771 // the pointer to our _IOleClientSiteEx. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
772 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
773 // Actually, we're going to lie to the browser. We're going to return our own _IDocHostUIHandlerEx |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
774 // struct, and tell the browser that it's a IDocHostUIHandler struct. It's ok. The first thing in |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
775 // our _IDocHostUIHandlerEx is an embedded IDocHostUIHandler, so the browser doesn't mind. We want the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
776 // browser to continue passing our _IDocHostUIHandlerEx pointer wherever it would normally pass a |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
777 // IDocHostUIHandler pointer. My, we're really playing dirty tricks on the browser here. heheh. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
778 else if (!memcmp(riid, &IID_IDocHostUIHandler, sizeof(GUID))) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
779 *ppvObject = &((_IOleClientSiteEx *)This)->ui; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
780 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
781 // For other types of objects the browser wants, just report that we don't have any such objects. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
782 // NOTE: If you want to add additional functionality to your browser hosting, you may need to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
783 // provide some more objects here. You'll have to investigate what the browser is asking for |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
784 // (ie, what REFIID it is passing). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
785 else |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
786 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
787 *ppvObject = 0; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
788 return(E_NOINTERFACE); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
789 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
790 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
791 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
792 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
793 |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
794 ULONG STDMETHODCALLTYPE Site_AddRef(IOleClientSite FAR* This) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
795 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
796 return(1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
797 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
798 |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
799 ULONG STDMETHODCALLTYPE Site_Release(IOleClientSite FAR* This) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
800 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
801 return(1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
802 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
803 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
804 HRESULT STDMETHODCALLTYPE Site_SaveObject(IOleClientSite FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
805 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
806 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
807 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
808 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
809 HRESULT STDMETHODCALLTYPE Site_GetMoniker(IOleClientSite FAR* This, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker ** ppmk) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
810 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
811 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
812 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
813 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
814 HRESULT STDMETHODCALLTYPE Site_GetContainer(IOleClientSite FAR* This, LPOLECONTAINER FAR* ppContainer) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
815 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
816 // Tell the browser that we are a simple object and don't support a container |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
817 *ppContainer = 0; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
818 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
819 return(E_NOINTERFACE); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
820 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
821 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
822 HRESULT STDMETHODCALLTYPE Site_ShowObject(IOleClientSite FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
823 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
824 return(NOERROR); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
825 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
826 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
827 HRESULT STDMETHODCALLTYPE Site_OnShowWindow(IOleClientSite FAR* This, BOOL fShow) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
828 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
829 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
830 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
831 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
832 HRESULT STDMETHODCALLTYPE Site_RequestNewObjectLayout(IOleClientSite FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
833 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
834 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
835 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
836 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
837 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
838 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
839 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
840 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
841 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
842 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
843 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
844 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
845 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
846 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
847 ////////////////////////////////////// My IOleInPlaceSite functions ///////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
848 // The browser object asks us for the pointer to our IOleInPlaceSite object by calling our IOleClientSite's |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
849 // QueryInterface (ie, Site_QueryInterface) and specifying a REFIID of IID_IOleInPlaceSite. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
850 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
851 HRESULT STDMETHODCALLTYPE InPlace_QueryInterface(IOleInPlaceSite FAR* This, REFIID riid, LPVOID FAR* ppvObj) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
852 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
853 // The browser assumes that our IOleInPlaceSite object is associated with our IOleClientSite |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
854 // object. So it is possible that the browser may call our IOleInPlaceSite's QueryInterface() |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
855 // to ask us to return a pointer to our IOleClientSite, in the same way that the browser calls |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
856 // our IOleClientSite's QueryInterface() to ask for a pointer to our IOleInPlaceSite. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
857 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
858 // Rather than duplicate much of the code in IOleClientSite's QueryInterface, let's just get |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
859 // a pointer to our _IOleClientSiteEx object, substitute it as the 'This' arg, and call our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
860 // our IOleClientSite's QueryInterface. Note that since our IOleInPlaceSite is embedded right |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
861 // inside our _IOleClientSiteEx, and comes immediately after the IOleClientSite, we can employ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
862 // the following trickery to get the pointer to our _IOleClientSiteEx. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
863 return(Site_QueryInterface((IOleClientSite *)((char *)This - sizeof(IOleClientSite)), riid, ppvObj)); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
864 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
865 |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
866 ULONG STDMETHODCALLTYPE InPlace_AddRef(IOleInPlaceSite FAR* This) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
867 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
868 return(1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
869 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
870 |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
871 ULONG STDMETHODCALLTYPE InPlace_Release(IOleInPlaceSite FAR* This) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
872 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
873 return(1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
874 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
875 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
876 HRESULT STDMETHODCALLTYPE InPlace_GetWindow(IOleInPlaceSite FAR* This, HWND FAR* lphwnd) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
877 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
878 // Return the HWND of the window that contains this browser object. We stored that |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
879 // HWND in our _IOleInPlaceSiteEx struct. Nevermind that the function declaration for |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
880 // Site_GetWindow says that 'This' is an IOleInPlaceSite *. Remember that in |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
881 // EmbedBrowserObject(), we allocated our own _IOleInPlaceSiteEx struct which |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
882 // contained an embedded IOleInPlaceSite struct within it. And when the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
883 // called Site_QueryInterface() to get a pointer to our IOleInPlaceSite object, we |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
884 // returned a pointer to our _IOleClientSiteEx. The browser doesn't know this. But |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
885 // we do. That's what we're really being passed, so we can recast it and use it as |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
886 // so here. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
887 *lphwnd = ((_IOleInPlaceSiteEx FAR*)This)->frame.window; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
888 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
889 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
890 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
891 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
892 HRESULT STDMETHODCALLTYPE InPlace_ContextSensitiveHelp(IOleInPlaceSite FAR* This, BOOL fEnterMode) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
893 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
894 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
895 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
896 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
897 HRESULT STDMETHODCALLTYPE InPlace_CanInPlaceActivate(IOleInPlaceSite FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
898 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
899 // Tell the browser we can in place activate |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
900 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
901 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
902 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
903 HRESULT STDMETHODCALLTYPE InPlace_OnInPlaceActivate(IOleInPlaceSite FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
904 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
905 // Tell the browser we did it ok |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
906 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
907 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
908 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
909 HRESULT STDMETHODCALLTYPE InPlace_OnUIActivate(IOleInPlaceSite FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
910 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
911 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
912 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
913 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
914 HRESULT STDMETHODCALLTYPE InPlace_GetWindowContext(IOleInPlaceSite FAR* This, LPOLEINPLACEFRAME FAR* lplpFrame, LPOLEINPLACEUIWINDOW FAR* lplpDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
915 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
916 // Give the browser the pointer to our IOleInPlaceFrame struct. We stored that pointer |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
917 // in our _IOleInPlaceSiteEx struct. Nevermind that the function declaration for |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
918 // Site_GetWindowContext says that 'This' is an IOleInPlaceSite *. Remember that in |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
919 // EmbedBrowserObject(), we allocated our own _IOleInPlaceSiteEx struct which |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
920 // contained an embedded IOleInPlaceSite struct within it. And when the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
921 // called Site_QueryInterface() to get a pointer to our IOleInPlaceSite object, we |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
922 // returned a pointer to our _IOleClientSiteEx. The browser doesn't know this. But |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
923 // we do. That's what we're really being passed, so we can recast it and use it as |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
924 // so here. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
925 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
926 // Actually, we're giving the browser a pointer to our own _IOleInPlaceSiteEx struct, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
927 // but telling the browser that it's a IOleInPlaceSite struct. No problem. Our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
928 // _IOleInPlaceSiteEx starts with an embedded IOleInPlaceSite, so the browser is |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
929 // cool with it. And we want the browser to pass a pointer to this _IOleInPlaceSiteEx |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
930 // wherever it would pass a IOleInPlaceSite struct to our IOleInPlaceSite functions. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
931 *lplpFrame = (LPOLEINPLACEFRAME)&((_IOleInPlaceSiteEx *)This)->frame; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
932 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
933 // We have no OLEINPLACEUIWINDOW |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
934 *lplpDoc = 0; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
935 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
936 // Fill in some other info for the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
937 lpFrameInfo->fMDIApp = FALSE; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
938 lpFrameInfo->hwndFrame = ((_IOleInPlaceFrameEx *)*lplpFrame)->window; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
939 lpFrameInfo->haccel = 0; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
940 lpFrameInfo->cAccelEntries = 0; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
941 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
942 // Give the browser the dimensions of where it can draw. We give it our entire window to fill. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
943 // We do this in InPlace_OnPosRectChange() which is called right when a window is first |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
944 // created anyway, so no need to duplicate it here. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
945 // GetClientRect(lpFrameInfo->hwndFrame, lprcPosRect); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
946 // GetClientRect(lpFrameInfo->hwndFrame, lprcClipRect); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
947 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
948 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
949 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
950 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
951 HRESULT STDMETHODCALLTYPE InPlace_Scroll(IOleInPlaceSite FAR* This, SIZE scrollExtent) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
952 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
953 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
954 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
955 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
956 HRESULT STDMETHODCALLTYPE InPlace_OnUIDeactivate(IOleInPlaceSite FAR* This, BOOL fUndoable) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
957 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
958 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
959 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
960 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
961 HRESULT STDMETHODCALLTYPE InPlace_OnInPlaceDeactivate(IOleInPlaceSite FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
962 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
963 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
964 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
965 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
966 HRESULT STDMETHODCALLTYPE InPlace_DiscardUndoState(IOleInPlaceSite FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
967 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
968 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
969 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
970 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
971 HRESULT STDMETHODCALLTYPE InPlace_DeactivateAndUndo(IOleInPlaceSite FAR* This) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
972 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
973 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
974 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
975 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
976 // Called when the position of the browser object is changed, such as when we call the IWebBrowser2's put_Width(), |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
977 // put_Height(), put_Left(), or put_Right(). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
978 HRESULT STDMETHODCALLTYPE InPlace_OnPosRectChange(IOleInPlaceSite FAR* This, LPCRECT lprcPosRect) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
979 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
980 IOleObject *browserObject; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
981 IOleInPlaceObject *inplace; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
982 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
983 // We need to get the browser's IOleInPlaceObject object so we can call its SetObjectRects |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
984 // function. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
985 browserObject = *((IOleObject **)((char *)This - sizeof(IOleObject *) - sizeof(IOleClientSite))); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
986 if (!browserObject->lpVtbl->QueryInterface(browserObject, &IID_IOleInPlaceObject, (void**)&inplace)) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
987 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
988 // Give the browser the dimensions of where it can draw. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
989 inplace->lpVtbl->SetObjectRects(inplace, lprcPosRect, lprcPosRect); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
990 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
991 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
992 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
993 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
994 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
995 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
996 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
997 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
998 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
999 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1000 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1001 ////////////////////////////////////// My IOleInPlaceFrame functions ///////////////////////////////////////// |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1002 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1003 HRESULT STDMETHODCALLTYPE Frame_QueryInterface(IOleInPlaceFrame FAR* This, REFIID riid, LPVOID FAR* ppvObj) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1004 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1005 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1006 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1007 |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
1008 ULONG STDMETHODCALLTYPE Frame_AddRef(IOleInPlaceFrame FAR* This) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1009 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1010 return(1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1011 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1012 |
1857
417176df4755
Add TOOLBAR define with MinGW by default... fix warnings...generated
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1620
diff
changeset
|
1013 ULONG STDMETHODCALLTYPE Frame_Release(IOleInPlaceFrame FAR* This) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1014 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1015 return(1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1016 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1017 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1018 HRESULT STDMETHODCALLTYPE Frame_GetWindow(IOleInPlaceFrame FAR* This, HWND FAR* lphwnd) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1019 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1020 // Give the browser the HWND to our window that contains the browser object. We |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1021 // stored that HWND in our IOleInPlaceFrame struct. Nevermind that the function |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1022 // declaration for Frame_GetWindow says that 'This' is an IOleInPlaceFrame *. Remember |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1023 // that in EmbedBrowserObject(), we allocated our own IOleInPlaceFrameEx struct which |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1024 // contained an embedded IOleInPlaceFrame struct within it. And then we lied when |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1025 // Site_GetWindowContext() returned that IOleInPlaceFrameEx. So that's what the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1026 // browser is passing us. It doesn't know that. But we do. So we can recast it and |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1027 // use it as so here. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1028 *lphwnd = ((_IOleInPlaceFrameEx *)This)->window; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1029 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1030 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1031 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1032 HRESULT STDMETHODCALLTYPE Frame_ContextSensitiveHelp(IOleInPlaceFrame FAR* This, BOOL fEnterMode) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1033 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1034 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1035 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1036 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1037 HRESULT STDMETHODCALLTYPE Frame_GetBorder(IOleInPlaceFrame FAR* This, LPRECT lprectBorder) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1038 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1039 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1040 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1041 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1042 HRESULT STDMETHODCALLTYPE Frame_RequestBorderSpace(IOleInPlaceFrame FAR* This, LPCBORDERWIDTHS pborderwidths) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1043 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1044 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1045 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1046 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1047 HRESULT STDMETHODCALLTYPE Frame_SetBorderSpace(IOleInPlaceFrame FAR* This, LPCBORDERWIDTHS pborderwidths) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1048 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1049 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1050 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1051 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1052 HRESULT STDMETHODCALLTYPE Frame_SetActiveObject(IOleInPlaceFrame FAR* This, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1053 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1054 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1055 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1056 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1057 HRESULT STDMETHODCALLTYPE Frame_InsertMenus(IOleInPlaceFrame FAR* This, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1058 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1059 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1060 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1061 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1062 HRESULT STDMETHODCALLTYPE Frame_SetMenu(IOleInPlaceFrame FAR* This, HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1063 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1064 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1065 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1066 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1067 HRESULT STDMETHODCALLTYPE Frame_RemoveMenus(IOleInPlaceFrame FAR* This, HMENU hmenuShared) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1068 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1069 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1070 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1071 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1072 HRESULT STDMETHODCALLTYPE Frame_SetStatusText(IOleInPlaceFrame FAR* This, LPCOLESTR pszStatusText) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1073 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1074 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1075 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1076 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1077 HRESULT STDMETHODCALLTYPE Frame_EnableModeless(IOleInPlaceFrame FAR* This, BOOL fEnable) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1078 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1079 return(S_OK); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1080 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1081 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1082 HRESULT STDMETHODCALLTYPE Frame_TranslateAccelerator(IOleInPlaceFrame FAR* This, LPMSG lpmsg, WORD wID) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1083 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1084 NOTIMPLEMENTED; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1085 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1086 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1087 |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1088 // The DWEventHandler object must be created by an application using IWebBRowser2, |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1089 // and given to IWebBrowser2's IConnectPoint object (via |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1090 // IConnectPoint's Advise function). |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1091 |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1092 // DWEventHandler VTable's GUID |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1093 // {d2d531c4-83d7-48d7-b733-840245ea2b34} |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1094 DEFINE_GUID(DIID_DWEventHandler, 0xd2d531c4, 0x83d7, 0x48d7, 0xb7, 0x33, 0x84, 0x2, 0x45, 0xea, 0x2b, 0x34); |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1095 |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1096 // DWEventHandler's VTable |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1097 #undef INTERFACE |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1098 #define INTERFACE DWEventHandler |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1099 DECLARE_INTERFACE_ (INTERFACE, IUnknown) |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1100 { |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1101 // Interface functions |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1102 STDMETHOD (QueryInterface) (THIS_ REFIID, void **) PURE; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1103 STDMETHOD_ (ULONG, AddRef) (THIS) PURE; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1104 STDMETHOD_ (ULONG, Release) (THIS) PURE; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1105 STDMETHOD_ (HRESULT, GetTypeInfoCount) (THIS_ UINT *) PURE; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1106 STDMETHOD_ (HRESULT, GetTypeInfo) (THIS_ UINT, LCID, ITypeInfo **) PURE; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1107 STDMETHOD_ (HRESULT, GetIDsOfNames) (THIS_ REFIID, LPOLESTR *, UINT, LCID, DISPID *) PURE; |
2055
53523298c7c7
Win: Fixed a couple of type warnings reported by Visual C.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2050
diff
changeset
|
1108 STDMETHOD_ (HRESULT, Invoke) (THIS_ DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *) PURE; |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1109 }; |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1110 |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1111 // IWebBrowser2 supports us giving it only 1 DWEventHandler object, so for simplicity, we |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1112 // can just declare it as a global. That way, we don't need to allocate it, free it, |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1113 // nor maintain a reference count for it. Here's our 1 DWEventHandler object. |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1114 static DWEventHandler MyDWEventHandler; |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1115 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1116 |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1117 static HRESULT STDMETHODCALLTYPE DWEventHandler_QueryInterface(DWEventHandler *this, REFIID vTableGuid, void **ppv) |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1118 { |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1119 // This is an DWEventHandler object, so we must recognize DWEventHandler VTable's GUID, |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1120 // Our DWEventHandler can also masquerade as an IUnknown |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1121 if (!IsEqualIID(vTableGuid, &IID_IUnknown) && !IsEqualIID(vTableGuid, &DIID_DWebBrowserEvents2)) |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1122 { |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1123 *ppv = 0; |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1124 return(E_NOINTERFACE); |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1125 } |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1126 |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1127 *ppv = this; |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1128 |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1129 // Normally, we'd call our AddRef function here. But since our DWEventHandler isn't |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1130 // allocated, we don't need to bother with reference counting |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1131 return(NOERROR); |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1132 } |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1133 |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1134 static ULONG STDMETHODCALLTYPE DWEventHandler_AddRef(DWEventHandler *this) |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1135 { |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1136 // Our one and only DWEventHandler isn't allocated. Instead, it is statically |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1137 // declared above (MyDWEventHandler). So we'll just return a 1 |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1138 return(1); |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1139 } |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1140 |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1141 static ULONG STDMETHODCALLTYPE DWEventHandler_Release(DWEventHandler *this) |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1142 { |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1143 return(1); |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1144 } |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1145 static HRESULT STDMETHODCALLTYPE DWEventHandler_GetTypeInfoCount(DWEventHandler *this, UINT * pctinfo) |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1146 { |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1147 return E_NOTIMPL; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1148 } |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1149 static HRESULT STDMETHODCALLTYPE DWebBrowserEvent2_GetTypeInfo(DWEventHandler *this, UINT iTInfo, LCID lcid, ITypeInfo ** ppTInfo) |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1150 { |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1151 return E_NOTIMPL; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1152 } |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1153 static HRESULT STDMETHODCALLTYPE DWebBrowserEvent2_GetIDsOfNames(DWEventHandler *this, REFIID riid, LPOLESTR * rgszNames, UINT cNames, LCID lcid, DISPID * rgDispId) |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1154 { |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1155 return E_NOTIMPL; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1156 } |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1157 static HRESULT STDMETHODCALLTYPE DWebBrowserEvent2_Invoke(DWEventHandler *this, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pDispParams, VARIANT * pVarResult, EXCEPINFO * pExcepInfo, UINT * puArgErr) |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1158 { |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1159 switch (dispIdMember) |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1160 { |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1161 case DISPID_BEFORENAVIGATE2: |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1162 { |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1163 // Params are in the variant array from right to left wrt how they are defined in the documentation. |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1164 LPCWSTR pszURL = pDispParams->rgvarg[5].pvarVal->bstrVal; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1165 IWebBrowser2* pwb = (IWebBrowser2*)pDispParams->rgvarg[pDispParams->cArgs - 1].byref; |
2021
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1166 VARIANT vWindow; |
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1167 BSTR bstrProp = SysAllocString(L"DWindow"); |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1168 HWND hwnd; |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1169 |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1170 /* Get the window handle and URL */ |
2021
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1171 vWindow.vt = VT_UI8; |
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1172 pwb->lpVtbl->GetProperty(pwb, bstrProp, &vWindow); |
2058
f8865a4b5835
Win: Fix warnings when compiling with mingw32 gcc 5.1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2055
diff
changeset
|
1173 hwnd = (HWND)DW_UINT_TO_POINTER(vWindow.ullVal); |
2021
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1174 SysFreeString(bstrProp); |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1175 /* Send the event for signal handling */ |
2625
2e804b4db81e
Win: Standardize internal function name style...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2058
diff
changeset
|
1176 _dw_wndproc(hwnd, WM_USER+101, (WPARAM)DW_INT_TO_POINTER(DW_HTML_CHANGE_STARTED), (LPARAM)WideToUTF8((LPWSTR)pszURL)); |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1177 |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1178 // Make sure you don't accidently cancel the navigation. |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1179 *V_BOOLREF(&pDispParams->rgvarg[0]) = VARIANT_FALSE; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1180 break; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1181 } |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1182 case DISPID_DOCUMENTCOMPLETE: |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1183 { |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1184 IWebBrowser2* pwb = (IWebBrowser2*)pDispParams->rgvarg[pDispParams->cArgs - 1].byref; |
2021
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1185 VARIANT vWindow; |
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1186 BSTR bstrProp = SysAllocString(L"DWindow"); |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1187 HWND hwnd; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1188 BSTR locationURL; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1189 |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1190 /* Get the window handle and URL */ |
2021
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1191 vWindow.vt = VT_UI8; |
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1192 pwb->lpVtbl->GetProperty(pwb, bstrProp, &vWindow); |
2058
f8865a4b5835
Win: Fix warnings when compiling with mingw32 gcc 5.1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2055
diff
changeset
|
1193 hwnd = (HWND)DW_UINT_TO_POINTER(vWindow.ullVal); |
2021
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1194 SysFreeString(bstrProp); |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1195 pwb->lpVtbl->get_LocationURL(pwb, &locationURL); |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1196 /* Send the event for signal handling */ |
2625
2e804b4db81e
Win: Standardize internal function name style...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2058
diff
changeset
|
1197 _dw_wndproc(hwnd, WM_USER+101, (WPARAM)DW_INT_TO_POINTER(DW_HTML_CHANGE_COMPLETE), (LPARAM)WideToUTF8((LPWSTR)locationURL)); |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1198 break; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1199 } |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1200 default: |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1201 return DISP_E_MEMBERNOTFOUND; |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1202 } |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1203 return NOERROR; |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1204 } |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1205 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1206 |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1207 // Our DWEventHandler VTable. We need only one of these, so we can |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1208 // declare it static |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1209 static const DWEventHandlerVtbl DWEventHandler_Vtbl = { |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1210 DWEventHandler_QueryInterface, |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1211 DWEventHandler_AddRef, |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1212 DWEventHandler_Release, |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1213 DWEventHandler_GetTypeInfoCount, |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1214 DWebBrowserEvent2_GetTypeInfo, |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1215 DWebBrowserEvent2_GetIDsOfNames, |
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1216 DWebBrowserEvent2_Invoke |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1217 }; |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1218 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1219 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1220 /*************************** UnEmbedBrowserObject() ************************ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1221 * Called to detach the browser object from our host window, and free its |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1222 * resources, right before we destroy our window. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1223 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1224 * hwnd = Handle to the window hosting the browser object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1225 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1226 * NOTE: The pointer to the browser object must have been stored in the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1227 * window's USERDATA field. In other words, don't call UnEmbedBrowserObject(). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1228 * with a HWND that wasn't successfully passed to EmbedBrowserObject(). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1229 */ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1230 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1231 void _UnEmbedBrowserObject(HWND hwnd) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1232 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1233 IOleObject **browserHandle; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1234 IOleObject *browserObject; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1235 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1236 // Retrieve the browser object's pointer we stored in our window's GWL_USERDATA when we |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1237 // initially attached the browser object to this window. If 0, you may have called this |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1238 // for a window that wasn't successfully passed to EmbedBrowserObject(). Bad boy! Or, we |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1239 // may have failed the EmbedBrowserObject() call in WM_CREATE, in which case, our window |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1240 // may get a WM_DESTROY which could call this a second time (ie, since we may call |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1241 // UnEmbedBrowserObject in EmbedBrowserObject). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1242 if ((browserHandle = (IOleObject **)dw_window_get_data(hwnd, "_dw_html"))) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1243 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1244 // Unembed the browser object, and release its resources. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1245 browserObject = *browserHandle; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1246 browserObject->lpVtbl->Close(browserObject, OLECLOSE_NOSAVE); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1247 browserObject->lpVtbl->Release(browserObject); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1248 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1249 // Zero out the pointer just in case UnEmbedBrowserObject is called again for this window |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1250 dw_window_set_data(hwnd, "_dw_html", NULL); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1251 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1252 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1253 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1254 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1255 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1256 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1257 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1258 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1259 /******************************* dw_html_action() ************************** |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1260 * Implements the functionality of a "Back". "Forward", "Home", "Search", |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1261 * "Refresh", or "Stop" button. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1262 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1263 * hwnd = Handle to the window hosting the browser object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1264 * action = One of the following: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1265 * 0 = Move back to the previously viewed web page. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1266 * 1 = Move forward to the previously viewed web page. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1267 * 2 = Move to the home page. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1268 * 3 = Search. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1269 * 4 = Refresh the page. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1270 * 5 = Stop the currently loading page. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1271 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1272 * NOTE: EmbedBrowserObject() must have been successfully called once with the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1273 * specified window, prior to calling this function. You need call |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1274 * EmbedBrowserObject() once only, and then you can make multiple calls to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1275 * this function to display numerous pages in the specified window. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1276 */ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1277 |
1362
412af8059331
Attempt to get it building with Mingw again... builds but crashes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
615
diff
changeset
|
1278 void _dw_html_action(HWND hwnd, int action) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1279 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1280 IWebBrowser2 *webBrowser2; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1281 IOleObject *browserObject; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1282 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1283 // Retrieve the browser object's pointer we stored in our window's GWL_USERDATA when |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1284 // we initially attached the browser object to this window. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1285 browserObject = *((IOleObject **)dw_window_get_data(hwnd, "_dw_html")); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1286 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1287 // We want to get the base address (ie, a pointer) to the IWebBrowser2 object embedded within the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1288 // object, so we can call some of the functions in the former's table. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1289 if (!browserObject->lpVtbl->QueryInterface(browserObject, &IID_IWebBrowser2, (void**)&webBrowser2)) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1290 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1291 // Ok, now the pointer to our IWebBrowser2 object is in 'webBrowser2', and so its VTable is |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1292 // webBrowser2->lpVtbl. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1293 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1294 // Call the desired function |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1295 switch (action) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1296 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1297 case DW_HTML_GOBACK: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1298 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1299 // Call the IWebBrowser2 object's GoBack function. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1300 webBrowser2->lpVtbl->GoBack(webBrowser2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1301 break; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1302 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1303 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1304 case DW_HTML_GOFORWARD: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1305 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1306 // Call the IWebBrowser2 object's GoForward function. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1307 webBrowser2->lpVtbl->GoForward(webBrowser2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1308 break; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1309 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1310 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1311 case DW_HTML_GOHOME: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1312 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1313 // Call the IWebBrowser2 object's GoHome function. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1314 webBrowser2->lpVtbl->GoHome(webBrowser2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1315 break; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1316 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1317 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1318 case DW_HTML_SEARCH: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1319 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1320 // Call the IWebBrowser2 object's GoSearch function. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1321 webBrowser2->lpVtbl->GoSearch(webBrowser2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1322 break; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1323 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1324 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1325 case DW_HTML_RELOAD: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1326 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1327 // Call the IWebBrowser2 object's Refresh function. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1328 webBrowser2->lpVtbl->Refresh(webBrowser2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1329 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1330 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1331 case DW_HTML_STOP: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1332 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1333 // Call the IWebBrowser2 object's Stop function. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1334 webBrowser2->lpVtbl->Stop(webBrowser2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1335 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1336 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1337 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1338 // Release the IWebBrowser2 object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1339 webBrowser2->lpVtbl->Release(webBrowser2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1340 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1341 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1342 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1343 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1344 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1345 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1346 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1347 /******************************* dw_html_raw() **************************** |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1348 * Takes a string containing some HTML BODY, and displays it in the specified |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1349 * window. For example, perhaps you want to display the HTML text of... |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1350 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1351 * <P>This is a picture.<P><IMG src="mypic.jpg"> |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1352 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1353 * hwnd = Handle to the window hosting the browser object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1354 * string = Pointer to nul-terminated string containing the HTML BODY. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1355 * (NOTE: No <BODY></BODY> tags are required in the string). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1356 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1357 * RETURNS: 0 if success, or non-zero if an error. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1358 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1359 * NOTE: EmbedBrowserObject() must have been successfully called once with the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1360 * specified window, prior to calling this function. You need call |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1361 * EmbedBrowserObject() once only, and then you can make multiple calls to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1362 * this function to display numerous pages in the specified window. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1363 */ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1364 |
2034
89d62197124b
Visual C in C++ mode complains about missing const declarations in paramaters.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2024
diff
changeset
|
1365 int _dw_html_raw(HWND hwnd, const char *string) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1366 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1367 IWebBrowser2 *webBrowser2; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1368 LPDISPATCH lpDispatch; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1369 IHTMLDocument2 *htmlDoc2; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1370 IOleObject *browserObject; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1371 SAFEARRAY *sfArray; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1372 VARIANT myURL; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1373 VARIANT *pVar; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1374 BSTR bstr; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1375 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1376 // Retrieve the browser object's pointer we stored in our window's GWL_USERDATA when |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1377 // we initially attached the browser object to this window. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1378 browserObject = *((IOleObject **)dw_window_get_data(hwnd, "_dw_html")); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1379 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1380 // Assume an error. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1381 bstr = 0; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1382 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1383 // We want to get the base address (ie, a pointer) to the IWebBrowser2 object embedded within the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1384 // object, so we can call some of the functions in the former's table. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1385 if (!browserObject->lpVtbl->QueryInterface(browserObject, &IID_IWebBrowser2, (void**)&webBrowser2)) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1386 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1387 // Ok, now the pointer to our IWebBrowser2 object is in 'webBrowser2', and so its VTable is |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1388 // webBrowser2->lpVtbl. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1389 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1390 // Before we can get_Document(), we actually need to have some HTML page loaded in the browser. So, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1391 // let's load an empty HTML page. Then, once we have that empty page, we can get_Document() and |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1392 // write() to stuff our HTML string into it. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1393 VariantInit(&myURL); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1394 myURL.vt = VT_BSTR; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1395 myURL.bstrVal = SysAllocString(L"about:blank"); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1396 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1397 // Call the Navigate2() function to actually display the page. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1398 webBrowser2->lpVtbl->Navigate2(webBrowser2, &myURL, 0, 0, 0, 0); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1399 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1400 // Free any resources (including the BSTR). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1401 VariantClear(&myURL); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1402 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1403 // Call the IWebBrowser2 object's get_Document so we can get its DISPATCH object. I don't know why you |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1404 // don't get the DISPATCH object via the browser object's QueryInterface(), but you don't. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1405 if (!webBrowser2->lpVtbl->get_Document(webBrowser2, &lpDispatch)) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1406 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1407 // We want to get a pointer to the IHTMLDocument2 object embedded within the DISPATCH |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1408 // object, so we can call some of the functions in the former's table. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1409 if (!lpDispatch->lpVtbl->QueryInterface(lpDispatch, &IID_IHTMLDocument2, (void**)&htmlDoc2)) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1410 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1411 // Ok, now the pointer to our IHTMLDocument2 object is in 'htmlDoc2', and so its VTable is |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1412 // htmlDoc2->lpVtbl. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1413 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1414 // Our HTML must be in the form of a BSTR. And it must be passed to write() in an |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1415 // array of "VARIENT" structs. So let's create all that. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1416 if ((sfArray = SafeArrayCreate(VT_VARIANT, 1, (SAFEARRAYBOUND *)&ArrayBound))) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1417 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1418 if (!SafeArrayAccessData(sfArray, (void**)&pVar)) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1419 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1420 pVar->vt = VT_BSTR; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1421 { |
1620
32b5fba0b00a
Must convert from UTF8 for the raw HTML on Windows regardless of the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1362
diff
changeset
|
1422 wchar_t *buffer; |
32b5fba0b00a
Must convert from UTF8 for the raw HTML on Windows regardless of the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1362
diff
changeset
|
1423 DWORD size; |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1424 |
1620
32b5fba0b00a
Must convert from UTF8 for the raw HTML on Windows regardless of the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1362
diff
changeset
|
1425 size = MultiByteToWideChar(CP_UTF8, 0, string, -1, 0, 0); |
32b5fba0b00a
Must convert from UTF8 for the raw HTML on Windows regardless of the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1362
diff
changeset
|
1426 if (!(buffer = (wchar_t *)GlobalAlloc(GMEM_FIXED, sizeof(wchar_t) * size))) goto bad; |
32b5fba0b00a
Must convert from UTF8 for the raw HTML on Windows regardless of the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1362
diff
changeset
|
1427 MultiByteToWideChar(CP_UTF8, 0, string, -1, buffer, size); |
32b5fba0b00a
Must convert from UTF8 for the raw HTML on Windows regardless of the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1362
diff
changeset
|
1428 bstr = SysAllocString(buffer); |
32b5fba0b00a
Must convert from UTF8 for the raw HTML on Windows regardless of the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1362
diff
changeset
|
1429 GlobalFree(buffer); |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1430 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1431 // Store our BSTR pointer in the VARIENT. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1432 if ((pVar->bstrVal = bstr)) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1433 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1434 // Pass the VARIENT with its BSTR to write() in order to shove our desired HTML string |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1435 // into the body of that empty page we created above. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1436 htmlDoc2->lpVtbl->write(htmlDoc2, sfArray); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1437 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1438 // Close the document. If we don't do this, subsequent calls to DisplayHTMLStr |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1439 // would append to the current contents of the page |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1440 htmlDoc2->lpVtbl->close(htmlDoc2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1441 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1442 // Normally, we'd need to free our BSTR, but SafeArrayDestroy() does it for us |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1443 // SysFreeString(bstr); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1444 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1445 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1446 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1447 // Free the array. This also frees the VARIENT that SafeArrayAccessData created for us, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1448 // and even frees the BSTR we allocated with SysAllocString |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1449 SafeArrayDestroy(sfArray); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1450 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1451 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1452 // Release the IHTMLDocument2 object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1453 bad: htmlDoc2->lpVtbl->Release(htmlDoc2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1454 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1455 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1456 // Release the DISPATCH object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1457 lpDispatch->lpVtbl->Release(lpDispatch); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1458 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1459 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1460 // Release the IWebBrowser2 object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1461 webBrowser2->lpVtbl->Release(webBrowser2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1462 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1463 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1464 // No error? |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1465 if (bstr) return(0); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1466 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1467 // An error |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1468 return(-1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1469 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1470 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1471 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1472 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1473 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1474 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1475 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1476 /******************************* dw_html_url() **************************** |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1477 * Displays a URL, or HTML file on disk. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1478 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1479 * hwnd = Handle to the window hosting the browser object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1480 * webPageName = Pointer to nul-terminated name of the URL/file. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1481 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1482 * RETURNS: 0 if success, or non-zero if an error. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1483 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1484 * NOTE: EmbedBrowserObject() must have been successfully called once with the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1485 * specified window, prior to calling this function. You need call |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1486 * EmbedBrowserObject() once only, and then you can make multiple calls to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1487 * this function to display numerous pages in the specified window. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1488 */ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1489 |
2034
89d62197124b
Visual C in C++ mode complains about missing const declarations in paramaters.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2024
diff
changeset
|
1490 int _dw_html_url(HWND hwnd, const char *url) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1491 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1492 IWebBrowser2 *webBrowser2; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1493 VARIANT myURL; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1494 IOleObject *browserObject; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1495 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1496 // Retrieve the browser object's pointer we stored in our window's GWL_USERDATA when |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1497 // we initially attached the browser object to this window. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1498 browserObject = *((IOleObject **)dw_window_get_data(hwnd, "_dw_html")); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1499 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1500 // We want to get the base address (ie, a pointer) to the IWebBrowser2 object embedded within the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1501 // object, so we can call some of the functions in the former's table. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1502 if (!browserObject->lpVtbl->QueryInterface(browserObject, &IID_IWebBrowser2, (void**)&webBrowser2)) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1503 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1504 // Ok, now the pointer to our IWebBrowser2 object is in 'webBrowser2', and so its VTable is |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1505 // webBrowser2->lpVtbl. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1506 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1507 // Our URL (ie, web address, such as "http://www.microsoft.com" or an HTM filename on disk |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1508 // such as "c:\myfile.htm") must be passed to the IWebBrowser2's Navigate2() function as a BSTR. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1509 // A BSTR is like a pascal version of a double-byte character string. In other words, the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1510 // first unsigned short is a count of how many characters are in the string, and then this |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1511 // is followed by those characters, each expressed as an unsigned short (rather than a |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1512 // char). The string is not nul-terminated. The OS function SysAllocString can allocate and |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1513 // copy a UNICODE C string to a BSTR. Of course, we'll need to free that BSTR after we're done |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1514 // with it. If we're not using UNICODE, we first have to convert to a UNICODE string. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1515 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1516 // What's more, our BSTR needs to be stuffed into a VARIENT struct, and that VARIENT struct is |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1517 // then passed to Navigate2(). Why? The VARIENT struct makes it possible to define generic |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1518 // 'datatypes' that can be used with all languages. Not all languages support things like |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1519 // nul-terminated C strings. So, by using a VARIENT, whose first field tells what sort of |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1520 // data (ie, string, float, etc) is in the VARIENT, COM interfaces can be used by just about |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1521 // any language. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1522 VariantInit(&myURL); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1523 myURL.vt = VT_BSTR; |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1524 myURL.bstrVal = SysAllocString(UTF8toWide(url)); |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1525 if (!myURL.bstrVal) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1526 { |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1527 webBrowser2->lpVtbl->Release(webBrowser2); |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1528 return(-6); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1529 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1530 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1531 // Call the Navigate2() function to actually display the page. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1532 webBrowser2->lpVtbl->Navigate2(webBrowser2, &myURL, 0, 0, 0, 0); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1533 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1534 // Free any resources (including the BSTR we allocated above). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1535 VariantClear(&myURL); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1536 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1537 // We no longer need the IWebBrowser2 object (ie, we don't plan to call any more functions in it, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1538 // so we can release our hold on it). Note that we'll still maintain our hold on the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1539 // object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1540 webBrowser2->lpVtbl->Release(webBrowser2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1541 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1542 // Success |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1543 return(0); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1544 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1545 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1546 return(-5); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1547 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1548 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1549 |
2015
c30f4354966e
Win: Added support for dw_html_javascript_run() using Edge (Chromium).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1960
diff
changeset
|
1550 /******************************* dw_html_javascript_run() **************************** |
c30f4354966e
Win: Added support for dw_html_javascript_run() using Edge (Chromium).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1960
diff
changeset
|
1551 * Runs a javascript in the specified browser context. |
c30f4354966e
Win: Added support for dw_html_javascript_run() using Edge (Chromium).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1960
diff
changeset
|
1552 * |
c30f4354966e
Win: Added support for dw_html_javascript_run() using Edge (Chromium).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1960
diff
changeset
|
1553 * hwnd = Handle to the window hosting the browser object. |
c30f4354966e
Win: Added support for dw_html_javascript_run() using Edge (Chromium).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1960
diff
changeset
|
1554 * script = Pointer to nul-terminated javascript string. |
c30f4354966e
Win: Added support for dw_html_javascript_run() using Edge (Chromium).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1960
diff
changeset
|
1555 * scriptdata = Pointer to user data to be passed to the callback. |
c30f4354966e
Win: Added support for dw_html_javascript_run() using Edge (Chromium).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1960
diff
changeset
|
1556 * |
c30f4354966e
Win: Added support for dw_html_javascript_run() using Edge (Chromium).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1960
diff
changeset
|
1557 * RETURNS: 0 if success, or non-zero if an error. |
c30f4354966e
Win: Added support for dw_html_javascript_run() using Edge (Chromium).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1960
diff
changeset
|
1558 */ |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1559 |
2034
89d62197124b
Visual C in C++ mode complains about missing const declarations in paramaters.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2024
diff
changeset
|
1560 int _dw_html_javascript_run(HWND hwnd, const char *script, void *scriptdata) |
2015
c30f4354966e
Win: Added support for dw_html_javascript_run() using Edge (Chromium).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1960
diff
changeset
|
1561 { |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1562 IWebBrowser2 *webBrowser2; |
2016
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1563 IHTMLWindow2 *htmlWindow2; |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1564 IHTMLDocument2 *htmlDocument2; |
2016
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1565 IOleObject *browserObject; |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1566 int retval = DW_ERROR_UNKNOWN; |
2016
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1567 |
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1568 // Retrieve the browser object's pointer we stored in our window's GWL_USERDATA when |
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1569 // we initially attached the browser object to this window. |
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1570 browserObject = *((IOleObject **)dw_window_get_data(hwnd, "_dw_html")); |
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1571 |
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1572 // We want to get the base address (ie, a pointer) to the IWebBrowser2 object embedded within the browser |
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1573 // object, so we can call some of the functions in the former's table. |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1574 if (!browserObject->lpVtbl->QueryInterface(browserObject, &IID_IWebBrowser2, (void**)&webBrowser2)) |
2016
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1575 { |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1576 IDispatch *pDp; |
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1577 |
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1578 if(!webBrowser2->lpVtbl->get_Document(webBrowser2, &pDp)) |
2016
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1579 { |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1580 if (!pDp->lpVtbl->QueryInterface(pDp, &IID_IHTMLDocument2, (void**)&htmlDocument2)) |
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1581 { |
2049
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1582 BSTR myscript = SysAllocString(UTF8toWide(script)); |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1583 if (myscript) |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1584 { |
2049
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1585 IDispatch* pScript = 0; |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1586 HRESULT hr = E_FAIL; |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1587 void* params[2]; |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1588 VARIANT result; |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1589 |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1590 VariantInit(&result); |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1591 |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1592 /* We first attempt to use the Invoke method */ |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1593 if(SUCCEEDED(htmlDocument2->lpVtbl->get_Script(htmlDocument2, &pScript))) |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1594 { |
2049
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1595 DISPID idSave; |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1596 LPOLESTR rgszNames[1] = {L"eval"}; |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1597 |
2049
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1598 if(SUCCEEDED(pScript->lpVtbl->GetIDsOfNames(pScript, &IID_NULL, rgszNames, 1, LOCALE_SYSTEM_DEFAULT, &idSave))) |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1599 { |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1600 DISPPARAMS dispParams = {NULL, NULL, 0, 0}; |
2050
13995a6bf05d
Win: Fixed HTML_RESULT returning the actual result in embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2049
diff
changeset
|
1601 VARIANT scriptparam; |
13995a6bf05d
Win: Fixed HTML_RESULT returning the actual result in embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2049
diff
changeset
|
1602 scriptparam.vt = VT_BSTR; |
13995a6bf05d
Win: Fixed HTML_RESULT returning the actual result in embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2049
diff
changeset
|
1603 scriptparam.bstrVal = myscript; |
2049
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1604 dispParams.cArgs = 1; |
2050
13995a6bf05d
Win: Fixed HTML_RESULT returning the actual result in embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2049
diff
changeset
|
1605 dispParams.rgvarg = &scriptparam; |
2049
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1606 hr = pScript->lpVtbl->Invoke(pScript, idSave, &IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD, &dispParams, &result, NULL, NULL); |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1607 } |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1608 pScript->lpVtbl->Release(pScript); |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1609 } |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1610 /* If Invoke fails, fall back to execScript */ |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1611 if(FAILED(hr) && SUCCEEDED(htmlDocument2->lpVtbl->get_parentWindow(htmlDocument2, &htmlWindow2))) |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1612 { |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1613 hr = htmlWindow2->lpVtbl->execScript(htmlWindow2, myscript, L"javascript", &result); |
2049
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1614 // We no longer need the IWebBrowser2 object (ie, we don't plan to call any more functions in it, |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1615 // so we can release our hold on it). Note that we'll still maintain our hold on the browser |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1616 // object. |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1617 htmlWindow2->lpVtbl->Release(htmlWindow2); |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1618 } |
2049
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1619 params[0] = (void*)(result.vt == VT_BSTR ? WideToUTF8(result.bstrVal) : NULL); |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1620 params[1] = DW_INT_TO_POINTER((SUCCEEDED(hr) ? DW_ERROR_NONE : DW_ERROR_UNKNOWN)); |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1621 /* Pass the result back for event handling */ |
2625
2e804b4db81e
Win: Standardize internal function name style...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2058
diff
changeset
|
1622 _dw_wndproc(hwnd, WM_USER+100, (WPARAM)params, (LPARAM)scriptdata); |
2049
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1623 VariantClear(&result); |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1624 SysFreeString(myscript); |
2bf8a22f515e
Win: Attempt to move to Invoke(eval) from the deprecated execScript() method.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2045
diff
changeset
|
1625 retval = DW_ERROR_NONE; |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1626 } |
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1627 htmlDocument2->lpVtbl->Release(htmlDocument2); |
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1628 } |
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1629 pDp->lpVtbl->Release(pDp); |
2016
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1630 } |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1631 webBrowser2->lpVtbl->Release(webBrowser2); |
2016
f696215e6d4e
Win: First attempt at implmenting dw_html_javascript_run() for embedded IE....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2015
diff
changeset
|
1632 } |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1633 return retval; |
2015
c30f4354966e
Win: Added support for dw_html_javascript_run() using Edge (Chromium).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1960
diff
changeset
|
1634 } |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1635 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1636 |
2018
663d79f28e46
Win: Fix dw_html_javascript_run() when using embedded IE browser widget.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2017
diff
changeset
|
1637 |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1638 /******************************* ResizeBrowser() **************************** |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1639 * Resizes the browser object for the specified window to the specified |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1640 * width and height. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1641 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1642 * hwnd = Handle to the window hosting the browser object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1643 * width = Width. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1644 * height = Height. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1645 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1646 * NOTE: EmbedBrowserObject() must have been successfully called once with the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1647 * specified window, prior to calling this function. You need call |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1648 * EmbedBrowserObject() once only, and then you can make multiple calls to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1649 * this function to resize the browser object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1650 */ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1651 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1652 void _ResizeBrowser(HWND hwnd, DWORD width, DWORD height) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1653 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1654 IWebBrowser2 *webBrowser2; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1655 IOleObject *browserObject; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1656 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1657 // Retrieve the browser object's pointer we stored in our window's GWL_USERDATA when |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1658 // we initially attached the browser object to this window. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1659 browserObject = *((IOleObject **)dw_window_get_data(hwnd, "_dw_html")); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1660 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1661 // We want to get the base address (ie, a pointer) to the IWebBrowser2 object embedded within the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1662 // object, so we can call some of the functions in the former's table. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1663 if (!browserObject->lpVtbl->QueryInterface(browserObject, &IID_IWebBrowser2, (void**)&webBrowser2)) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1664 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1665 // Ok, now the pointer to our IWebBrowser2 object is in 'webBrowser2', and so its VTable is |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1666 // webBrowser2->lpVtbl. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1667 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1668 // Call are put_Width() and put_Height() to set the new width/height. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1669 webBrowser2->lpVtbl->put_Width(webBrowser2, width); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1670 webBrowser2->lpVtbl->put_Height(webBrowser2, height); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1671 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1672 // We no longer need the IWebBrowser2 object (ie, we don't plan to call any more functions in it, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1673 // so we can release our hold on it). Note that we'll still maintain our hold on the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1674 // object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1675 webBrowser2->lpVtbl->Release(webBrowser2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1676 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1677 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1678 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1679 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1680 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1681 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1682 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1683 /***************************** EmbedBrowserObject() ************************** |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1684 * Puts the browser object inside our host window, and save a pointer to this |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1685 * window's browser object in the window's GWL_USERDATA field. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1686 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1687 * hwnd = Handle of our window into which we embed the browser object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1688 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1689 * RETURNS: 0 if success, or non-zero if an error. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1690 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1691 * NOTE: We tell the browser object to occupy the entire client area of the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1692 * window. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1693 * |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1694 * NOTE: No HTML page will be displayed here. We can do that with a subsequent |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1695 * call to either DisplayHTMLPage() or DisplayHTMLStr(). This is merely once-only |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1696 * initialization for using the browser object. In a nutshell, what we do |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1697 * here is get a pointer to the browser object in our window's GWL_USERDATA |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1698 * so we can access that object's functions whenever we want, and we also pass |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1699 * pointers to our IOleClientSite, IOleInPlaceFrame, and IStorage structs so that |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1700 * the browser can call our functions in our struct's VTables. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1701 */ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1702 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1703 long _EmbedBrowserObject(HWND hwnd) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1704 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1705 IOleObject *browserObject; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1706 IWebBrowser2 *webBrowser2; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1707 RECT rect; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1708 char *ptr; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1709 _IOleClientSiteEx *_iOleClientSiteEx; |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1710 |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1711 MyDWEventHandler.lpVtbl = (DWEventHandlerVtbl *)&DWEventHandler_Vtbl; |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1712 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1713 // Our IOleClientSite, IOleInPlaceSite, and IOleInPlaceFrame functions need to get our window handle. We |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1714 // could store that in some global. But then, that would mean that our functions would work with only that |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1715 // one window. If we want to create multiple windows, each hosting its own browser object (to display its |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1716 // own web page), then we need to create unique IOleClientSite, IOleInPlaceSite, and IOleInPlaceFrame |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1717 // structs for each window. And we'll put an extra field at the end of those structs to store our extra |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1718 // data such as a window handle. So, our functions won't have to touch global data, and can therefore be |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1719 // re-entrant and work with multiple objects/windows. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1720 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1721 // Remember that a pointer to our IOleClientSite we create here will be passed as the first arg to every |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1722 // one of our IOleClientSite functions. Ditto with the IOleInPlaceFrame object we create here, and the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1723 // IOleInPlaceFrame functions. So, our functions are able to retrieve the window handle we'll store here, |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1724 // and then, they'll work with all such windows containing a browser control. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1725 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1726 // Furthermore, since the browser will be calling our IOleClientSite's QueryInterface to get a pointer to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1727 // our IOleInPlaceSite and IDocHostUIHandler objects, that means that our IOleClientSite QueryInterface |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1728 // must have an easy way to grab those pointers. Probably the easiest thing to do is just embed our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1729 // IOleInPlaceSite and IDocHostUIHandler objects inside of an extended IOleClientSite which we'll call |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1730 // a _IOleClientSiteEx. As long as they come after the pointer to the IOleClientSite VTable, then we're |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1731 // ok. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1732 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1733 // Of course, we need to GlobalAlloc the above structs now. We'll just get all 4 with a single call to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1734 // GlobalAlloc, especially since 3 of them are all contained inside of our _IOleClientSiteEx anyway. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1735 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1736 // So, we're not actually allocating separate IOleClientSite, IOleInPlaceSite, IOleInPlaceFrame and |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1737 // IDocHostUIHandler structs. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1738 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1739 // One final thing. We're going to allocate extra room to store the pointer to the browser object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1740 if (!(ptr = (char *)GlobalAlloc(GMEM_FIXED, sizeof(_IOleClientSiteEx) + sizeof(IOleObject *)))) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1741 return(-1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1742 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1743 // Initialize our IOleClientSite object with a pointer to our IOleClientSite VTable. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1744 _iOleClientSiteEx = (_IOleClientSiteEx *)(ptr + sizeof(IOleObject *)); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1745 _iOleClientSiteEx->client.lpVtbl = &MyIOleClientSiteTable; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1746 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1747 // Initialize our IOleInPlaceSite object with a pointer to our IOleInPlaceSite VTable. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1748 _iOleClientSiteEx->inplace.inplace.lpVtbl = &MyIOleInPlaceSiteTable; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1749 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1750 // Initialize our IOleInPlaceFrame object with a pointer to our IOleInPlaceFrame VTable. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1751 _iOleClientSiteEx->inplace.frame.frame.lpVtbl = &MyIOleInPlaceFrameTable; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1752 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1753 // Save our HWND (in the IOleInPlaceFrame object) so our IOleInPlaceFrame functions can retrieve it. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1754 _iOleClientSiteEx->inplace.frame.window = hwnd; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1755 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1756 // Initialize our IDocHostUIHandler object with a pointer to our IDocHostUIHandler VTable. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1757 _iOleClientSiteEx->ui.ui.lpVtbl = &MyIDocHostUIHandlerTable; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1758 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1759 // Get a pointer to the browser object and lock it down (so it doesn't "disappear" while we're using |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1760 // it in this program). We do this by calling the OS function OleCreate(). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1761 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1762 // NOTE: We need this pointer to interact with and control the browser. With normal WIN32 controls such as a |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1763 // Static, Edit, Combobox, etc, you obtain an HWND and send messages to it with SendMessage(). Not so with |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1764 // the browser object. You need to get a pointer to its "base structure" (as returned by OleCreate()). This |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1765 // structure contains an array of pointers to functions you can call within the browser object. Actually, the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1766 // base structure contains a 'lpVtbl' field that is a pointer to that array. We'll call the array a 'VTable'. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1767 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1768 // For example, the browser object happens to have a SetHostNames() function we want to call. So, after we |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1769 // retrieve the pointer to the browser object (in a local we'll name 'browserObject'), then we can call that |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1770 // function, and pass it args, as so: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1771 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1772 // browserObject->lpVtbl->SetHostNames(browserObject, SomeString, SomeString); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1773 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1774 // There's our pointer to the browser object in 'browserObject'. And there's the pointer to the browser object's |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1775 // VTable in 'browserObject->lpVtbl'. And the pointer to the SetHostNames function happens to be stored in an |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1776 // field named 'SetHostNames' within the VTable. So we are actually indirectly calling SetHostNames by using |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1777 // a pointer to it. That's how you use a VTable. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1778 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1779 // NOTE: We pass our _IOleClientSiteEx struct and lie -- saying that it's a IOleClientSite. It's ok. A |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1780 // _IOleClientSiteEx struct starts with an embedded IOleClientSite. So the browser won't care, and we want |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1781 // this extended struct passed to our IOleClientSite functions. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1782 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1783 if (!OleCreate(&CLSID_WebBrowser, &IID_IOleObject, OLERENDER_DRAW, 0, (IOleClientSite *)_iOleClientSiteEx, &MyIStorage, (void**)&browserObject)) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1784 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1785 // Ok, we now have the pointer to the browser object in 'browserObject'. Let's save this in the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1786 // memory block we allocated above, and then save the pointer to that whole thing in our window's |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1787 // USERDATA field. That way, if we need multiple windows each hosting its own browser object, we can |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1788 // call EmbedBrowserObject() for each one, and easily associate the appropriate browser object with |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1789 // its matching window and its own objects containing per-window data. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1790 *((IOleObject **)ptr) = browserObject; |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1791 dw_window_set_data(hwnd, "_dw_html", (void *)ptr); |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1792 |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1793 // We can now call the browser object's SetHostNames function. SetHostNames lets the browser object know our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1794 // application's name and the name of the document in which we're embedding the browser. (Since we have no |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1795 // document name, we'll pass a 0 for the latter). When the browser object is opened for editing, it displays |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1796 // these names in its titlebar. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1797 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1798 // We are passing 3 args to SetHostNames. You'll note that the first arg to SetHostNames is the base |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1799 // address of our browser control. This is something that you always have to remember when working in C |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1800 // (as opposed to C++). When calling a VTable function, the first arg to that function must always be the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1801 // structure which contains the VTable. (In this case, that's the browser control itself). Why? That's |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1802 // because that function is always assumed to be written in C++. And the first argument to any C++ function |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1803 // must be its 'this' pointer (ie, the base address of its class, which in this case is our browser object |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1804 // pointer). In C++, you don't have to pass this first arg, because the C++ compiler is smart enough to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1805 // produce an executable that always adds this first arg. In fact, the C++ compiler is smart enough to |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1806 // know to fetch the function pointer from the VTable, so you don't even need to reference that. In other |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1807 // words, the C++ equivalent code would be: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1808 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1809 // browserObject->SetHostNames(L"My Host Name", 0); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1810 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1811 // So, when you're trying to convert C++ code to C, always remember to add this first arg whenever you're |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1812 // dealing with a VTable (ie, the field is usually named 'lpVtbl') in the standard objects, and also add |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1813 // the reference to the VTable itself. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1814 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1815 // Oh yeah, the L is because we need UNICODE strings. And BTW, the host and document names can be anything |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1816 // you want. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1817 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1818 browserObject->lpVtbl->SetHostNames(browserObject, L"My Host Name", 0); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1819 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1820 GetClientRect(hwnd, &rect); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1821 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1822 // Let browser object know that it is embedded in an OLE container. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1823 if (!OleSetContainedObject((struct IUnknown *)browserObject, TRUE) && |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1824 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1825 // Set the display area of our browser control the same as our window's size |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1826 // and actually put the browser object into our window. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1827 !browserObject->lpVtbl->DoVerb(browserObject, OLEIVERB_SHOW, NULL, (IOleClientSite *)_iOleClientSiteEx, -1, hwnd, &rect) && |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1828 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1829 // Ok, now things may seem to get even trickier, One of those function pointers in the browser's VTable is |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1830 // to the QueryInterface() function. What does this function do? It lets us grab the base address of any |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1831 // other object that may be embedded within the browser object. And this other object has its own VTable |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1832 // containing pointers to more functions we can call for that object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1833 // |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1834 // We want to get the base address (ie, a pointer) to the IWebBrowser2 object embedded within the browser |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1835 // object, so we can call some of the functions in the former's table. For example, one IWebBrowser2 function |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1836 // we intend to call below will be Navigate2(). So we call the browser object's QueryInterface to get our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1837 // pointer to the IWebBrowser2 object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1838 !browserObject->lpVtbl->QueryInterface(browserObject, &IID_IWebBrowser2, (void**)&webBrowser2)) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1839 { |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1840 IConnectionPointContainer *container; |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1841 IConnectionPoint *point; |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1842 HRESULT hr; |
2021
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1843 VARIANT vWindow; |
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1844 BSTR bstrProp; |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1845 |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1846 // Ok, now the pointer to our IWebBrowser2 object is in 'webBrowser2', and so its VTable is |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1847 // webBrowser2->lpVtbl. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1848 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1849 // Let's call several functions in the IWebBrowser2 object to position the browser display area |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1850 // in our window. The functions we call are put_Left(), put_Top(), put_Width(), and put_Height(). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1851 // Note that we reference the IWebBrowser2 object's VTable to get pointers to those functions. And |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1852 // also note that the first arg we pass to each is the pointer to the IWebBrowser2 object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1853 webBrowser2->lpVtbl->put_Left(webBrowser2, 0); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1854 webBrowser2->lpVtbl->put_Top(webBrowser2, 0); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1855 webBrowser2->lpVtbl->put_Width(webBrowser2, rect.right); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1856 webBrowser2->lpVtbl->put_Height(webBrowser2, rect.bottom); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1857 |
2021
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1858 // Save the window handle as a property for later use |
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1859 VariantInit(&vWindow); |
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1860 vWindow.vt = VT_UI8; |
2058
f8865a4b5835
Win: Fix warnings when compiling with mingw32 gcc 5.1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2055
diff
changeset
|
1861 vWindow.ullVal = (ULONGLONG)DW_POINTER_TO_UINT(hwnd); |
2021
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1862 bstrProp = SysAllocString(L"DWindow"); |
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1863 webBrowser2->lpVtbl->PutProperty(webBrowser2, bstrProp, vWindow); |
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1864 SysFreeString(bstrProp); |
0cce5fed4594
Win: get_HWND method does not seem to be working, so use Set/GetProperty()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2019
diff
changeset
|
1865 |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1866 // Get IWebBrowser2' IConnectionPointContainer sub-object. We do this by calling |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1867 // IWebBrowser2' QueryInterface, and pass it the standard GUID for an |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1868 // IConnectionPointContainer VTable |
2058
f8865a4b5835
Win: Fix warnings when compiling with mingw32 gcc 5.1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2055
diff
changeset
|
1869 if (!(hr = webBrowser2->lpVtbl->QueryInterface(webBrowser2, &IID_IConnectionPointContainer, (void **)&container))) |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1870 { |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1871 // Get IWebBrowser2' IConnectionPoint sub-object for specifically giving |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1872 // IWebBRowser2 our DWEventHandler. We do this by calling IConnectionPointContainer's |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1873 // FindConnectionPoint, and pass it DWEventHandler VTable's GUID |
2019
583c2d62845c
Win: Implemented the STARTED and COMPLETE signals for DW_SIGNAL_HTML_CHANGED for IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2018
diff
changeset
|
1874 hr = container->lpVtbl->FindConnectionPoint(container, &DIID_DWebBrowserEvents2, &point); |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1875 |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1876 // We don't need the IConnectionPointContainer, now that we got the one IConnectionPoint |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1877 // we want (ie, the one we use to give IWebBrowser2 our DWEventHandler) |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1878 container->lpVtbl->Release(container); |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1879 |
2022
28809bf17957
Win: Switch to using _wcsicmp() from CompareStringOrdinal() for increased compatibility.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2021
diff
changeset
|
1880 if (!hr) |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1881 { |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1882 DWORD cookie; |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1883 |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1884 // Now call the IConnectionPoint's Advise function, giving it some object |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1885 // whose QueryInterface it will call to get our DWEventHandler object. Let's |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1886 // just give it our DWEventHandler object. So Advise will call our DWEventHandler's |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1887 // QueryInterface to tell us to give it a pointer to our DWEventHandler. Dumb? |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1888 // You bet. All of this convoluted stuff is a combination of poor pre-planning |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1889 // by Microsoft programmers when they designed this stuff, as well as the |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1890 // colossal blunder of designing COM to accomodate the limitations of early, |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1891 // primitive editions of Visual Basic. |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1892 // |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1893 // Advise() gives us back a "cookie" value that we'll need to later pass to |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1894 // Unadvise() (when we want to tell IWebBrowser2 to stop using our DWEventHandler) |
2022
28809bf17957
Win: Switch to using _wcsicmp() from CompareStringOrdinal() for increased compatibility.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2021
diff
changeset
|
1895 if (!(hr = point->lpVtbl->Advise(point, (IUnknown *)&MyDWEventHandler, &cookie))) |
2017
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1896 dw_window_set_data(hwnd, "_dw_html_cookie", DW_INT_TO_POINTER(cookie)); |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1897 } |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1898 } |
686b2d049056
Win: Attempt to add event handler to capture DocumentComplete with embedded IE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2016
diff
changeset
|
1899 |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1900 // We no longer need the IWebBrowser2 object (ie, we don't plan to call any more functions in it |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1901 // right now, so we can release our hold on it). Note that we'll still maintain our hold on the |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1902 // browser object until we're done with that object. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1903 webBrowser2->lpVtbl->Release(webBrowser2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1904 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1905 // Success |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1906 return(0); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1907 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1908 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1909 // Something went wrong! |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1910 _UnEmbedBrowserObject(hwnd); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1911 return(-3); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1912 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1913 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1914 GlobalFree(ptr); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1915 return(-2); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1916 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1917 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1918 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1919 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1920 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1921 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1922 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1923 /************************** browserWindowProc() ************************* |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1924 * Our message handler for our window to host the browser. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1925 */ |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1926 |
2625
2e804b4db81e
Win: Standardize internal function name style...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2058
diff
changeset
|
1927 LRESULT CALLBACK _dw_browserwndproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1928 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1929 switch (uMsg) |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1930 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1931 case WM_SIZE: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1932 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1933 // Resize the browser object to fit the window |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1934 _ResizeBrowser(hwnd, LOWORD(lParam), HIWORD(lParam)); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1935 return(0); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1936 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1937 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1938 case WM_CREATE: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1939 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1940 // Embed the browser object into our host window. We need do this only |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1941 // once. Note that the browser object will start calling some of our |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1942 // IOleInPlaceFrame and IOleClientSite functions as soon as we start |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1943 // calling browser object functions in EmbedBrowserObject(). |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1944 if (_EmbedBrowserObject(hwnd)) return(-1); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1945 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1946 // Success |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1947 return(0); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1948 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1949 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1950 case WM_DESTROY: |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1951 { |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1952 // Detach the browser object from this window, and free resources. |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1953 _UnEmbedBrowserObject(hwnd); |
2625
2e804b4db81e
Win: Standardize internal function name style...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2058
diff
changeset
|
1954 _dw_free_window_memory(hwnd, 0); |
584
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1955 return(TRUE); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1956 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1957 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1958 |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1959 return(DefWindowProc(hwnd, uMsg, wParam, lParam)); |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1960 } |
420c6c94abc7
Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1961 |