protected override void OnStart(string[] args)
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Service1));
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
Form1 frm1 = new Form1();
frm1.Show();
frm1.Text = "通过服务1启动的窗体";
// 
// notifyIcon1
// 
this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
this.notifyIcon1.Text = "我的图标";
this.notifyIcon1.Visible = true;
this.notifyIcon1.Click += new System.EventHandler(this.notifyIcon1_Click);

}
在上面的代码中我要在服务启动以后显示一个window窗体并且在屏幕的右下角显示一个托盘图标(在服务启动之前我已经设置了服务的属性,在登录选项卡上选中了"允许服务与桌面交互"选项).
服务启动后托盘图标和窗体确实能够显示出来,但是窗体却怎么也没有任何响应,我在托盘图标上也添加了单击事件,并在事件当中编写了代码.可是也没有任何响应.这是为什么啊?
另外,如何在我的程序当中控制"允许服务与桌面交互"选项自动被设置阿?
在线等,多谢多谢.