stringgrid1->rowcount++;
}
}
msglist=null;
msglist = new tlist;
label1->caption = "您的任务数:"+inttostr(stringgrid1->rowcount-1);
}
}
//---------------------------------------------------------------------------
void __fastcall tform1::clientsocket1disconnect(tobject *sender,
tcustomwinsocket *socket)
{
btnconnect->enabled=true;
btndisconnect->enabled=false;
statusbar1->simpletext="无法连接到服务端!";
trayicon1->iconindex = 2;
}
//---------------------------------------------------------------------------
void __fastcall tform1::btndisconnectclick(tobject *sender)
{
clientsocket1->close();
btnconnect->enabled=true;
btndisconnect->enabled=false;
}
//---------------------------------------------------------------------------
void __fastcall tform1::clientsocket1error(tobject *sender,
tcustomwinsocket *socket, terrorevent errorevent, int &errorcode)
{
statusbar1->simpletext="无法连接到:"+serverip;
errorcode=0;
btndisconnect->enabled=true;
btnconnect->enabled=false;
}
//---------------------------------------------------------------------------
//判断某人的任务数
tform1::strcount(string substing, string sourcestr)
{
//todo: add your source code here
int sp = substing.length();
int pos = sourcestr.pos(substing);
string tmp;
int capa=0;
while( pos > 0 )
{
tmp=sourcestr.substring(1,pos-1);
capa++;
sourcestr=sourcestr.substring(pos+sp,sourcestr.length()-pos-sp+1);
pos=sourcestr.pos(substing);
}
return capa;
}
void __fastcall tform1::formclose(tobject *sender, tcloseaction &action)
{
clientsocket1->close();
}
//---------------------------------------------------------------------------
void __fastcall tform1::formclick(tobject *sender)
{
delete msglist;
}
//---------------------------------------------------------------------------
void __fastcall tform1::n3click(tobject *sender)
{
n3->enabled=false;
formabout->showmodal();
n3->enabled=true;
}
//---------------------------------------------------------------------------
void __fastcall tform1::image1click(tobject *sender)
{
shellexecute(handle,null,misurl.c_str(),null,null,sw_shownormal);
}
//---------------------------------------------------------------------------
void __fastcall tform1::formshow(tobject *sender)
{
if(!trayicon1->visible)
trayicon1->visible=true;
trayicon1->minimize();
}
//---------------------------------------------------------------------------
unit1.h
//---------------------------------------------------------------------------
#ifndef unit1h
#define unit1h
//---------------------------------------------------------------------------
#include <classes.hpp>
#include <controls.hpp>
#include <stdctrls.hpp>
#include <forms.hpp>