Skip to content
Snippets Groups Projects
Commit 275e3851 authored by Rom Walton's avatar Rom Walton
Browse files

VBOX: Introducing a basic graphics application for vboxwrapper based on HTML...

VBOX: Introducing a basic graphics application for vboxwrapper based on HTML rendering. Basic plumbing is done.

TODO:
* Add vbox job elements to point to various URLs for various states. (running/suspended/not running)
* Add window timer to poll for shared memory changes
* Exit if running in screen saver mode and keyboard/mouse activity is detected.
parent 0ca76008
No related branches found
No related tags found
No related merge requests found
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2010-2012 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#define _ATL_FREE_THREADED
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
#include <AtlBase.h>
#include <AtlCom.h>
#include <AtlCtl.h>
#include <AtlWin.h>
#include <AtlStr.h>
#include <AtlFile.h>
#include <AtlTypes.h>
#include <exdisp.h>
#include <exdispid.h>
#include <string>
#include "win_util.h"
#include "version.h"
#include "boinc_api.h"
#include "diagnostics.h"
#include "filesys.h"
#include "vboxhtmlgfx_win.h"
#include "vboxlogging.h"
#include "vboxcheckpoint.h"
#include "browserctrl_win.h"
CWndClassInfo& CHTMLBrowserHost::GetWndClassInfo()
{
static CWndClassInfo wc =
{
{ sizeof(WNDCLASSEX), 0, StartWindowProc, 0, 0, 0, 0, 0, (HBRUSH)(COLOR_WINDOW + 1), 0, NULL, 0 },
NULL, NULL, IDC_ARROW, TRUE, 0, _T("")
};
return wc;
}
HWND CHTMLBrowserHost::Create(
HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, _U_MENUorID MenuOrID, LPVOID lpCreateParam
){
ATOM atom = GetWndClassInfo().Register(&m_pfnSuperWindowProc);
if (!atom)
return NULL;
// Allocate the thunk structure here, where we can fail gracefully.
BOOL result = m_thunk.Init(NULL,NULL);
if (result == FALSE)
{
SetLastError(ERROR_OUTOFMEMORY);
return NULL;
}
_AtlWinModule.AddCreateWndData(&m_thunk.cd, this);
dwStyle = GetWndStyle(dwStyle);
dwExStyle = GetWndExStyle(dwExStyle);
// set caption
if (szWindowName == NULL)
{
szWindowName = GetWndCaption();
}
return CWindow::Create((LPCTSTR)atom, hWndParent, rect, szWindowName, dwStyle, dwExStyle, MenuOrID, lpCreateParam);
}
STDMETHODIMP CHTMLBrowserHost::ShowMessage(
HWND hwnd, LPOLESTR lpstrText, LPOLESTR lpstrCaption, DWORD dwType, LPOLESTR lpstrHelpFile, DWORD dwHelpContext, LRESULT *plResult
){
vboxlog_msg(
"Show Message:\n"
" Caption: %S\n"
" Text: %S\n",
lpstrCaption,
lpstrText
);
return S_OK;
}
STDMETHODIMP CHTMLBrowserHost::ShowHelp(
HWND hwnd, LPOLESTR pszHelpFile, UINT uCommand, DWORD dwData, POINT ptMouse, IDispatch *pDispatchObjectHit
){
return S_OK;
};
STDMETHODIMP CHTMLBrowserHost::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
{
return E_NOTIMPL;
}
STDMETHODIMP CHTMLBrowserHost::Exec(const GUID* pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG* pvaIn, VARIANTARG* pvaOut )
{
HRESULT hr = S_OK;
if (pguidCmdGroup && IsEqualGUID(*pguidCmdGroup, CGID_DocHostCommandHandler))
{
switch (nCmdID)
{
case OLECMDID_SHOWSCRIPTERROR:
{
CComPtr<IHTMLDocument2> pDoc;
CComPtr<IHTMLWindow2> pWindow;
CComPtr<IHTMLEventObj> pEventObj;
CComBSTR rgwszNames[5] =
{ L"errorLine", L"errorCharacter", L"errorCode", L"errorMessage", L"errorUrl" };
CComVariant rgvaEventInfo[5];
DISPID rgDispIDs[5];
DISPPARAMS params;
params.cArgs = 0;
params.cNamedArgs = 0;
// Get the document that is currently being viewed.
hr = pvaIn->punkVal->QueryInterface(IID_IHTMLDocument2, (void **) &pDoc);
// Get document.parentWindow.
hr = pDoc->get_parentWindow(&pWindow);
// Get the window.event object.
hr = pWindow->get_event(&pEventObj);
// Get the error info from the window.event object.
for (int i = 0; i < 5; i++)
{
// Get the property's dispID.
hr = pEventObj->GetIDsOfNames(IID_NULL, &rgwszNames[i], 1, LOCALE_SYSTEM_DEFAULT, &rgDispIDs[i]);
// Get the value of the property.
hr = pEventObj->Invoke(rgDispIDs[i], IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYGET, &params, &rgvaEventInfo[i], NULL, NULL);
SysFreeString(rgwszNames[i]);
}
vboxlog_msg(
"Show Script Error:\n"
" URL: %S\n"
" Message: %S\n"
" Error Code: %d\n"
" Error Line: %d\n"
" Error Position: %d",
rgvaEventInfo[4].bstrVal,
rgvaEventInfo[3].bstrVal,
rgvaEventInfo[2].uiVal,
rgvaEventInfo[0].uiVal,
rgvaEventInfo[1].uiVal
);
// Stop running scripts on the page.
(*pvaOut).vt = VT_BOOL;
(*pvaOut).boolVal = VARIANT_FALSE;
break;
}
default:
hr = OLECMDERR_E_NOTSUPPORTED;
break;
}
}
else
{
hr = OLECMDERR_E_UNKNOWNGROUP;
}
return (hr);
}
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2010-2015 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#ifndef _BROWSERCTRL_WIN_H_
#define _BROWSERCTRL_WIN_H_
class ATL_NO_VTABLE CHTMLBrowserHost :
public CAxHostWindow,
public IDocHostShowUI,
public IOleCommandTarget
{
public:
DECLARE_NO_REGISTRY()
DECLARE_PROTECT_FINAL_CONSTRUCT()
DECLARE_POLY_AGGREGATABLE(CHTMLBrowserHost)
DECLARE_GET_CONTROLLING_UNKNOWN()
BEGIN_COM_MAP(CHTMLBrowserHost)
COM_INTERFACE_ENTRY(IDocHostShowUI)
COM_INTERFACE_ENTRY(IOleCommandTarget)
COM_INTERFACE_ENTRY_CHAIN(CAxHostWindow)
END_COM_MAP()
static CWndClassInfo& GetWndClassInfo();
HWND Create(HWND hWndParent, _U_RECT rect = NULL, LPCTSTR szWindowName = NULL, DWORD dwStyle = 0, DWORD dwExStyle = 0, _U_MENUorID MenuOrID = 0U, LPVOID lpCreateParam = NULL);
// COM Interface - IDocHostShowUI
// http://msdn.microsoft.com/en-us/library/aa770041(v=vs.85).aspx
//
STDMETHOD(ShowMessage)(HWND hwnd, LPOLESTR lpstrText, LPOLESTR lpstrCaption, DWORD dwType, LPOLESTR lpstrHelpFile, DWORD dwHelpContext, LRESULT *plResult);
STDMETHOD(ShowHelp)(HWND hwnd, LPOLESTR pszHelpFile, UINT uCommand, DWORD dwData, POINT ptMouse, IDispatch *pDispatchObjectHit);
// COM Interface - IOleCommandTarget
// http://support.microsoft.com/kb/261003
//
STDMETHOD(QueryStatus)(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText);
STDMETHOD(Exec)(const GUID* pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANTARG* pvaIn, VARIANTARG* pvaOut );
};
#endif
\ No newline at end of file
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2010-2012 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#define _ATL_FREE_THREADED
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
#include <AtlBase.h>
#include <AtlCom.h>
#include <AtlCtl.h>
#include <AtlWin.h>
#include <AtlStr.h>
#include <AtlFile.h>
#include <AtlTypes.h>
#include <exdisp.h>
#include <exdispid.h>
#include <string>
#include "win_util.h"
#include "version.h"
#include "boinc_api.h"
#include "diagnostics.h"
#include "filesys.h"
#include "vboxhtmlgfx_win.h"
#include "vboxlogging.h"
#include "vboxcheckpoint.h"
#include "browserctrl_win.h"
#include "browserwnd_win.h"
#include "browsermain_win.h"
#ifdef _MSC_VER
#define snprintf _snprintf
#endif
CBrowserModule::CBrowserModule()
{
m_pWnd = NULL;
m_bFullscreen = false;
}
HRESULT CBrowserModule::InitializeCom() throw()
{
return ::OleInitialize(NULL);
}
void CBrowserModule::UninitializeCom() throw()
{
::OleUninitialize();
}
HRESULT CBrowserModule::PreMessageLoop(int nShowCmd) throw()
{
RECT rc = {0, 0, 0, 0};
DWORD dwExStyle = 0;
DWORD dwStyle = 0;
APP_INIT_DATA aid;
char szWindowTitle[256];
HRESULT hr = __super::PreMessageLoop(nShowCmd);
if (FAILED(hr)) {
return hr;
}
// Initialize ATL Window Classes
//
AtlAxWinInit();
// Prepare environment for detecting system conditions
//
boinc_parse_init_data_file();
boinc_get_init_data(aid);
// Construct the window caption
if (aid.app_version) {
snprintf(
szWindowTitle, sizeof(szWindowTitle),
"%s version %.2f [workunit: %s]",
aid.app_name, aid.app_version/100.0, aid.wu_name
);
} else {
snprintf(
szWindowTitle, sizeof(szWindowTitle),
"%s [workunit: %s]",
aid.app_name, aid.wu_name
);
}
if (m_bFullscreen) {
HDC dc = GetDC(NULL);
rc.left = 0;
rc.top = 0;
rc.right = GetDeviceCaps(dc, HORZRES);
rc.bottom = GetDeviceCaps(dc, VERTRES);
ReleaseDC(NULL, dc);
dwStyle = WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_POPUP;
dwExStyle = WS_EX_APPWINDOW|WS_EX_TOPMOST;
while(ShowCursor(false) >= 0);
} else {
rc.left = 0;
rc.top = 0;
rc.right = 800;
rc.bottom = 600;
dwStyle = WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_OVERLAPPEDWINDOW;
dwExStyle = WS_EX_APPWINDOW|WS_EX_WINDOWEDGE;
while(ShowCursor(true) < 0);
}
m_pWnd = new CHTMLBrowserWnd();
if (m_pWnd == NULL)
{
__super::PostMessageLoop();
return E_OUTOFMEMORY;
}
m_pWnd->Create(GetDesktopWindow(), rc, szWindowTitle, dwStyle, dwExStyle);
m_pWnd->ShowWindow(nShowCmd);
return S_OK;
}
HRESULT CBrowserModule::PostMessageLoop() throw()
{
if (m_pWnd)
{
delete m_pWnd;
m_pWnd = NULL;
}
AtlAxWinTerm();
return __super::PostMessageLoop();
}
int CBrowserModule::BOINCParseCommandLine(int argc, char** argv) {
for (int i=1; i<argc; i++) {
if (!strcmp(argv[i], "--fullscreen")) {
vboxlog_msg("Fullscreen mode requested.");
m_bFullscreen = true;
}
}
return 0;
}
CBrowserModule _AtlModule;
int run(int argc, char** argv) {
_AtlModule.BOINCParseCommandLine(argc, argv);
return _AtlModule.WinMain(SW_SHOWDEFAULT);
}
extern int main(int, char**);
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode) {
LPSTR command_line;
char* argv[100];
int argc;
command_line = GetCommandLine();
argc = parse_command_line(command_line, argv);
return main(argc, argv);
}
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2010-2015 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#ifndef _BROWSERMAIN_WIN_H_
#define _BROWSERMAIN_WIN_H_
class CHTMLBrowserWnd;
class CBrowserModule : public ATL::CAtlExeModuleT<CBrowserModule>
{
public:
CBrowserModule();
static HRESULT InitializeCom() throw();
static void UninitializeCom() throw();
HRESULT PreMessageLoop(int nShowCmd) throw();
HRESULT PostMessageLoop() throw();
int BOINCParseCommandLine(int argc, char** argv);
bool m_bFullscreen;
CHTMLBrowserWnd* m_pWnd;
};
#endif
\ No newline at end of file
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2010-2012 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#define _ATL_FREE_THREADED
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
#include <AtlBase.h>
#include <AtlCom.h>
#include <AtlCtl.h>
#include <AtlWin.h>
#include <AtlStr.h>
#include <AtlFile.h>
#include <AtlTypes.h>
#include <exdisp.h>
#include <exdispid.h>
#include <string>
#include "win_util.h"
#include "version.h"
#include "boinc_api.h"
#include "diagnostics.h"
#include "filesys.h"
#include "vboxhtmlgfx_win.h"
#include "vboxlogging.h"
#include "vboxcheckpoint.h"
#include "browserctrl_win.h"
#include "browserwnd_win.h"
CHTMLBrowserWnd::CHTMLBrowserWnd()
{
m_pBrowserHost = NULL;
}
CHTMLBrowserWnd::~CHTMLBrowserWnd()
{
}
LRESULT CHTMLBrowserWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
HRESULT hr;
RECT rcClient;
CComPtr<IUnknown> pCtrl;
CComVariant v;
// Create Control Host
hr = CComObject<CHTMLBrowserHost>::CreateInstance(&m_pBrowserHost);
ATLASSERT(SUCCEEDED(hr));
// Create Control Window
GetClientRect(&rcClient);
m_pBrowserHost->Create(m_hWnd, rcClient, NULL, WS_CHILD | WS_VISIBLE);
ATLASSERT(m_pBrowserHost->m_hWnd != NULL);
// Create Control
m_pBrowserHost->CreateControlEx(
L"Shell.Explorer",
m_pBrowserHost->m_hWnd,
NULL,
&pCtrl,
__uuidof(DWebBrowserEvents2),
(IUnknown*)(IDispEventImpl<1, CHTMLBrowserWnd, &__uuidof(DWebBrowserEvents2), &LIBID_SHDocVw, 1, 1>*)this
);
// Get an IWebBrowser2 interface on the control and navigate to a page.
m_pBrowserCtrl = pCtrl;
if (m_pBrowserCtrl) {
m_pBrowserCtrl->Navigate(CComBSTR("http://www.romwnet.org/"), &v, &v, &v, &v);
}
bHandled = TRUE;
return 0;
}
LRESULT CHTMLBrowserWnd::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
DestroyWindow();
bHandled = TRUE;
return 0;
}
LRESULT CHTMLBrowserWnd::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
bHandled = TRUE;
return 0;
}
LRESULT CHTMLBrowserWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
m_pBrowserHost->MoveWindow(0, 0, LOWORD(lParam), HIWORD(lParam));
bHandled = TRUE;
return 0;
}
void CHTMLBrowserWnd::OnNavigateComplete(IDispatch* pDisp, VARIANT* URL)
{
vboxlog_msg("URL Change Detected. (%S)", URL->bstrVal);
}
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2010-2015 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#ifndef _BROWSERWND_WIN_H_
#define _BROWSERWND_WIN_H_
class CHTMLBrowserWnd :
public CWindowImpl<CHTMLBrowserWnd, CWindow, CNullTraits>,
public IDispEventImpl<1, CHTMLBrowserWnd, &__uuidof(DWebBrowserEvents2), &LIBID_SHDocVw, 1, 1>
{
public:
DECLARE_WND_CLASS_EX(_T("BOINC_app"), 0, 0);
DECLARE_NO_REGISTRY();
BEGIN_SINK_MAP(CHTMLBrowserWnd)
SINK_ENTRY_EX(1, __uuidof(DWebBrowserEvents2), DISPID_NAVIGATECOMPLETE2, OnNavigateComplete)
END_SINK_MAP()
BEGIN_MSG_MAP(CHTMLBrowserWnd)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_CLOSE, OnClose)
MESSAGE_HANDLER(WM_TIMER, OnTimer)
MESSAGE_HANDLER(WM_SIZE, OnSize)
END_MSG_MAP()
CHTMLBrowserWnd();
~CHTMLBrowserWnd();
// Generic Window Events
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
// HTML Browser Events
void OnNavigateComplete(IDispatch* pDisp, VARIANT* URL);
CComObject<CHTMLBrowserHost>* m_pBrowserHost;
CComQIPtr<IWebBrowser2> m_pBrowserCtrl;
bool m_bScreensaverMode;
};
#endif
\ No newline at end of file
File deleted
......@@ -33,35 +33,25 @@
#include "version.h"
#include "boinc_api.h"
#include "diagnostics.h"
#include "filesys.h"
#include "md5_file.h"
#include "parse.h"
#include "str_util.h"
#include "str_replace.h"
#include "util.h"
#include "error_numbers.h"
#include "procinfo.h"
#include "vboxlogging.h"
extern int run(int, char**);
int main(int argc, char** argv) {
int retval = 0;
// Initialize diagnostic system
//
boinc_init_graphics_diagnostics(BOINC_DIAG_DEFAULTS);
return 0;
}
#ifdef _WIN32
// Log banner
//
vboxlog_msg("vboxhtmlgfx (%d.%d.%d): starting", BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, VBOXWRAPPER_RELEASE);
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode) {
LPSTR command_line;
char* argv[100];
int argc;
retval = run(argc, argv);
command_line = GetCommandLine();
argc = parse_command_line(command_line, argv);
return main(argc, argv);
boinc_finish_diag();
return retval;
}
#endif
......@@ -3,6 +3,9 @@
// Used by vboxhtmlgfx_win.rc
//
#define IDD_BROWSER 101
#define IDC_IE 1000
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
......@@ -10,7 +13,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 109
#define _APS_NEXT_COMMAND_VALUE 40000
#define _APS_NEXT_CONTROL_VALUE 1010
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 102
#endif
#endif
......@@ -75,6 +75,22 @@ END
// Bitmap
//
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_BROWSER DIALOGEX 0, 0, 327, 199
STYLE DS_SETFONT | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_APPWINDOW
CAPTION "BOINC Application"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "",IDC_IE,"{8856F961-340A-11D0-A96B-00C04FD705A2}",
WS_GROUP | WS_TABSTOP,0,0,198,106
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
......
......@@ -398,17 +398,18 @@ int main(int argc, char** argv) {
char buf[256];
// Initialize diagnostics system
//
boinc_init_diagnostics(BOINC_DIAG_DEFAULTS);
// Configure BOINC Runtime System environment
//
memset(&boinc_options, 0, sizeof(boinc_options));
boinc_options.main_program = true;
boinc_options.check_heartbeat = true;
boinc_options.handle_process_control = true;
boinc_init_options(&boinc_options);
// Prepare environment for detecting system conditions
//
boinc_get_init_data_p(&aid);
// Log banner
//
vboxlog_msg("vboxwrapper (%d.%d.%d): starting", BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, VBOXWRAPPER_RELEASE);
......@@ -416,9 +417,7 @@ int main(int argc, char** argv) {
// Initialize system services
//
#ifdef _WIN32
// Initialize the COM subsystem.
CoInitialize(NULL);
#ifdef USE_WINSOCK
WSADATA wsdata;
retval = WSAStartup( MAKEWORD( 1, 1 ), &wsdata);
......@@ -429,6 +428,10 @@ int main(int argc, char** argv) {
#endif
#endif
// Prepare environment for detecting system conditions
//
boinc_parse_init_data_file();
boinc_get_init_data(aid);
#ifdef _WIN32
// Determine what version of VirtualBox we are using via the registry. Use a
......@@ -461,7 +464,8 @@ int main(int argc, char** argv) {
pVM = (VBOX_VM*) new vboxmanage::VBOX_VM();
#endif
// Parse command line parameters
//
for (int i=1; i<argc; i++) {
if (!strcmp(argv[i], "--trickle")) {
trickle_period = atof(argv[++i]);
......@@ -1153,6 +1157,8 @@ int main(int argc, char** argv) {
WSACleanup();
#endif
#endif
return 0;
}
#ifdef _WIN32
......
......@@ -129,7 +129,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsCpp</CompileAs>
<ForcedIncludeFiles>boinc_win.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<DisableSpecificWarnings>4192; 4049; 4146, 4278</DisableSpecificWarnings>
<DisableSpecificWarnings>4192; 4049; 4146; 4278</DisableSpecificWarnings>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
......@@ -229,7 +229,7 @@
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>CompileAsCpp</CompileAs>
<ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
<DisableSpecificWarnings>4192; 4049; 4146, 4278</DisableSpecificWarnings>
<DisableSpecificWarnings>4192; 4049; 4146; 4278</DisableSpecificWarnings>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
......@@ -266,8 +266,7 @@
<PreprocessorDefinitions>WIN32;_DEBUG;_MT;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>boinc_win.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)boinc_win.pch</PrecompiledHeaderOutputFile>
<BrowseInformation>
......@@ -277,7 +276,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsCpp</CompileAs>
<ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
<DisableSpecificWarnings>4192; 4049; 4146, 4278</DisableSpecificWarnings>
<DisableSpecificWarnings>4192; 4049; 4146; 4278</DisableSpecificWarnings>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
......@@ -311,9 +310,15 @@
<ResourceCompile Include="..\samples\vboxhtmlgfx\vboxhtmlgfx_win.rc" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\samples\vboxhtmlgfx\browserctrl_win.cpp" />
<ClCompile Include="..\samples\vboxhtmlgfx\browsermain_win.cpp" />
<ClCompile Include="..\samples\vboxhtmlgfx\browserwnd_win.cpp" />
<ClCompile Include="..\samples\vboxhtmlgfx\vboxhtmlgfx.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\samples\vboxhtmlgfx\browserctrl_win.h" />
<ClInclude Include="..\samples\vboxhtmlgfx\browsermain_win.h" />
<ClInclude Include="..\samples\vboxhtmlgfx\browserwnd_win.h" />
<ClInclude Include="..\samples\vboxhtmlgfx\vboxhtmlgfx.h" />
<ClInclude Include="..\samples\vboxhtmlgfx\vboxhtmlgfx_win.h" />
</ItemGroup>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment