🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13715

Automatically shutting down PC

#13715
From: Kral Ja Prvni
Date: Fri, 19 Sep 2003 11:34
19 lines
1857 bytes
Hi,

how do I do a program that will (under WinXP) shut down the system if 
noone logs in in five minutes after it power-on? I know the 
ExitWindowsEx function but I do not know how to start my program even if 
noone is logged in.

Thanks.

Bolek

PS: The reason for such program is a little instability of my system 
which very rarely causes its unexpected reboot. The computer is running 
all the week, 24 hours a day and does some time-consuming work. 
Sometimes I do not visit the computer for several days. However, if it 
suddenly reboots, the work gets interrupted and the program is unable to 
continue where it stopped even if I added it to automatically started 
programs. So the computer runs and consumes much of electricity without 
any effect and I think it is better to power it off.
Technical Details
Message-ID: <3f6ae965$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news-xfer1.atl.newshosting.com!63.218.45.11.MISMATCH!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,468b161fed69905,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-19 04:53:45 PST
Date: Fri, 19 Sep 2003 13:34:39 +0200
From: Kral Ja Prvni <kraljaprvni@seznam.cz>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Automatically shutting down PC
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 147.231.2.205
Message-ID: <3f6ae965$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1063971173 147.231.2.205 (19 Sep 2003 04:32:53 -0700)
Lines: 20
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news-xfer1.atl.newshosting.com!63.218.45.11.MISMATCH!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail