Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 105269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:24:45+00:00 2026-05-11T01:24:45+00:00

When an application is running as a Windows Service (written in .NET), what would

  • 0

When an application is running as a Windows Service (written in .NET), what would be the best way to detect whether or not a user is logged on, and when a user logs on, to be able to begin displaying the necessary dialogs, or when that user has logged off, so the display of dialogs can be prevented?

I hope I phrased this correctly 🙂

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:24:46+00:00Added an answer on May 11, 2026 at 1:24 am

    You shouldn’t be doing this at all from a service. First, a service by default doesn’t have access to the desktop. You can change this in versions of Windows before Vista by checking the ‘Allow service to interact with desktop’ checkbox on the properties dialog for the service, but this is a very, very bad idea.

    In Vista, services cannot interact with the desktop at all.

    You are making the assumption that there will only ever be one interactive user on the machine at the time, which is not always the case. Because of Terminal Services, you can have more than one user logged into interactive sessions.

    What you should do is create a small client program which is launched when the user logs in. This program would interact with the service through some distributed technology (like Remoting, or WCF, I recommend the latter). Based on the communication it receives from the server, that client program can launch dialogs and user interface elements to interact with the user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Windows Service (written in .NET 1.1) running under a specific user
I have a windows service written in C# .NET framework 3.5 and would like
My application consists of two parts: A Windows Service running under the LocalSystem account
I have a .NET application running on windows. I want clicking on some page
I have an adobe air application running on windows. I would like to call
I need to implement an FTP service inside my .NET application (running as a
We have a Windows service written in C#. it is crashing after running for
We have an application running as a Windows service on a production server. The
I have a .net 3.5 application running in production on Windows XP x86 dualcore.
I have written a windows service in c# that's designed not to stop or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.