#include "StdAfx.h"
#include "inplaceedit.h"

InPlaceEdit::InPlaceEdit(void)
{
	hWndSink = NULL;
}

InPlaceEdit::~InPlaceEdit(void)
{
}

void InPlaceEdit::Start()
{
	BringWindowToTop(hWnd);
	SetFocus(hEditCtrl);
	Show();
}

void InPlaceEdit::Stop()
{
	Hide();
}

void InPlaceEdit::OnLoseFocus()
{
	SafeSendMessage(hWndSink,WM_COMMAND,MAKEWPARAM(0,ID_LEFTBUTTON),(LPARAM)hWnd);
}

void InPlaceEdit::SetMessageSink(HWND h)
{
	hWndSink = h;
}