473,698 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Showing forms within a Windows Service

OK so I built this Windows Service which was able to use
MessageBox.Show to present text to the user from within the service. I
had to use a special property though within that method- which is
MessageBoxOptio ns.ServiceNotif ication.

Now I'd like to create a custom form and have the service show it, to
administer settings of that service. How do I do this? I tried creating
a simple form and instatiating it then calling Application.run (form) on
it, but nothing happened. No error seemed to occur either because I'm
not getting the output from my exception handler in the event logs...

Any ideas?

Dec 15 '05 #1
3 7683
tman,

You don't want to do this. Services do not depend on an interactive
user session in order to run, they are always running, whether or not
someone is logged in or not.

What you want to do is have a program running in the interactive user
session which uses remoting to communicate with the service. The service
can then send a message to the program that is running, and have it display
a form from there.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"tman" <tl*****@gmail. com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
OK so I built this Windows Service which was able to use
MessageBox.Show to present text to the user from within the service. I
had to use a special property though within that method- which is
MessageBoxOptio ns.ServiceNotif ication.

Now I'd like to create a custom form and have the service show it, to
administer settings of that service. How do I do this? I tried creating
a simple form and instatiating it then calling Application.run (form) on
it, but nothing happened. No error seemed to occur either because I'm
not getting the output from my exception handler in the event logs...

Any ideas?

Dec 15 '05 #2
Thanks for the quick reply Nicholas! Yeah that helps me alot, I was
unsure of how to correctly do this. I wanted to make an app that sits
in System Tray to configure the service like many commercial apps do -
I always thought it was the same app as the service but now I realize
it's separate.

I will look up Remoting to see how that works.

Real quick though, remoting can work both ways right? The service can
also communitcate with this desktop app if it needs to.. can it?

thanks

Dec 15 '05 #3
tman,

Yes, it can. You can have an object sitting in your app which derives
from MarshalByRefObj ect, which you pass to your service. Then, when the
service calls a method on that object, it will marshal the call back into
your app.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"tman" <tl*****@gmail. com> wrote in message
news:11******** *************@g 44g2000cwa.goog legroups.com...
Thanks for the quick reply Nicholas! Yeah that helps me alot, I was
unsure of how to correctly do this. I wanted to make an app that sits
in System Tray to configure the service like many commercial apps do -
I always thought it was the same app as the service but now I realize
it's separate.

I will look up Remoting to see how that works.

Real quick though, remoting can work both ways right? The service can
also communitcate with this desktop app if it needs to.. can it?

thanks

Dec 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3039
by: Henry | last post by:
I was trying to work through the Lab 2 exercises in the Microsoft's Windows-Based Applications in Visual C#. While I am not showing any errors I am also not seeing the mainMenu object when I run the application. I am wondering if someone could point out why in the code below: using System; using System.Drawing; using System.Collections;
8
3276
by: Raed Sawalha | last post by:
I have form with progress bar ,when application begin processing and progress bar moving if I minimized the form and try to restore it ,it is not showing until the processing completed ,how can I enabled minimize, maximize moving form while processing in underway?
3
4866
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be protected by forms authentication. When I create forms authentication at root level it works but when I move my code up to the subfolder I get this error: Server Error in '/TestProjects/FormsAuthenticationTestingArea' Application.
2
6530
by: Chris Dunaway | last post by:
I am attempting to use the AppDomain.UnhandledException event in a Windows Forms app and also in a Windows Service. But the event doesn't seem to be called. In a Windows Forms app, the event IS called but only if I run the app through the IDE. If run standalone (release or debug build, it doesn't matter), the event handler is never called. In the Windows Forms app, I changed it to use the Application.ThreadException event and that...
6
1406
by: Laser Lu | last post by:
Thanks for looking at this post:) Does anyone knows how to make the asp.net process runs in the UserInteractive mode? I just want to show some Windows Forms in my asp.net application on the server side to capture and display application monitoring messages, as Windows Forms will display realtime messages much more easily than Web Pages. Can anybody help me? Thanks a lot!
3
4383
by: Simon Verona | last post by:
I have a parent form which contains a toolbar. The toolbar controls the loading and switching to of MDI child forms. The code for the toolbar click event and one of the subroutines that loads and shows a child form is: Private Sub tbMenu_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles tbMenu.ButtonClick Dim btn As System.Windows.Forms.ToolBarButton For Each btn In...
1
4096
by: Darsin | last post by:
What i am doing is to pull the data from a CMS and import it to Word 2007 Beta and i also have to export the data from Word 2007 Beta back to that CMS. We have with us two Web Services of the CMS. The Web Services are explained as follows: IMPORT WEB SERVICE:
5
3553
by: Rory Becker | last post by:
Having now created a Custom MembershipProvider that seems to work correctly with my Logon and ChangePassword controls, I am, as they say, a happy bunny. The next stange is to move on to the creation of content which adjusts based on the user. I have several pages which require a user to be logged on and several which do not. Prior to this point in time I have used 2 different master pages. one with a control which checks a session...
21
3364
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters a zipcode that is unknown this form will open. I don't want users to modify any of this customers data until they close the zipcode form. Normally this can accomplished using a modal form, however this prevents me from opening a new copy of...
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.