Windows services don't typically interact with the desktop, mostly because a service can run when nobody is logged onto the box. If you need something to pop up at 4pm every day, I would write an application and add it to the Windows scheduler.
As far as doing something on a schedule in a Windows service, you need to set up a thread that sits/spins until the desired date/time, something like this:
public class MyService
{
Thread m_thread = null;
private void OnStart(string[] args)
{
if (m_thread != null && m_thread.State == ThreadState.Running)
{
m_thread.Abort();
m_thread = null;
}
m_thread = new Thread(new ThreadStart(ThreadProc));
m_thread.Start();
}
private void OnStop()
{
m_thread.Abort();
}
private void ThreadProc()
{
DateTime temp = DateTime.Now;
DateTime nextTime = new DateTime(temp.Year, temp.Month, temp.Day, 16, 0, 0, 0);
while (true)
{
DateTime now = DateTime.Now;
if (now >= nextTime)
{
nextTime.AddDays(1);
}
Sleep(750);
}
}
}
The code above may need some tweaking as I did it off the top of my head.