• Preventing Shut Down

    From Jeff Gaines@21:1/5 to All on Fri Jan 19 14:42:27 2024
    Should have thought of this earlier.

    New project (C# in my case) containg just thse lines:

    public FormNoShutdown()
    {
    InitializeComponent();

    this.FormClosing += new FormClosingEventHandler(FormNoShutdown_FormClosing);
    }

    void FormNoShutdown_FormClosing(object sender, FormClosingEventArgs e)
    {
    if (e.CloseReason == CloseReason.WindowsShutDown)
    {
    e.Cancel = true;
    }
    }

    Leave it running and if Windows tries to shutdwon it will prevent it, and
    you will get the standard screen asking what you want to do.

    --
    Jeff Gaines Dorset UK
    The only thing necessary for evil to prevail is for good people to do or
    say nothing. (Edmund Burke)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)