Procedure TDataThread. Execute;
The begin
While true do
The begin
Showmessage (' I in performing ');
Sleep (1000);
end;
end;
TService code inside the following
DataThread: TDataThread;
Procedure TAttServer. ServiceContinue (Sender: TService;
Var Continued: Boolean);
The begin
DataThread. Resume;
Continued:=True;
end;
Procedure TAttServer. ServicePause (Sender: TService; Var Paused: Boolean);
The begin
DataThread. Suspend;
Paused:=True;
end;
Procedure TAttServer. ServiceStart (Sender: TService; Var Started: Boolean);
The begin
DataThread:=TDataThread. Create (False);
Started:=True;
end;
Procedure TAttServer. ServiceStop (Sender: TService; Var Stopped: Boolean);
The begin
DataThread. The Terminate;
Stopped:=True;
end;
The question now is, after I compile, install starts, program does not run a thread to Execute, not a pop-up message box, could you tell me why? Research for the first time the Service Application, please tell master,
CodePudding user response:
As far as possible do not use the means of the pop-up interface, service the default is not to interact with the UI, you can try to write a Duan Dongxi into text or something,CodePudding user response:
Pop-up message I just do a test, look have to perform to this, but the program doesn't perform to it, is what I wrote in less TService event?