🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual.misc
Article #324

Re: Urgent: How can I turn off my PC using Visual Basic?

#324
From: Wilko
Date: Thu, 21 Nov 2002 22:28
32 lines
2196 bytes
Try this:

at module level in a module or PRIVATE in a form:
Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal
dwReserved As Long) As Long

in a sub or function:
  Const EWX_SHUTDOWN = 1
  Dim ResLon As Long
  ResLon = ExitWindowsEx(EWX_SHUTDOWN, 0&)

Don't forget to save before you try this otherwise you will have to start
again...

Wilko

Mirco Soderi heeft geschreven in bericht ...
>Hello everyone!
>
>How can I turn off my PC using Visual Basic programming code?
>
>If you need to know it, I can turn off my PC following these steps:
>* press CTRL - ALT - CANC on my keyboard;
>* press ALT - A at the same time on my keyboard.
>
>THANK YOU in advance to all the ones who will decide to help me! PLEASE, do
>it a.s.a.p. !!!
>
>- Mirco Soderi -
>
>
>
Technical Details
Message-ID: <arjmma$n0f$1@reader1.tiscali.nl>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news-x2.support.nl!news.tiscali.nl!not-for-mail
References: <np9D9.52408$Yw.2397488@news2.tin.it>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 107824,afc153ec0582a215
X-Google-Attributes: gid107824,public
X-Google-Thread: 115e07,afc153ec0582a215
X-Google-Attributes: gid115e07,public
X-Google-Thread: 108062,afc153ec0582a215
X-Google-Attributes: gid108062,public
X-Google-Thread: 110e3b,afc153ec0582a215
X-Google-Attributes: gid110e3b,public
X-Google-ArrivalTime: 2002-11-21 14:28:29 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news-x2.support.nl!news.tiscali.nl!not-for-mail
From: "Wilko" <sorry@no.spam.please>
Newsgroups: comp.lang.basic.visual.misc,cz.comp.lang.basic.visual,fj.comp.lang.visualbasic,japan.comp.lang.visual-basic
Subject: Re: Urgent: How can I turn off my PC using Visual Basic?
Date: Thu, 21 Nov 2002 23:28:18 +0100
Organization: Tiscali Benelux
Lines: 34
Message-ID: <arjmma$n0f$1@reader1.tiscali.nl>
References: <np9D9.52408$Yw.2397488@news2.tin.it>
NNTP-Posting-Host: xs195-241-210-76.dial.tiscali.nl
X-Trace: reader1.tiscali.nl 1037917707 23567 195.241.210.76 (21 Nov 2002 22:28:27 GMT)
X-Complaints-To: newsmaster@tiscali.nl
NNTP-Posting-Date: Thu, 21 Nov 2002 22:28:27 +0000 (UTC)
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3