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

  • Home
  • SEARCH
  • 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
  • 0 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

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Google now has the answer for which I seek. With… May 11, 2026 at 9:59 am
  • added an answer I have an MSBuild Target that builds my documentation in… May 11, 2026 at 9:59 am
  • added an answer WIN32 is a name that you could use and even… May 11, 2026 at 9:59 am

Related Questions

When an application is running as a Windows Service (written in .NET), what would
When an ASP.NET application is running under IIS6.0 in Windows 2003 Server with impersonation,
How to debug javascript in visual studio when an asp.net application is run under
When an application crashes on Windows and a debugger such as Visual Studio is
When building an application, is there any meaningful difference between the idea of Find
When designing a user interface for an application that is going to be used
Can anybody tell me when Application_End is triggered in a lifecycle of an application?
A Session is per browser (determined via cookies), but when does an Application start,
I have a problem with an ASP.NET application that is driving me nuts. When
When you lock an object is that object locked throughout the whole application? For

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.