显示从窗口服务Windows窗体 [英] show a windows form from a window service
问题描述
我创建一个窗口服务。我的要求是,以显示从特定区间窗口NT服务窗口的形式。为了测试目的,我只是想显示在服务启动方式:
i am creating a window service. my requirement is to display window form from window NT service on particular interval. For testing purpose , i just want to display the form on service start:
protected override void OnStart(string[] args)
{
eventLog1.WriteEntry("In OnStart -before form show");
Messager_Form obj = new Messager_Form();
obj.Show();
// System.Diagnostics.Process.Start("calc.exe");
eventLog1.WriteEntry("In OnStart -after form show");
// timer1.Start();
}
它不工作。无论是形式显示,也没有计算的进程正在运行。我已经找到一些链接
显示弹出,但大多暗示WCF。是不是可以不WCF。有谁能够告诉我实现这一目标的方式。
it not working. Neither form is showing nor calc process is running. i have found some links showing pop up , but most of them suggesting WCF. isn't it possible without wcf. can anybody show me the way to achieve this.
推荐答案
我已经使用这个code项目文章从session0服务SESSION1推出一个应用程序,就像一个魅力。
I have used this code project article to launch a app in session1 from a session0 service, works like a charm.
的http://www.$c$cproject.com/Articles/35773/Subverting-Vista-UAC-in-Both-32-and-64-bit-Archite
这篇关于显示从窗口服务Windows窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!