473,395 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to bring a GUI running as service in background to front on login?

mbmccormick
I have a .NET Windows Form application running in the background as a service on a server under the SYSTEM user account. Is there any way for me to view the GUI of this application (bring it to the front) when a user logs in to the server? (either programatically or something I can do in Windows)

Thanks.
Feb 5 '08 #1
11 13766
kenobewan
4,871 Expert 4TB
My guess would be to add to windows start up menu and load, but not my area so...
Feb 6 '08 #2
My guess would be to add to windows start up menu and load, but not my area so...
Right. The application is already running (because it starts at boot), and I need to bring that GUI (and task tray icon, because it has that) to the active display (console session) when a user logs in.
Feb 6 '08 #3
Plater
7,872 Expert 4TB
Have your service listen for a special message, then have a small program that will be launched when the user logs in that sends ou this message. When the message is received, the window is shown?
Feb 6 '08 #4
Have your service listen for a special message, then have a small program that will be launched when the user logs in that sends ou this message. When the message is received, the window is shown?
I see what your saying. Sort of like the ServiceController object. I don't really want to rework this whole program to incorporate this object.

I guess I should rephrase this question... Is there a tool or command that I can use to bring an application (not a service) that is running in the background to the active display (i.e. make it visible) in Windows?
Feb 6 '08 #5
Shashi Sadasivan
1,435 Expert 1GB
A windows service is not intended to use GUI, and if it does have GUI components then there is a waay to allow the GUI to be displayed,
its somethere from the services -> rightclick, and some property is to be set.

However that compromises some security of the OS, not exactly sure of that.

But the way to show a UI , is to create a windows applications, and start it up when the service raises an event.
Feb 7 '08 #6
A windows service is not intended to use GUI, and if it does have GUI components then there is a waay to allow the GUI to be displayed,
its somethere from the services -> rightclick, and some property is to be set.

However that compromises some security of the OS, not exactly sure of that.

But the way to show a UI , is to create a windows applications, and start it up when the service raises an event.

It does not work that way.... I remember doing a Windows Service Project where I launched a Notepad process. But guess what, Notepad would run and you can see it appear in the taskmanager, but you would not be able to see the GUI.

It was almost 3 years back and I do not remember exactly. But here is what I think that would work.

Go to Services->Select your service and go to properties->Log on tab.

Check "Allow this service to interact with Desktop".

This should do the trick and when you make a Process.Start() like calls to launch a GUI apps, then they would show up. with this checkbox unchecked, your GUI would not be seen.

Anyway I do not exactly remember how to do it within the service installer. I will let you know in case I figure it out.
Feb 7 '08 #7
Plater
7,872 Expert 4TB
If I had to guess, the reason you never saw the GUI for your notepad before, was that it was as a different user then the currently logged on one. (If you look in taskmanager you can add the column that says what user the process belongs too)
But I could be wrong on that, and it could just be the way services work anyway.
Feb 7 '08 #8
If I had to guess, the reason you never saw the GUI for your notepad before, was that it was as a different user then the currently logged on one. (If you look in taskmanager you can add the column that says what user the process belongs too)
But I could be wrong on that, and it could just be the way services work anyway.
hmm...it was long back so i am not too sure. But i think the user account was all right. like i said there is an option that enables your service to interact with the desktop,
Feb 7 '08 #9
Thank you Shashi Sadasivan and krishnabhargav! This fixed my problem, and I can now see my service. The "Allow this service to interact with the desktop" did it for me. Thanks again!

I have one last question... I can login and see my GUI (which is great), but now whenever I logout the service gets stopped. What can I do, either by modifying the code in my VB .NET application or as a setting in Windows or on the service to avoid this problem?
Feb 7 '08 #10
Thank you Shashi Sadasivan and krishnabhargav! This fixed my problem, and I can now see my service. The "Allow this service to interact with the desktop" did it for me. Thanks again!

I have one last question... I can login and see my GUI (which is great), but now whenever I logout the service gets stopped. What can I do, either by modifying the code in my VB .NET application or as a setting in Windows or on the service to avoid this problem?
Like I said earlier, been a really long time since i did any win daemons.

anyway, try to run the service on a super user account, like other windows services which (much to our dismay) keeps running even if u log out
Feb 8 '08 #11
I've moved this to: http://www.thescripts.com/forum/showthread.php?p=3063414#post3063414
Feb 8 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: zren | last post by:
Hi, I wonder if anyone knows how to programmatically make a python window get focus and bring it to front. Here a python window means the Tkinter Toplevel widget. Thanks. Zhen
0
by: Marian Dvorsky | last post by:
I would like to create an application that will be running in the background and will have an icon in the Notify bar in the lower-right corner of Windows desktop. For Windows NT+ I will probably...
0
by: DraguVaso | last post by:
Hi, My application has some interaction with an other application. I sometimes need to put the other application to the front. The problem is that I'm not able to get a nice solution to work in...
1
by: Patrick Dugan | last post by:
Is it possible to get the handle of a running service? I have a program (ActiveX program) running in memory. When I start my service I need to pass the service's handle to that program in order...
3
by: aledrjones | last post by:
Hi I've got a c# application that will often run in the background as it is used to monitor connections to a host. An activex control displays the communication between the app and the host. ...
3
by: M O J O | last post by:
Hi, I have an application where I've implemented a global hotkey, so no matter what other application is in front (have focus), my app will react when the key combination is pressed. This works...
1
by: fperri | last post by:
Hello, I have a form that generates a report. After the code is executed that creates the tables behind the report, it opens the report via VB. But when it opens the report in preview, it puts it...
1
by: nielsena54 | last post by:
I have used client-server software where a server program is installed on one computer and the client application is installed on another. When installing the client, it is able to automatically...
1
by: Hiran | last post by:
I have a simple 'hello world' web service here http://www.askhiran2008.com/asliwebservicevb2/service.asmx. It should return data from the Northwind sample database. It works fine when being...
0
by: Developer111 | last post by:
I am developing an application having multiple screens appearing one after another using Vs2008 on Windows Xp(sp3) in vb.net. My requirement is to bring some screens (windows form) in front of the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.