locked
Invoke a Windows Form from a Windows service RRS feed

  • Question

  • HI

    I'm posting this question in this forum cause I consider I need to go deeper into .net to acomplish it.

    I need to call, show , manage a windows application from a windows service.

    I know that using System.Diagnostigs.Process I can execute an app but it does not work from a Windows service. The process I want to run is executed but I can see the User interfaz and I can control the methods inside my windows form.

    My question is How can I manipulate or at least trigger a WinApp from my Windows services?

    Any link

    Thanks

    Kenny

    Thursday, November 23, 2006 2:17 AM

Answers

  • This is really complex! With Win2000/XP/2003 you can have the service run as local system and check the "Allow access to desktop". Then your app might show up on login session 0. With remote access to windows those users get other login session which you cannot reach with that technique. Starting with vista even a local login is not in session 0 anymore, so that is a no go.

    Windows secures the sessions and code to accessing different sessions (actually they are named "window stations") is quite some code and I think Win32 only. So lots of pinvoke.

    Have this as a starter: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/window_station_security_and_access_rights.asp

    --
    SvenC

    Thursday, November 23, 2006 6:37 AM