Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I made a window service .I want to open a window form on start of the window service. Am able to open it in window XP but for window vista and window7 its not working. can anyone please help.

Thanks in Advance
Posted
Updated 4-Jul-12 23:44pm
v2

1 solution

This is so good that is does not work. It is done to prevent the harm you could make yourself by creating a form in the service. When you think about the functionality an properties of the services, you will understand that they should not have UI. Remember, a Windows service is the application which is supposed to execute its code even when you log out, somebody else logs in, or, after OP restart and start of the services, nobody logs in. Desktops replace one another or do not exist. How a form could come through all this?

You could have a separate process of a separate application which is executed legitimately under some user's account but communicates with your service. This is a pretty usual practice.

—SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 5-Jul-12 12:21pm    
[OP commented:]

Ya you have a valid point but that is my requirement.so can you please help me in doing this.
--SA
Sergey Alexandrovich Kryukov 5-Jul-12 12:26pm    
No if, not buts.

"Requirement"... Those who give your requirements also can do all kinds of mistakes. One of the most important and difficult skills you should have as a software developer is to deal with such situations. You should be able to point out such problem and make sure you get functional requirements, not mixed with instrumental detail. This "requirement" in self-contradictory. Please see the second paragraph of my answer.

--SA
pallavi Praharaj 6-Jul-12 0:48am    
Ok.Thank you for your time.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900