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 6555271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:47:57+00:00 2026-05-25T12:47:57+00:00

I have an executable that can run normally or as service. At the startup

  • 0

I have an executable that can run normally or as service. At the startup it may show an error message if there is an error (using MessageBox api). This can cause failure if the application is running as service but not allowed to interact with desktop.The process may appear to be hanging. Is there a programmatic way to detect if the application can interact with desktop ? I can then use some other error notification mechanism (log file etc)

  • 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. Editorial Team
    Editorial Team
    2026-05-25T12:47:58+00:00Added an answer on May 25, 2026 at 12:47 pm

    From MSDN:

    To determine whether a service is running as an interactive service,
    call the GetProcessWindowStation function to retrieve a handle to the
    window station, and the GetUserObjectInformation function to test
    whether the window station has the WSF_VISIBLE attribute.

    In .NET you can use Environment.UserInteractive

    The UserInteractive property reports false for a Windows process or a
    service like IIS that runs without a user interface. If this property
    is false, do not display modal dialogs or message boxes because there
    is no graphical user interface for the user to interact with.

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

Sidebar

Related Questions

I have an OpenGL-program using GLSL, that I can run just fine with the
I have an executable that is started by a windows service, this program will
I have a setup executable that I need to install. When I run it,
I have an executable that I need to run some tests on in C++
I have a plain perl script that can be run from the command-line via
I have a Windows executable that is launched from within a service by calling
I have a Perl script that I've written and can compile it using pp
I have an executable that requires .NET Framework to run; I have used reflector
I have an executable that needs to run as an administrator on a Windows
I have an executable that depending on the command line switch supplied looks something

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.