views:

57

answers:

3

I want to create a popup application that will run against my sql database and Fire a popup everymorning at the user machine to ask a question. the response will be send back to the Database. Prety easy with Windows service BUT not with a POpup or Interface. How can i accomplish this? Thanks for any suggestion

+1  A: 

It takes quite a bit of work to make a service show windows on a user session. The easiest thing to do would be to setup your installer to make your program run on login.

An easy way to do this is to put an key pointing to your application's executable in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

joshperry
Well i don t necessarily need a windows service..Basically i need the way to just have a popup schedule to open every morning when the user log in his computer
FasoService
+1  A: 

With session-0 isolation in Vista and later, it is no longer possible to create a popup/interface from a service. If your program must run as a service then you need to have both a service and a client application that runs in the user's session. You can then use a number of different ways to communicate between the two. I recently used .NET's remoting to solve this problem.

Brad
Good point on the # operating system that may be a problem. Ity does not have to run as a service. But a simple reminder. The problem is i need to have a user interface to comunicate with the user
FasoService
If it doesn't need to run as a service, then save yourself a lot of work (and a few system resources for your users) and don't run it as such.
Brad
A: 

You don't need to run a service if you just need to show the pop-up window every morning. Just make a normal windows application, and then schedule it to run every morning using Windows Task Scheduler ( http://en.wikipedia.org/wiki/Task_Scheduler).

You can specify the time, path to executable, frequency & time (every hour, every day, every month etc.) when you create the task. You can even specify if to run the task at user login (incase the user is not logged on at the time you want the task to run).

You can automate creation of the task when your program installs.

Edit: Here is an example of creating a task in c# http://community.bartdesmet.net/blogs/bart/archive/2008/02/23/calling-the-task-scheduler-in-windows-vista-and-windows-server-2008-from-managed-code.aspx

ace