<commit_before>#include <MyHeaders\Window.h>

Window::Window()
{
	Handle = 0;
}

Window::Window(const TCHAR *classname, const TCHAR *windowname, 
	const WStyle style, 
	const int x, const int y, 
	const int width, const int height)
{
	Handle = 0;
	Create(classname, windowname, style, x, y, width, height);
}

Window::Window(const TCHAR *classname, const TCHAR *windowname, 
	const WStyle style, 
	const int x, const int y,
	const int width, const int height, 
	const HWND parent, 
	const HMENU menuID)
{
	Handle = 0;
	Create(classname, windowname, style, x, y, width, height);
}

void Window::SetAppData(const void *data)
{
	SetWindowLongPtr(Handle, GWLP_USERDATA, (LONG)data);
}

void* Window::GetAppData()
{
	return (void*)GetWindowLongPtr(Handle, GWLP_USERDATA);
}

void Window::SetTitle(const TCHAR *title)
{
	SetWindowText(Handle, title);
}

HDC Window::getDC()
{
	return GetDC(Handle);
}

bool Window::releaseDC(HDC dc)
{
	return ReleaseDC(Handle, dc) != 0;
}

HDC Window::getWindowDC()
{
	return GetWindowDC(Handle);
}

bool Window::SetOpacity(BYTE value)
{
	return SetLayeredWindowAttributes(Handle, 0, value, LWA_ALPHA) != 0;
}


void Window::MessageLoop()
{
	while (IsWindow(Handle))
	{
		GetMessage(&msg, Handle, 0, 0);
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
}

bool Window::MessageAvailable()
{
	return PeekMessage(&msg, Handle, 0, 0, PM_NOREMOVE) != 0;
}

bool Window::getMessageNoWait()
{
	return PeekMessage(&msg, Handle, 0, 0, PM_REMOVE) != 0;
}

unsigned int Window::sendMessage()
{
	TranslateMessage(&msg);
	return DispatchMessage(&msg);
}

bool Window::getMessage()
{
	return GetMessage(&msg, Handle, 0, 0) > 0;
}

bool Window::Destroy()
{
	if (!Handle)
		return true;
	if (DestroyWindow(Handle))
		return (Handle = 0) != 0;
	return false;;
}

bool Window::IsVisible()
{<commit_msg>Update Window.cpp<commit_after>#include <MyHeaders\Window.h>

Window::Window()
{
	Handle = 0;
}

Window::Window(const TCHAR *classname, const TCHAR *windowname, 
	const WStyle style, 
	const int x, const int y, 
	const int width, const int height)
{
	Handle = 0;
	Create(classname, windowname, style, x, y, width, height);
}

Window::Window(const TCHAR *classname, const TCHAR *windowname, 
	const WStyle style, 
	const int x, const int y,
	const int width, const int height, 
	const HWND parent, 
	const HMENU menuID)
{
	Handle = 0;
	Create(classname, windowname, style, x, y, width, height);
}

void Window::SetAppData(const void *data)
{
	SetWindowLongPtr(Handle, GWLP_USERDATA, (LONG)data);
}

void* Window::GetAppData()
{
	return (void*)GetWindowLongPtr(Handle, GWLP_USERDATA);
}

void Window::SetTitle(const TCHAR *title)
{
	SetWindowText(Handle, title);
}

HDC Window::getDC()
{
	return GetDC(Handle);
}

bool Window::releaseDC(HDC dc)
{
	return ReleaseDC(Handle, dc) != 0;
}

HDC Window::getWindowDC()
{
	return GetWindowDC(Handle);
}

bool Window::SetOpacity(BYTE value)
{
	return SetLayeredWindowAttributes(Handle, 0, value, LWA_ALPHA) != 0;
}


void Window::MessageLoop()
{
	while (IsWindow(Handle))
	{
		GetMessage(&msg, Handle, 0, 0);
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
}

bool Window::MessageAvailable()
{
	return PeekMessage(&msg, Handle, 0, 0, PM_NOREMOVE) != 0;
}

bool Window::getMessageNoWait()
{
	return PeekMessage(&msg, Handle, 0, 0, PM_REMOVE) != 0;
}

unsigned int Window::sendMessage()
{
	TranslateMessage(&msg);
	return DispatchMessage(&msg);
}

bool Window::getMessage()
{
	return GetMessage(&msg, Handle, 0, 0) > 0;
}

bool Window::Destroy()
{
	if (!Handle)
		return true;
	if (!DestroyWindow(Handle))
		return false;
		
	Handle = 0;
	return false;;
}

bool Window::IsVisible()
{
{'fraction_non_alphanumeric': 0.14520999176502883, 'fraction_numerical': 0.010156464452374416, 'mean_word_length': 5.370629370629371, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2237478', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1334, 'n_words': 343}