Exemplo n.º 1
0
BOOL CWndVendorMessage::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	CWndEdit* pWndText = (CWndEdit*)GetDlgItem( WIDC_EDIT1 );
	switch(nID)
	{
		case WIDC_EDIT1: // 본문 
			if( message == EN_RETURN)
			{
				if( pWndText->m_string.IsEmpty() == FALSE )
				{
					char szChat[1024];
					if( strlen( pWndText->m_string ) < 1020 )
					{
						CString strFormat;
						pWndText->m_string.GetTextFormat(strFormat);
						if( strlen( strFormat ) < 1020 )
						{
							strcpy( szChat, strFormat );
							g_DPlay.SendChatting( szChat );
							pWndText->Empty();
						}
					}
				}
			}
			break;
		case WIDC_BUTTON1: // 본문 
			{
				if( pWndText->m_string.IsEmpty() == FALSE )
				{
					char szChat[1024];
					if( strlen( pWndText->m_string ) < 1020 )
					{
						CString strFormat;
						pWndText->m_string.GetTextFormat(strFormat);
						if( strlen( strFormat ) < 1020 )
						{
							strcpy( szChat, strFormat );
							g_DPlay.SendChatting( szChat );
							pWndText->Empty();
						}
					}
				}
			}
			break;
		case WTBID_CLOSE:
			{
				if( g_pPlayer->m_vtInfo.IsVendorOpen() )
					g_DPlay.SendCloseChattingRoom();
			}
			break;
	}
	return CWndNeuz::OnChildNotify( message, nID, pLResult ); 
}