-
Notifications
You must be signed in to change notification settings - Fork 2
/
SCefBrowser.cpp
56 lines (42 loc) · 969 Bytes
/
SCefBrowser.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
48
49
50
51
52
53
54
55
56
#include "StdAfx.h"
#include "SCefBrowser.h"
#include "CefBrowserWrapper.h"
SCefBrowser::SCefBrowser(void)
{
m_pCefBrowserWrapper = NULL;
}
SCefBrowser::~SCefBrowser(void)
{
if(m_pCefBrowserWrapper)
delete m_pCefBrowserWrapper ;
m_pCefBrowserWrapper = NULL;
}
int SCefBrowser::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
SetMsgHandled(FALSE);
RECT rctCef={0,0,0,0};
HWND hParent = GetParent(m_hWnd);
::GetClientRect(hParent,&rctCef);
m_pCefBrowserWrapper = new CefBrowserWrapper(m_hWnd);
m_pCefBrowserWrapper->CreateCef(rctCef);
return 0;
}
BOOL SCefBrowser::OnInitDialog(HWND wndFocus,LPARAM lInitParam)
{
SetMsgHandled(FALSE);
return 0;
}
BOOL SCefBrowser::OnEraseBkgnd(HDC dc)
{
return TRUE;
}
void SCefBrowser::OnClose()
{
SetMsgHandled(FALSE);
}
void SCefBrowser::OnSize(UINT nType, CSize size)
{
CRect rc;
GetClientRect(&rc);
m_pCefBrowserWrapper->AdjuestCef(rc);
}