c# program pauses when machine is locked

Posted on 2012-08-22
Last Modified: 2012-08-23
Hi All,

I have a winform c# program thats on a 5 minute timer.  Once the timer counts down to zero, the program reads my outlook emails, then launches an excel object and does STUFF.

Here is the problem.  When I lock my machine, the timer still counts down, but hangs when it reaches zero.  It never launches the rest of the code.  When I log back in I see, the timer at zero, then the program continues as if nothing happened.  This is on my work pc with windows xp in a corporate environment.

Any ideas why my code hangs or how to prevent it?

Question by:solarissf
    LVL 29

    Accepted Solution

    Hi Solarissf,

    When the computer goes into locked mode it's considered that no user is interacting with the desktop. While you can still execute code in a locked workstation it's the automation code that is the real problem. You may not be able to perform certain automation tasks while the desktop is in a locked state.

    Author Comment

    ok, thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now