hi all,
i am creating a windows service. i have created a windows form on the
same.
when i logout the windows form get closed. Is it possible to only hide
the form at the time of logoff.
i want that my form remains till the windows service is not stopped
regards,
raan
Herfried K. Wagner [MVP] - 08 Feb 2008 16:15 GMT
"Raan" <raan0101@gmail.com> schrieb:
> i am creating a windows service. i have created a windows form on the
> same.
[quoted text clipped - 3 lines]
>
> i want that my form remains till the windows service is not stopped
Services typically do not have a UI for security reasons. Instead of adding
your form to the service, write an autostart client applications which
contains the user interface and interacts with the server via IPC
meachanisms such as sockets, named pipes, remoting, WCF, ...

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Mr. Arnold - 09 Feb 2008 13:11 GMT
> hi all,
>
[quoted text clipped - 3 lines]
> when i logout the windows form get closed. Is it possible to only hide
> the form at the time of logoff.
I know there is a namespace System something that allows a Windows Desktop
solution to check for logout on the desktop, and it will raise an event in
the running .Net solution. I am sorry. I cannot remember what System
namespace, maybe Diagnostics. But I know it's there and you can use it.
I know I saw this when I was using Google to search out another .Net
solution.
> i want that my form remains till the windows service is not stopped
You may be able to use an OnCustomeCommnad() in the service. If the service
is not active when you call the Service's OnCustomeCommnad() from your
Windows desktop solution, you should be able to dectec it on a try/catch,
which would be in the Logout event of that (Logout event) I am talking
about. You're going to have to look for that feature in the .Net Framework.