none
Stop Interactive Services Detection Dialog from Popping up

    Question

  • Hi,

    I have written a Service so that I can use it to launch an EXE, when the computer boots up. I chose such method because it was put forward as a solution to me, in the following thread I had started sometime back.

    http://social.msdn.microsoft.com/Forums/en-US/clr/thread/6060cb41-8517-4769-9b3f-30fa4ae5d431/?prof=required

    It is working. But there is a slight problem. When i start the Service, a windows Dialog pops up..

    Its Title Bar is "Interactive Services Detection"

    The Dialog is "A Program running on this Computer is trying to display a message"

    The Program might need information from you or your permission to complete a Task.

    -->View the message

    -->Ask me Later.

    If I click view the message, then it shows me the console window of the MyEXE. And it looks fine, But then all other Desktop applications which are running get lost from the view.

    I understand the reasons this dialog is popping up, but if I cannot avoid it, then I cannot use the service solution to launch EXE.


    I just wanted a method to automatically launch an couple of EXEs which have a Console Window and a UI, respectively, instead of having to double click the EXE file, to start the EXE. Is there any other method, other that of using a Service, which can help me auto launch an EXE, instead of having to double click the EXE file ? One condition is that the first launch of EXE can only occur, if a specific service is running. So, I have to able to check the status, whether is precursor service is running or not.

    In this previous thread link, you can find my code. Thank you

    http://social.msdn.microsoft.com/Forums/en-US/clr/thread/1369824e-005a-489e-9497-e2a73170cd97

     


    diana4


    Tuesday, July 19, 2011 4:46 AM

Answers

  • http://msdn.microsoft.com/en-us/gg465091

    In this lab, you will learn the workarounds for a Windows service that attempts to display UI, and you will learn how to set appropriate security and access levels on kernel objects shared by services and applications.  



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by Diana4 Thursday, July 21, 2011 12:37 AM
    Wednesday, July 20, 2011 11:18 PM
  • The startup registry is not for services, it is for UI apps. And you should register for autostart in your installer, so depending on how you write your installer package, the steps can be quite different. Most installer authoring software support putting a shortcut in the startup start menu folder or add an entry in the registry. Some even support registering a windows service.

    Although services are supposed to start before a user log in, due to interdependence between services some services won't start until other services finished initializing. If you log in right after computer starts, you will probably find some service not ready by the time your UI app is autostarted. You need to accommodate this in your UI app, such as sleep for awhile and check the service status again later



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by Diana4 Friday, July 22, 2011 1:20 AM
    Thursday, July 21, 2011 11:54 PM

All replies

  • Spin-off the UI part into a new process and run the process when the user is logging in.'

    Without a user the UI has nobody to interact with anyways.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Wednesday, July 20, 2011 2:41 AM
  • Thank you. Good Idea, but I want to clarify. I had 2 EXEs. Which i wanted to launch successively, using the Service. The First one to be launched by the service had a Console Window. Its a Console Application. Are you saying that the Console Application which opens the console window will not cause the Interactive Services Detection Dialog to open up ? Now, I was launching the UI EXE from within the Console Application EXE. So it would be easy to separate it out into user login process. Also what is the best method to launch the UI EXE when user logs in ? Can you post some reference/article ?

    I actually recollect that even the console window is causing the Interactive Services Dialog to open up


    diana4
    Wednesday, July 20, 2011 3:52 AM
  • If you get the interactive service detection dialog, it is likely your app has problem with remote desktop and fast user switching as well.

    At install time, You can place a shortcut to the UI exe in the start menu's startup folder, or write to the run registry. Then you can talk to the console app to relay messages to the user and send back the user's response (kinda like what SQL Server is doing)

    Application that allocates a console does not necessary trigger a desktop interaction dialog. 



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Wednesday, July 20, 2011 5:37 PM
  • Thank you. can you give me some code examples or references/links for what you are suggesting me to do.

     


    diana4
    Wednesday, July 20, 2011 11:09 PM
  • http://msdn.microsoft.com/en-us/gg465091

    In this lab, you will learn the workarounds for a Windows service that attempts to display UI, and you will learn how to set appropriate security and access levels on kernel objects shared by services and applications.  



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by Diana4 Thursday, July 21, 2011 12:37 AM
    Wednesday, July 20, 2011 11:18 PM
  • Hi, Can you comment on whether the method suggested in this mail thread, is good & usable ?

    http://social.msdn.microsoft.com/Forums/en/csharplanguage/thread/8a5ba629-d31c-4122-8679-569d9683c29c

    Are there any drawbacks to it

    Thanks


    diana4
    Thursday, July 21, 2011 12:46 AM
  • There are a lot of suggestions over there, which one you are referring to? 

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Thursday, July 21, 2011 3:04 PM
  • the suggestion to Put my EXE's name in "Windows Startup section in registry". 

    http://social.msdn.microsoft.com/Forums/en-US/clr/thread/1369824e-005a-489e-9497-e2a73170cd97

    But I do not know if All the Services which are set to Automatic startup mode, are expected to have started by the time the "Windows Startup section in registry" is executed because my EXE can only run if a specific service, set to Automatic Startup mode is already running


    diana4
    Thursday, July 21, 2011 11:06 PM
  • The startup registry is not for services, it is for UI apps. And you should register for autostart in your installer, so depending on how you write your installer package, the steps can be quite different. Most installer authoring software support putting a shortcut in the startup start menu folder or add an entry in the registry. Some even support registering a windows service.

    Although services are supposed to start before a user log in, due to interdependence between services some services won't start until other services finished initializing. If you log in right after computer starts, you will probably find some service not ready by the time your UI app is autostarted. You need to accommodate this in your UI app, such as sleep for awhile and check the service status again later



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by Diana4 Friday, July 22, 2011 1:20 AM
    Thursday, July 21, 2011 11:54 PM
  • Hi,

    You had pointed me to  http://msdn.microsoft.com/en-us/gg465091 this link. In this lab, you will learn the workarounds for a Windows service that attempts to display UI, and you will learn how to set appropriate security and access levels on kernel objects shared by services and applications.

    I am having difficulty doing the exercises in the lab, because the lab asks me to work on Session0_Starter solution, but I cannot find this solution anywhere on my development computer. I searched all the C:drive. I am using Visual Studio 2008, on 2 enviroments. XP & server 2003. This lab also is asking to modify C++/C code where as I am doing this in C-sharp.

    For example it is asking me to "Find the second //TODO comment in the TimeService.cpp file". But i do not know where such file is or such location is..

    Any suggestions ? Any other references which explain the concepts and how to implement them ? Thank you


    diana4
    Monday, November 07, 2011 3:14 AM