How can I raise WinForm from WinService ?

  • Thread starter Thread starter bnaya
  • Start date Start date
B

bnaya

How can I raise WinForm from WinService ?
I cannot use remoting because i need the WinForm on the same process as the
Win Service.

I tried the followings:

MyForm m_frmDetails = new MyForm();
m_frmDetails.Show();

and

MyForm m_frmDetails = new MyForm();
Application.Run(m_frmDetails);
 
You can not open a winform from a winservice w/o remoting. I looked into it
a while ago and it talks about it somewhere in the help file.

Chris
 
Hi Bnaya,

The windows service is running in it's own service account and which has it
own desktop. So if we show any UI in the windows service, that' won't be
visible to the currently logon users since the UI are all in the servic'e
desktop. In addition, by default the NTService is non-interacivable with
desktop unless we config it running under LOCALSYSTE and enable the
interactive with desktop. Anyway, it's not recommended to directly
dealing with UI in windows service. I think Chris's suggestion on let a
remote client show a UI and communicate with the serivice via any other
means such as remoting or sockets maybe a reasonable way.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top