#include "stdafx.h"
#include "StaticWindow.h"

StaticWindow::StaticWindow()
{

}

StaticWindow::~StaticWindow()
{

}

int StaticWindow::Create(HWND parent)
{
	SkinnableWindow::Create(parent);
	close.Create(hWnd);
	minimize.Create(hWnd);

	// the close and minimize button locations are measured from the right and top
	close.SetLocation(size.Width-close.fromright,close.location.Y);
	minimize.SetLocation(size.Width-minimize.fromright,minimize.location.Y);

	close.SetMessageSink(hWnd);
	minimize.SetMessageSink(hWnd);
	return 1;
}

void StaticWindow::Load(const char * b)
{
	_bstr_t base = b;
	SkinnableWindow::Load(base);
	close.Load(base+"::close");
	minimize.Load(base+"::minimize");
}

void StaticWindow::OnClose()
{
	Hide();
}