commit d7520eb74b098759833c483d2f07766478b45011 Author: jdg Date: Sun Sep 12 22:23:04 2021 +0200 First commit 18/09/2000 diff --git a/AllBox.cpp b/AllBox.cpp new file mode 100644 index 0000000..65363a4 --- /dev/null +++ b/AllBox.cpp @@ -0,0 +1,687 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include +#include + +#include "AllBox.h" +#include "MiniChat_userlist.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma link "actimg" +#pragma link "CoolForm" +#pragma link "DialUp" +#pragma resource "*.dfm" + + +/* + Status + 0 escucha + 1 new-msg + 2 enviando-msg +*/ + +TBoxes *Boxes; +//--------------------------------------------------------------------------- +__fastcall TBoxes::TBoxes(TComponent* Owner) + : TForm(Owner) +{ + InMessage = new TStringList; + + BoxActive = 0; + Status = 0; + TrayMessage(NIM_ADD); + TrayMessage(NIM_MODIFY); + + // Cargamos la lista de usuarios... + LoadUserList(); + MiniChatList->UserList->Items = para->Items; + for ( int i=0; i<20; i++ ) + OutChats[i] = new TNMMsg(this); +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::LoadUserList( void ) +{ + FILE *users; + char buffer[200]; + AnsiString Name; + NumUsers = 0; + + if ( (users = fopen( "users.cfg", "r" ) ) != NULL ) + { + while ( !feof( users ) && NumUsers < 45 ) + { + fgets( buffer, 200, users ); + if ( StrLen( buffer ) >= 10 && buffer[0]!='#' ) + { + Name = AnsiString( scanUntil( buffer, 32 ) + 1 ); + TranslateIP[NumUsers] = AnsiString( buffer ); + Name = Name.SetLength(Name.Length()-1); + para -> Items -> Add( Name ); + NumUsers ++; + } + } + + fclose( users ); + } + +} +//--------------------------------------------------------------------------- +char * __fastcall TBoxes::scanUntil( char *text, char Terminador ) +{ + char *buff; + + buff = text; + + while ( *buff != '\0' && *buff != Terminador ) + buff++; + + *buff = '\0'; + + return buff; +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::DrawItem(TMessage& Msg) +{ + IconDrawItem((LPDRAWITEMSTRUCT)Msg.LParam); + TForm::Dispatch(&Msg); +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::MyNotify(TMessage& Msg) +{ + POINT MousePos; + + switch(Msg.LParam) + { + case WM_RBUTTONUP: + if ( GetCursorPos(&MousePos) ) + { + PopupMenu1->PopupComponent = Boxes; + SetForegroundWindow(Handle); + PopupMenu1->Popup(MousePos.x, MousePos.y); + PopupMenu1->PopupComponent = 0; + } + else + Show(); + break; + case WM_LBUTTONDBLCLK: + Properties1Click(0); + break; +/* + case WM_LBUTTONUP: + Properties1Click(0); + break; +*/ + default: + break; + } + TForm::Dispatch(&Msg); +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::ActiveImage4Click(TObject *Sender) +{ + Visible = false; + + if ( MiniChatList -> Visible ) + MiniChatList -> Visible = false; + +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::FormDestroy(TObject *Sender) +{ + for ( int i=0; i<20; i++ ) + delete OutChats[i]; + + delete InMessage; + TrayMessage(NIM_DELETE); +} +//--------------------------------------------------------------------------- +bool __fastcall TBoxes::TrayMessage(DWORD dwMessage) +{ + NOTIFYICONDATA tnd; + PSTR pszTip; + + pszTip = TipText(); + + tnd.cbSize = sizeof(NOTIFYICONDATA); + tnd.hWnd = Handle; + tnd.uID = IDC_MYICON; + tnd.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; + tnd.uCallbackMessage = MYWM_NOTIFY; + + if (dwMessage == NIM_MODIFY) + { + tnd.hIcon = IconHandle(); + if (pszTip) + lstrcpyn(tnd.szTip, pszTip, sizeof(tnd.szTip)); + else + tnd.szTip[0] = '\0'; + } + else + { + tnd.hIcon = NULL; + tnd.szTip[0] = '\0'; + } + + return (Shell_NotifyIcon(dwMessage, &tnd)); +} +//--------------------------------------------------------------------------- +HANDLE __fastcall TBoxes::IconHandle(void) +{ + switch ( Status ) + { + case 1: + return imagenOFF -> Picture->Icon->Handle; + } + return imagenOn -> Picture->Icon->Handle; +} +//--------------------------------------------------------------------------- +PSTR __fastcall TBoxes::TipText(void) +{ + switch( Status ) + { + case 0: + return ("Escuchando nuevos mensajes"); + case 1: + return ("Tiene mensajes nuevos"); + case 2: + return ("Enviando Mensaje"); + } + return ("Código de STATUS DESCONOCIDO"); +} + +//--------------------------------------------------------------------------- +LRESULT IconDrawItem(LPDRAWITEMSTRUCT lpdi) +{ + HICON hIcon; + + hIcon = (HICON)LoadImage(g_hinst, MAKEINTRESOURCE(lpdi->CtlID), IMAGE_ICON, + 16, 16, 0); + if (!hIcon) + return(FALSE); + + DrawIconEx(lpdi->hDC, lpdi->rcItem.left, lpdi->rcItem.top, hIcon, + 16, 16, 0, NULL, DI_NORMAL); + + return(TRUE); +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::Properties1Click(TObject *Sender) +{ + Visible = true; +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::Acercade1Click(TObject *Sender) +{ + ShowMessage( "JD soft.\nBipBip es un programa desarrollado por:\nJosé David Guillén\ny distribuido por Informática D.J. [ www.infdj.com ]"); +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::Shutdown1Click(TObject *Sender) +{ + Close(); +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::FormCloseQuery(TObject *Sender, bool &CanClose) +{ +/* + if ( MessageDlg( "Si sale ahora del programa, no podrá recibir los mensajes en tiempo real.\n¿Salir de todas formas?", mtWarning, TMsgDlgButtons() << mbNo << mbYes, 0 ) == mrNo ) + CanClose = false; + else +*/ + MiniChatList->Close(); +} +//--------------------------------------------------------------------------- + +//// TrayMessage(NIM_MODIFY); + + + + + +void __fastcall TBoxes::ActiveImage2Click(TObject *Sender) +{ + // Vemos que mensajes tenemos en nuestra IN-BOX + LeeMensajes( "inbox\\" ); + + BoxActive = 1; + + // Listado de Mensajes + AllBox -> Visible = true; + + // Descripción del mensaje + Label1 -> Caption = "Para:"; para->Visible = false; + Label2 -> Caption = "Asunto:"; asunto->Visible = false; + Enviar->Caption = "&Enviar"; Enviar->Visible = false; + Mensaje->ReadOnly = false; Mensaje->Lines->Clear(); + Mensaje->Visible = false; + + // MiniChat + LineChat->Visible = false; + MiniChat->Visible = false; +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::LeeMensajes(char *carpeta) +{ + // Lee, examina y añade al ALLbox,,, + TSearchRec sr; + int iAttributes = 0; + AllBox->RowCount = 1; + iAttributes |= faReadOnly | faHidden | faSysFile | faArchive | faAnyFile; + iAttributes = 0xFF; + + AllBox->Cells[0][AllBox->RowCount-1] = ""; AllBox->Cells[1][AllBox->RowCount-1] = ""; AllBox->Cells[2][AllBox->RowCount-1] = ""; AllBox->Cells[3][AllBox->RowCount-1] = ""; + if (FindFirst( AnsiString( AnsiString(carpeta)+"*.txt" ).c_str(), iAttributes, sr) == 0) + { + AllBox->Enabled = true; +// if (sr.Attr == iAttributes) + { + AllBox->Cells[3][AllBox->RowCount-1] = sr.Name; + ExtractInfo( (sr.Name).c_str(), carpeta ); + } + while (FindNext(sr) == 0) + { +// if (sr.Attr == iAttributes) + { + AllBox->RowCount += 1; + AllBox->Cells[3][AllBox->RowCount-1] = sr.Name; + ExtractInfo( (sr.Name).c_str(), carpeta ); + } + } + } else { + AllBox->Enabled = false; + } + FindClose(sr); +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::ExtractInfo(char *filename, AnsiString Box) +{ + FILE *msg; + char buffer[200]; + AnsiString buf; + + AnsiString filenameBOX = Box + AnsiString(filename); + + AllBox->Cells[0][AllBox->RowCount-1] = AnsiString( filename ).SubString( 14, 5 ); + + if ( ( msg = fopen( filenameBOX.c_str(), "r" ) ) != NULL ) + { + fgets( buffer, 199, msg ); + buf = buffer; + + AllBox->Cells[1][AllBox->RowCount-1] = TranslateName( buf.SetLength( buf.Length() -1 ) ); + + fgets( buffer, 199, msg ); + buf = buffer; + AllBox->Cells[2][AllBox->RowCount-1] = buf.SetLength( buf.Length() - 1 ); + fclose( msg ); + } + +} +//--------------------------------------------------------------------------- +AnsiString __fastcall TBoxes::TranslateName( AnsiString name ) +{ + for ( int I=0; I < NumUsers; I++ ) + { + if ( TranslateIP[ I ] == name ) + return para->Items->Strings[I]; + } + return name; +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::ActiveImage1Click(TObject *Sender) +{ + // Listado de Mensajes + AllBox -> Visible = false; + + // Descripción del mensaje + Label1 -> Caption = "Para:"; para->Visible = true; + Label2 -> Caption = "Asunto:"; asunto->Visible = true; + Enviar -> Caption = "&Enviar"; Enviar->Visible = true; + Mensaje->ReadOnly = false; Mensaje->Lines->Clear(); + Mensaje->Visible = true; + FechaMsg->Visible = false; + + // MiniChat + LineChat->Visible = false; + MiniChat->Visible = false; +} +//--------------------------------------------------------------------------- + +void __fastcall TBoxes::EnviarClick(TObject *Sender) +{ + if ( Enviar->Caption == "&Borrar!!" ) + { + DeleteFile( (BoxActive == 1 ? "inbox\\" : "outbox\\" ) + AllBox->Rows[AllBox->Row]->Strings[3] ); + if ( BoxActive == 1 ) + ActiveImage2Click(0); + else + ActiveImage3Click(0); + return; + } + + char FileMessage[80]; + + if ( para->ItemIndex != -1 ) + { + unsigned short year, month, day; + unsigned short h, m, s, ss; + TDateTime::CurrentDate().DecodeDate( &year, &month, &day ); + TDateTime::CurrentTime().DecodeTime( &h, &m, &s, &ss ); + +// FileMessage = Format( "outbox\\%02d%02d%02d-%02d%02d%02d.txt", OPENARRAY(TVarRec, (year, month, day, h, m, ss)) ); + sprintf( FileMessage, "outbox\\%02d-%02d-%02d @ %02d.%02d'%02d.txt", year, month, day, h, m, ss ); + + Mensaje -> Lines -> Insert( 0, asunto->Text ); + Mensaje -> Lines -> Insert( 0, TranslateIP[para->ItemIndex] ); + Mensaje -> Lines -> SaveToFile( FileMessage ); + Mensaje -> Lines -> Clear(); + asunto->Text = ""; + para->Text = ""; + + EnviaMensaje( AnsiString(FileMessage) ); + if ( asunto->Text.Pos( "$-" ) == 1 ) + DeleteFile( AnsiString(FileMessage) ); + } else { + ShowMessage( "Debe indicar el destinatario..." ); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TBoxes::ActiveImage3Click(TObject *Sender) +{ + LeeMensajes( "outbox\\" ); + + BoxActive = 2; + + // Listado de Mensajes + AllBox -> Visible = true; + + // Descripción del mensaje + Label1 -> Caption = "Para:"; para->Visible = false; + Label2 -> Caption = "Asunto:"; asunto->Visible = false; + Enviar->Caption = "&Enviar"; Enviar->Visible = false; + Mensaje->ReadOnly = false; Mensaje->Lines->Clear(); + Mensaje->Visible = false; + + // MiniChat + LineChat->Visible = false; + MiniChat->Visible = false; +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::SendNowTimer(TObject *Sender) +{ + int OldStatus = Status; + // Damos salida a todos los mensajes pendientes... + TSearchRec sr; + int iAttributes = 0xFF; + + if (FindFirst( AnsiString( "outbox\\*.txt" ).c_str(), iAttributes, sr) == 0) + { + EnviaMensaje( "outbox\\"+sr.Name ); + while (FindNext(sr) == 0) + EnviaMensaje( "outbox\\"+sr.Name ); + } + FindClose(sr); + /// + Status = OldStatus; TrayMessage(NIM_MODIFY); +} +//--------------------------------------------------------------------------- + +void __fastcall TBoxes::AllBoxDblClick(TObject *Sender) +{ + // Mostramos el mensaje seleccionado... + Status = 0; TrayMessage(NIM_MODIFY); + + // Listado de Mensajes + AllBox -> Visible = false; + + // Descripción del mensaje + para->Visible = false; + asunto->Visible = false; + Enviar->Caption = "&Borrar!!"; Enviar->Visible = true; + Mensaje->ReadOnly = true; + Mensaje->Visible = true; + FechaMsg->Visible = true; + FechaMsg->Caption = AllBox->Rows[AllBox->Row]->Strings[3]; + + // MiniChat + LineChat->Visible = false; + MiniChat->Visible = false; + + + Mensaje->Lines->LoadFromFile( (BoxActive == 1 ? "inbox\\" : "outbox\\" ) + AllBox->Rows[AllBox->Row]->Strings[3] ); + Mensaje->Lines->Delete( 0 ); + Mensaje->Lines->Delete( 0 ); + Label1 -> Caption = "De:\t" + AllBox->Rows[AllBox->Row]->Strings[1]; + Label2 -> Caption = "Asunto: " + AllBox->Rows[AllBox->Row]->Strings[2]; +} +//--------------------------------------------------------------------------- + +void __fastcall TBoxes::ActiveImage5Click(TObject *Sender) +{ + // Linea Anterior + if ( BoxActive ) + { + if ( AllBox->Row > 0 ) + { + AllBox->Row--; + if ( AllBox->Visible == false ) + AllBoxDblClick( 0 ); + } + } +} +//--------------------------------------------------------------------------- + +void __fastcall TBoxes::ActiveImage6Click(TObject *Sender) +{ + // Linea Siguiente + if ( BoxActive ) + { + if ( AllBox->Row < (AllBox->RowCount-1) ) + { + AllBox->Row++; + if ( AllBox->Visible == false ) + AllBoxDblClick( 0 ); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::EnviaMensaje( AnsiString FileName ) +{ + Status = 2; TrayMessage(NIM_MODIFY); + + + OutBox->TimeOut = 20000; + OutBox->ReportLevel = Status_Basic; + OutBox->FromName = OutBox->LocalIP; + OutBox->Port = 6711; + + TStringList *OutMessage; + + try { + OutMessage = new TStringList; + OutMessage->LoadFromFile( FileName ); + OutBox->Host = OutMessage->Strings[0]; + + // Archivo +// OutBox->PostIt( FileName.SubString( 8, FileName.Length() - 7 ) ); + OutBox->FromName = "BeginMessage"; + OutBox->PostIt( OutBox->LocalIP ); + OutBox->FromName = OutBox->LocalIP; + + + for ( int I=1; I < OutMessage->Count; I++ ) + OutBox->PostIt( OutMessage->Strings[I] ); + + OutBox->FromName = "EndMessage"; + if ( OutBox->PostIt( FileName.SubString( 8, FileName.Length() - 7 ) ) .AnsiPos( "OK" ) != 0 ) + { + sndPlaySound("outbox\\msgout.wav", SND_ASYNC | SND_FILENAME); + DeleteFile( FileName ); + } + else + sndPlaySound("outbox\\msgfail.wav", SND_ASYNC | SND_FILENAME); + delete OutMessage; + }catch(...){ + // nothing + sndPlaySound("outbox\\msgfail.wav", SND_ASYNC | SND_FILENAME); +// ShowMessage( "El mensaje NO pudo ser ENVIADO.\nPuede ser que el equipo no exista.\n(cada 5 minutos, se reintentará su envio)" ); + } + Status = 0; TrayMessage(NIM_MODIFY); +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::InBoxMSG(TComponent *Sender, + const AnsiString sFrom, const AnsiString sMsg) +{ + if ( sFrom == "BeginMessage" && InMessage->Count > 0 ) + { + InMessage->Insert( 0, sMsg ); + InMessage->Add("-------------------------------\nColision en la red detectada ]cabecera desordenada o mezclada[\n-------------------------------"); + } + + if ( sFrom == "EndMessage" ) + { + if ( InMessage->Strings[1].Pos( "$-" ) == 1 ) + { + // Esto es un comando de control, asi que lo procesamos de forma especial + + // Apagar el equipo + if ( InMessage->Strings[1].UpperCase() == "$-APAGAR" ) + ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCE | EWX_POWEROFF, 0); + // Cortar la conexion a internet + if ( InMessage->Strings[1].UpperCase() == "$-MODEM" ) + DialUp1 -> GetConnections(); + InMessage->Clear(); + } else { + InMessage->SaveToFile( "inbox\\"+sMsg ); + InMessage->Clear(); + Status = 1; TrayMessage(NIM_MODIFY); + sndPlaySound("inbox\\newmsg.wav", SND_ASYNC | SND_FILENAME); + if ( Visible == false ) + { + NewMessage->Enabled = true; + // Visible = true; + } + } + } else + InMessage->Add(sMsg); +} +//--------------------------------------------------------------------------- + + +void __fastcall TBoxes::ActiveImage7Click(TObject *Sender) +{ + LineChat->Visible = true; + + // MiniChat + // Mostramos tb. la lista de usuarios a los que mandamos nuestras notas... + LineChat->Visible = true; + MiniChat->Visible = true; + + if ( MiniChat -> Visible ) + { + MiniChatList -> Visible = !MiniChatList->Visible; + } + // Listado de Mensajes + AllBox -> Visible = false; + + // Descripción del mensaje + para->Visible = false; + asunto->Visible = false; + Enviar->Visible = false; + Mensaje->Visible = false; + + MiniChatList->Left = Left + Width; + MiniChatList->Top = Top+50; +} +//--------------------------------------------------------------------------- + +void __fastcall TBoxes::LineChatKeyPress(TObject *Sender, char &Key) +{ + if ( Key == VK_RETURN && !LineChat->Text.IsEmpty() ) + { + // ...lo subimos pa'rriba + MiniChat->Lines->Add( LineChat->Text ); + // Enviamos el mensaje, a todos los usuarios marcados en el UserList + for ( msgI=0; msgI < MiniChatList->UserList->Items->Count; msgI++ ) + { + if ( MiniChatList->UserList->Checked[msgI]) + { + try{ + int LineOut = msgI < 20 ? msgI : 0; + OutChats[LineOut]->ReportLevel = Status_None; + OutChats[LineOut]->Host = TranslateIP[ msgI ]; + OutChats[LineOut]->FromName = OutBox->LocalIP; + OutChats[LineOut]->Port = 6712; + OutChats[LineOut]->TimeOut = 250; + OutChats[LineOut]->PostIt( LineChat->Text ); +/* + OutBox->ReportLevel = Status_None; + OutBox->Host = TranslateIP[ msgI ]; + OutBox->FromName = OutBox->LocalIP; + OutBox->Port = 6712; + OutBox->TimeOut = 250; + OutBox->PostIt( LineChat->Text ); +*/ + } catch(...) { + // nothing... + MiniChatList->UserList->Checked[msgI] = false; + MiniChat->Lines->Add( ">>>> "+MiniChatList->UserList->Items->Strings[msgI] + " Desconectado "); + } + } + } + LineChat->Text=""; + } +} +//--------------------------------------------------------------------------- + +void __fastcall TBoxes::InChatMSG(TComponent *Sender, + const AnsiString sFrom, const AnsiString sMsg) +{ + for ( int I=0; I < NumUsers; I++ ) + { + if ( TranslateIP[ I ] == sFrom ) + MiniChatList->UserList->Checked[ I ] = true; + } + + MiniChat->Lines->Add( TranslateName(sFrom) + "> " + sMsg ); + if ( MiniChat->Lines->Count == 200 ) MiniChat->Lines->Delete( 0 ); +} +//--------------------------------------------------------------------------- + +void __fastcall TBoxes::NewMessageTimer(TObject *Sender) +{ + NewMessage->Enabled = false; + Visible = true; + ActiveImage2Click( 0 ); +} +//--------------------------------------------------------------------------- + +void __fastcall TBoxes::AllBoxKeyPress(TObject *Sender, char &Key) +{ + if ( Key == VK_RETURN ) + AllBoxDblClick( 0 ); +} +//--------------------------------------------------------------------------- +void __fastcall TBoxes::CoolForm1MouseUp(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + if ( MiniChat -> Visible ) + { + MiniChatList->Left = Left + Width; + MiniChatList->Top = Top+50; + } +} +//--------------------------------------------------------------------------- + + + +void __fastcall TBoxes::DialUp1ActiveConnection(TObject *Sender, + int Handle, TRasConnStatusA &Status, AnsiString StatusString, + AnsiString EntryName, AnsiString DeviceType, AnsiString DeviceName) +{ + DialUp1 -> HangUpConn( Handle ); +} +//--------------------------------------------------------------------------- + diff --git a/AllBox.dfm b/AllBox.dfm new file mode 100644 index 0000000..0989283 Binary files /dev/null and b/AllBox.dfm differ diff --git a/AllBox.h b/AllBox.h new file mode 100644 index 0000000..0d65d8d --- /dev/null +++ b/AllBox.h @@ -0,0 +1,138 @@ +//--------------------------------------------------------------------------- +#ifndef AllBoxH +#define AllBoxH +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include "actimg.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "CoolForm.hpp" +#include "DialUp.h" + +#define MYWM_NOTIFY (WM_APP+100) +#define IDC_MYICON 1006 +extern HINSTANCE g_hinst; +LRESULT IconDrawItem(LPDRAWITEMSTRUCT lpdi); +//--------------------------------------------------------------------------- +class TBoxes : public TForm +{ +__published: // IDE-managed Components + TActiveImage *ActiveImage1; + TActiveImage *ActiveImage2; + TActiveImage *ActiveImage3; + TActiveImage *ActiveImage4; + TActiveImage *ActiveImage5; + TActiveImage *ActiveImage6; + TActiveImage *ActiveImage7; + TImage *imagenOn; + TImage *imagenOFF; + TPopupMenu *PopupMenu1; + TMenuItem *Properties1; + TMenuItem *Shutdown1; + TMenuItem *N2; + TMenuItem *Acercade1; + TStringGrid *AllBox; + TLabel *Label1; + TComboBox *para; + TButton *Enviar; + TMemo *Mensaje; + TLabel *Label2; + TEdit *asunto; + TTimer *SendNow; + TNMMsg *OutBox; + TNMMSGServ *InBox; + TCoolForm *CoolForm1; + TEdit *LineChat; + TMemo *MiniChat; + TNMMsg *OutChat; + TNMMSGServ *InChat; + TTimer *NewMessage; + TDialUp *DialUp1; + TLabel *FechaMsg; + void __fastcall ActiveImage4Click(TObject *Sender); + void __fastcall FormDestroy(TObject *Sender); + void __fastcall Properties1Click(TObject *Sender); + void __fastcall Acercade1Click(TObject *Sender); + void __fastcall Shutdown1Click(TObject *Sender); + void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose); + + + + void __fastcall ActiveImage2Click(TObject *Sender); + void __fastcall ActiveImage1Click(TObject *Sender); + void __fastcall EnviarClick(TObject *Sender); + void __fastcall ActiveImage3Click(TObject *Sender); + void __fastcall SendNowTimer(TObject *Sender); + void __fastcall AllBoxDblClick(TObject *Sender); + void __fastcall ActiveImage5Click(TObject *Sender); + void __fastcall ActiveImage6Click(TObject *Sender); + + + + + void __fastcall InBoxMSG(TComponent *Sender, const AnsiString sFrom, + const AnsiString sMsg); + + void __fastcall ActiveImage7Click(TObject *Sender); + void __fastcall LineChatKeyPress(TObject *Sender, char &Key); + void __fastcall InChatMSG(TComponent *Sender, const AnsiString sFrom, + const AnsiString sMsg); + void __fastcall NewMessageTimer(TObject *Sender); + + void __fastcall AllBoxKeyPress(TObject *Sender, char &Key); + void __fastcall CoolForm1MouseUp(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall DialUp1ActiveConnection(TObject *Sender, + int Handle, TRasConnStatusA &Status, AnsiString StatusString, + AnsiString EntryName, AnsiString DeviceType, + AnsiString DeviceName); +private: // User declarations + void __fastcall DrawItem(TMessage& Msg); + void __fastcall MyNotify(TMessage& Msg); + bool __fastcall TrayMessage(DWORD dwMessage); + HANDLE __fastcall IconHandle(void); + void __fastcall ToggleState(void); + PSTR __fastcall TipText(void); + int Status; + + AnsiString TranslateIP[50]; + + char * __fastcall scanUntil( char *text, char Terminador ); + void __fastcall LoadUserList( void ); + int NumUsers; + + TNMMsg *OutChats[20]; + + TStringList *InMessage; + +public: // User declarations + __fastcall TBoxes(TComponent* Owner); + void __fastcall LeeMensajes(char *carpeta); + void __fastcall ExtractInfo(char *filename, AnsiString Box); + AnsiString __fastcall TranslateName( AnsiString name ); + void __fastcall EnviaMensaje( AnsiString FileName ); + + int BoxActive; + int msgI; + + + + +BEGIN_MESSAGE_MAP + MESSAGE_HANDLER(WM_DRAWITEM,TMessage,DrawItem) + MESSAGE_HANDLER(MYWM_NOTIFY,TMessage,MyNotify) +END_MESSAGE_MAP(TForm) +}; +//--------------------------------------------------------------------------- +extern PACKAGE TBoxes *Boxes; +//--------------------------------------------------------------------------- +#endif diff --git a/Armazon.psp b/Armazon.psp new file mode 100644 index 0000000..ace41bc Binary files /dev/null and b/Armazon.psp differ diff --git a/BipBip!.zip b/BipBip!.zip new file mode 100644 index 0000000..0408aac Binary files /dev/null and b/BipBip!.zip differ diff --git a/BipBip.bpr b/BipBip.bpr new file mode 100644 index 0000000..704da40 --- /dev/null +++ b/BipBip.bpr @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=1 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=3082 +CodePage=1252 + +[Version Info Keys] +CompanyName=www.infdj.com +FileDescription=IntraBeeper para LAN's +FileVersion=1.0.0.0 +InternalName=BipBip +LegalCopyright=JD soft. +LegalTrademarks= +OriginalFilename=BipBip +ProductName= +ProductVersion=1.0.0.0 +Comments=José David Guillén +e-mail=jd@infdj.com + +[Excluded Packages] +$(BCB)\Projects\Bpl\Dialup.bpl=RAS Tools + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + + \ No newline at end of file diff --git a/BipBip.cpp b/BipBip.cpp new file mode 100644 index 0000000..f056eb6 --- /dev/null +++ b/BipBip.cpp @@ -0,0 +1,28 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("BipBip.res"); +USEFORM("AllBox.cpp", Boxes); +USEFORM("MiniChat_userlist.cpp", MiniChatList); +//--------------------------------------------------------------------------- +HINSTANCE g_hinst; +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE hInstance, LPSTR, int) +{ + try + { + Application->Initialize(); + g_hinst = hInstance; + Application->Title = "BipBip!!!"; + Application->CreateForm(__classid(TMiniChatList), &MiniChatList); + Application->CreateForm(__classid(TBoxes), &Boxes); + Application->ShowMainForm = false; + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/BipBip.exe b/BipBip.exe new file mode 100644 index 0000000..5bc57e8 Binary files /dev/null and b/BipBip.exe differ diff --git a/BipBip.res b/BipBip.res new file mode 100644 index 0000000..9b066e6 Binary files /dev/null and b/BipBip.res differ diff --git a/MiniChat_userlist.cpp b/MiniChat_userlist.cpp new file mode 100644 index 0000000..ee214fc --- /dev/null +++ b/MiniChat_userlist.cpp @@ -0,0 +1,16 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop + +#include "MiniChat_userlist.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TMiniChatList *MiniChatList; +//--------------------------------------------------------------------------- +__fastcall TMiniChatList::TMiniChatList(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- + diff --git a/MiniChat_userlist.dfm b/MiniChat_userlist.dfm new file mode 100644 index 0000000..87f37e8 Binary files /dev/null and b/MiniChat_userlist.dfm differ diff --git a/MiniChat_userlist.h b/MiniChat_userlist.h new file mode 100644 index 0000000..34d1597 --- /dev/null +++ b/MiniChat_userlist.h @@ -0,0 +1,23 @@ +//--------------------------------------------------------------------------- +#ifndef MiniChat_userlistH +#define MiniChat_userlistH +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TMiniChatList : public TForm +{ +__published: // IDE-managed Components + TCheckListBox *UserList; +private: // User declarations +public: // User declarations + __fastcall TMiniChatList(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TMiniChatList *MiniChatList; +//--------------------------------------------------------------------------- +#endif diff --git a/MiniChat_userlist.zip b/MiniChat_userlist.zip new file mode 100644 index 0000000..8ab0d97 Binary files /dev/null and b/MiniChat_userlist.zip differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..c0b2f0c --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +#BipBip + + +*18/09/2000* + +ToDo: wwtcf? + + +![screenshot](/BipBip.png "Screenshot") diff --git a/botones.rar b/botones.rar new file mode 100644 index 0000000..bb01263 Binary files /dev/null and b/botones.rar differ diff --git a/botones/Fondo.bmp b/botones/Fondo.bmp new file mode 100644 index 0000000..1ebcbe8 Binary files /dev/null and b/botones/Fondo.bmp differ diff --git a/botones/cfg-0.bmp b/botones/cfg-0.bmp new file mode 100644 index 0000000..65265f5 Binary files /dev/null and b/botones/cfg-0.bmp differ diff --git a/botones/cfg-1.bmp b/botones/cfg-1.bmp new file mode 100644 index 0000000..2c59981 Binary files /dev/null and b/botones/cfg-1.bmp differ diff --git a/botones/down-0.bmp b/botones/down-0.bmp new file mode 100644 index 0000000..d80ec2e Binary files /dev/null and b/botones/down-0.bmp differ diff --git a/botones/down-1.bmp b/botones/down-1.bmp new file mode 100644 index 0000000..6074bba Binary files /dev/null and b/botones/down-1.bmp differ diff --git a/botones/in-box-0.bmp b/botones/in-box-0.bmp new file mode 100644 index 0000000..95be67d Binary files /dev/null and b/botones/in-box-0.bmp differ diff --git a/botones/in-box-1.bmp b/botones/in-box-1.bmp new file mode 100644 index 0000000..701a7b6 Binary files /dev/null and b/botones/in-box-1.bmp differ diff --git a/botones/minimize-0.bmp b/botones/minimize-0.bmp new file mode 100644 index 0000000..4b3027c Binary files /dev/null and b/botones/minimize-0.bmp differ diff --git a/botones/minimize-1.bmp b/botones/minimize-1.bmp new file mode 100644 index 0000000..24dfd91 Binary files /dev/null and b/botones/minimize-1.bmp differ diff --git a/botones/new-msg-0.bmp b/botones/new-msg-0.bmp new file mode 100644 index 0000000..840fe1d Binary files /dev/null and b/botones/new-msg-0.bmp differ diff --git a/botones/new-msg-1.bmp b/botones/new-msg-1.bmp new file mode 100644 index 0000000..7b78a47 Binary files /dev/null and b/botones/new-msg-1.bmp differ diff --git a/botones/out-box-0.bmp b/botones/out-box-0.bmp new file mode 100644 index 0000000..9642745 Binary files /dev/null and b/botones/out-box-0.bmp differ diff --git a/botones/out-box-1.bmp b/botones/out-box-1.bmp new file mode 100644 index 0000000..3dc1e59 Binary files /dev/null and b/botones/out-box-1.bmp differ diff --git a/botones/up-0.bmp b/botones/up-0.bmp new file mode 100644 index 0000000..29f2692 Binary files /dev/null and b/botones/up-0.bmp differ diff --git a/botones/up-1.bmp b/botones/up-1.bmp new file mode 100644 index 0000000..fea8b3d Binary files /dev/null and b/botones/up-1.bmp differ diff --git a/inbox/2000-11-26 @ 11.15'10.txt b/inbox/2000-11-26 @ 11.15'10.txt new file mode 100644 index 0000000..1680958 --- /dev/null +++ b/inbox/2000-11-26 @ 11.15'10.txt @@ -0,0 +1,2 @@ +192.168.0.1 +gfh diff --git a/inbox/newmsg.wav b/inbox/newmsg.wav new file mode 100644 index 0000000..cda5a92 Binary files /dev/null and b/inbox/newmsg.wav differ diff --git a/outbox/msgfail.wav b/outbox/msgfail.wav new file mode 100644 index 0000000..921e528 Binary files /dev/null and b/outbox/msgfail.wav differ diff --git a/outbox/msgout.wav b/outbox/msgout.wav new file mode 100644 index 0000000..e9c185d Binary files /dev/null and b/outbox/msgout.wav differ diff --git a/users.cfg b/users.cfg new file mode 100644 index 0000000..2c02ee9 --- /dev/null +++ b/users.cfg @@ -0,0 +1,8 @@ +192.168.0.3 Juan Manuel +192.168.0.5 Palomareeeeee +68.5.1.4 !! Que jodio, si hasta funciona... !! +192.168.0.1 MiPEASO de Equipo +192.168.0.2 Antonio +192.168.0.102 MESA1.2 +192.168.0.103 MESA2.1 +# \ No newline at end of file