Terry,
For an application that takes 2 to 3 hours without any user intervention, I
would consider creating a Console Application or a Windows Service instead
of a Windows Forms application!
A Windows Service by definition runs in the background so there is no UI
needed (or allowed) Windows Service doesn't even require a person logged
into the machine.
A Console Application runs in a console window (aka a "DOS Box").
I would consider using Performance Counters and/or an Event Log so my
"Process" (Windows Service or Console Application) could notify any user of
its progress. I might create a Windows Forms application that read these
Performance Counters and/or Event Logs & displayed the info in a "usable"
format, possible on remote machines! For a Console Application I would
consider simply using Console.Write to display progress messages to the
user.
The "This Program is not responding" is caused because your app did not
respond to any windows messages (Mouse Move) in a timely manner. This is
normally an indication of a hung app. DoEvents is one method of responding
to these windows messages in a timely manner. Threads is another. Both
require "special" code as your are mixing your "process" with the "UI". As
I suggested above I would literally separate the "process" from the "UI" by
making two programs...
Hope this helps
Jay
"Terry Olsen" <to******@hotmail.com> wrote in message
news:Oe**************@tk2msftngp13.phx.gbl...
I have a program that seems to be locked up when it's chugging away. It
takes about 2-3 hours for its process to complete and normally runs
between 2am-5am when nobody is in the office so it's not really a big deal. But
i've noticed that if a user was to click on the CloseBox, the Windows
"This Program is not responding" dialog pops up and gives the user the option to
stop the program. Is there a way to stop this from happening? I would
assume that if the program was really hung then I could ctrl-alt-delete it
and stop it that way...