RE: How can I raise WinForm from WinService ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Nadav (Nadav_at_discussions.microsoft.com)
Date: 12/23/04

  • Next message: Nadav: "RE: Socket Exception only on windowsXP - SP2"
    Date: Thu, 23 Dec 2004 08:29:02 -0800
    
    

    A scervices run before the computer is logged on, therefor, it doesn't have a
    desktop associated with it, to enable a scerive to interact with desktop you
    can:
    1. at the service properties dialog enable 'Allow service to interact with
    desktop', this will enable you scervice to interact with the 'default'
    desktop.
    2. manually use the Win32 desktop APIs ( OpenDesktop, EnumDesktop, ... ) to
    associate a desktop with the scervice ( I don't know of any C# equivalent,
    but still, I may be wrong ).
    (*) usage of the latter option will enable association of the WinForm with a
    desktop other then the default such as desktops associated with a terminal
    client session.

    Hope this helps...

    Nadav.
      http://www.ddevel.com

    "bnaya" wrote:

    > How can I raise WinForm from WinService ?
    > I cannot use remoting because i need the WinForm on the same process as the
    > Win Service.
    >
    > I tried the followings:
    >
    > MyForm m_frmDetails = new MyForm();
    > m_frmDetails.Show();
    >
    > and
    >
    > MyForm m_frmDetails = new MyForm();
    > Application.Run(m_frmDetails);
    >
    >
    >


  • Next message: Nadav: "RE: Socket Exception only on windowsXP - SP2"