日期:2014-05-19  浏览次数:20714 次

windows服务与桌面交互的问题
我做一个windows服务,里面有个定时器,定期启动一个进程。
下面是我的定时器执行函数
private   void   timer1_Elapsed(object   sender,   System.Timers.ElapsedEventArgs   e)
{
MessageBox.Show( "hello ");
Process   proc=new   Process();  
proc.StartInfo.FileName= "iexplorer.exe "; proc.StartInfo.WindowStyle=ProcessWindowStyle.Normal;  
bool   result   =   proc.Start();
MessageBox.Show(result? "sucess ": "fail ");                        
}

不知道为什么前面的MessageBox.Show能出窗体,后面的启动进程和show窗体死活出不来。哪位能指教下,谢谢

------解决方案--------------------
既然是服务了,怎么可能show一个窗口出来呢?