//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "NotificationThreadUnit.h"
#include "NotificationFormUnit.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
__fastcall TNotificationThread::TNotificationThread(bool CreateSuspended, TForm* pForm)
	: TThread(CreateSuspended)
{
	m_pForm = pForm;
}
//---------------------------------------------------------------------------
void __fastcall TNotificationThread::Execute()
{

	if( ((TNotificationForm *)m_pForm)->ParseJson() &&
		((TNotificationForm *)m_pForm)->LoadImg() )
	{
 		PostMessage(Application->MainForm->Handle, UM_NOTIFICATION,
					NOTIFICATION_SHOW_FORM , 0 );
	}else{
		PostMessage(Application->MainForm->Handle, UM_NOTIFICATION,
					NOTIFICATION_NO_JSONDATA, 0 );
	}
}
//---------------------------------------------------------------------------





