windows.forms.timer not work when device is power-off

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My program doesn't work when device is powered off.
After power on I saw that UI wasn't updated.
May be I must use System.Thread.Timer
 
I forgot to write that I'm using windows.forms.timer to update UI every 1
minute
My application is alarm clock and I use timer to check for upcoming alarms
 
When the power is off your application doesn't run - therefore it cannot
update itself until after the power is on. If you want to do "alarms" that
can wake the unit up from suspend mode than you need to use the notification
support like CeRunAppAtEvent().
 
I've just tired:

static public System.Threading.Timer m_TT;
public Form1()
{
InitializeComponent();
m_TT= new System.Threading.Timer(new
System.Threading.TimerCallback(bgTimer_Tick), this, 0, 20000);
}

private void bgTimer_Tick(object state)
{
Form1 frm = (Form1) state;
frm.Invoke(new EventHandler(bgTimerInvoke));
}

private void bgTimerInvoke(object sender, EventArgs e)
{
MakeSound();
}

when power is on -> it is OK
when I power is off -> app play sound only once

and somethimes app stops
 
Did you reqad Steve's reply? When the device is off no code is executed, so
there's no way for your app to do anything. You must set a wakeup timer.

-Chris
 
Back
Top