Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Windows Service App starting other apps

Windows Service App starting other apps

Scheduled Pinned Locked Moved Visual Basic
questionhelp
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    leezardd
    wrote on last edited by
    #1

    I am writing a windows service app to monitor for files that change. If I determine a file has changed I want to start another application that runs independent of the service app. Currently I have tried to use the Process.Start. When the newly started application encountered an error (that displays a message box) the error message ”It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application” was returned. I only want the service app to be responsible for starting the new application. How can I kick off the new application with no ties back to the service app?

    D 1 Reply Last reply
    0
    • L leezardd

      I am writing a windows service app to monitor for files that change. If I determine a file has changed I want to start another application that runs independent of the service app. Currently I have tried to use the Process.Start. When the newly started application encountered an error (that displays a message box) the error message ”It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application” was returned. I only want the service app to be responsible for starting the new application. How can I kick off the new application with no ties back to the service app?

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You have to go into the Service Control Manager and get the properties on your service. In there, under the Log On tab, make sure that "Allow service to interact with desktop" is turned on. If it's not, then your application doesn't run under the same desktop that the user sees. It'll run under a hidden desktop with no user interface. This is why your getting this error. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      L 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You have to go into the Service Control Manager and get the properties on your service. In there, under the Log On tab, make sure that "Allow service to interact with desktop" is turned on. If it's not, then your application doesn't run under the same desktop that the user sees. It'll run under a hidden desktop with no user interface. This is why your getting this error. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        L Offline
        L Offline
        leezardd
        wrote on last edited by
        #3

        I understand why am getting the error. I don't want my service to interact with the desktop. How can my service start a new application so that the new application can interact with the desktop not my service? Thanks!

        D 1 Reply Last reply
        0
        • L leezardd

          I understand why am getting the error. I don't want my service to interact with the desktop. How can my service start a new application so that the new application can interact with the desktop not my service? Thanks!

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You have a choice: Either enable the service to interact with the desktop or don't launch applications that require a user interface. Think of it this way: The service has to have "interact" enabled to launch an application on the desktop. If this is not enabled, the applications that the service launches inherit the security context of the local SYSTEM account, which is running under an invisible desktop with no UI. If you enable the service to interact with the desktop, any applications launched by the service will inherit the security context of the User that's logged in on the visible desktop and, hence, your launched app will be visible. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          L 1 Reply Last reply
          0
          • D Dave Kreskowiak

            You have a choice: Either enable the service to interact with the desktop or don't launch applications that require a user interface. Think of it this way: The service has to have "interact" enabled to launch an application on the desktop. If this is not enabled, the applications that the service launches inherit the security context of the local SYSTEM account, which is running under an invisible desktop with no UI. If you enable the service to interact with the desktop, any applications launched by the service will inherit the security context of the User that's logged in on the visible desktop and, hence, your launched app will be visible. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            L Offline
            L Offline
            leezardd
            wrote on last edited by
            #5

            Thanks for your help. Now that I understand the choices I can decide how to set up the service. :-D

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups