[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

windows service opens form in windows application

Andrew

4/24/2008 1:48:00 PM



Hi,
How do I get my Windows service opens form in windows application ?

I have tis bit of code in :
protected override void OnStart(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form2());
eventLog1.WriteEntry("Start DONE.");
}
This does not work. When I start my service it just times out.
cheers.
Andrew

1 Answer

Marc Gravell

5/9/2008 2:59:00 PM

0

> You can Show a form from a windows service by checking the "Allow service to
> interact with desktop" for your service from Windows Service Manager
> Properties window.

Note that this won't work in Vista; in short... don't do it! Have a
separate UI app (pehaps run at user startup) that talks to the service
via IPC, and leave the service to run silent.

Marc