Results 1 to 8 of 8

Thread: Question for advanced .net developers

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    123

    Question Question for advanced .net developers

    Hello,

    There is no one who seems to have the answer to my question. I have searched the whole internet for this nut to crack....

    I have a service which starts automaticly at windows startup. At the "On start" event of the service the icon should be created at the same time with the "user interactive with desktop" option but (offcourse) before a user has logged in, this option has no effect...the result is an icon which won't get created as soon as an user has logged in... My question is:

    Is there a class in .net which notifies the windows login event?

    (ps: i already tried to use the system.environment.username-class.. That doesn't work due to the fact that the service is started BEFORE login so the username = System and won't change if a user logs in...)
    Last edited by maarten_de_ruiter; Dec 5th, 2005 at 06:35 AM.

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Question for advanced .net developers

    Why use C:\Documents and Settings\All Users\Desktop, check for your icon, if it doesn't exist create it. Whenever anybody logs into your server, the icon will already be available.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    123

    Re: Question for advanced .net developers

    It's not about the desktop-icon...it's about the systemtray-icon

  4. #4
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Question for advanced .net developers

    Maybe you could set a timer to check for the winlogin.exe process, once the process is found, add the icon, and disable the timer.

  5. #5
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Question for advanced .net developers

    I don't think you can do this.. the services are started after you log on... take a look at your lower right screen.. when I log in.. there isnt anything listed in there at first, then each icon appears one after another.. its pretty quick, but yet its still after you log on.. I think Windows does this on purpose, as a security measure or something. Ensures the correct services are started depending on the logged in user.... (but I could be wrong...)

    ***EDIT - However, I did notice different logon types... Try changing your service to log on as Local Service instead as Local System (log on options in service)
    Last edited by gigemboy; Dec 5th, 2005 at 12:22 PM.

  6. #6
    Hyperactive Member
    Join Date
    Mar 2001
    Posts
    485

    Re: Question for advanced .net developers

    Why not write a tertiary program and put it under startup?

    This way, when it's executed, it will attach to the service (marshalling?)

    Just like how the SQL Service Manager works.

  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Re: Question for advanced .net developers

    I agree with Harddisk, use another application. Services are not intended to have any GUI at all even with the interact with desktop flag on. I don't believe Services wait for you to login at all.

  8. #8
    Addicted Member
    Join Date
    Sep 2004
    Posts
    133

    Re: Question for advanced .net developers

    I had a need for similar functionality. I wrote my Windows Service with the Enterprise Library so that I could use the Configuration Application Block (among others) so that any parts I wanted to change I had easy access to.

    I wrote Another Win Forms application that looks at the Status of the Windows Service and Updates a Tray Icon based on it's current Status. I also have A "Configure" window that loads the settings from the config files and allows a user to update them on the fly.

    It is really ALOT easier than I thought it would be.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width