<commit_before>#include "EmbedWindow.h"

#define WNDSTYLE		(WS_CLIPCHILDREN | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)

CEmbedWindow::CEmbedWindow()
{
	RECT windowRect;
	SetRect(&windowRect, 0, 0, 800, 600);
	AdjustWindowRectEx(&windowRect, WNDSTYLE, FALSE, NULL);

	Create(NULL, Framework::Win32::CDefaultWndClass::GetName(), _T("Embedding"), WNDSTYLE, windowRect, NULL, NULL);
	SetClassPtr();

	m_embedControl = new Palleon::CWin32EmbedControl(m_hWnd, Framework::Win32::CRect(0, 0, 32, 32),
		_T("ShadowMapping.exe"), _T("C:\\Projects\\Palleon\\samples\\ShadowMapping"));
}

CEmbedWindow::~CEmbedWindow()
{
	delete m_embedControl;
}

long CEmbedWindow::OnSize(unsigned int, unsigned int, unsigned int)
{
	UpdateLayout();
	return FALSE;
}

void CEmbedWindow::UpdateLayout()
{
	auto clientRect = GetClientRect();
	clientRect.Inflate(-10, -10);
	m_embedControl->SetSizePosition(clientRect);
}<commit_msg>Added proper high dpi support in Embedding sample.<commit_after>#include "EmbedWindow.h"

#define WNDSTYLE		(WS_CLIPCHILDREN | WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)

CEmbedWindow::CEmbedWindow()
{
	int logX = GetDeviceCaps(GetDC(NULL), LOGPIXELSX);
	int logY = GetDeviceCaps(GetDC(NULL), LOGPIXELSY);

	int windowWidth = MulDiv(800, logX, 96);
	int windowHeight = MulDiv(600, logY, 96);

	RECT windowRect;
	SetRect(&windowRect, 0, 0, windowWidth, windowHeight);
	AdjustWindowRectEx(&windowRect, WNDSTYLE, FALSE, NULL);

	Create(NULL, Framework::Win32::CDefaultWndClass::GetName(), _T("Embedding"), WNDSTYLE, windowRect, NULL, NULL);
	SetClassPtr();

	m_embedControl = new Palleon::CWin32EmbedControl(m_hWnd, Framework::Win32::CRect(0, 0, 32, 32),
		_T("ShadowMapping.exe"), _T("C:\\Projects\\Palleon\\samples\\ShadowMapping"));
}

CEmbedWindow::~CEmbedWindow()
{
	delete m_embedControl;
}

long CEmbedWindow::OnSize(unsigned int, unsigned int, unsigned int)
{
	UpdateLayout();
	return FALSE;
}

void CEmbedWindow::UpdateLayout()
{
	auto clientRect = GetClientRect();
	clientRect.Inflate(-10, -10);
	m_embedControl->SetSizePosition(clientRect);
}
{'fraction_non_alphanumeric': 0.14393581878244455, 'fraction_numerical': 0.024539877300613498, 'mean_word_length': 7.249027237354086, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6703641', 'n_tokens_mistral': 864, 'n_tokens_neox': 786, 'n_words': 145}