Solved

Interactive Windows Service

Posted on 2003-11-20
3
669 Views
Last Modified: 2007-12-19
Here is the deal, I need an interactive Windows Webservice.  I had the application running as just an app but I would like to run it as a Windows Service with the same functionality but just starting with the Local System.  I found the setting for "Allow service to interact with desktop." and I have that checked.

Here is what is happening...I have a windows form that does all the work and I want it to be a "NotifyIcon" down in the task bar when a user is logged in.  When the user double clicks on this icon, a form is shown and they can change certain asspects of the service and how it works.

I have it all put together and it was working fine as an application but now, I can not really interact with the form.  When I double click on the NotifyIcon, nothing happens.  I tried debuging it and it doesn't look like the even is ever getting raised or something so nothing ever happens.

Any ideas or example solutions would be greatly appreciated and rewarded.

Thanks,
Eric
0
Comment
Question by:RealMrTea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Assisted Solution

by:NetPointer
NetPointer earned 100 total points
ID: 9789742
if u download "Download 101 Code Samples for Visual Basic .NET 2003" from

http://msdn.microsoft.com/vbasic/downloads/samples/default.aspx

you will find following in it.

VB.NET - Windows Forms -  How-To System Tray Icon
VB.NET - Framework - How-To Service Manager

I suggest you dont mix both the code, but make two seperate app. one to configure service and other the actual service. and when u configure your service thru the application, you restart your service from that application (code is in above example.)

regarding debugging, i dont see there should be any problem. can u tell any specific signs?

regards,
NetPointer
0
 
LVL 1

Accepted Solution

by:
RocketMan801 earned 400 total points
ID: 9792237
i thik that a good solution would be to split your APP in 2 parts:

A - the "core" of the aplication, i mean, the real funcionality of the APP running as a service as you have done, and of course becouse it is  a service, starting after the user logs into the machine

B - The "config form" of your app, running as a normal app, that starts when the user logs on becouse of  a key in the registry, or "start menu" or what ever you want, that, (and here is the important part) interacts with your service using the ServiceController class. Nothe that you dont have to inherit that class in a new one, just use it, calling the method "ExecuteCommand()" to send commands to the service, the service will raise the "OnCustomCommand()" method, there you can writte the result of the ausers interacion.
0
 
LVL 7

Author Comment

by:RealMrTea
ID: 9810628
Thanks to the both of you for providing intresting and helpful answers.  I am going to split the points since you had simular answers.  Most of the points go to RocketMan because what I really needed was the ExecuteCommand and OnCustomCommand methods.  If anyone else is doing something simular, this is what I would recomend trying.

Thanks again,
Eric
0

Featured Post

Major Serverless Shift

Comparison of major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question