Skip to content

Commit

Permalink
Add a toolbox bitmap / Exclude some more There client specific code /…
Browse files Browse the repository at this point in the history
… Fix a possible registration error due to running the wrong (i.e. 64-bit) version of regsvr32.exe
  • Loading branch information
datadiode committed Sep 30, 2023
1 parent c227007 commit 11ffca3
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 5 deletions.
Binary file added BrowserProxy/BrowserProxy.bmp
Binary file not shown.
6 changes: 6 additions & 0 deletions BrowserProxy/BrowserProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,12 +644,14 @@ HRESULT STDMETHODCALLTYPE BrowserProxyModule::Invoke(HRESULT errorCode, ICoreWeb
}
).Get(), &m_windowCloseRequestedToken);

#ifdef THERE
m_view->add_DOMContentLoaded(Callback<ICoreWebView2DOMContentLoadedEventHandler>(
[this](ICoreWebView2 *sender, ICoreWebView2DOMContentLoadedEventArgs *args) -> HRESULT
{
return OnDOMContentLoaded(sender, args);
}
).Get(), &m_domContentLoadedToken);
#endif

m_view->add_DownloadStarting(Callback<ICoreWebView2DownloadStartingEventHandler>(
[this](ICoreWebView2 *sender, ICoreWebView2DownloadStartingEventArgs *args) -> HRESULT
Expand Down Expand Up @@ -1077,6 +1079,7 @@ HRESULT BrowserProxyModule::OnWindowCloseRequested(ICoreWebView2 *sender)
return S_OK;
}

#ifdef THERE
HRESULT BrowserProxyModule::OnDOMContentLoaded(ICoreWebView2 *sender, ICoreWebView2DOMContentLoadedEventArgs *args)
{
if (sender == nullptr || args == nullptr)
Expand Down Expand Up @@ -1107,6 +1110,7 @@ HRESULT BrowserProxyModule::OnDOMContentLoaded(ICoreWebView2 *sender, ICoreWebVi

return S_OK;
}
#endif

HRESULT BrowserProxyModule::OnDownloadStarting(ICoreWebView2 *sender, ICoreWebView2DownloadStartingEventArgs *args)
{
Expand Down Expand Up @@ -1217,6 +1221,7 @@ HRESULT BrowserProxyModule::SetVisibility(BOOL visible)
return S_OK;
}

#ifdef THERE
HRESULT BrowserProxyModule::ForwardCookie(ICoreWebView2CookieManager *cookieManager, const WCHAR *url,
const WCHAR *name, const WCHAR *domain, const WCHAR *path)
{
Expand Down Expand Up @@ -1284,6 +1289,7 @@ HRESULT BrowserProxyModule::ApplyScript(ICoreWebView2 *view, LONG id)

return S_OK;
}
#endif

HRESULT BrowserProxyModule::SetDeferral(ICoreWebView2NewWindowRequestedEventArgs *args)
{
Expand Down
4 changes: 4 additions & 0 deletions BrowserProxy/BrowserProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,18 @@ class BrowserProxyModule: public CComObjectRootEx<CComSingleThreadModel>,
HRESULT OnWebMessageReceived(ICoreWebView2 *sender, ICoreWebView2WebMessageReceivedEventArgs *args);
#endif
HRESULT OnWindowCloseRequested(ICoreWebView2 *sender);
#ifdef THERE
HRESULT OnDOMContentLoaded(ICoreWebView2 *sender, ICoreWebView2DOMContentLoadedEventArgs *args);
#endif
HRESULT OnDownloadStarting(ICoreWebView2 *sender, ICoreWebView2DownloadStartingEventArgs *args);
HRESULT Navigate();
HRESULT InvokeBrowserEvent(DISPID id, DISPPARAMS &args, VARIANT *result = nullptr);
HRESULT SetVisibility(BOOL visible);
#ifdef THERE
HRESULT ForwardCookie(ICoreWebView2CookieManager *cookieManager, const WCHAR *url,
const WCHAR *name, const WCHAR *domain, const WCHAR *path);
HRESULT ApplyScript(ICoreWebView2 *view, LONG id);
#endif
HRESULT SetDeferral(ICoreWebView2NewWindowRequestedEventArgs *args);
HRESULT ProcessDeferral();

Expand Down
18 changes: 14 additions & 4 deletions BrowserProxy/BrowserProxy.rc
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,2,2
PRODUCTVERSION 1,1,2,2
FILEVERSION 1,1,2,3
PRODUCTVERSION 1,1,2,3
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -76,12 +76,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "datadiode"
VALUE "FileDescription", "ActiveX proxy to Edge WebView2"
VALUE "FileVersion", "1.1.2.2"
VALUE "FileVersion", "1.1.2.3"
VALUE "InternalName", "OpennessWebView2.dll"
VALUE "LegalCopyright", "(c) Hmph! et al."
VALUE "OriginalFilename", "OpennessWebView2.dll"
VALUE "ProductName", "OpennessWebView2 Control"
VALUE "ProductVersion", "1.1.2.2"
VALUE "ProductVersion", "1.1.2.3"
END
END
BLOCK "VarFileInfo"
Expand All @@ -99,13 +99,23 @@ END
IDR_BROWSERPROXY REGISTRY "BrowserProxy.rgs"


/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//

IDR_BROWSERPROXY BITMAP "BrowserProxy.bmp"


/////////////////////////////////////////////////////////////////////////////
//
// TEXTFILE
//

#ifdef THERE
IDR_COUPLING 256 "coupling.js"
IDR_SETTINGS 256 "settings.html"
#endif


/////////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions BrowserProxy/BrowserProxy.rgs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ HKCR
ForceRemove 'Programmable'
ForceRemove 'Control'
ForceRemove 'Insertable'
ForceRemove 'ToolboxBitmap32' = s '%MODULE%, 101'
'MiscStatus' = s '0'
{
'1' = s '131473'
Expand Down
2 changes: 2 additions & 0 deletions BrowserProxy/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

#define IDS_PROJNAME 100
#define IDR_BROWSERPROXY 101
#ifdef THERE
#define IDR_COUPLING 102
#define IDR_SETTINGS 103

#define TEXTFILE 256
#endif

// Next default values for new objects
//
Expand Down
Binary file modified Installer/MakeSFX.exe
Binary file not shown.
3 changes: 2 additions & 1 deletion Installer/setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ echo BrowserExecutableFolder=%~dp0%~n2 >> OpennessWebView2.ini
:register
set options=
for %%x in (%*) do if /i "%%x" == "/autoextract" set options=/s
regsvr32.exe %options% OpennessWebView2.dll
for %%x in (system32 syswow64) do if exist "%SystemRoot%\%%x" set SystemLeaf=%%x
"%SystemRoot%\%SystemLeaf%\regsvr32.exe" %options% OpennessWebView2.dll
del %0

0 comments on commit 11ffca3

Please sign in to comment.