Delay at Logon scheduled task

This forum is designated to discuss SiComponents Scheduling Agent.
Post Reply
simplysup
Posts: 8
Joined: Mon Apr 30, 2007 12:23 am

Delay at Logon scheduled task

Post by simplysup »

Hi,

Is it possible to access and programmatically set the "Delay task for" Advance setting in an At Logon task. I note that a number of 'TriggerRundomDelayMinutes' properties have been added to TTaskTrigger but there doesn't seem to be one for an At Logon task - and I'm not sure if these properties are involved with setting a delay in the first place?

Cheers,

Nigel
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Re: Delay at Logon scheduled task

Post by isiticov »

Hello,

We will add the respective property to the class in the next update. Meantime, you can use the following code as a workaround for this:

Code: Select all

function GetLogonDelayMinutes(const ATrigger: TTrigger): DWORD;
var
  iLogon: ILogonTrigger;
begin
  iLogon := ATrigger.GetVistaTrigger as ILogonTrigger;
  Result := VistaPattern2Minutes(iLogon.Delay);
end;

procedure SetLogonDelayMinutes(const ATrigger: TTrigger; const AMinutes: DWORD);
var
  iLogon: ILogonTrigger;
begin
  iLogon := ATrigger.GetVistaTrigger as ILogonTrigger;
  iLogon.Delay := Minutes2VistaPattern(AMinutes);
end;
Hope this helps.
Best regards,
Igor Siticov.
simplysup
Posts: 8
Joined: Mon Apr 30, 2007 12:23 am

Re: Delay at Logon scheduled task

Post by simplysup »

Many thanks Igor!
Post Reply