-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchtmltopdf_win.cpp
47 lines (35 loc) · 1.33 KB
/
chtmltopdf_win.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include <windows.h>
#include "chtmltopdf/chtmltopdf_app.h"
#include "include/cef_sandbox_win.h"
// Entry point function for all processes.
int APIENTRY wWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow) {
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
CefMainArgs main_args(hInstance);
int exit_code = CefExecuteProcess(main_args, NULL, NULL);
if (exit_code >= 0) {
// The sub-process has completed so return here.
return exit_code;
}
// Specify CEF global settings here.
CefSettings settings;
settings.no_sandbox = true;
// SimpleApp implements application-level callbacks for the browser process.
// It will create the first browser instance in OnContextInitialized() after
// CEF has initialized.
CefRefPtr<CHtmlToPdfApp> app(new CHtmlToPdfApp);
// Initialize CEF.
CefInitialize(main_args, settings, app.get(), NULL);
// Run the CEF message loop. This will block until CefQuitMessageLoop() is
// called.
CefRunMessageLoop();
// Shut down CEF.
CefShutdown();
return 0;
}