示例#1
0
void __fastcall TMainFrm::DisconnectExecute(TObject *Sender)
{


   if (POP->Connected())
      {
         try
           { POP->Reset();
           }

         catch (...)
         {
            ShowStatus("Your POP server doesn''t have Reset feature");
         }
         POP->Disconnect();
      }
    ToggleStatus(false,true);
    TListItem * li;
    int count=lvHeaders->Items->Count;
    while (count)
      {
      li=lvHeaders->Items->Item[count-1];
       if  (li->ImageIndex==3)
       li->ImageIndex=5;
      count--;
      }

}
示例#2
0
void CJobControlDlg::OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult) 
{
	int	JobIdx = GetCurSel();
	if (JobIdx >= 0 && !IsRunning(JobIdx)) {	// can't change status of running job
		if (GetStatus(JobIdx) == JOB_FAILED)
			ShowErrorMsg(JobIdx);
		ToggleStatus(JobIdx, JOB_WAITING, JOB_POSTPONED);
	}
	*pResult = 0;
}
示例#3
0
void __fastcall TMainFrm::CheckMailExecute(TObject *Sender)
{
   ShowBusy(true);

   ShowStatus("Connecting....");

   if (POP->Connected())
      {
       POP->Disconnect();
      }

   
   POP->Host = Pop3ServerName;
   POP->Port = Pop3ServerPort;
   POP->UserId = Pop3ServerUser;
   POP->Password = Pop3ServerPassword;
   Application->ProcessMessages();
   Application->ProcessMessages();
   Application->ProcessMessages();
   POP->Connect();
   ToggleStatus(true,true);
   FMsgCount = POP->CheckMessages();
   FMailBoxSize = POP->RetrieveMailBoxSize()/1024;
   ShowFileStatus();
   if (FMsgCount > 0)
        {
         ShowFileStatus();
         RetrievePOPHeaders(FMsgCount);
        }
   else
      {
         ShowStatus("No messages on server");
      }

  if (POP->Connected())
      {
       POP->Disconnect();
      }
   ToggleStatus(false,true);
   ShowBusy(false);

}
示例#4
0
void __fastcall TMainFrm::PurgeExecute(TObject *Sender)
{
   TListItem * li;
   int count=lvHeaders->Items->Count;
    while (count)
        {
        li=lvHeaders->Items->Item[count-1];
        if  (li->ImageIndex==3)
        {  if (!POP->Connected())
           POP->Connect();
           POP->Delete(count);
        }
        count--;
        }


   if (POP->Connected())
   POP->Disconnect();
   ToggleStatus(false,false);
   ::Sleep(500);//needed to delay reconnection..... raises an exception otherwise
   CheckMailExecute(Sender);

}
示例#5
0
void CJobControlDlg::OnPostpone() 
{
	int	JobIdx = GetCurSel();
	if (JobIdx >= 0 && !IsRunning(JobIdx))	// can't change status of running job
		ToggleStatus(JobIdx, JOB_POSTPONED, JOB_WAITING);
}
示例#6
0
void __fastcall TMainFrm::FormActivate(TObject *Sender)
{
   ResetHeadersGrid();
   ToggleStatus(false,false);
}